From: Sergiu Dotenco Date: Sun, 25 Jan 2015 11:32:06 +0000 (+0100) Subject: fixed vc compilation errors X-Git-Tag: v3.1.900a~103^2~1^2^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81ce2c24f9fec640740de9bcea920ab71ef89059;p=thirdparty%2Flibarchive.git fixed vc compilation errors --- diff --git a/libarchive/archive_read_support_format_zip.c b/libarchive/archive_read_support_format_zip.c index e73c174fc..3c4c30b2c 100644 --- a/libarchive/archive_read_support_format_zip.c +++ b/libarchive/archive_read_support_format_zip.c @@ -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 */ diff --git a/libarchive/archive_write_set_format_warc.c b/libarchive/archive_write_set_format_warc.c index c4416ec1c..51102b4bb 100644 --- a/libarchive/archive_write_set_format_warc.c +++ b/libarchive/archive_write_set_format_warc.c @@ -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; diff --git a/libarchive/test/test_read_format_zip_nested.c b/libarchive/test/test_read_format_zip_nested.c index 000cafd67..6830afb71 100644 --- a/libarchive/test/test_read_format_zip_nested.c +++ b/libarchive/test/test_read_format_zip_nested.c @@ -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));