]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Change a bunch more internal off_t to int64_t.
authorTim Kientzle <kientzle@gmail.com>
Mon, 31 May 2010 18:46:16 +0000 (14:46 -0400)
committerTim Kientzle <kientzle@gmail.com>
Mon, 31 May 2010 18:46:16 +0000 (14:46 -0400)
SVN-Revision: 2434

libarchive/archive_read.c
libarchive/archive_read_support_format_ar.c
libarchive/archive_read_support_format_cpio.c
libarchive/archive_read_support_format_mtree.c
libarchive/archive_read_support_format_tar.c
libarchive/archive_read_support_format_zip.c

index 6b2f04c215ba1f77e6d56ee14b09dfc714912c90..3829cf1f8d92cc36f47dffd3a5abee92bf405ae8 100644 (file)
@@ -731,9 +731,8 @@ archive_read_data_block(struct archive *_a,
        *offset = (off_t)offset64;
        return (r);
 }
-#endif
 
-#if ARCHIVE_VERSION_NUMBER < 3000000
+
 static int
 archive_read_data_block64(struct archive *_a,
     const void **buff, size_t *size, int64_t *offset)
@@ -756,7 +755,6 @@ archive_read_data_block(struct archive *_a,
 
        return (a->format->read_data)(a, buff, size, offset);
 }
-#endif
 
 static int
 close_filters(struct archive_read *a)
index 5e7b1362951851b0e00cd19b80f81b8e66271b7c..df6eb5d78d57298a9470d5cdbfe376452720a37e 100644 (file)
@@ -50,9 +50,9 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_ar.c 201101
 #include "archive_read_private.h"
 
 struct ar {
-       off_t    entry_bytes_remaining;
-       off_t    entry_offset;
-       off_t    entry_padding;
+       int64_t  entry_bytes_remaining;
+       int64_t  entry_offset;
+       int64_t  entry_padding;
        char    *strtab;
        size_t   strtab_size;
        char     read_global_header;
@@ -352,7 +352,7 @@ archive_read_format_ar_read_header(struct archive_read *a,
                 * overflowing a size_t and against the filename size
                 * being larger than the entire entry. */
                if (number > (uint64_t)(bsd_name_length + 1)
-                   || (off_t)bsd_name_length > ar->entry_bytes_remaining) {
+                   || (int64_t)bsd_name_length > ar->entry_bytes_remaining) {
                        archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
                            "Bad input file size");
                        return (ARCHIVE_FATAL);
@@ -483,7 +483,7 @@ archive_read_format_ar_read_data(struct archive_read *a,
 static int
 archive_read_format_ar_skip(struct archive_read *a)
 {
-       off_t bytes_skipped;
+       int64_t bytes_skipped;
        struct ar* ar;
 
        ar = (struct ar *)(a->format->data);
index d3c1ee58be56b18c6f85686c6308add265325fab..dbeaeb6c2c5ed32370e2ddd69ebd913ea7cdbaa5 100644 (file)
@@ -133,9 +133,9 @@ struct cpio {
        struct links_entry       *links_head;
        struct archive_string     entry_name;
        struct archive_string     entry_linkname;
-       off_t                     entry_bytes_remaining;
-       off_t                     entry_offset;
-       off_t                     entry_padding;
+       int64_t                   entry_bytes_remaining;
+       int64_t                   entry_offset;
+       int64_t                   entry_padding;
 };
 
 static int64_t atol16(const char *, unsigned);
index 5e687d331576a249a4d8d8c7e5746eac21608dfa..47d3e68d961bd4f37d21b97c8499368f37757914 100644 (file)
@@ -86,7 +86,7 @@ struct mtree {
        struct archive_string    line;
        size_t                   buffsize;
        char                    *buff;
-       off_t                    offset;
+       int64_t                  offset;
        int                      fd;
        int                      filetype;
        int                      archive_format;
@@ -98,7 +98,7 @@ struct mtree {
 
        struct archive_entry_linkresolver *resolver;
 
-       off_t                    cur_size, cur_offset;
+       int64_t                  cur_size, cur_offset;
 };
 
 static int     cleanup(struct archive_read *);
@@ -997,7 +997,7 @@ read_data(struct archive_read *a, const void **buff, size_t *size, int64_t *offs
 
        *buff = mtree->buff;
        *offset = mtree->offset;
-       if ((off_t)mtree->buffsize > mtree->cur_size - mtree->offset)
+       if ((int64_t)mtree->buffsize > mtree->cur_size - mtree->offset)
                bytes_to_read = mtree->cur_size - mtree->offset;
        else
                bytes_to_read = mtree->buffsize;
index f11fe19df346b464c20a1ad4a5c184517af96bd9..6fc164f50386d4c856f6c6a25a436d3506139508 100644 (file)
@@ -139,8 +139,8 @@ struct archive_entry_header_gnutar {
  */
 struct sparse_block {
        struct sparse_block     *next;
-       off_t   offset;
-       off_t   remaining;
+       int64_t offset;
+       int64_t remaining;
 };
 
 struct tar {
@@ -177,7 +177,7 @@ static ssize_t      UTF8_mbrtowc(wchar_t *pwc, const char *s, size_t n);
 static int     archive_block_is_null(const unsigned char *p);
 static char    *base64_decode(const char *, size_t, size_t *);
 static void     gnu_add_sparse_entry(struct tar *,
-                   off_t offset, off_t remaining);
+                   int64_t offset, int64_t remaining);
 static void    gnu_clear_sparse_list(struct tar *);
 static int     gnu_sparse_old_read(struct archive_read *, struct tar *,
                    const struct archive_entry_header_gnutar *header);
@@ -883,7 +883,7 @@ static int
 read_body_to_string(struct archive_read *a, struct tar *tar,
     struct archive_string *as, const void *h)
 {
-       off_t size, padded_size;
+       int64_t size, padded_size;
        const struct archive_entry_header_ustar *header;
        const void *src;
 
@@ -1742,7 +1742,7 @@ header_gnutar(struct archive_read *a, struct tar *tar,
 }
 
 static void
-gnu_add_sparse_entry(struct tar *tar, off_t offset, off_t remaining)
+gnu_add_sparse_entry(struct tar *tar, int64_t offset, int64_t remaining)
 {
        struct sparse_block *p;
 
@@ -1863,7 +1863,7 @@ static int
 gnu_sparse_01_parse(struct tar *tar, const char *p)
 {
        const char *e;
-       off_t offset = -1, size = -1;
+       int64_t offset = -1, size = -1;
 
        for (;;) {
                e = p;
@@ -1963,7 +1963,7 @@ gnu_sparse_10_read(struct archive_read *a, struct tar *tar)
 {
        ssize_t remaining, bytes_read;
        int entries;
-       off_t offset, size, to_skip;
+       int64_t offset, size, to_skip;
 
        /* Clear out the existing sparse list. */
        gnu_clear_sparse_list(tar);
index f43f3070dbd538070e5f27909ca11eedeeb6ccd6..f81bf1d9e0f26759da7035877efa8a01b6a4834e 100644 (file)
@@ -758,7 +758,7 @@ archive_read_format_zip_read_data_skip(struct archive_read *a)
 {
        struct zip *zip;
        const void *buff = NULL;
-       off_t bytes_skipped;
+       int64_t bytes_skipped;
 
        zip = (struct zip *)(a->format->data);