#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;
char *tmp;
struct tm *date;
time_t t;
+ uintptr_t *counter;
info = cgit_parse_commit(commit);
tmp = xstrdup(info->author);
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);
}
memset(&authors, 0, sizeof(authors));
while ((commit = get_revision(&rev)) != NULL) {
add_commit(&authors, commit, period);
- free_commit_buffer(commit);
+ free_commit_buffer(the_repository->parsed_objects, commit);
free_commit_list(commit->parents);
commit->parents = NULL;
}
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;
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);
cgit_print_layout_start();
html("<div class='cgit-panel'>");
html("<b>stat options</b>");
- html("<form method='get' action=''>");
+ html("<form method='get'>");
cgit_add_hidden_formfields(1, 0, "stats");
html("<table><tr><td colspan='2'/></tr>");
if (ctx.repo->max_stats > 1) {