From f6a4017127d6fca01aaaa8dbc3c64c23713fd601 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 21 Oct 2014 01:22:57 +0200 Subject: [PATCH] (zlib) Add forward declarations to silence warnings --- deps/rzlib/gzlib.c | 8 +++++--- deps/rzlib/inflate.c | 20 ++++++++++++++------ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/deps/rzlib/gzlib.c b/deps/rzlib/gzlib.c index 3760314538..7443a75c19 100644 --- a/deps/rzlib/gzlib.c +++ b/deps/rzlib/gzlib.c @@ -15,6 +15,10 @@ #endif #endif +/* Forward declarations */ +z_off_t ZEXPORT gzoffset(gzFile file); +int ZEXPORT gzbuffer(gzFile file, unsigned size); + /* Local functions */ local void gz_reset OF((gz_statep)); local gzFile gz_open OF((const void *, int, const char *)); @@ -476,9 +480,7 @@ z_off64_t ZEXPORT gzoffset64(gzFile file) /* -- see zlib.h -- */ z_off_t ZEXPORT gzoffset(gzFile file) { - z_off64_t ret; - - ret = gzoffset64(file); + z_off64_t ret = gzoffset64(file); return ret == (z_off_t)ret ? (z_off_t)ret : -1; } diff --git a/deps/rzlib/inflate.c b/deps/rzlib/inflate.c index 94dc702801..0b4f0b7825 100644 --- a/deps/rzlib/inflate.c +++ b/deps/rzlib/inflate.c @@ -96,6 +96,7 @@ #endif /* function prototypes */ +int ZEXPORT inflateReset2(z_streamp strm, int windowBits); local void fixedtables OF((struct inflate_state FAR *state)); local int updatewindow OF((z_streamp strm, const unsigned char FAR *end, unsigned copy)); @@ -105,8 +106,12 @@ void makefixed OF((void)); local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf, unsigned len)); +long ZEXPORT inflateMark(z_streamp strm); + int ZEXPORT inflateResetKeep(z_streamp strm); +int ZEXPORT inflateUndermine(z_streamp strm, int subvert); + int ZEXPORT inflateGetDictionary(z_streamp strm, Bytef *dictionary, uInt *dictLength); int ZEXPORT inflateResetKeep(z_streamp strm) @@ -148,10 +153,11 @@ int ZEXPORT inflateReset(z_streamp strm) int ZEXPORT inflateReset2(z_streamp strm, int windowBits) { int wrap; - struct inflate_state FAR *state; + struct inflate_state FAR *state = NULL; /* get the state */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (strm == Z_NULL || strm->state == Z_NULL) + return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; /* extract wrap request from windowBits parameter */ @@ -1456,9 +1462,10 @@ int ZEXPORT inflateCopy(z_streamp dest, z_streamp source) int ZEXPORT inflateUndermine(z_streamp strm, int subvert) { - struct inflate_state FAR *state; + struct inflate_state FAR *state = NULL; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (strm == Z_NULL || strm->state == Z_NULL) + return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; state->sane = !subvert; #ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR @@ -1471,9 +1478,10 @@ int ZEXPORT inflateUndermine(z_streamp strm, int subvert) long ZEXPORT inflateMark(z_streamp strm) { - struct inflate_state FAR *state; + struct inflate_state FAR *state = NULL; - if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16; + if (strm == Z_NULL || strm->state == Z_NULL) + return -1L << 16; state = (struct inflate_state FAR *)strm->state; return ((long)(state->back) << 16) + (state->mode == COPY ? state->length :