]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
fixed vc compilation errors
authorSergiu Dotenco <sergiu.dotenco@gmail.com>
Sun, 25 Jan 2015 11:32:06 +0000 (12:32 +0100)
committerSergiu Dotenco <sergiu.dotenco@gmail.com>
Sun, 25 Jan 2015 11:35:35 +0000 (12:35 +0100)
libarchive/archive_read_support_format_zip.c
libarchive/archive_write_set_format_warc.c
libarchive/test/test_read_format_zip_nested.c

index e73c174fcae8f6b7c4233584e04c547077944f9d..3c4c30b2c214d70a7ecf0028014b782fbc87e9f6 100644 (file)
@@ -119,7 +119,7 @@ struct trad_enc_ctx {
 #define LA_USED_ZIP64  (1 << 0)
 #define LA_FROM_CENTRAL_DIRECTORY (1 << 1)
 
-/* 
+/*
  * See "WinZip - AES Encryption Information"
  *     http://www.winzip.com/aes_info.htm
  */
@@ -906,7 +906,7 @@ zip_read_local_file_header(struct archive_read *a, struct archive_entry *entry,
        archive_entry_set_atime(entry, zip_entry->atime, 0);
 
        if ((zip->entry->mode & AE_IFMT) == AE_IFLNK) {
-               size_t linkname_length = zip_entry->compressed_size;
+               size_t linkname_length = (size_t)zip_entry->compressed_size;
 
                archive_entry_set_size(entry, 0);
                p = __archive_read_ahead(a, linkname_length, NULL);
@@ -1260,7 +1260,7 @@ zip_read_data_deflate(struct archive_read *a, const void **buff,
                                                buff_remaining = 0;
                                        else
                                                buff_remaining =
-                                                   zip->entry_bytes_remaining
+                                                   (size_t)zip->entry_bytes_remaining
                                                      - zip->decrypted_bytes_remaining;
                                }
                        }
@@ -2316,7 +2316,7 @@ read_zip64_eocd(struct archive_read *a, struct zip *zip, const char *p)
        eocd64_size = archive_le64dec(p + 4) + 12;
        if (eocd64_size < 56 || eocd64_size > 16384)
                return;
-       if ((p = __archive_read_ahead(a, eocd64_size, NULL)) == NULL)
+       if ((p = __archive_read_ahead(a, (size_t)eocd64_size, NULL)) == NULL)
                return;
 
        /* Sanity-check the EOCD64 */
index c4416ec1ce9d2d64aad8fc24e5da6c2fa9b365da..51102b4bb1a1ebebf3d310a018a72a250381fdda 100644 (file)
@@ -231,7 +231,7 @@ _warc_header(struct archive_write *a, struct archive_entry *entry)
                        /*rtm*/w->now,
                        /*mtm*/archive_entry_mtime(entry),
                        /*cty*/NULL,
-                       /*len*/archive_entry_size(entry),
+                       /*len*/(size_t)archive_entry_size(entry),
                };
                ssize_t r;
 
index 000cafd67c8ba9b6764eb546c1f511538958347f..6830afb716d7ac6d9df2c7fe02a811d18a049cbf 100644 (file)
@@ -49,7 +49,7 @@ DEFINE_TEST(test_read_format_zip_nested)
        assertEqualIntA(a, archive_read_has_encrypted_entries(a), 0);
 
        /* Save contents of inner Zip. */
-       innerLength = archive_entry_size(ae);
+       innerLength = (size_t)archive_entry_size(ae);
        inner = calloc(innerLength, 1);
        assertEqualInt(innerLength, archive_read_data(a, inner, innerLength));
 
@@ -69,7 +69,7 @@ DEFINE_TEST(test_read_format_zip_nested)
        assert((a = archive_read_new()) != NULL);
        assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
        assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, inner, innerLength, 1));
-       
+
        assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
        assertEqualString("another_file.txt", archive_entry_pathname(ae));
        assertEqualInt(29, archive_entry_size(ae));