summaryrefslogtreecommitdiffstats
path: root/usr.bin/tar
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2008-11-05 05:26:11 +0000
committerkientzle <kientzle@FreeBSD.org>2008-11-05 05:26:11 +0000
commit17a8787cc850d68b35c32a3e06c17ac0d0ec040a (patch)
tree569fcdfe5956a3df1e9764ca7f19913fba2c0fa5 /usr.bin/tar
parent1ebf3ee9a3db9492efa600f6c7614a1851e8c357 (diff)
downloadFreeBSD-src-17a8787cc850d68b35c32a3e06c17ac0d0ec040a.zip
FreeBSD-src-17a8787cc850d68b35c32a3e06c17ac0d0ec040a.tar.gz
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
Diffstat (limited to 'usr.bin/tar')
-rw-r--r--usr.bin/tar/test/main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/tar/test/main.c b/usr.bin/tar/test/main.c
index c9284c1..b4e6e61 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);
}
OpenPOWER on IntegriCloud