From: Michihiro NAKAJIMA Date: Tue, 14 Feb 2012 07:05:25 +0000 (+0900) Subject: Fix build failure in aggressive warnings on FreeBSD/amd64. X-Git-Tag: v3.0.4~2^2~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ecb1bb23cc28c22e787f3bf5a65342bcb0f3282;p=thirdparty%2Flibarchive.git Fix build failure in aggressive warnings on FreeBSD/amd64. --- diff --git a/libarchive/archive_read.c b/libarchive/archive_read.c index b1d491435..987295f02 100644 --- a/libarchive/archive_read.c +++ b/libarchive/archive_read.c @@ -633,7 +633,7 @@ archive_read_data(struct archive *_a, void *buff, size_t s) } /* Compute the amount of zero padding needed. */ - if (a->read_data_output_offset + s < + if (a->read_data_output_offset + (int64_t)s < a->read_data_offset) { len = s; } else if (a->read_data_output_offset < diff --git a/libarchive/archive_read_data_into_fd.c b/libarchive/archive_read_data_into_fd.c index 14f941070..b4398f1ec 100644 --- a/libarchive/archive_read_data_into_fd.c +++ b/libarchive/archive_read_data_into_fd.c @@ -64,7 +64,7 @@ pad_to(struct archive *a, int fd, int can_lseek, } while (target_offset > actual_offset) { to_write = nulls_size; - if (target_offset < actual_offset + nulls_size) + if (target_offset < actual_offset + (int64_t)nulls_size) to_write = (size_t)(target_offset - actual_offset); bytes_written = write(fd, nulls, to_write); if (bytes_written < 0) { diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c index a1174172a..41b8ada68 100644 --- a/libarchive/archive_read_disk_posix.c +++ b/libarchive/archive_read_disk_posix.c @@ -782,7 +782,7 @@ _archive_read_data_block(struct archive *_a, const void **buff, t->entry_buff_size = t->current_filesystem->buff_size; buffbytes = t->entry_buff_size; - if (buffbytes > t->current_sparse->length) + if ((int64_t)buffbytes > t->current_sparse->length) buffbytes = t->current_sparse->length; /* diff --git a/tar/write.c b/tar/write.c index 1c0f5ccc8..158d25a08 100644 --- a/tar/write.c +++ b/tar/write.c @@ -654,7 +654,7 @@ copy_file_data_block(struct bsdtar *bsdtar, struct archive *a, } while (sparse > 0) { - if (sparse > bsdtar->buff_size) + if (sparse > (int64_t)bsdtar->buff_size) ns = bsdtar->buff_size; else ns = (size_t)sparse;