diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2007-02-07 12:38:21 +0100 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-02-07 09:28:23 -0800 |
commit | 40db58b8dc17ee9fac86ad126d442bb87b5ad549 (patch) | |
tree | d7b40273452f7c0bda27c255d2b9cb47c8b3159a /fast-import.c | |
parent | fcee5a145d5a9e27afa8086c54e8f718a4a8f1cc (diff) | |
download | git-40db58b8dc17ee9fac86ad126d442bb87b5ad549.tar.gz git-40db58b8dc17ee9fac86ad126d442bb87b5ad549.tar.xz |
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>
Diffstat (limited to 'fast-import.c')
-rw-r--r-- | fast-import.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fast-import.c b/fast-import.c index face9bba3..3f4e73f82 100644 --- a/fast-import.c +++ b/fast-import.c @@ -883,7 +883,8 @@ static int store_object( SHA_CTX c; z_stream s; - hdrlen = sprintf((char*)hdr,"%s %lu",type_names[type],datlen) + 1; + hdrlen = sprintf((char*)hdr,"%s %lu", type_names[type], + (unsigned long)datlen) + 1; SHA1_Init(&c); SHA1_Update(&c, hdr, hdrlen); SHA1_Update(&c, dat, datlen); @@ -1432,7 +1433,8 @@ static void *cmd_data (size_t *size) while (n < length) { size_t s = fread(buffer + n, 1, length - n, stdin); if (!s && feof(stdin)) - die("EOF in data (%lu bytes remaining)", length - n); + die("EOF in data (%lu bytes remaining)", + (unsigned long)(length - n)); n += s; } } @@ -2050,7 +2052,7 @@ int main(int argc, const char **argv) fprintf(stderr, " marks: %10ju (%10ju unique )\n", (((uintmax_t)1) << marks->shift) * 1024, marks_set_count); fprintf(stderr, " atoms: %10u\n", atom_cnt); fprintf(stderr, "Memory total: %10ju KiB\n", (total_allocd + alloc_count*sizeof(struct object_entry))/1024); - fprintf(stderr, " pools: %10lu KiB\n", total_allocd/1024); + fprintf(stderr, " pools: %10lu KiB\n", (unsigned long)(total_allocd/1024)); fprintf(stderr, " objects: %10ju KiB\n", (alloc_count*sizeof(struct object_entry))/1024); fprintf(stderr, "---------------------------------------------------------------------\n"); pack_report(); |