diff options
author | Martin Matuska <mm@FreeBSD.org> | 2012-02-09 19:13:36 +0000 |
---|---|---|
committer | Martin Matuska <mm@FreeBSD.org> | 2012-02-09 19:13:36 +0000 |
commit | 4d44c8d1829cfdaa134c3f88cad04f0c73b47ad8 (patch) | |
tree | 02e7b67dbf1852d01e12499cb10c8e3a960c2038 | |
parent | bfd7accf016895bfc7c0af369106f52e0ca32e79 (diff) |
Update libarchive's vendor dist to latest changes in release branch.
Now all the gcc warnings I have reported upstream should be fixed.
Git branch: release
Git commit: 01580b4298a946fb31e822a083bf49e9f37809ac
Obtained from: https://github.com/libarchive/libarchive.git
Notes
Notes:
svn path=/vendor/libarchive/dist/; revision=231297
-rw-r--r-- | cpio/test/main.c | 6 | ||||
-rw-r--r-- | libarchive/archive_rb.c | 4 | ||||
-rw-r--r-- | libarchive/archive_read_disk_entry_from_file.c | 6 | ||||
-rw-r--r-- | libarchive/archive_read_disk_posix.c | 6 | ||||
-rw-r--r-- | libarchive/archive_read_support_format_rar.c | 4 | ||||
-rw-r--r-- | libarchive/archive_read_support_format_zip.c | 2 | ||||
-rw-r--r-- | libarchive/archive_string.c | 8 | ||||
-rw-r--r-- | libarchive/archive_write_disk_posix.c | 15 | ||||
-rw-r--r-- | libarchive/archive_write_set_format_iso9660.c | 11 | ||||
-rw-r--r-- | libarchive/test/main.c | 6 | ||||
-rw-r--r-- | libarchive/test/test_acl_pax.c | 2 | ||||
-rw-r--r-- | libarchive/test/test_acl_posix1e.c | 2 | ||||
-rw-r--r-- | libarchive/test/test_sparse_basic.c | 2 | ||||
-rw-r--r-- | tar/test/main.c | 6 |
14 files changed, 46 insertions, 34 deletions
diff --git a/cpio/test/main.c b/cpio/test/main.c index e19aabcc42c6..a0c5295860c7 100644 --- a/cpio/test/main.c +++ b/cpio/test/main.c @@ -1316,7 +1316,7 @@ assertion_file_nlinks(const char *file, int line, assertion_count(file, line); r = lstat(pathname, &st); - if (r == 0 && st.st_nlink == nlinks) + if (r == 0 && (int)st.st_nlink == nlinks) return (1); failure_start(file, line, "File %s has %d links, expected %d", pathname, st.st_nlink, nlinks); @@ -1380,7 +1380,7 @@ assertion_is_dir(const char *file, int line, const char *pathname, int mode) /* Windows doesn't handle permissions the same way as POSIX, * so just ignore the mode tests. */ /* TODO: Can we do better here? */ - if (mode >= 0 && mode != (st.st_mode & 07777)) { + if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) { failure_start(file, line, "Dir %s has wrong mode", pathname); logprintf(" Expected: 0%3o\n", mode); logprintf(" Found: 0%3o\n", st.st_mode & 07777); @@ -1413,7 +1413,7 @@ assertion_is_reg(const char *file, int line, const char *pathname, int mode) /* Windows doesn't handle permissions the same way as POSIX, * so just ignore the mode tests. */ /* TODO: Can we do better here? */ - if (mode >= 0 && mode != (st.st_mode & 07777)) { + if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) { failure_start(file, line, "File %s has wrong mode", pathname); logprintf(" Expected: 0%3o\n", mode); logprintf(" Found: 0%3o\n", st.st_mode & 07777); diff --git a/libarchive/archive_rb.c b/libarchive/archive_rb.c index fa307be25064..70bf7e6d3379 100644 --- a/libarchive/archive_rb.c +++ b/libarchive/archive_rb.c @@ -96,7 +96,7 @@ __archive_rb_tree_init(struct archive_rb_tree *rbt, const struct archive_rb_tree_ops *ops) { rbt->rbt_ops = ops; - *((const struct archive_rb_node **)&rbt->rbt_root) = RB_SENTINEL_NODE; + *((struct archive_rb_node **)&rbt->rbt_root) = RB_SENTINEL_NODE; } struct archive_rb_node * @@ -683,7 +683,7 @@ __archive_rb_tree_iterate(struct archive_rb_tree *rbt, */ if (RB_SENTINEL_P(self->rb_nodes[direction])) { while (!RB_ROOT_P(rbt, self)) { - if (other == RB_POSITION(self)) + if (other == (unsigned int)RB_POSITION(self)) return RB_FATHER(self); self = RB_FATHER(self); } diff --git a/libarchive/archive_read_disk_entry_from_file.c b/libarchive/archive_read_disk_entry_from_file.c index 8ce88b380fca..284b9e9733b3 100644 --- a/libarchive/archive_read_disk_entry_from_file.c +++ b/libarchive/archive_read_disk_entry_from_file.c @@ -191,7 +191,7 @@ archive_read_disk_entry_from_file(struct archive *_a, fd = open(path, O_RDONLY | O_NONBLOCK); if (fd >= 0) { unsigned long stflags; - int r = ioctl(fd, EXT2_IOC_GETFLAGS, &stflags); + r = ioctl(fd, EXT2_IOC_GETFLAGS, &stflags); if (r == 0 && stflags != 0) archive_entry_set_fflags(entry, stflags, 0); } @@ -870,12 +870,12 @@ setup_sparse(struct archive_read_disk *a, if (fm->fm_mapped_extents == 0) break; fe = fm->fm_extents; - for (i = 0; i < fm->fm_mapped_extents; i++, fe++) { + for (i = 0; i < (int)fm->fm_mapped_extents; i++, fe++) { if (!(fe->fe_flags & FIEMAP_EXTENT_UNWRITTEN)) { /* The fe_length of the last block does not * adjust itself to its size files. */ int64_t length = fe->fe_length; - if (fe->fe_logical + length > size) + if (fe->fe_logical + length > (uint64_t)size) length -= fe->fe_logical + length - size; if (fe->fe_logical == 0 && length == size) { /* This is not sparse. */ diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c index b81ab30fe719..dd03ceebaa2c 100644 --- a/libarchive/archive_read_disk_posix.c +++ b/libarchive/archive_read_disk_posix.c @@ -2214,7 +2214,8 @@ tree_target_is_same_as_parent(struct tree *t, const struct stat *st) struct tree_entry *te; for (te = t->current->parent; te != NULL; te = te->parent) { - if (te->dev == st->st_dev && te->ino == st->st_ino) + if (te->dev == (int64_t)st->st_dev && + te->ino == (int64_t)st->st_ino) return (1); } return (0); @@ -2231,7 +2232,8 @@ tree_current_is_symblic_link_target(struct tree *t) lst = tree_current_lstat(t); st = tree_current_stat(t); - return (st != NULL && st->st_dev == t->current_filesystem->dev && + return (st != NULL && + (int64_t)st->st_dev == t->current_filesystem->dev && st->st_dev != lst->st_dev); } diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c index 838407950b8e..1a8b157eb1f3 100644 --- a/libarchive/archive_read_support_format_rar.c +++ b/libarchive/archive_read_support_format_rar.c @@ -305,7 +305,7 @@ static int archive_read_format_rar_cleanup(struct archive_read *); /* Support functions */ static int read_header(struct archive_read *, struct archive_entry *, char); -static time_t get_time(int time); +static time_t get_time(int); static int read_exttime(const char *, struct rar *, const char *); static int read_symlink_stored(struct archive_read *, struct archive_entry *, struct archive_string_conv *); @@ -1047,7 +1047,7 @@ read_header(struct archive_read *a, struct archive_entry *entry, memcpy(&rar_header, p, sizeof(rar_header)); rar->file_flags = archive_le16dec(rar_header.flags); header_size = archive_le16dec(rar_header.size); - if (header_size < sizeof(file_header) + 7) { + if (header_size < (int64_t)sizeof(file_header) + 7) { archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Invalid header size"); return (ARCHIVE_FATAL); diff --git a/libarchive/archive_read_support_format_zip.c b/libarchive/archive_read_support_format_zip.c index fce04b8a2cc1..5668f12c5375 100644 --- a/libarchive/archive_read_support_format_zip.c +++ b/libarchive/archive_read_support_format_zip.c @@ -265,7 +265,7 @@ archive_read_format_zip_seekable_bid(struct archive_read *a, int best_bid) if (zip->central_directory_entries != archive_le16dec(p + 8)) return 0; /* Central directory can't extend beyond end of this file. */ - if (zip->central_directory_offset + zip->central_directory_size > filesize) + if (zip->central_directory_offset + (int64_t)zip->central_directory_size > filesize) return 0; /* This is just a tiny bit higher than the maximum returned by diff --git a/libarchive/archive_string.c b/libarchive/archive_string.c index 49ff108ee0a3..1dce5600e44b 100644 --- a/libarchive/archive_string.c +++ b/libarchive/archive_string.c @@ -1646,7 +1646,7 @@ make_codepage_from_charset(const char *charset) * Return ANSI Code Page of current locale set by setlocale(). */ static unsigned -get_current_codepage() +get_current_codepage(void) { char *locale, *p; unsigned cp; @@ -1721,7 +1721,7 @@ static struct { * Return OEM Code Page of current locale set by setlocale(). */ static unsigned -get_current_oemcp() +get_current_oemcp(void) { int i; char *locale, *p; @@ -1750,7 +1750,7 @@ get_current_oemcp() */ static unsigned -get_current_codepage() +get_current_codepage(void) { return (-1);/* Unknown */ } @@ -1761,7 +1761,7 @@ make_codepage_from_charset(const char *charset) return (-1);/* Unknown */ } static unsigned -get_current_oemcp() +get_current_oemcp(void) { return (-1);/* Unknown */ } diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c index a07960f550fb..752ce89806ed 100644 --- a/libarchive/archive_write_disk_posix.c +++ b/libarchive/archive_write_disk_posix.c @@ -1672,7 +1672,7 @@ cleanup_pathname_win(struct archive_write_disk *a) p = a->name; while (*p != '\0' && alen) { l = mbtowc(&wc, p, alen); - if (l == -1) { + if (l == (size_t)-1) { while (*p != '\0') { if (*p == '\\') *p = '/'; @@ -1979,6 +1979,7 @@ set_time(int fd, int mode, const char *name, * on fds and symlinks. */ struct timespec ts[2]; + (void)mode; /* UNUSED */ ts[0].tv_sec = atime; ts[0].tv_nsec = atime_nsec; ts[1].tv_sec = mtime; @@ -2036,6 +2037,11 @@ set_time(int fd, int mode, const char *name, /* * We don't know how to set the time on this platform. */ + (void)fd; /* UNUSED */ + (void)mode; /* UNUSED */ + (void)name; /* UNUSED */ + (void)atime_nsec; /* UNUSED */ + (void)mtime_nsec; /* UNUSED */ return (ARCHIVE_WARN); #endif } @@ -2105,6 +2111,9 @@ set_times(struct archive_write_disk *a, r1 = set_time(fd, mode, name, atime, atime_nanos, birthtime, birthtime_nanos); +#else + (void)birthtime; /* UNUSED */ + (void)birthtime_nanos; /* UNUSED */ #endif r2 = set_time(fd, mode, name, atime, atime_nanos, @@ -2537,12 +2546,12 @@ set_mac_metadata(struct archive_write_disk *a, const char *pathname, /* Default empty function body to satisfy mainline code. */ static int set_acls(struct archive_write_disk *a, int fd, const char *name, - struct archive_acl *acl) + struct archive_acl *aacl) { (void)a; /* UNUSED */ (void)fd; /* UNUSED */ (void)name; /* UNUSED */ - (void)acl; /* UNUSED */ + (void)aacl; /* UNUSED */ return (ARCHIVE_OK); } diff --git a/libarchive/archive_write_set_format_iso9660.c b/libarchive/archive_write_set_format_iso9660.c index 2e43be54343f..bdb3e3a1b569 100644 --- a/libarchive/archive_write_set_format_iso9660.c +++ b/libarchive/archive_write_set_format_iso9660.c @@ -3689,7 +3689,7 @@ wb_set_offset(struct archive_write *a, int64_t off) ext_bytes = off - iso9660->wbuff_tail; iso9660->wbuff_remaining = sizeof(iso9660->wbuff) - (iso9660->wbuff_tail - iso9660->wbuff_offset); - while (ext_bytes >= iso9660->wbuff_remaining) { + while (ext_bytes >= (int64_t)iso9660->wbuff_remaining) { if (write_null(a, (size_t)iso9660->wbuff_remaining) != ARCHIVE_OK) return (ARCHIVE_FATAL); @@ -6513,8 +6513,7 @@ isoent_traverse_tree(struct archive_write *a, struct vdd* vdd) struct idr idr; int depth; int r; - int (*genid)(struct archive_write *a, struct isoent *isoent, - struct idr *idr); + int (*genid)(struct archive_write *, struct isoent *, struct idr *); idr_init(iso9660, vdd, &idr); np = vdd->rootent; @@ -7283,7 +7282,7 @@ setup_boot_information(struct archive_write *a) size_t rsize; ssize_t i, rs; - if (size > sizeof(buff)) + if (size > (int64_t)sizeof(buff)) rsize = sizeof(buff); else rsize = (size_t)size; @@ -7466,7 +7465,7 @@ zisofs_detect_magic(struct archive_write *a, const void *buff, size_t s) int64_t entry_size; entry_size = archive_entry_size(file->entry); - if (sizeof(iso9660->zisofs.magic_buffer) > entry_size) + if ((int64_t)sizeof(iso9660->zisofs.magic_buffer) > entry_size) magic_max = entry_size; else magic_max = sizeof(iso9660->zisofs.magic_buffer); @@ -7511,7 +7510,7 @@ zisofs_detect_magic(struct archive_write *a, const void *buff, size_t s) ceil = (uncompressed_size + (ARCHIVE_LITERAL_LL(1) << log2_bs) -1) >> log2_bs; doff = (ceil + 1) * 4 + 16; - if (entry_size < doff) + if (entry_size < (int64_t)doff) return;/* Invalid data. */ /* Check every Block Pointer has valid value. */ diff --git a/libarchive/test/main.c b/libarchive/test/main.c index 64f0380602d5..386b10b500b1 100644 --- a/libarchive/test/main.c +++ b/libarchive/test/main.c @@ -1314,7 +1314,7 @@ assertion_file_nlinks(const char *file, int line, assertion_count(file, line); r = lstat(pathname, &st); - if (r == 0 && st.st_nlink == nlinks) + if (r == 0 && (int)st.st_nlink == nlinks) return (1); failure_start(file, line, "File %s has %d links, expected %d", pathname, st.st_nlink, nlinks); @@ -1378,7 +1378,7 @@ assertion_is_dir(const char *file, int line, const char *pathname, int mode) /* Windows doesn't handle permissions the same way as POSIX, * so just ignore the mode tests. */ /* TODO: Can we do better here? */ - if (mode >= 0 && mode != (st.st_mode & 07777)) { + if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) { failure_start(file, line, "Dir %s has wrong mode", pathname); logprintf(" Expected: 0%3o\n", mode); logprintf(" Found: 0%3o\n", st.st_mode & 07777); @@ -1411,7 +1411,7 @@ assertion_is_reg(const char *file, int line, const char *pathname, int mode) /* Windows doesn't handle permissions the same way as POSIX, * so just ignore the mode tests. */ /* TODO: Can we do better here? */ - if (mode >= 0 && mode != (st.st_mode & 07777)) { + if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) { failure_start(file, line, "File %s has wrong mode", pathname); logprintf(" Expected: 0%3o\n", mode); logprintf(" Found: 0%3o\n", st.st_mode & 07777); diff --git a/libarchive/test/test_acl_pax.c b/libarchive/test/test_acl_pax.c index 6a7ee1516491..2bee4572cf7f 100644 --- a/libarchive/test/test_acl_pax.c +++ b/libarchive/test/test_acl_pax.c @@ -163,7 +163,7 @@ compare_acls(struct archive_entry *ae, struct acl_t *acls, int n, int mode) } } assertEqualInt(ARCHIVE_EOF, r); - assert((mode & 0777) == (archive_entry_mode(ae) & 0777)); + assert((mode_t)(mode & 0777) == (archive_entry_mode(ae) & 0777)); failure("Could not find match for ACL " "(type=%d,permset=%d,tag=%d,qual=%d,name=``%s'')", acls[marker[0]].type, acls[marker[0]].permset, diff --git a/libarchive/test/test_acl_posix1e.c b/libarchive/test/test_acl_posix1e.c index 68e76671ba29..2055682bb2ab 100644 --- a/libarchive/test/test_acl_posix1e.c +++ b/libarchive/test/test_acl_posix1e.c @@ -193,7 +193,7 @@ compare_acls(struct archive_entry *ae, struct acl_t *acls, int n, int mode) } } assertEqualInt(ARCHIVE_EOF, r); - assert((mode & 0777) == (archive_entry_mode(ae) & 0777)); + assert((mode_t)(mode & 0777) == (archive_entry_mode(ae) & 0777)); failure("Could not find match for ACL " "(type=%d,permset=%d,tag=%d,qual=%d,name=``%s'')", acls[marker[0]].type, acls[marker[0]].permset, diff --git a/libarchive/test/test_sparse_basic.c b/libarchive/test/test_sparse_basic.c index 52d76c6013df..1d62e7c7883a 100644 --- a/libarchive/test/test_sparse_basic.c +++ b/libarchive/test/test_sparse_basic.c @@ -177,6 +177,7 @@ is_sparse_supported(const char *path) char buff[1024]; const char *testfile = "can_sparse"; + (void)path; /* UNUSED */ memset(&ut, 0, sizeof(ut)); assertEqualInt(uname(&ut), 0); p = ut.release; @@ -221,6 +222,7 @@ is_sparse_supported(const char *path) static int is_sparse_supported(const char *path) { + (void)path; /* UNUSED */ return (0); } diff --git a/tar/test/main.c b/tar/test/main.c index eb33cf27145a..984b4cea9185 100644 --- a/tar/test/main.c +++ b/tar/test/main.c @@ -1316,7 +1316,7 @@ assertion_file_nlinks(const char *file, int line, assertion_count(file, line); r = lstat(pathname, &st); - if (r == 0 && st.st_nlink == nlinks) + if (r == 0 && (int)st.st_nlink == nlinks) return (1); failure_start(file, line, "File %s has %d links, expected %d", pathname, st.st_nlink, nlinks); @@ -1380,7 +1380,7 @@ assertion_is_dir(const char *file, int line, const char *pathname, int mode) /* Windows doesn't handle permissions the same way as POSIX, * so just ignore the mode tests. */ /* TODO: Can we do better here? */ - if (mode >= 0 && mode != (st.st_mode & 07777)) { + if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) { failure_start(file, line, "Dir %s has wrong mode", pathname); logprintf(" Expected: 0%3o\n", mode); logprintf(" Found: 0%3o\n", st.st_mode & 07777); @@ -1413,7 +1413,7 @@ assertion_is_reg(const char *file, int line, const char *pathname, int mode) /* Windows doesn't handle permissions the same way as POSIX, * so just ignore the mode tests. */ /* TODO: Can we do better here? */ - if (mode >= 0 && mode != (st.st_mode & 07777)) { + if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) { failure_start(file, line, "File %s has wrong mode", pathname); logprintf(" Expected: 0%3o\n", mode); logprintf(" Found: 0%3o\n", st.st_mode & 07777); |