]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix Visual Studio compiler warnings (64 bit) (#2189)
authorTobias Stoeckmann <stoeckmann@users.noreply.github.com>
Wed, 15 May 2024 02:55:51 +0000 (04:55 +0200)
committerGitHub <noreply@github.com>
Wed, 15 May 2024 02:55:51 +0000 (19:55 -0700)
Some warnings are specific to 64 bit systems. Compiled with Visual
Studio 2022 on Windows 11 x64.

Co-authored-by: Duncan Horn <dunhor@microsoft.com>
libarchive/test/test_read_format_rar5.c
test_utils/test_main.c

index f278b0719e76683015cf431c73a62ea888ed4536..e51ed53d0cc6c642e690497094cab21bf1a9b070 100644 (file)
@@ -843,7 +843,7 @@ DEFINE_TEST(test_read_format_rar5_block_by_block)
        struct archive_entry *ae;
        struct archive *a;
        uint8_t buf[173];
-       int bytes_read;
+       ssize_t bytes_read;
        uint32_t computed_crc = 0;
 
        extract_reference_file("test_read_format_rar5_compressed.rar");
index 496db6d9122c2bd08bd2d0fcbee60331127d3f86..ae5e74225cf2749af92933cd06af8846b77ba4ec 100644 (file)
@@ -219,7 +219,8 @@ my_CreateSymbolicLinkA(const char *linkname, const char *target,
        static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, DWORD);
        DWORD attrs;
        static int set;
-       int ret, tmpflags, llen, tlen;
+       int ret, tmpflags;
+       size_t llen, tlen;
        int flags = 0;
        char *src, *tgt, *p;
        if (!set) {
@@ -3879,9 +3880,9 @@ main(int argc, char **argv)
        static const int limit = sizeof(tests) / sizeof(tests[0]);
        int test_set[sizeof(tests) / sizeof(tests[0])];
        int i = 0, j = 0, tests_run = 0, tests_failed = 0, option;
-       int testprogdir_len;
+       size_t testprogdir_len;
 #ifdef PROGRAM
-       int tmp2_len;
+       size_t tmp2_len;
 #endif
        time_t now;
        struct tm *tmptr;
@@ -4085,7 +4086,7 @@ main(int argc, char **argv)
 
        {
                char *testprg;
-               int testprg_len;
+               size_t testprg_len;
 #if defined(_WIN32) && !defined(__CYGWIN__)
                /* Command.com sometimes rejects '/' separators. */
                testprg = strdup(testprogfile);