From 69c171a5ab14f6a55077e4d32ae047952d2b5112 Mon Sep 17 00:00:00 2001 From: Tobias Stoeckmann Date: Wed, 15 May 2024 04:55:51 +0200 Subject: [PATCH] Fix Visual Studio compiler warnings (64 bit) (#2189) Some warnings are specific to 64 bit systems. Compiled with Visual Studio 2022 on Windows 11 x64. Co-authored-by: Duncan Horn --- libarchive/test/test_read_format_rar5.c | 2 +- test_utils/test_main.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libarchive/test/test_read_format_rar5.c b/libarchive/test/test_read_format_rar5.c index f278b0719..e51ed53d0 100644 --- a/libarchive/test/test_read_format_rar5.c +++ b/libarchive/test/test_read_format_rar5.c @@ -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"); diff --git a/test_utils/test_main.c b/test_utils/test_main.c index 496db6d91..ae5e74225 100644 --- a/test_utils/test_main.c +++ b/test_utils/test_main.c @@ -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); -- 2.47.2