@matheusbsbs / matheus-bagliano / commits / 40db58b8dc
Fork 0

fast-import: Fix compile warnings

Not on all platforms are size_t and unsigned long equivalent. Since I do not know how portable %z is, I play safe, and just cast the respective variables to unsigned long. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>

Johannes Schindelin committed Feb 7, 2007 at 12:38 UTC 40db58b8dc17ee9fac86ad126d442bb87b5ad549
1 file changed +5 -3
fast-import.c
+5 -3
@@ -883,7 +883,8 @@ static int store_object(
883 SHA_CTX c;
884 z_stream s;
885
886 - hdrlen = sprintf((char*)hdr,"%s %lu",type_names[type],datlen) + 1;
886 + hdrlen = sprintf((char*)hdr,"%s %lu", type_names[type],
887 + (unsigned long)datlen) + 1;
888 SHA1_Init(&c);
889 SHA1_Update(&c, hdr, hdrlen);
890 SHA1_Update(&c, dat, datlen);
@@ -1432,7 +1433,8 @@ static void *cmd_data (size_t *size)
1433 while (n < length) {
1434 size_t s = fread(buffer + n, 1, length - n, stdin);
1435 if (!s && feof(stdin))
1435 - die("EOF in data (%lu bytes remaining)", length - n);
1436 + die("EOF in data (%lu bytes remaining)",
1437 + (unsigned long)(length - n));
1438 n += s;
1439 }
1440 }
@@ -2050,7 +2052,7 @@ int main(int argc, const char **argv)
2052 fprintf(stderr, " marks: %10ju (%10ju unique )\n", (((uintmax_t)1) << marks->shift) * 1024, marks_set_count);
2053 fprintf(stderr, " atoms: %10u\n", atom_cnt);
2054 fprintf(stderr, "Memory total: %10ju KiB\n", (total_allocd + alloc_count*sizeof(struct object_entry))/1024);
2053 - fprintf(stderr, " pools: %10lu KiB\n", total_allocd/1024);
2055 + fprintf(stderr, " pools: %10lu KiB\n", (unsigned long)(total_allocd/1024));
2056 fprintf(stderr, " objects: %10ju KiB\n", (alloc_count*sizeof(struct object_entry))/1024);
2057 fprintf(stderr, "---------------------------------------------------------------------\n");
2058 pack_report();