Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Feb 2012 19:13:36 +0000 (UTC)
From:      Martin Matuska <mm@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r231297 - in vendor/libarchive/dist: cpio/test libarchive libarchive/test tar/test
Message-ID:  <201202091913.q19JDaKF018882@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mm
Date: Thu Feb  9 19:13:36 2012
New Revision: 231297
URL: http://svn.freebsd.org/changeset/base/231297

Log:
  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

Modified:
  vendor/libarchive/dist/cpio/test/main.c
  vendor/libarchive/dist/libarchive/archive_rb.c
  vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c
  vendor/libarchive/dist/libarchive/archive_read_disk_posix.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c
  vendor/libarchive/dist/libarchive/archive_string.c
  vendor/libarchive/dist/libarchive/archive_write_disk_posix.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c
  vendor/libarchive/dist/libarchive/test/main.c
  vendor/libarchive/dist/libarchive/test/test_acl_pax.c
  vendor/libarchive/dist/libarchive/test/test_acl_posix1e.c
  vendor/libarchive/dist/libarchive/test/test_sparse_basic.c
  vendor/libarchive/dist/tar/test/main.c

Modified: vendor/libarchive/dist/cpio/test/main.c
==============================================================================
--- vendor/libarchive/dist/cpio/test/main.c	Thu Feb  9 17:50:24 2012	(r231296)
+++ vendor/libarchive/dist/cpio/test/main.c	Thu Feb  9 19:13:36 2012	(r231297)
@@ -1316,7 +1316,7 @@ assertion_file_nlinks(const char *file, 
 
 	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 l
 	/* 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 l
 	/* 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);

Modified: vendor/libarchive/dist/libarchive/archive_rb.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_rb.c	Thu Feb  9 17:50:24 2012	(r231296)
+++ vendor/libarchive/dist/libarchive/archive_rb.c	Thu Feb  9 19:13:36 2012	(r231297)
@@ -96,7 +96,7 @@ __archive_rb_tree_init(struct archive_rb
     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
 	 */
 	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);
 		}

Modified: vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c	Thu Feb  9 17:50:24 2012	(r231296)
+++ vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c	Thu Feb  9 19:13:36 2012	(r231297)
@@ -191,7 +191,7 @@ archive_read_disk_entry_from_file(struct
 			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. */

Modified: vendor/libarchive/dist/libarchive/archive_read_disk_posix.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_read_disk_posix.c	Thu Feb  9 17:50:24 2012	(r231296)
+++ vendor/libarchive/dist/libarchive/archive_read_disk_posix.c	Thu Feb  9 19:13:36 2012	(r231297)
@@ -2214,7 +2214,8 @@ tree_target_is_same_as_parent(struct tre
 	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(stru
 
 	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);
 }
 

Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c	Thu Feb  9 17:50:24 2012	(r231296)
+++ vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c	Thu Feb  9 19:13:36 2012	(r231297)
@@ -305,7 +305,7 @@ static int archive_read_format_rar_clean
 
 /* 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, stru
   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);

Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c	Thu Feb  9 17:50:24 2012	(r231296)
+++ vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c	Thu Feb  9 19:13:36 2012	(r231297)
@@ -265,7 +265,7 @@ archive_read_format_zip_seekable_bid(str
 	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

Modified: vendor/libarchive/dist/libarchive/archive_string.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_string.c	Thu Feb  9 17:50:24 2012	(r231296)
+++ vendor/libarchive/dist/libarchive/archive_string.c	Thu Feb  9 19:13:36 2012	(r231297)
@@ -1646,7 +1646,7 @@ make_codepage_from_charset(const char *c
  * 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 *c
 	return (-1);/* Unknown */
 }
 static unsigned
-get_current_oemcp()
+get_current_oemcp(void)
 {
 	return (-1);/* Unknown */
 }

Modified: vendor/libarchive/dist/libarchive/archive_write_disk_posix.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_write_disk_posix.c	Thu Feb  9 17:50:24 2012	(r231296)
+++ vendor/libarchive/dist/libarchive/archive_write_disk_posix.c	Thu Feb  9 19:13:36 2012	(r231297)
@@ -1672,7 +1672,7 @@ cleanup_pathname_win(struct archive_writ
 	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 *n
 	 * 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 *n
 	/*
 	 * 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_di
 /* 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);
 }
 

Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c	Thu Feb  9 17:50:24 2012	(r231296)
+++ vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c	Thu Feb  9 19:13:36 2012	(r231297)
@@ -3689,7 +3689,7 @@ wb_set_offset(struct archive_write *a, i
 		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_writ
 	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_wr
 		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
 	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
 	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. */

Modified: vendor/libarchive/dist/libarchive/test/main.c
==============================================================================
--- vendor/libarchive/dist/libarchive/test/main.c	Thu Feb  9 17:50:24 2012	(r231296)
+++ vendor/libarchive/dist/libarchive/test/main.c	Thu Feb  9 19:13:36 2012	(r231297)
@@ -1314,7 +1314,7 @@ assertion_file_nlinks(const char *file, 
 
 	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 l
 	/* 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 l
 	/* 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);

Modified: vendor/libarchive/dist/libarchive/test/test_acl_pax.c
==============================================================================
--- vendor/libarchive/dist/libarchive/test/test_acl_pax.c	Thu Feb  9 17:50:24 2012	(r231296)
+++ vendor/libarchive/dist/libarchive/test/test_acl_pax.c	Thu Feb  9 19:13:36 2012	(r231297)
@@ -163,7 +163,7 @@ compare_acls(struct archive_entry *ae, s
 		}
 	}
 	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,

Modified: vendor/libarchive/dist/libarchive/test/test_acl_posix1e.c
==============================================================================
--- vendor/libarchive/dist/libarchive/test/test_acl_posix1e.c	Thu Feb  9 17:50:24 2012	(r231296)
+++ vendor/libarchive/dist/libarchive/test/test_acl_posix1e.c	Thu Feb  9 19:13:36 2012	(r231297)
@@ -193,7 +193,7 @@ compare_acls(struct archive_entry *ae, s
 		}
 	}
 	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,

Modified: vendor/libarchive/dist/libarchive/test/test_sparse_basic.c
==============================================================================
--- vendor/libarchive/dist/libarchive/test/test_sparse_basic.c	Thu Feb  9 17:50:24 2012	(r231296)
+++ vendor/libarchive/dist/libarchive/test/test_sparse_basic.c	Thu Feb  9 19:13:36 2012	(r231297)
@@ -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);
 }
 

Modified: vendor/libarchive/dist/tar/test/main.c
==============================================================================
--- vendor/libarchive/dist/tar/test/main.c	Thu Feb  9 17:50:24 2012	(r231296)
+++ vendor/libarchive/dist/tar/test/main.c	Thu Feb  9 19:13:36 2012	(r231297)
@@ -1316,7 +1316,7 @@ assertion_file_nlinks(const char *file, 
 
 	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 l
 	/* 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 l
 	/* 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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202091913.q19JDaKF018882>