diff --git a/common/lzma/LzmaEnc.c b/common/lzma/LzmaEnc.c index 377e20c..e300fa6 100644 --- a/common/lzma/LzmaEnc.c +++ b/common/lzma/LzmaEnc.c @@ -2832,7 +2832,7 @@ SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, BoolInt reInit, CLzmaEnc *p = (CLzmaEnc *)pp; UInt64 nowPos64; SRes res; - CLzmaEnc_SeqOutStreamBuf outStream; + static CLzmaEnc_SeqOutStreamBuf outStream; outStream.vt.Write = SeqOutStreamBuf_Write; outStream.data = dest; diff --git a/stub/Makefile b/stub/Makefile index e08d9d0..47fd9ef 100644 --- a/stub/Makefile +++ b/stub/Makefile @@ -2,7 +2,7 @@ SUBMAKE = $(MAKE) -C include $(PS2SDK)/Defs.make -EE_CPPFLAGS = -G0 -I $(PS2SDK)/ee/include -I $(PS2SDK)/common/include -I . -I zlib -I lzo -I lz4 -I ../common/lzma -D_EE -O3 -Wall -DDO_EXECPS2 +EE_CPPFLAGS = -G0 -I $(PS2SDK)/ee/include -I $(PS2SDK)/common/include -I . -I zlib -I lzo -I lz4 -I ../common/lzma -D_EE -O3 -Wall -Werror -DDO_EXECPS2 EE_LDFLAGS = -T ./linkfile -L $(PS2SDK)/ee/lib -lc_nano -lkernel TARGETS = \ diff --git a/stub/lz4/Makefile b/stub/lz4/Makefile index 3902717..8597032 100644 --- a/stub/lz4/Makefile +++ b/stub/lz4/Makefile @@ -1,6 +1,6 @@ include $(PS2SDK)/Defs.make -EE_CPPFLAGS = -G0 -I . -D_EE -O3 -Wall -DLSB_FIRST -DALIGN_DWORD -DLZ4_FORCE_SW_BITCOUNT +EE_CPPFLAGS = -G0 -I . -D_EE -O3 -Wall -Werror -DLSB_FIRST -DALIGN_DWORD -DLZ4_FORCE_SW_BITCOUNT OBJS = lz4.o diff --git a/stub/lzma/Makefile b/stub/lzma/Makefile index 7dd969c..3f725ea 100644 --- a/stub/lzma/Makefile +++ b/stub/lzma/Makefile @@ -4,7 +4,7 @@ EE_OBJS_DIR = obj/ EE_LIB_DIR = SRC_DIR = ../../common/lzma/ -EE_CPPFLAGS = -G0 -I $(SRC_DIR) -D_EE -Os -Wall -D_LZMA_SIZE_OPT +EE_CPPFLAGS = -G0 -I $(SRC_DIR) -D_EE -Os -Wall -Werror -D_LZMA_SIZE_OPT EE_OBJS = Alloc.o LzFind.o LzmaDec.o LzmaEnc.o diff --git a/stub/lzo/Makefile b/stub/lzo/Makefile index 770a0cf..0545e4f 100644 --- a/stub/lzo/Makefile +++ b/stub/lzo/Makefile @@ -1,6 +1,6 @@ include $(PS2SDK)/Defs.make -EE_CPPFLAGS = -G0 -I . -D_EE -O3 -Wall -DLSB_FIRST -DALIGN_DWORD +EE_CPPFLAGS = -G0 -I . -D_EE -O3 -Wall -Werror -DLSB_FIRST -DALIGN_DWORD OBJS = minilzo.o diff --git a/stub/zlib/Makefile b/stub/zlib/Makefile index d04dcc5..0a19756 100644 --- a/stub/zlib/Makefile +++ b/stub/zlib/Makefile @@ -1,6 +1,6 @@ include $(PS2SDK)/Defs.make -EE_CPPFLAGS = -G0 -I . -D_EE -O3 -Wall -DNO_GZIP -DBUILDFIXED -DNO_vsnprintf +EE_CPPFLAGS = -G0 -I . -D_EE -O3 -Wall -Werror -DNO_GZIP -DBUILDFIXED -DNO_vsnprintf OBJS = adler32.o zutil.o inflate.o inffast.o inftrees.o diff --git a/stub/zlib/adler32.c b/stub/zlib/adler32.c index a868f07..cabf419 100644 --- a/stub/zlib/adler32.c +++ b/stub/zlib/adler32.c @@ -62,11 +62,11 @@ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); #endif /* ========================================================================= */ -uLong ZEXPORT adler32(adler, buf, len) - uLong adler; - const Bytef *buf; - uInt len; -{ +uLong ZEXPORT adler32( + uLong adler, + const Bytef *buf, + uInt len +) { unsigned long sum2; unsigned n; @@ -133,11 +133,11 @@ uLong ZEXPORT adler32(adler, buf, len) } /* ========================================================================= */ -local uLong adler32_combine_(adler1, adler2, len2) - uLong adler1; - uLong adler2; - z_off64_t len2; -{ +local uLong adler32_combine_( + uLong adler1, + uLong adler2, + z_off64_t len2 +) { unsigned long sum1; unsigned long sum2; unsigned rem; @@ -162,18 +162,18 @@ local uLong adler32_combine_(adler1, adler2, len2) } /* ========================================================================= */ -uLong ZEXPORT adler32_combine(adler1, adler2, len2) - uLong adler1; - uLong adler2; - z_off_t len2; -{ +uLong ZEXPORT adler32_combine( + uLong adler1, + uLong adler2, + z_off_t len2 +) { return adler32_combine_(adler1, adler2, len2); } -uLong ZEXPORT adler32_combine64(adler1, adler2, len2) - uLong adler1; - uLong adler2; - z_off64_t len2; -{ +uLong ZEXPORT adler32_combine64( + uLong adler1, + uLong adler2, + z_off64_t len2 +) { return adler32_combine_(adler1, adler2, len2); } diff --git a/stub/zlib/inffast.c b/stub/zlib/inffast.c index bda59ce..828a01a 100644 --- a/stub/zlib/inffast.c +++ b/stub/zlib/inffast.c @@ -64,10 +64,10 @@ requires strm->avail_out >= 258 for each loop to avoid checking for output space. */ -void ZLIB_INTERNAL inflate_fast(strm, start) -z_streamp strm; -unsigned start; /* inflate()'s starting value for strm->avail_out */ -{ +void ZLIB_INTERNAL inflate_fast( + z_streamp strm, + unsigned start /* inflate()'s starting value for strm->avail_out */ +) { struct inflate_state FAR *state; z_const unsigned char FAR *in; /* local strm->next_in */ z_const unsigned char FAR *last; /* have enough input while in < last */ diff --git a/stub/zlib/inflate.c b/stub/zlib/inflate.c index 8eee5e2..901c1d8 100644 --- a/stub/zlib/inflate.c +++ b/stub/zlib/inflate.c @@ -101,9 +101,9 @@ local int updatewindow OF((z_streamp strm, const unsigned char FAR *end, local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf, unsigned len)); -int ZEXPORT inflateResetKeep(strm) -z_streamp strm; -{ +int ZEXPORT inflateResetKeep( + z_streamp strm +) { struct inflate_state FAR *state; if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; @@ -126,9 +126,9 @@ z_streamp strm; return Z_OK; } -int ZEXPORT inflateReset(strm) -z_streamp strm; -{ +int ZEXPORT inflateReset( + z_streamp strm +) { struct inflate_state FAR *state; if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; @@ -139,10 +139,10 @@ z_streamp strm; return inflateResetKeep(strm); } -int ZEXPORT inflateReset2(strm, windowBits) -z_streamp strm; -int windowBits; -{ +int ZEXPORT inflateReset2( + z_streamp strm, + int windowBits +) { int wrap; struct inflate_state FAR *state; @@ -177,12 +177,12 @@ int windowBits; return inflateReset(strm); } -int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) -z_streamp strm; -int windowBits; -const char *version; -int stream_size; -{ +int ZEXPORT inflateInit2_( + z_streamp strm, + int windowBits, + const char *version, + int stream_size +) { int ret; struct inflate_state FAR *state; @@ -219,19 +219,19 @@ int stream_size; return ret; } -int ZEXPORT inflateInit_(strm, version, stream_size) -z_streamp strm; -const char *version; -int stream_size; -{ +int ZEXPORT inflateInit_( + z_streamp strm, + const char *version, + int stream_size +) { return inflateInit2_(strm, DEF_WBITS, version, stream_size); } -int ZEXPORT inflatePrime(strm, bits, value) -z_streamp strm; -int bits; -int value; -{ +int ZEXPORT inflatePrime( + z_streamp strm, + int bits, + int value +) { struct inflate_state FAR *state; if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; @@ -258,9 +258,9 @@ int value; used for threaded applications, since the rewriting of the tables and virgin may not be thread-safe. */ -local void fixedtables(state) -struct inflate_state FAR *state; -{ +local void fixedtables( + struct inflate_state FAR *state +) { #ifdef BUILDFIXED static int virgin = 1; static code *lenfix, *distfix; @@ -376,11 +376,11 @@ void makefixed() output will fall in the output data, making match copies simpler and faster. The advantage may be dependent on the size of the processor's data caches. */ -local int updatewindow(strm, end, copy) -z_streamp strm; -const Bytef *end; -unsigned copy; -{ +local int updatewindow( + z_streamp strm, + const Bytef *end, + unsigned copy +) { struct inflate_state FAR *state; unsigned dist; @@ -602,10 +602,10 @@ unsigned copy; will return Z_BUF_ERROR if it has not reached the end of the stream. */ -int ZEXPORT inflate(strm, flush) -z_streamp strm; -int flush; -{ +int ZEXPORT inflate( + z_streamp strm, + int flush +) { struct inflate_state FAR *state; z_const unsigned char FAR *next; /* next input */ unsigned char FAR *put; /* next output */ @@ -1251,9 +1251,9 @@ int flush; return ret; } -int ZEXPORT inflateEnd(strm) -z_streamp strm; -{ +int ZEXPORT inflateEnd( + z_streamp strm +) { struct inflate_state FAR *state; if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) return Z_STREAM_ERROR; @@ -1265,11 +1265,11 @@ z_streamp strm; return Z_OK; } -int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength) -z_streamp strm; -Bytef *dictionary; -uInt *dictLength; -{ +int ZEXPORT inflateGetDictionary( + z_streamp strm, + Bytef *dictionary, + uInt *dictLength +) { struct inflate_state FAR *state; /* check state */ @@ -1288,11 +1288,11 @@ uInt *dictLength; return Z_OK; } -int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) -z_streamp strm; -const Bytef *dictionary; -uInt dictLength; -{ +int ZEXPORT inflateSetDictionary( + z_streamp strm, + const Bytef *dictionary, + uInt dictLength +) { struct inflate_state FAR *state; unsigned long dictid; int ret; @@ -1323,10 +1323,10 @@ uInt dictLength; return Z_OK; } -int ZEXPORT inflateGetHeader(strm, head) -z_streamp strm; -gz_headerp head; -{ +int ZEXPORT inflateGetHeader( + z_streamp strm, + gz_headerp head +) { struct inflate_state FAR *state; /* check state */ @@ -1351,11 +1351,11 @@ gz_headerp head; called again with more data and the *have state. *have is initialized to zero for the first call. */ -local unsigned syncsearch(have, buf, len) -unsigned FAR *have; -const unsigned char FAR *buf; -unsigned len; -{ +local unsigned syncsearch( + unsigned FAR *have, + const unsigned char FAR *buf, + unsigned len +) { unsigned got; unsigned next; @@ -1374,9 +1374,9 @@ unsigned len; return next; } -int ZEXPORT inflateSync(strm) -z_streamp strm; -{ +int ZEXPORT inflateSync( + z_streamp strm +) { unsigned len; /* number of bytes to look at or looked at */ unsigned long in, out; /* temporary to save total_in and total_out */ unsigned char buf[4]; /* to restore bit buffer to byte string */ @@ -1425,9 +1425,9 @@ z_streamp strm; block. When decompressing, PPP checks that at the end of input packet, inflate is waiting for these length bytes. */ -int ZEXPORT inflateSyncPoint(strm) -z_streamp strm; -{ +int ZEXPORT inflateSyncPoint( + z_streamp strm +) { struct inflate_state FAR *state; if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; @@ -1435,10 +1435,10 @@ z_streamp strm; return state->mode == STORED && state->bits == 0; } -int ZEXPORT inflateCopy(dest, source) -z_streamp dest; -z_streamp source; -{ +int ZEXPORT inflateCopy( + z_streamp dest, + z_streamp source +) { struct inflate_state FAR *state; struct inflate_state FAR *copy; unsigned char FAR *window; @@ -1482,10 +1482,10 @@ z_streamp source; return Z_OK; } -int ZEXPORT inflateUndermine(strm, subvert) -z_streamp strm; -int subvert; -{ +int ZEXPORT inflateUndermine( + z_streamp strm, + int subvert +) { struct inflate_state FAR *state; if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; @@ -1499,9 +1499,9 @@ int subvert; #endif } -long ZEXPORT inflateMark(strm) -z_streamp strm; -{ +long ZEXPORT inflateMark( + z_streamp strm +) { struct inflate_state FAR *state; if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16; diff --git a/stub/zlib/inftrees.c b/stub/zlib/inftrees.c index 44d89cf..fb18fa1 100644 --- a/stub/zlib/inftrees.c +++ b/stub/zlib/inftrees.c @@ -29,14 +29,14 @@ const char inflate_copyright[] = table index bits. It will differ if the request is greater than the longest code or if it is less than the shortest code. */ -int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work) -codetype type; -unsigned short FAR *lens; -unsigned codes; -code FAR * FAR *table; -unsigned FAR *bits; -unsigned short FAR *work; -{ +int ZLIB_INTERNAL inflate_table( + codetype type, + unsigned short FAR *lens, + unsigned codes, + code FAR * FAR *table, + unsigned FAR *bits, + unsigned short FAR *work +) { unsigned len; /* a code's length in bits */ unsigned sym; /* index of code symbols */ unsigned min, max; /* minimum and maximum code lengths */ diff --git a/stub/zlib/zutil.c b/stub/zlib/zutil.c index 23d2ebe..6defaf7 100644 --- a/stub/zlib/zutil.c +++ b/stub/zlib/zutil.c @@ -122,9 +122,9 @@ uLong ZEXPORT zlibCompileFlags() # endif int ZLIB_INTERNAL z_verbose = verbose; -void ZLIB_INTERNAL z_error (m) - char *m; -{ +void ZLIB_INTERNAL z_error( + char *m +) { fprintf(stderr, "%s\n", m); exit(1); } @@ -133,9 +133,9 @@ void ZLIB_INTERNAL z_error (m) /* exported to allow conversion of error code to string for compress() and * uncompress() */ -const char * ZEXPORT zError(err) - int err; -{ +const char * ZEXPORT zError( + int err +) { return ERR_MSG(err); } @@ -149,22 +149,22 @@ const char * ZEXPORT zError(err) #ifndef HAVE_MEMCPY -void ZLIB_INTERNAL zmemcpy(dest, source, len) - Bytef* dest; - const Bytef* source; - uInt len; -{ +void ZLIB_INTERNAL zmemcpy( + Bytef* dest, + const Bytef* source, + uInt len +) { if (len == 0) return; do { *dest++ = *source++; /* ??? to be unrolled */ } while (--len != 0); } -int ZLIB_INTERNAL zmemcmp(s1, s2, len) - const Bytef* s1; - const Bytef* s2; - uInt len; -{ +int ZLIB_INTERNAL zmemcmp( + const Bytef* s1, + const Bytef* s2, + uInt len +) { uInt j; for (j = 0; j < len; j++) { @@ -173,10 +173,10 @@ int ZLIB_INTERNAL zmemcmp(s1, s2, len) return 0; } -void ZLIB_INTERNAL zmemzero(dest, len) - Bytef* dest; - uInt len; -{ +void ZLIB_INTERNAL zmemzero( + Bytef* dest, + uInt len +) { if (len == 0) return; do { *dest++ = 0; /* ??? to be unrolled */ @@ -217,8 +217,11 @@ local ptr_table table[MAX_PTR]; * a protected system like OS/2. Use Microsoft C instead. */ -voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size) -{ +voidpf ZLIB_INTERNAL zcalloc( + voidpf opaque, + unsigned items, + unsigned size +) { voidpf buf = opaque; /* just to make some compilers happy */ ulg bsize = (ulg)items*size; @@ -241,8 +244,10 @@ voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size) return buf; } -void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) -{ +void ZLIB_INTERNAL zcfree( + voidpf opaque, + voidpf ptr +) { int n; if (*(ush*)&ptr != 0) { /* object < 64K */ farfree(ptr); @@ -276,14 +281,19 @@ void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) # define _hfree hfree #endif -voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size) -{ +voidpf ZLIB_INTERNAL zcalloc( + voidpf opaque, + uInt items, + uInt size +) { if (opaque) opaque = 0; /* to make compiler happy */ return _halloc((long)items, size); } -void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) -{ +void ZLIB_INTERNAL zcfree( + voidpf opaque, + voidpf ptr +) { if (opaque) opaque = 0; /* to make compiler happy */ _hfree(ptr); } @@ -301,20 +311,20 @@ extern voidp calloc OF((uInt items, uInt size)); extern void free OF((voidpf ptr)); #endif -voidpf ZLIB_INTERNAL zcalloc (opaque, items, size) - voidpf opaque; - unsigned items; - unsigned size; -{ +voidpf ZLIB_INTERNAL zcalloc( + voidpf opaque, + unsigned items, + unsigned size +) { if (opaque) items += size - size; /* make compiler happy */ return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : (voidpf)calloc(items, size); } -void ZLIB_INTERNAL zcfree (opaque, ptr) - voidpf opaque; - voidpf ptr; -{ +void ZLIB_INTERNAL zcfree( + voidpf opaque, + voidpf ptr +) { free(ptr); if (opaque) return; /* make compiler happy */ }