summaryrefslogtreecommitdiff
path: root/vcs-svn/fast_export.c
diff options
context:
space:
mode:
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>2010-09-09 17:24:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-09-12 17:24:55 (GMT)
commit5418d96ddca8134b5abeb99430f61c062d91f722 (patch)
treeebffba01d66471fd9d3012b4b963a3c6ec77f8bb /vcs-svn/fast_export.c
parent3b3a8ed4beadf5d9437597108355b23c7143bc81 (diff)
downloadgit-5418d96ddca8134b5abeb99430f61c062d91f722.zip
git-5418d96ddca8134b5abeb99430f61c062d91f722.tar.gz
git-5418d96ddca8134b5abeb99430f61c062d91f722.tar.bz2
vcs-svn: Fix some printf format compiler warnings
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>
Diffstat (limited to 'vcs-svn/fast_export.c')
-rw-r--r--vcs-svn/fast_export.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/vcs-svn/fast_export.c b/vcs-svn/fast_export.c
index 256a052..6cfa256 100644
--- a/vcs-svn/fast_export.c
+++ b/vcs-svn/fast_export.c
@@ -25,7 +25,7 @@ void fast_export_modify(uint32_t depth, uint32_t *path, uint32_t mode,
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');
}
@@ -38,7 +38,8 @@ void fast_export_commit(uint32_t revision, uint32_t author, char *log,
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';
@@ -59,7 +60,7 @@ void fast_export_commit(uint32_t revision, uint32_t author, char *log,
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)
@@ -69,7 +70,7 @@ 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);
}