From 50bb724108b7417b0df3bbf7029c43dbd734df49 Mon Sep 17 00:00:00 2001 From: kientzle Date: Fri, 10 Nov 2006 06:39:46 +0000 Subject: Portability and style fixes: * Actually use the HAVE_
_H macros to conditionally include system headers. They've been defined for a long time, but only used in a few places. Now they're used pretty consistently throughout. * Fill in a lot of missing casts for conversions from void*. Although Standard C doesn't require this, some people have been trying to use C++ compilers with this code, and they do require it. Bit-for-bit, the compiled object files are identical, except for one assert() whose line number changed, so I'm pretty confident I didn't break anything. ;-) --- lib/libarchive/archive_read_data_into_buffer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/libarchive/archive_read_data_into_buffer.c') diff --git a/lib/libarchive/archive_read_data_into_buffer.c b/lib/libarchive/archive_read_data_into_buffer.c index 0b52617..48de46a 100644 --- a/lib/libarchive/archive_read_data_into_buffer.c +++ b/lib/libarchive/archive_read_data_into_buffer.c @@ -27,7 +27,9 @@ #include "archive_platform.h" __FBSDID("$FreeBSD$"); +#ifdef HAVE_STRING_H #include +#endif #include "archive.h" @@ -37,7 +39,7 @@ archive_read_data_into_buffer(struct archive *a, void *d, ssize_t len) char *dest; ssize_t bytes_read, total_bytes; - dest = d; + dest = (char *)d; total_bytes = 0; bytes_read = archive_read_data(a, dest, len); while (bytes_read > 0) { -- cgit v1.1