]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Eliminate more warnings on Borland C.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 23 Dec 2009 00:26:44 +0000 (19:26 -0500)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 23 Dec 2009 00:26:44 +0000 (19:26 -0500)
SVN-Revision: 1774

cpio/test/main.c
cpio/test/test_option_help.c
libarchive/test/main.c
libarchive/test/test_entry.c
tar/test/main.c
tar/test/test_help.c
tar/write.c

index 36f466af9b2f1f9d17e0b482c8e0ba4ab51f7967..f1d7ba393f70cd3db5a97bc2c6edc26e8d4d30c9 100644 (file)
@@ -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);
index b9433a43a68b7134a2eb18644df00199b764a228..56234306f5397a20f9aee7841efc4196daea9f41 100644 (file)
@@ -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");
index c7fd3a888ef4d704bd071a372c6b0dd681c2e450..36feb5c1ad734cb29934a03a2440e39e25f776a7 100644 (file)
@@ -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);
index 8ed8f52c4fc4382d5dbf7ef67e098db08a91fc36..6cf6416e0842d76a10c23fadc0bc983239f77a41 100644 (file)
@@ -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,
index b2d34fa1a8e71bcfe4890b87646c56b386de654b..edfba0c57f8ae49a9a62edf24d316f8cc0d00f67 100644 (file)
@@ -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);
index 163e2127f266adeb1b662a27a72ca5215f5e00c4..3bb517d00cde6aad34fcc5cd6c80469b337f8b79 100644 (file)
@@ -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");
index 3b14e7e620ecb168d50b2567be301ade5abe3abe..bf59f27467453025d3447dd7e68e50b665c2e5d5 100644 (file)
@@ -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 */