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
This commit is contained in:
mm 2012-02-09 19:13:36 +00:00
parent 67a9f0832a
commit 3d633235ca
14 changed files with 46 additions and 34 deletions

View File

@ -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);

View File

@ -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);
}

View File

@ -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. */

View File

@ -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);
}

View File

@ -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);

View File

@ -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

View File

@ -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 */
}

View File

@ -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);
}

View File

@ -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. */

View File

@ -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);

View File

@ -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,

View File

@ -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,

View File

@ -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);
}

View File

@ -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);