diff options
author | Ramsay Jones <ramsay@ramsay1.demon.co.uk> | 2008-07-03 16:52:09 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-07-05 17:26:29 -0700 |
commit | 6e1c23442a0315ad440bb8457703dcf1ad943b96 (patch) | |
tree | 029bfdb329dfdaeb8a85787c6548fbf06d191b78 /builtin-pack-objects.c | |
parent | db5d6666afb9f315f9c9ac74a5d638f07cf9cbe0 (diff) | |
download | git-6e1c23442a0315ad440bb8457703dcf1ad943b96.tar.gz |
Fix some warnings (on cygwin) to allow -Werror
When printing valuds of type uint32_t, we should use PRIu32, and should
not assume that it is unsigned int. On 32-bit platforms, it could be
defined as unsigned long. The same caution applies to ntohl().
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-pack-objects.c')
-rw-r--r-- | builtin-pack-objects.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index 28207d9b3a..2dadec1630 100644 --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@ -568,7 +568,8 @@ static void write_pack_file(void) free(written_list); stop_progress(&progress_state); if (written != nr_result) - die("wrote %u objects while expecting %u", written, nr_result); + die("wrote %"PRIu32" objects while expecting %"PRIu32, + written, nr_result); /* * We have scanned through [0 ... i). Since we have written * the correct number of objects, the remaining [i ... nr_objects) @@ -580,7 +581,8 @@ static void write_pack_file(void) j += !e->idx.offset && !e->preferred_base; } if (j) - die("wrote %u objects as expected but %u unwritten", written, j); + die("wrote %"PRIu32" objects as expected but %"PRIu32 + " unwritten", written, j); } static int locate_object_entry_hash(const unsigned char *sha1) @@ -1694,7 +1696,8 @@ static int add_ref_tag(const char *path, const unsigned char *sha1, int flag, vo static void prepare_pack(int window, int depth) { struct object_entry **delta_list; - uint32_t i, n, nr_deltas; + uint32_t i, nr_deltas; + unsigned n; get_object_details(); @@ -1785,7 +1788,8 @@ static int git_pack_config(const char *k, const char *v, void *cb) if (!strcmp(k, "pack.indexversion")) { pack_idx_default_version = git_config_int(k, v); if (pack_idx_default_version > 2) - die("bad pack.indexversion=%d", pack_idx_default_version); + die("bad pack.indexversion=%"PRIu32, + pack_idx_default_version); return 0; } if (!strcmp(k, "pack.packsizelimit")) { @@ -2219,7 +2223,8 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix) prepare_pack(window, depth); write_pack_file(); if (progress) - fprintf(stderr, "Total %u (delta %u), reused %u (delta %u)\n", + fprintf(stderr, "Total %"PRIu32" (delta %"PRIu32")," + " reused %"PRIu32" (delta %"PRIu32")\n", written, written_delta, reused, reused_delta); return 0; } |