diff options
context:
space:
mode:
Diffstat (limited to 'source/ui-stats.c')
-rw-r--r--source/ui-stats.c21
1 file changed, 11 insertions, 10 deletions
diff --git a/source/ui-stats.c b/source/ui-stats.c
index 3ae3034..4c83cf3 100644
--- a/source/ui-stats.c
+++ b/source/ui-stats.c
@@ -79,7 +79,7 @@ static char *pretty_month(struct tm *tm)
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
- return fmt("%s %d", months[tm->tm_mon], tm->tm_year + 1900);
+ return cgit_fmt("%s %d", months[tm->tm_mon], tm->tm_year + 1900);
}
static void trunc_quarter(struct tm *tm)
@@ -105,7 +105,7 @@ static void inc_quarter(struct tm *tm)
static char *pretty_quarter(struct tm *tm)
{
- return fmt("Q%d %d", tm->tm_mon / 3 + 1, tm->tm_year + 1900);
+ return cgit_fmt("Q%d %d", tm->tm_mon / 3 + 1, tm->tm_year + 1900);
}
static void trunc_year(struct tm *tm)
@@ -126,7 +126,7 @@ static void inc_year(struct tm *tm)
static char *pretty_year(struct tm *tm)
{
- return fmt("%d", tm->tm_year + 1900);
+ return cgit_fmt("%d", tm->tm_year + 1900);
}
static const struct cgit_period periods[] = {
@@ -142,7 +142,7 @@ static const struct cgit_period periods[] = {
*/
int cgit_find_stats_period(const char *expr, const struct cgit_period **period)
{
- int i;
+ size_t i;
char code = '\0';
if (!expr)
@@ -151,7 +151,7 @@ int cgit_find_stats_period(const char *expr, const struct cgit_period **period)
if (strlen(expr) == 1)
code = expr[0];
- for (i = 0; i < sizeof(periods) / sizeof(periods[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(periods); i++)
if (periods[i].code == code || !strcmp(periods[i].name, expr)) {
if (period)
*period = &periods[i];
@@ -259,7 +259,7 @@ static struct string_list collect_stats(const struct cgit_period *period)
while ((commit = get_revision(&rev)) != NULL) {
struct commitinfo *info = cgit_parse_commit(commit);
- if (info->committer_date >= since)
+ if ((time_t)info->committer_date >= since)
add_commit(&authors, info, period);
cgit_free_commitinfo(info);
@@ -293,7 +293,7 @@ static void print_combined_authorrow(struct string_list *authors, int from,
total = 0;
htmlf("<tr><td class='%s'>%s</td>", leftclass,
- fmt(name, to - from + 1));
+ cgit_fmt(name, to - from + 1));
for (j = 0; j < period->count; j++) {
tmp = period->pretty(&tm);
period->inc(&tm);
@@ -484,7 +484,8 @@ static void print_language_row(const char *label, unsigned long bytes,
static void print_languages(struct lang_walk_ctx *lw)
{
unsigned long other;
- int i, shown;
+ size_t i;
+ int shown;
if (!lw->total)
return;
@@ -574,8 +575,8 @@ void cgit_show_stats(void)
html("<tr><td class='label'>Period:</td>");
html("<td class='ctrl'><select name='period' data-autosubmit='1'>");
for (i = 0; i < nperiods; i++)
- html_option(fmt("%c", periods[i].code),
- periods[i].name, fmt("%c", period->code));
+ html_option(cgit_fmt("%c", periods[i].code),
+ periods[i].name, cgit_fmt("%c", period->code));
html("</select></td></tr>");
}
html("<tr><td class='label'>Authors:</td>");