X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/9fb53af215639fcd3bfb876fa9c8bac221244bdf..30ccdcaa74ebc0aab2b7843b0db8251d0ddf56de:/ui-commit.c diff --git a/ui-commit.c b/ui-commit.c index 20a7cb2..ff1fad3 100644 --- a/ui-commit.c +++ b/ui-commit.c @@ -8,11 +8,11 @@ #include "cgit.h" -int files = 0, slots = 0; -int total_adds = 0, total_rems = 0, max_changes = 0; -int lines_added, lines_removed; +static int files, slots; +static int total_adds, total_rems, max_changes; +static int lines_added, lines_removed; -struct fileinfo { +static struct fileinfo { char status; unsigned char old_sha1[20]; unsigned char new_sha1[20]; @@ -29,7 +29,6 @@ void print_fileinfo(struct fileinfo *info) { char *query, *query2; char *class; - double width; switch (info->status) { case DIFF_STATUS_ADDED: @@ -96,18 +95,15 @@ void print_fileinfo(struct fileinfo *info) } html("
",
- info->added * width / (info->added + info->removed));
- htmlf("
",
- info->removed * width / (info->added + info->removed));
- html("| ", + info->added * 100.0 / max_changes); + htmlf(" | ", + info->removed * 100.0 / max_changes); + htmlf(" | ", + (max_changes - info->removed - info->added) * 100.0 / max_changes); + html(" |