svn commit: r189475 - head/lib/libarchive

Tim Kientzle kientzle at FreeBSD.org
Fri Mar 6 18:29:44 PST 2009


Author: kientzle
Date: Sat Mar  7 02:29:43 2009
New Revision: 189475
URL: http://svn.freebsd.org/changeset/base/189475

Log:
  Merge r591 from libarchive.googlecode.com: signed/unsigned fixes.

Modified:
  head/lib/libarchive/archive_read_support_compression_bzip2.c

Modified: head/lib/libarchive/archive_read_support_compression_bzip2.c
==============================================================================
--- head/lib/libarchive/archive_read_support_compression_bzip2.c	Sat Mar  7 02:24:32 2009	(r189474)
+++ head/lib/libarchive/archive_read_support_compression_bzip2.c	Sat Mar  7 02:29:43 2009	(r189475)
@@ -200,7 +200,7 @@ bzip2_filter_read(struct archive_read_fi
 {
 	struct private_data *state;
 	size_t read_avail, decompressed;
-	unsigned char *read_buf;
+	const char *read_buf;
 	ssize_t ret;
 
 	state = (struct private_data *)self->data;
@@ -262,11 +262,11 @@ bzip2_filter_read(struct archive_read_fi
 
 		/* stream.next_in is really const, but bzlib
 		 * doesn't declare it so. <sigh> */
-		read_buf = (unsigned char *)(uintptr_t)
+		read_buf =
 		    __archive_read_filter_ahead(self->upstream, 1, &ret);
 		if (read_buf == NULL)
 			return (ARCHIVE_FATAL);
-		state->stream.next_in = read_buf;
+		state->stream.next_in = (char *)(uintptr_t)read_buf;
 		state->stream.avail_in = ret;
 		/* There is no more data, return whatever we have. */
 		if (ret == 0) {
@@ -280,7 +280,7 @@ bzip2_filter_read(struct archive_read_fi
 		/* Decompress as much as we can in one pass. */
 		ret = BZ2_bzDecompress(&(state->stream));
 		__archive_read_filter_consume(self->upstream,
-		    (unsigned char *)state->stream.next_in - read_buf);
+		    state->stream.next_in - read_buf);
 
 		switch (ret) {
 		case BZ_STREAM_END: /* Found end of stream. */


More information about the svn-src-head mailing list