summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3b3a8ed)
raw | patch | inline | side by side (parent: 3b3a8ed)
author | Ramsay Jones <ramsay@ramsay1.demon.co.uk> | |
Thu, 9 Sep 2010 17:24:06 +0000 (18:24 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 12 Sep 2010 17:24:55 +0000 (10:24 -0700) |
In particular, on systems that define uint32_t as an unsigned long,
gcc complains as follows:
CC vcs-svn/fast_export.o
vcs-svn/fast_export.c: In function `fast_export_modify':
vcs-svn/fast_export.c:28: warning: unsigned int format, uint32_t arg (arg 2)
vcs-svn/fast_export.c:28: warning: int format, uint32_t arg (arg 3)
vcs-svn/fast_export.c: In function `fast_export_commit':
vcs-svn/fast_export.c:42: warning: int format, uint32_t arg (arg 5)
vcs-svn/fast_export.c:62: warning: int format, uint32_t arg (arg 2)
vcs-svn/fast_export.c: In function `fast_export_blob':
vcs-svn/fast_export.c:72: warning: int format, uint32_t arg (arg 2)
vcs-svn/fast_export.c:72: warning: int format, uint32_t arg (arg 3)
CC vcs-svn/svndump.o
vcs-svn/svndump.c: In function `svndump_read':
vcs-svn/svndump.c:260: warning: int format, uint32_t arg (arg 3)
In order to suppress the warnings we use the C99 format specifier
macros PRIo32 and PRIu32 from <inttypes.h>.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gcc complains as follows:
CC vcs-svn/fast_export.o
vcs-svn/fast_export.c: In function `fast_export_modify':
vcs-svn/fast_export.c:28: warning: unsigned int format, uint32_t arg (arg 2)
vcs-svn/fast_export.c:28: warning: int format, uint32_t arg (arg 3)
vcs-svn/fast_export.c: In function `fast_export_commit':
vcs-svn/fast_export.c:42: warning: int format, uint32_t arg (arg 5)
vcs-svn/fast_export.c:62: warning: int format, uint32_t arg (arg 2)
vcs-svn/fast_export.c: In function `fast_export_blob':
vcs-svn/fast_export.c:72: warning: int format, uint32_t arg (arg 2)
vcs-svn/fast_export.c:72: warning: int format, uint32_t arg (arg 3)
CC vcs-svn/svndump.o
vcs-svn/svndump.c: In function `svndump_read':
vcs-svn/svndump.c:260: warning: int format, uint32_t arg (arg 3)
In order to suppress the warnings we use the C99 format specifier
macros PRIo32 and PRIu32 from <inttypes.h>.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-compat-util.h | patch | blob | history | |
vcs-svn/fast_export.c | patch | blob | history | |
vcs-svn/svndump.c | patch | blob | history |
diff --git a/git-compat-util.h b/git-compat-util.h
index 877096ecb09e524174ff22db3722d6428f43bcf4..81883e7270daadafb4d827e894fa4645ff2e2b66 100644 (file)
--- a/git-compat-util.h
+++ b/git-compat-util.h
#define PRIx32 "x"
#endif
+#ifndef PRIo32
+#define PRIo32 "o"
+#endif
+
#ifndef PATH_SEP
#define PATH_SEP ':'
#endif
diff --git a/vcs-svn/fast_export.c b/vcs-svn/fast_export.c
index 256a0522b2b8484fa27d8730addee0591ea09195..6cfa256a3702332205faab546a405f6810cc16bd 100644 (file)
--- a/vcs-svn/fast_export.c
+++ b/vcs-svn/fast_export.c
uint32_t mark)
{
/* Mode must be 100644, 100755, 120000, or 160000. */
- printf("M %06o :%d ", mode, mark);
+ printf("M %06"PRIo32" :%"PRIu32" ", mode, mark);
pool_print_seq(depth, path, '/', stdout);
putchar('\n');
}
if (!log)
log = "";
if (~uuid && ~url) {
- snprintf(gitsvnline, MAX_GITSVN_LINE_LEN, "\n\ngit-svn-id: %s@%d %s\n",
+ snprintf(gitsvnline, MAX_GITSVN_LINE_LEN,
+ "\n\ngit-svn-id: %s@%"PRIu32" %s\n",
pool_fetch(url), revision, pool_fetch(uuid));
} else {
*gitsvnline = '\0';
repo_diff(revision - 1, revision);
fputc('\n', stdout);
- printf("progress Imported commit %d.\n\n", revision);
+ printf("progress Imported commit %"PRIu32".\n\n", revision);
}
void fast_export_blob(uint32_t mode, uint32_t mark, uint32_t len)
buffer_skip_bytes(5);
len -= 5;
}
- printf("blob\nmark :%d\ndata %d\n", mark, len);
+ printf("blob\nmark :%"PRIu32"\ndata %"PRIu32"\n", mark, len);
buffer_copy_bytes(len);
fputc('\n', stdout);
}
diff --git a/vcs-svn/svndump.c b/vcs-svn/svndump.c
index 630eeb53b7d75f71bdf91cbdf45f428d0a14eb35..53d0215d2d8f38fee589321890c9305c8da4d2c5 100644 (file)
--- a/vcs-svn/svndump.c
+++ b/vcs-svn/svndump.c
handle_node();
active_ctx = REV_CTX;
} else {
- fprintf(stderr, "Unexpected content length header: %d\n", len);
+ fprintf(stderr, "Unexpected content length header: %"PRIu32"\n", len);
buffer_skip_bytes(len);
}
}