svn commit: r184668 - head/usr.bin/tar/test
Tim Kientzle
kientzle at FreeBSD.org
Tue Nov 4 21:26:12 PST 2008
Author: kientzle
Date: Wed Nov 5 05:26:11 2008
New Revision: 184668
URL: http://svn.freebsd.org/changeset/base/184668
Log:
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
Modified:
head/usr.bin/tar/test/main.c
Modified: head/usr.bin/tar/test/main.c
==============================================================================
--- head/usr.bin/tar/test/main.c Wed Nov 5 03:01:23 2008 (r184667)
+++ head/usr.bin/tar/test/main.c Wed Nov 5 05:26:11 2008 (r184668)
@@ -324,10 +324,10 @@ test_assert_equal_string(const char *fil
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,
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);
}
More information about the svn-src-head
mailing list