From: Michihiro NAKAJIMA Date: Wed, 23 Dec 2009 00:26:44 +0000 (-0500) Subject: Eliminate more warnings on Borland C. X-Git-Tag: v2.8.0~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=537759732e10c98ad03cceef707ae727b74551ea;p=thirdparty%2Flibarchive.git Eliminate more warnings on Borland C. SVN-Revision: 1774 --- diff --git a/cpio/test/main.c b/cpio/test/main.c index 36f466af9..f1d7ba393 100644 --- a/cpio/test/main.c +++ b/cpio/test/main.c @@ -1060,7 +1060,7 @@ assertion_file_nlinks(const char *file, int line, assertion_count(file, line); r = my_GetFileInformationByName(pathname, &bhfi); - if (r != 0 && bhfi.nNumberOfLinks == nlinks) + if (r != 0 && bhfi.nNumberOfLinks == (DWORD)nlinks) return (1); failure_start(file, line, "File %s has %d links, expected %d", pathname, bhfi.nNumberOfLinks, nlinks); diff --git a/cpio/test/test_option_help.c b/cpio/test/test_option_help.c index b9433a43a..56234306f 100644 --- a/cpio/test/test_option_help.c +++ b/cpio/test/test_option_help.c @@ -51,6 +51,7 @@ DEFINE_TEST(test_option_help) /* Exercise --help option. */ r = systemf("%s --help >help.stdout 2>help.stderr", testprog); + assertEqualInt(r, 0); failure("--help should generate nothing to stderr."); assertEmptyFile("help.stderr"); /* Help message should start with name of program. */ @@ -67,6 +68,7 @@ DEFINE_TEST(test_option_help) /* -h option should generate the same output. */ r = systemf("%s -h >h.stdout 2>h.stderr", testprog); + assertEqualInt(r, 0); failure("-h should generate nothing to stderr."); assertEmptyFile("h.stderr"); failure("stdout should be same for -h and --help"); @@ -74,6 +76,7 @@ DEFINE_TEST(test_option_help) /* -W help should be another synonym. */ r = systemf("%s -W help >Whelp.stdout 2>Whelp.stderr", testprog); + assertEqualInt(r, 0); failure("-W help should generate nothing to stderr."); assertEmptyFile("Whelp.stderr"); failure("stdout should be same for -W help and --help"); diff --git a/libarchive/test/main.c b/libarchive/test/main.c index c7fd3a888..36feb5c1a 100644 --- a/libarchive/test/main.c +++ b/libarchive/test/main.c @@ -1056,7 +1056,7 @@ assertion_file_nlinks(const char *file, int line, assertion_count(file, line); r = my_GetFileInformationByName(pathname, &bhfi); - if (r != 0 && bhfi.nNumberOfLinks == nlinks) + if (r != 0 && bhfi.nNumberOfLinks == (DWORD)nlinks) return (1); failure_start(file, line, "File %s has %d links, expected %d", pathname, bhfi.nNumberOfLinks, nlinks); diff --git a/libarchive/test/test_entry.c b/libarchive/test/test_entry.c index 8ed8f52c4..6cf6416e0 100644 --- a/libarchive/test/test_entry.c +++ b/libarchive/test/test_entry.c @@ -51,7 +51,6 @@ DEFINE_TEST(test_entry) const char *xname; /* For xattr tests. */ const void *xval; /* For xattr tests. */ size_t xsize; /* For xattr tests. */ - int c; wchar_t wc; long l; @@ -442,7 +441,7 @@ DEFINE_TEST(test_entry) skipping("ACL preserved by archive_entry_clone()"); #else /* Verify ACL was copied. */ - assertEqualInt(4, c = archive_entry_acl_reset(e2, + assertEqualInt(4, archive_entry_acl_reset(e2, ARCHIVE_ENTRY_ACL_TYPE_ACCESS)); /* First three are standard permission bits. */ assertEqualInt(0, archive_entry_acl_next(e2, @@ -483,7 +482,7 @@ DEFINE_TEST(test_entry) skipping("xattr data preserved by archive_entry_clone"); #else /* Verify xattr was copied. */ - assertEqualInt(1, c = archive_entry_xattr_reset(e2)); + assertEqualInt(1, archive_entry_xattr_reset(e2)); assertEqualInt(0, archive_entry_xattr_next(e2, &xname, &xval, &xsize)); assertEqualString(xname, "xattr1"); assertEqualString(xval, "xattrvalue"); @@ -567,7 +566,7 @@ DEFINE_TEST(test_entry) skipping("ACL held by clone of archive_entry"); #else /* Verify ACL was unchanged. */ - assertEqualInt(4, c = archive_entry_acl_reset(e2, + assertEqualInt(4, archive_entry_acl_reset(e2, ARCHIVE_ENTRY_ACL_TYPE_ACCESS)); /* First three are standard permission bits. */ assertEqualInt(0, archive_entry_acl_next(e2, diff --git a/tar/test/main.c b/tar/test/main.c index b2d34fa1a..edfba0c57 100644 --- a/tar/test/main.c +++ b/tar/test/main.c @@ -1061,7 +1061,7 @@ assertion_file_nlinks(const char *file, int line, assertion_count(file, line); r = my_GetFileInformationByName(pathname, &bhfi); - if (r != 0 && bhfi.nNumberOfLinks == nlinks) + if (r != 0 && bhfi.nNumberOfLinks == (DWORD)nlinks) return (1); failure_start(file, line, "File %s has %d links, expected %d", pathname, bhfi.nNumberOfLinks, nlinks); diff --git a/tar/test/test_help.c b/tar/test/test_help.c index 163e2127f..3bb517d00 100644 --- a/tar/test/test_help.c +++ b/tar/test/test_help.c @@ -51,6 +51,7 @@ DEFINE_TEST(test_help) /* Exercise --help option. */ r = systemf("%s --help >help.stdout 2>help.stderr", testprog); + assertEqualInt(r, 0); failure("--help should generate nothing to stderr."); assertEmptyFile("help.stderr"); /* Help message should start with name of program. */ @@ -67,6 +68,7 @@ DEFINE_TEST(test_help) /* -h option should generate the same output. */ r = systemf("%s -h >h.stdout 2>h.stderr", testprog); + assertEqualInt(r, 0); failure("-h should generate nothing to stderr."); assertEmptyFile("h.stderr"); failure("stdout should be same for -h and --help"); @@ -74,6 +76,7 @@ DEFINE_TEST(test_help) /* -W help should be another synonym. */ r = systemf("%s -W help >Whelp.stdout 2>Whelp.stderr", testprog); + assertEqualInt(r, 0); failure("-W help should generate nothing to stderr."); assertEmptyFile("Whelp.stderr"); failure("stdout should be same for -W help and --help"); diff --git a/tar/write.c b/tar/write.c index 3b14e7e62..bf59f2746 100644 --- a/tar/write.c +++ b/tar/write.c @@ -679,7 +679,7 @@ write_hierarchy(struct bsdtar *bsdtar, struct archive *a, const char *path) return; } - while ((tree_ret = tree_next(tree))) { + while ((tree_ret = tree_next(tree)) != 0) { int r; const char *name = tree_current_path(tree); const struct stat *st = NULL; /* info to use for this entry */