about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ui-stats.c14
-rw-r--r--ui-stats.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/ui-stats.c b/ui-stats.c index a264f6a..9cd8247 100644 --- a/ui-stats.c +++ b/ui-stats.c
@@ -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
128struct cgit_period periods[] = { 128static 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 */
139int cgit_find_stats_period(const char *expr, struct cgit_period **period) 139int 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
167static void add_commit(struct string_list *authors, struct commit *commit, 167static 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 */
212static struct string_list collect_stats(struct cgit_period *period) 212static 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
297static void print_authors(struct string_list *authors, int top, 297static 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,
363void cgit_show_stats(void) 363void 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
diff --git a/ui-stats.h b/ui-stats.h index 341ab13..0e61b03 100644 --- a/ui-stats.h +++ b/ui-stats.h
@@ -20,7 +20,7 @@ struct cgit_period {
20 char *(*pretty)(struct tm *tm); 20 char *(*pretty)(struct tm *tm);
21}; 21};
22 22
23extern int cgit_find_stats_period(const char *expr, struct cgit_period **period); 23extern int cgit_find_stats_period(const char *expr, const struct cgit_period **period);
24extern const char *cgit_find_stats_periodname(int idx); 24extern const char *cgit_find_stats_periodname(int idx);
25 25
26extern void cgit_show_stats(void); 26extern void cgit_show_stats(void);