diff options
| -rw-r--r-- | ui-stats.c | 14 | ||||
| -rw-r--r-- | ui-stats.h | 2 |
2 files changed, 8 insertions, 8 deletions
| @@ -125,7 +125,7 @@ static char *pretty_year(struct tm *tm) | |||
| 125 | return fmt("%d", tm->tm_year + 1900); | 125 | return fmt("%d", tm->tm_year + 1900); |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | struct cgit_period periods[] = { | 128 | static const struct cgit_period periods[] = { |
| 129 | {'w', "week", 12, 4, trunc_week, dec_week, inc_week, pretty_week}, | 129 | {'w', "week", 12, 4, trunc_week, dec_week, inc_week, pretty_week}, |
| 130 | {'m', "month", 12, 4, trunc_month, dec_month, inc_month, pretty_month}, | 130 | {'m', "month", 12, 4, trunc_month, dec_month, inc_month, pretty_month}, |
| 131 | {'q', "quarter", 12, 4, trunc_quarter, dec_quarter, inc_quarter, pretty_quarter}, | 131 | {'q', "quarter", 12, 4, trunc_quarter, dec_quarter, inc_quarter, pretty_quarter}, |
| @@ -136,7 +136,7 @@ struct cgit_period periods[] = { | |||
| 136 | * and update the period pointer to the correcsponding struct. | 136 | * and update the period pointer to the correcsponding struct. |
| 137 | * If no matching code is found, return 0. | 137 | * If no matching code is found, return 0. |
| 138 | */ | 138 | */ |
| 139 | int cgit_find_stats_period(const char *expr, struct cgit_period **period) | 139 | int cgit_find_stats_period(const char *expr, const struct cgit_period **period) |
| 140 | { | 140 | { |
| 141 | int i; | 141 | int i; |
| 142 | char code = '\0'; | 142 | char code = '\0'; |
| @@ -165,7 +165,7 @@ const char *cgit_find_stats_periodname(int idx) | |||
| 165 | } | 165 | } |
| 166 | 166 | ||
| 167 | static void add_commit(struct string_list *authors, struct commit *commit, | 167 | static void add_commit(struct string_list *authors, struct commit *commit, |
| 168 | struct cgit_period *period) | 168 | const struct cgit_period *period) |
| 169 | { | 169 | { |
| 170 | struct commitinfo *info; | 170 | struct commitinfo *info; |
| 171 | struct string_list_item *author, *item; | 171 | struct string_list_item *author, *item; |
| @@ -209,7 +209,7 @@ static int cmp_total_commits(const void *a1, const void *a2) | |||
| 209 | /* Walk the commit DAG and collect number of commits per author per | 209 | /* Walk the commit DAG and collect number of commits per author per |
| 210 | * timeperiod into a nested string_list collection. | 210 | * timeperiod into a nested string_list collection. |
| 211 | */ | 211 | */ |
| 212 | static struct string_list collect_stats(struct cgit_period *period) | 212 | static struct string_list collect_stats(const struct cgit_period *period) |
| 213 | { | 213 | { |
| 214 | struct string_list authors; | 214 | struct string_list authors; |
| 215 | struct rev_info rev; | 215 | struct rev_info rev; |
| @@ -256,7 +256,7 @@ static void print_combined_authorrow(struct string_list *authors, int from, | |||
| 256 | const char *leftclass, | 256 | const char *leftclass, |
| 257 | const char *centerclass, | 257 | const char *centerclass, |
| 258 | const char *rightclass, | 258 | const char *rightclass, |
| 259 | struct cgit_period *period) | 259 | const struct cgit_period *period) |
| 260 | { | 260 | { |
| 261 | struct string_list_item *author; | 261 | struct string_list_item *author; |
| 262 | struct authorstat *authorstat; | 262 | struct authorstat *authorstat; |
| @@ -295,7 +295,7 @@ static void print_combined_authorrow(struct string_list *authors, int from, | |||
| 295 | } | 295 | } |
| 296 | 296 | ||
| 297 | static void print_authors(struct string_list *authors, int top, | 297 | static void print_authors(struct string_list *authors, int top, |
| 298 | struct cgit_period *period) | 298 | const struct cgit_period *period) |
| 299 | { | 299 | { |
| 300 | struct string_list_item *author; | 300 | struct string_list_item *author; |
| 301 | struct authorstat *authorstat; | 301 | struct authorstat *authorstat; |
| @@ -363,7 +363,7 @@ static void print_authors(struct string_list *authors, int top, | |||
| 363 | void cgit_show_stats(void) | 363 | void cgit_show_stats(void) |
| 364 | { | 364 | { |
| 365 | struct string_list authors; | 365 | struct string_list authors; |
| 366 | struct cgit_period *period; | 366 | const struct cgit_period *period; |
| 367 | int top, i; | 367 | int top, i; |
| 368 | const char *code = "w"; | 368 | const char *code = "w"; |
| 369 | 369 | ||
| @@ -20,7 +20,7 @@ struct cgit_period { | |||
| 20 | char *(*pretty)(struct tm *tm); | 20 | char *(*pretty)(struct tm *tm); |
| 21 | }; | 21 | }; |
| 22 | 22 | ||
| 23 | extern int cgit_find_stats_period(const char *expr, struct cgit_period **period); | 23 | extern int cgit_find_stats_period(const char *expr, const struct cgit_period **period); |
| 24 | extern const char *cgit_find_stats_periodname(int idx); | 24 | extern const char *cgit_find_stats_periodname(int idx); |
| 25 | 25 | ||
| 26 | extern void cgit_show_stats(void); | 26 | extern void cgit_show_stats(void); |
