author | Mark Lodato <lodatom@gmail.com> | 2010-09-04 15:30:18 (UTC) |
---|---|---|
committer | Mark Lodato <lodatom@gmail.com> | 2010-09-04 15:35:38 (UTC) |
commit | e4ddc8f72b5a7d8c55a6c2042c7b7f945ba4b1a2 (patch) (side-by-side diff) | |
tree | 2ade0bb45e15ad5466ca4d3433201477f0c9214e /ui-diff.c | |
parent | a4c58d92bfee0cf2e35ab1c5e828a6d790108a69 (diff) | |
download | cgit-e4ddc8f72b5a7d8c55a6c2042c7b7f945ba4b1a2.zip cgit-e4ddc8f72b5a7d8c55a6c2042c7b7f945ba4b1a2.tar.gz cgit-e4ddc8f72b5a7d8c55a6c2042c7b7f945ba4b1a2.tar.bz2 |
fix errors in printf-style format strings
There were many places where the arguments to a printf-like function did
not match the format string. Mostly, these were a missing 'l' flag, but
there were three exceptions:
- In ui-stats.c, a size_t argument must be printed. C99 has the "%zu"
flag for this purpose, but not all compilers support this. Therefore,
we mimic what git does - use a NO_C99_FORMAT Makefile variable.
- In ui-stats.c, cgit_print_error() was called with a pointer instead of
a character.
- In ui-log.c, the "columns" argument was never used.
Signed-off-by: Mark Lodato <lodatom@gmail.com>
-rw-r--r-- | ui-diff.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -83,25 +83,25 @@ static void print_fileinfo(struct fileinfo *info) cgit_print_filemode(info->old_mode); html("]</span>"); } htmlf("</td><td class='%s'>", class); cgit_diff_link(info->new_path, NULL, NULL, ctx.qry.head, ctx.qry.sha1, ctx.qry.sha2, info->new_path, 0); if (info->status == DIFF_STATUS_COPIED || info->status == DIFF_STATUS_RENAMED) htmlf(" (%s from %s)", info->status == DIFF_STATUS_COPIED ? "copied" : "renamed", info->old_path); html("</td><td class='right'>"); if (info->binary) { - htmlf("bin</td><td class='graph'>%d -> %d bytes", + htmlf("bin</td><td class='graph'>%ld -> %ld bytes", info->old_size, info->new_size); return; } htmlf("%d", info->added + info->removed); html("</td><td class='graph'>"); htmlf("<table summary='file diffstat' width='%d%%'><tr>", (max_changes > 100 ? 100 : max_changes)); htmlf("<td class='add' style='width: %.1f%%;'/>", info->added * 100.0 / max_changes); htmlf("<td class='rem' style='width: %.1f%%;'/>", info->removed * 100.0 / max_changes); htmlf("<td class='none' style='width: %.1f%%;'/>", (max_changes - info->removed - info->added) * 100.0 / max_changes); |