From a9d6e6e695da6c6ed7f4bb32630ab2f3d9314806 Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Sun, 19 Sep 2010 17:00:05 +0000 Subject: Merge branch 'ml/bugfix' --- (limited to 'ui-stats.c') diff --git a/ui-stats.c b/ui-stats.c index 50c2540..946a6ea 100644 --- a/ui-stats.c +++ b/ui-stats.c @@ -5,6 +5,12 @@ #include "ui-shared.h" #include "ui-stats.h" +#ifdef NO_C99_FORMAT +#define SZ_FMT "%u" +#else +#define SZ_FMT "%zu" +#endif + #define MONTHS 6 struct authorstat { @@ -283,10 +289,10 @@ void print_combined_authorrow(struct string_list *authors, int from, int to, if (date) subtotal += (size_t)date->util; } - htmlf("%d", centerclass, subtotal); + htmlf("%ld", centerclass, subtotal); total += subtotal; } - htmlf("%d", rightclass, total); + htmlf("%ld", rightclass, total); } void print_authors(struct string_list *authors, int top, @@ -335,16 +341,16 @@ void print_authors(struct string_list *authors, int top, if (!date) html("0"); else { - htmlf("%d", date->util); + htmlf(""SZ_FMT"", (size_t)date->util); total += (size_t)date->util; } } - htmlf("%d", total); + htmlf("%ld", total); } if (top < authors->nr) print_combined_authorrow(authors, top, authors->nr - 1, - "Others (%d)", "left", "", "sum", period); + "Others (%ld)", "left", "", "sum", period); print_combined_authorrow(authors, 0, authors->nr - 1, "Total", "total", "sum", "sum", period); @@ -367,7 +373,7 @@ void cgit_show_stats(struct cgit_context *ctx) i = cgit_find_stats_period(code, &period); if (!i) { - cgit_print_error(fmt("Unknown statistics type: %c", code)); + cgit_print_error(fmt("Unknown statistics type: %c", code[0])); return; } if (i > ctx->repo->max_stats) { -- cgit v0.9.0.2