]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix build failure without zlib and liblzo.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 7 Nov 2012 11:32:26 +0000 (20:32 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 7 Nov 2012 11:32:26 +0000 (20:32 +0900)
libarchive/archive_read_support_filter_lzop.c
libarchive/archive_read_support_format_7zip.c
libarchive/archive_read_support_format_rar.c
libarchive/archive_read_support_format_zip.c
libarchive/archive_write_set_format_7zip.c
libarchive/archive_write_set_format_zip.c

index 321130a8e1fdaee3ffeffbf8e2fe8d3a059a2edd..713af31e99f0ca42d1869224b32c9edb1ca0f159 100644 (file)
@@ -54,7 +54,8 @@ __FBSDID("$FreeBSD$");
 #endif
 
 #include "archive.h"
-#ifndef HAVE_ZLIB_H
+#if !defined(HAVE_ZLIB_H) &&\
+     defined(HAVE_LZO_LZOCONF_H) && defined(HAVE_LZO_LZO1X_H)
 #include "archive_crc32.h"
 #endif
 #include "archive_endian.h"
index 6a0a29d351e21a927fa5e2cf48d1ff503bbf3f6b..194b8d51c96aa72e0c4430335ba57287417ef750 100644 (file)
@@ -736,7 +736,8 @@ archive_read_format_7zip_read_data(struct archive_read *a,
 
        /* Update checksum */
        if ((zip->entry->flg & CRC32_IS_SET) && bytes)
-               zip->entry_crc32 = crc32(zip->entry_crc32, *buff, (uInt)bytes);
+               zip->entry_crc32 = crc32(zip->entry_crc32, *buff,
+                   (unsigned)bytes);
 
        /* If we hit the end, swallow any end-of-data marker. */
        if (zip->end_of_entry) {
@@ -2688,7 +2689,7 @@ header_bytes(struct archive_read *a, size_t rbytes)
        }
 
        /* Update checksum */
-       zip->header_crc32 = crc32(zip->header_crc32, p, (uInt)rbytes);
+       zip->header_crc32 = crc32(zip->header_crc32, p, (unsigned)rbytes);
        return (p);
 }
 
index 888949890bdc211c1bb404daabad96d0c4f791d0..2f4020e8958594d40a46e597dea83da9794a8899 100644 (file)
@@ -862,7 +862,7 @@ archive_read_format_rar_read_header(struct archive_read *a,
         return (ARCHIVE_FATAL);
       }
 
-      crc32_val = crc32(0, (const unsigned char *)p + 2, (uInt)skip - 2);
+      crc32_val = crc32(0, (const unsigned char *)p + 2, (unsigned)skip - 2);
       if ((crc32_val & 0xffff) != archive_le16dec(p)) {
         archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
           "Header CRC error");
@@ -905,7 +905,7 @@ archive_read_format_rar_read_header(struct archive_read *a,
         p = h;
       }
 
-      crc32_val = crc32(0, (const unsigned char *)p + 2, (uInt)skip - 2);
+      crc32_val = crc32(0, (const unsigned char *)p + 2, (unsigned)skip - 2);
       if ((crc32_val & 0xffff) != archive_le16dec(p)) {
         archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
           "Header CRC error");
@@ -1701,7 +1701,8 @@ read_data_stored(struct archive_read *a, const void **buff, size_t *size,
   rar->bytes_remaining -= bytes_avail;
   rar->bytes_unconsumed = bytes_avail;
   /* Calculate File CRC. */
-  rar->crc_calculated = crc32(rar->crc_calculated, *buff, (uInt)bytes_avail);
+  rar->crc_calculated = crc32(rar->crc_calculated, *buff,
+    (unsigned)bytes_avail);
   return (ARCHIVE_OK);
 }
 
@@ -1731,7 +1732,8 @@ read_data_compressed(struct archive_read *a, const void **buff, size_t *size,
         *offset = rar->offset_outgoing;
         rar->offset_outgoing += *size;
         /* Calculate File CRC. */
-        rar->crc_calculated = crc32(rar->crc_calculated, *buff, (uInt)*size);
+        rar->crc_calculated = crc32(rar->crc_calculated, *buff,
+          (unsigned)*size);
         rar->unp_offset = 0;
         return (ARCHIVE_OK);
       }
@@ -1764,7 +1766,8 @@ read_data_compressed(struct archive_read *a, const void **buff, size_t *size,
         *offset = rar->offset_outgoing;
         rar->offset_outgoing += *size;
         /* Calculate File CRC. */
-        rar->crc_calculated = crc32(rar->crc_calculated, *buff, (uInt)*size);
+        rar->crc_calculated = crc32(rar->crc_calculated, *buff,
+          (unsigned)*size);
         return (ret);
       }
       continue;
@@ -1897,7 +1900,7 @@ read_data_compressed(struct archive_read *a, const void **buff, size_t *size,
   *offset = rar->offset_outgoing;
   rar->offset_outgoing += *size;
   /* Calculate File CRC. */
-  rar->crc_calculated = crc32(rar->crc_calculated, *buff, (uInt)*size);
+  rar->crc_calculated = crc32(rar->crc_calculated, *buff, (unsigned)*size);
   return ret;
 }
 
index b23c84db4c94ef1fd553cc065c25e9adb5732db5..b730a70011bb52e06bf893f85118b72ef3ddd963 100644 (file)
@@ -919,7 +919,8 @@ archive_read_format_zip_read_data(struct archive_read *a,
                return (r);
        /* Update checksum */
        if (*size)
-               zip->entry_crc32 = crc32(zip->entry_crc32, *buff, (uInt)*size);
+               zip->entry_crc32 = crc32(zip->entry_crc32, *buff,
+                   (unsigned)*size);
        /* If we hit the end, swallow any end-of-data marker. */
        if (zip->end_of_entry) {
                /* Check file size, CRC against these values. */
index ef8cb959eee0b182055d13e247c4e15db13ef436..3b20d30838f341b55d0b1e994aa40f8127ad03ce 100644 (file)
@@ -504,7 +504,7 @@ _7z_write_header(struct archive_write *a, struct archive_entry *entry)
                bytes = compress_out(a, p, (size_t)file->size, ARCHIVE_Z_RUN);
                if (bytes < 0)
                        return ((int)bytes);
-               zip->entry_crc32 = crc32(zip->entry_crc32, p, (uInt)bytes);
+               zip->entry_crc32 = crc32(zip->entry_crc32, p, (unsigned)bytes);
                zip->entry_bytes_remaining -= bytes;
        }
 
@@ -562,7 +562,8 @@ compress_out(struct archive_write *a, const void *buff, size_t s,
                return (0);
 
        if ((zip->crc32flg & PRECODE_CRC32) && s)
-               zip->precode_crc32 = crc32(zip->precode_crc32, buff, (uInt)s);
+               zip->precode_crc32 = crc32(zip->precode_crc32, buff,
+                   (unsigned)s);
        zip->stream.next_in = (const unsigned char *)buff;
        zip->stream.avail_in = s;
        do {
@@ -608,7 +609,7 @@ _7z_write_data(struct archive_write *a, const void *buff, size_t s)
        bytes = compress_out(a, buff, s, ARCHIVE_Z_RUN);
        if (bytes < 0)
                return (bytes);
-       zip->entry_crc32 = crc32(zip->entry_crc32, buff, (uInt)bytes);
+       zip->entry_crc32 = crc32(zip->entry_crc32, buff, (unsigned)bytes);
        zip->entry_bytes_remaining -= bytes;
        return (bytes);
 }
index d7ec326e7c010e2855a959652e44f7efd3181061..6ec5c1997e3d1795af6a1c70de8992a549034643 100644 (file)
@@ -648,7 +648,7 @@ archive_write_zip_data(struct archive_write *a, const void *buff, size_t s)
                zip->written_bytes += s;
                zip->remaining_data_bytes -= s;
                l->compressed_size += s;
-               l->crc32 = crc32(l->crc32, buff, (uInt)s);
+               l->crc32 = crc32(l->crc32, buff, (unsigned)s);
                return (s);
 #if HAVE_ZLIB_H
        case COMPRESSION_DEFLATE: