From: Tim Kientzle Date: Mon, 31 May 2010 18:46:16 +0000 (-0400) Subject: Change a bunch more internal off_t to int64_t. X-Git-Tag: v3.0.0a~987 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a64fcb083cc50aa2162bbeae49d99d5e4b6c0c2b;p=thirdparty%2Flibarchive.git Change a bunch more internal off_t to int64_t. SVN-Revision: 2434 --- diff --git a/libarchive/archive_read.c b/libarchive/archive_read.c index 6b2f04c21..3829cf1f8 100644 --- a/libarchive/archive_read.c +++ b/libarchive/archive_read.c @@ -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) diff --git a/libarchive/archive_read_support_format_ar.c b/libarchive/archive_read_support_format_ar.c index 5e7b13629..df6eb5d78 100644 --- a/libarchive/archive_read_support_format_ar.c +++ b/libarchive/archive_read_support_format_ar.c @@ -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); diff --git a/libarchive/archive_read_support_format_cpio.c b/libarchive/archive_read_support_format_cpio.c index d3c1ee58b..dbeaeb6c2 100644 --- a/libarchive/archive_read_support_format_cpio.c +++ b/libarchive/archive_read_support_format_cpio.c @@ -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); diff --git a/libarchive/archive_read_support_format_mtree.c b/libarchive/archive_read_support_format_mtree.c index 5e687d331..47d3e68d9 100644 --- a/libarchive/archive_read_support_format_mtree.c +++ b/libarchive/archive_read_support_format_mtree.c @@ -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; diff --git a/libarchive/archive_read_support_format_tar.c b/libarchive/archive_read_support_format_tar.c index f11fe19df..6fc164f50 100644 --- a/libarchive/archive_read_support_format_tar.c +++ b/libarchive/archive_read_support_format_tar.c @@ -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); diff --git a/libarchive/archive_read_support_format_zip.c b/libarchive/archive_read_support_format_zip.c index f43f3070d..f81bf1d9e 100644 --- a/libarchive/archive_read_support_format_zip.c +++ b/libarchive/archive_read_support_format_zip.c @@ -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);