diff options
author | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2016-03-15 21:00:36 +0100 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2016-03-15 21:00:36 +0100 |
commit | 73eaec8b7aaa02e77cd475ccfdb117e188895457 (patch) | |
tree | 9bba8659c62de209331edf2685bf7372f2ba3226 /ui-stats.c | |
parent | d0f10b314dca7c6929b6fe8fa4cb5af10bcf8c2d (diff) | |
parent | 39735d95ca8775204ed4c5f306009707f7da79c6 (diff) | |
download | pkg-cgit-73eaec8b7aaa02e77cd475ccfdb117e188895457.zip pkg-cgit-73eaec8b7aaa02e77cd475ccfdb117e188895457.tar.gz pkg-cgit-73eaec8b7aaa02e77cd475ccfdb117e188895457.tar.bz2 |
Merge branch 'master' of git://git.zx2c4.com/cgit
Diffstat (limited to 'ui-stats.c')
-rw-r--r-- | ui-stats.c | 19 |
1 files changed, 8 insertions, 11 deletions
@@ -3,12 +3,6 @@ #include "html.h" #include "ui-shared.h" -#ifdef NO_C99_FORMAT -#define SZ_FMT "%u" -#else -#define SZ_FMT "%zu" -#endif - struct authorstat { long total; struct string_list list; @@ -174,6 +168,7 @@ static void add_commit(struct string_list *authors, struct commit *commit, char *tmp; struct tm *date; time_t t; + uintptr_t *counter; info = cgit_parse_commit(commit); tmp = xstrdup(info->author); @@ -189,9 +184,11 @@ static void add_commit(struct string_list *authors, struct commit *commit, period->trunc(date); tmp = xstrdup(period->pretty(date)); item = string_list_insert(items, tmp); - if (item->util) + counter = (uintptr_t *)&item->util; + if (*counter) free(tmp); - item->util++; + (*counter)++; + authorstat->total++; cgit_free_commitinfo(info); } @@ -286,7 +283,7 @@ static void print_combined_authorrow(struct string_list *authors, int from, items = &authorstat->list; date = string_list_lookup(items, tmp); if (date) - subtotal += (size_t)date->util; + subtotal += (uintptr_t)date->util; } htmlf("<td class='%s'>%ld</td>", centerclass, subtotal); total += subtotal; @@ -340,8 +337,8 @@ static void print_authors(struct string_list *authors, int top, if (!date) html("<td>0</td>"); else { - htmlf("<td>"SZ_FMT"</td>", (size_t)date->util); - total += (size_t)date->util; + htmlf("<td>%lu</td>", (uintptr_t)date->util); + total += (uintptr_t)date->util; } } htmlf("<td class='sum'>%ld</td></tr>", total); |