X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/6940b23b9e4698ba466a4616e4de77b986560ad3..d41b2ddcb331caa74c1a90a0253f234142848552:/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) {