Changed z_compress_level() and z_uncompress() prototypes to match the ones in Solaris.

Fixes compilation warning.
This commit is contained in:
Ricardo M. Correia 2009-02-22 03:35:51 +00:00 committed by Brian Behlendorf
parent a1cf80b493
commit 4327ac3ff9

View File

@ -48,8 +48,8 @@
* Z_STREAM_ERROR if the level parameter is invalid. * Z_STREAM_ERROR if the level parameter is invalid.
*/ */
static __inline__ int static __inline__ int
z_compress_level(Byte *dest, uLong *destLen, const Byte *source, z_compress_level(void *dest, size_t *destLen, const void *source,
uLong sourceLen, int level) size_t sourceLen, int level)
{ {
z_stream stream; z_stream stream;
int err; int err;
@ -58,13 +58,13 @@ z_compress_level(Byte *dest, uLong *destLen, const Byte *source,
stream.avail_in = (uInt)sourceLen; stream.avail_in = (uInt)sourceLen;
#ifdef MAXSEG_64K #ifdef MAXSEG_64K
/* Check for source > 64K on 16-bit machine: */ /* Check for source > 64K on 16-bit machine: */
if ((uLong)stream.avail_in != sourceLen) if ((size_t)stream.avail_in != sourceLen)
return Z_BUF_ERROR; return Z_BUF_ERROR;
#endif #endif
stream.next_out = dest; stream.next_out = dest;
stream.avail_out = (uInt)*destLen; stream.avail_out = (uInt)*destLen;
if ((uLong)stream.avail_out != *destLen) if ((size_t)stream.avail_out != *destLen)
return Z_BUF_ERROR; return Z_BUF_ERROR;
err = zlib_deflateInit(&stream, level); err = zlib_deflateInit(&stream, level);
@ -98,7 +98,7 @@ z_compress_level(Byte *dest, uLong *destLen, const Byte *source,
* buffer, or Z_DATA_ERROR if the input data was corrupted. * buffer, or Z_DATA_ERROR if the input data was corrupted.
*/ */
static __inline__ int static __inline__ int
z_uncompress(Byte *dest, uLong *destLen, const Byte *source, uLong sourceLen) z_uncompress(void *dest, size_t *destLen, const void *source, size_t sourceLen)
{ {
z_stream stream; z_stream stream;
int err; int err;
@ -106,13 +106,13 @@ z_uncompress(Byte *dest, uLong *destLen, const Byte *source, uLong sourceLen)
stream.next_in = (Byte *)source; stream.next_in = (Byte *)source;
stream.avail_in = (uInt)sourceLen; stream.avail_in = (uInt)sourceLen;
/* Check for source > 64K on 16-bit machine: */ /* Check for source > 64K on 16-bit machine: */
if ((uLong)stream.avail_in != sourceLen) if ((size_t)stream.avail_in != sourceLen)
return Z_BUF_ERROR; return Z_BUF_ERROR;
stream.next_out = dest; stream.next_out = dest;
stream.avail_out = (uInt)*destLen; stream.avail_out = (uInt)*destLen;
if ((uLong)stream.avail_out != *destLen) if ((size_t)stream.avail_out != *destLen)
return Z_BUF_ERROR; return Z_BUF_ERROR;
err = zlib_inflateInit(&stream); err = zlib_inflateInit(&stream);