]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Removed cast warnings under Visual Studio 1150/head
authorGrzegorz Antoniak <ga@anadoxin.org>
Wed, 27 Feb 2019 19:04:45 +0000 (20:04 +0100)
committerGrzegorz Antoniak <ga@anadoxin.org>
Wed, 27 Feb 2019 19:04:45 +0000 (20:04 +0100)
libarchive/test/test_read_format_rar5.c
libarchive/test/test_read_format_xar.c
libarchive/test/test_read_format_zip.c

index 16198238f60a495464a67510e9fd1e14e297306f..15542074b77fe198f2cdaf5fbf49732411480a24 100644 (file)
@@ -96,7 +96,7 @@ int extract_one(struct archive* a, struct archive_entry* ae, uint32_t crc) {
     int ret = 1;
     uint32_t computed_crc;
 
-    fsize = archive_entry_size(ae);
+    fsize = (la_ssize_t) archive_entry_size(ae);
     buf = malloc(fsize);
     if(buf == NULL)
         return 1;
index 4654f8386efb8fdecd63233ab3e62168966b353d..1c8524520b397d0769da642411a7985439d4b3b2 100644 (file)
@@ -799,7 +799,7 @@ static void verify(unsigned char *d, size_t s,
 static void verifyB(unsigned char *d, size_t s) {
        struct archive* a;
        struct archive_entry *entry = NULL;
-       la_int64_t buf_size;
+       size_t buf_size;
        unsigned char *buf;
 
        assert((a = archive_read_new()) != NULL);
@@ -826,20 +826,20 @@ static void verifyB(unsigned char *d, size_t s) {
 
        // f1, content "onetwothree\n", size 12 bytes
        assertA(0 == archive_read_next_header(a, &entry));
-       buf_size = archive_entry_size(entry);
+       buf_size = (size_t) archive_entry_size(entry);
        assertA(buf_size == 12);
        buf = (unsigned char*) malloc(buf_size);
        assertA(NULL != buf);
-       assertA(buf_size == archive_read_data(a, buf, buf_size));
+       assertA(buf_size == (size_t) archive_read_data(a, buf, buf_size));
        free(buf);
 
        // f2, content "fourfivesix\n", size 12 bytes
        assertA(0 == archive_read_next_header(a, &entry));
-       buf_size = archive_entry_size(entry);
+       buf_size = (size_t) archive_entry_size(entry);
        assertA(buf_size == 12);
        buf = (unsigned char*) malloc(buf_size);
        assertA(NULL != buf);
-       assertA(buf_size == archive_read_data(a, buf, buf_size));
+       assertA(buf_size == (size_t) archive_read_data(a, buf, buf_size));
        free(buf);
 
        assertEqualInt(ARCHIVE_OK, archive_read_free(a));
index b965299a4f5c6068fb1c1775a64c48bbffd08813..d152a19b4f847f2f41fdc59da0d96d792ac1a204 100644 (file)
@@ -37,7 +37,7 @@ int extract_one(struct archive* a, struct archive_entry* ae, uint32_t crc)
     int ret = 1;
     uint32_t computed_crc;
 
-    fsize = archive_entry_size(ae);
+    fsize = (la_ssize_t) archive_entry_size(ae);
     buf = malloc(fsize);
     if(buf == NULL)
         return 1;