diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Hold object sizes in size_t as git 2.55 does
Git 2.55 moved object sizes from unsigned long to size_t. The two are the same type on 64-bit hosts, but not on a 32-bit one, where GCC 14 rejects the mismatched pointers, so cgit stopped compiling there.
Diffstat (limited to '')
-rw-r--r--source/ui-diff.c16
1 file changed, 8 insertions, 8 deletions
diff --git a/source/ui-diff.c b/source/ui-diff.c
index 9ea6543..f133a9c 100644
--- a/source/ui-diff.c
+++ b/source/ui-diff.c
@@ -33,8 +33,8 @@ struct fileinfo {
char *new_path;
unsigned int added;
unsigned int removed;
- unsigned long old_size;
- unsigned long new_size;
+ size_t old_size;
+ size_t new_size;
unsigned int binary:1;
struct strbuf body;
};
@@ -146,7 +146,7 @@ static void print_fileinfo(struct fileinfo *info)
}
html("</td><td class='right'>");
if (info->binary) {
- htmlf("bin</td><td class='graph'>%lu -> %lu bytes</td></tr>\n", info->old_size,
+ htmlf("bin</td><td class='graph'>%zu -> %zu bytes</td></tr>\n", info->old_size,
info->new_size);
return;
}
@@ -363,7 +363,7 @@ static struct fileinfo *reserve_item(void)
* written it straight out on a second walk.
*/
static void collect_body(struct diff_filepair *pair, struct fileinfo *item, int *binary,
- unsigned long *old_size, unsigned long *new_size)
+ size_t *old_size, size_t *new_size)
{
struct strbuf *body = &item->body;
linediff_fn line_fn = use_ssdiff ? cgit_ssdiff_line_cb : print_line;
@@ -428,8 +428,8 @@ static void inspect_filepair(struct diff_filepair *pair)
{
struct fileinfo *item;
int binary = 0;
- unsigned long old_size = 0;
- unsigned long new_size = 0;
+ size_t old_size = 0;
+ size_t new_size = 0;
if (!show_filepair(pair))
return;
@@ -498,8 +498,8 @@ static int over_line_cap(int idx)
static void filepair_cb(struct diff_filepair *pair)
{
- unsigned long old_size = 0;
- unsigned long new_size = 0;
+ size_t old_size = 0;
+ size_t new_size = 0;
int binary = 0;
int idx;
linediff_fn line_fn = print_line;