diff options
author | Tim Kientzle <kientzle@FreeBSD.org> | 2008-11-05 05:26:11 +0000 |
---|---|---|
committer | Tim Kientzle <kientzle@FreeBSD.org> | 2008-11-05 05:26:11 +0000 |
commit | f4e24c4e7a85244bcc1bc3009b03938f6893b0ae (patch) | |
tree | 569fcdfe5956a3df1e9764ca7f19913fba2c0fa5 /usr.bin | |
parent | 7b4a950a7df886f19bea7d2f57ef8f7ef81b7428 (diff) | |
download | src-f4e24c4e7a85244bcc1bc3009b03938f6893b0ae.tar.gz src-f4e24c4e7a85244bcc1bc3009b03938f6893b0ae.zip |
Fix compile warnings building on amd64. This is modified slightly
from Jaakko's original patch: I have misgivings about the portability
of the 'z' printf modifier so opted to cast the arguments to (int)
instead.
PR: bin/128561
Submitted by: Jaakko Heinonen
MFC after: 30 days
Notes
Notes:
svn path=/head/; revision=184668
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tar/test/main.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/tar/test/main.c b/usr.bin/tar/test/main.c index c9284c16d422..b4e6e61e3264 100644 --- a/usr.bin/tar/test/main.c +++ b/usr.bin/tar/test/main.c @@ -324,10 +324,10 @@ test_assert_equal_string(const char *file, int line, file, line); fprintf(stderr, " %s = ", e1); strdump(v1); - fprintf(stderr, " (length %d)\n", v1 == NULL ? 0 : strlen(v1)); + fprintf(stderr, " (length %d)\n", v1 == NULL ? 0 : (int)strlen(v1)); fprintf(stderr, " %s = ", e2); strdump(v2); - fprintf(stderr, " (length %d)\n", v2 == NULL ? 0 : strlen(v2)); + fprintf(stderr, " (length %d)\n", v2 == NULL ? 0 : (int)strlen(v2)); report_failure(extra); return (0); } @@ -402,7 +402,7 @@ hexdump(const char *p, const char *ref, size_t l, size_t offset) char sep; for(i=0; i < l; i+=16) { - fprintf(stderr, "%04x", i + offset); + fprintf(stderr, "%04x", (int)(i + offset)); sep = ' '; for (j = 0; j < 16 && i + j < l; j++) { if (ref != NULL && p[i + j] != ref[i + j]) @@ -494,7 +494,8 @@ test_assert_empty_file(const char *f1fmt, ...) if (fd < 0) { fprintf(stderr, " Unable to open %s\n", f1); } else { - s = sizeof(buff) < st.st_size ? sizeof(buff) : st.st_size; + s = (sizeof(buff) < (size_t)st.st_size) ? + (ssize_t)sizeof(buff) : (ssize_t)st.st_size; s = read(fd, buff, s); hexdump(buff, NULL, s, 0); } |