diff options
| author | Max Horn | 2009-02-21 04:10:21 +0000 |
|---|---|---|
| committer | Max Horn | 2009-02-21 04:10:21 +0000 |
| commit | bcb1a71052948d61474076615d6641f7b2153599 (patch) | |
| tree | 8ec447dfc037b218029a9ee605e3b8047b01eb7d /engines/sci/scicore | |
| parent | ecaab0fe944811b44ae1ecf1157264623bda2b1f (diff) | |
| download | scummvm-rg350-bcb1a71052948d61474076615d6641f7b2153599.tar.gz scummvm-rg350-bcb1a71052948d61474076615d6641f7b2153599.tar.bz2 scummvm-rg350-bcb1a71052948d61474076615d6641f7b2153599.zip | |
SCI: Fixed more warnings
svn-id: r38658
Diffstat (limited to 'engines/sci/scicore')
| -rw-r--r-- | engines/sci/scicore/console.cpp | 14 | ||||
| -rw-r--r-- | engines/sci/scicore/decompress0.cpp | 11 | ||||
| -rw-r--r-- | engines/sci/scicore/decompress01.cpp | 23 | ||||
| -rw-r--r-- | engines/sci/scicore/decompress1.cpp | 11 | ||||
| -rw-r--r-- | engines/sci/scicore/decompress11.cpp | 3 | ||||
| -rw-r--r-- | engines/sci/scicore/tools.cpp | 1 |
6 files changed, 28 insertions, 35 deletions
diff --git a/engines/sci/scicore/console.cpp b/engines/sci/scicore/console.cpp index e788ab8244..1d8b1c1a7b 100644 --- a/engines/sci/scicore/console.cpp +++ b/engines/sci/scicore/console.cpp @@ -42,12 +42,11 @@ static void (*_con_pixmap_callback)(gfx_pixmap_t *) = NULL; /****************************************/ -int -sciprintf(const char *fmt, ...) { +int sciprintf(const char *fmt, ...) { va_list argp; - size_t bufsize = 256; - unsigned int i; - char *buf = (char *) sci_malloc(bufsize); + int bufsize = 256; + int i; + char *buf = (char *)sci_malloc(bufsize); if (NULL == fmt) { error("console.c: sciprintf(): NULL passed for parameter fmt\n"); @@ -67,7 +66,7 @@ sciprintf(const char *fmt, ...) { va_start(argp, fmt); /* reset argp */ free(buf); - buf = (char *) sci_malloc(bufsize <<= 1); + buf = (char *)sci_malloc(bufsize <<= 1); } va_end(argp); @@ -85,8 +84,7 @@ sciprintf(const char *fmt, ...) { return 1; } -void -con_set_string_callback(void(*callback)(char *)) { +void con_set_string_callback(void(*callback)(char *)) { _con_string_callback = callback; } diff --git a/engines/sci/scicore/decompress0.cpp b/engines/sci/scicore/decompress0.cpp index 0eb3774b31..1027c156b2 100644 --- a/engines/sci/scicore/decompress0.cpp +++ b/engines/sci/scicore/decompress0.cpp @@ -249,10 +249,10 @@ int sci0_get_compression_method(Common::ReadStream &stream) { int decompress0(resource_t *result, Common::ReadStream &stream, int sci_version) { - guint16 compressedLength; - guint16 compressionMethod; - guint16 result_size; - guint8 *buffer; + uint16 compressedLength; + uint16 compressionMethod; + uint16 result_size; + uint8 *buffer; if (stream.read(&(result->id), 2) != 2) return SCI_ERROR_IO_ERROR; @@ -278,8 +278,7 @@ int decompress0(resource_t *result, Common::ReadStream &stream, int sci_version) #endif result->size = result_size; - if ((result->size > SCI_MAX_RESOURCE_SIZE) || - (compressedLength > SCI_MAX_RESOURCE_SIZE)) + if (result->size > SCI_MAX_RESOURCE_SIZE) return SCI_ERROR_RESOURCE_TOO_BIG; /* With SCI0, this simply cannot happen. */ diff --git a/engines/sci/scicore/decompress01.cpp b/engines/sci/scicore/decompress01.cpp index 4fb450e9a7..b0bc2a95f3 100644 --- a/engines/sci/scicore/decompress01.cpp +++ b/engines/sci/scicore/decompress01.cpp @@ -44,16 +44,16 @@ struct tokenlist { static gint8 stak[0x1014] = {0}; static gint8 lastchar = 0; static gint16 stakptr = 0; -static guint16 numbits, s_bitstring, lastbits, decryptstart; +static guint16 s_numbits, s_bitstring, lastbits, decryptstart; static gint16 curtoken, endtoken; -guint32 gbits(int numbits, guint8 * data, int dlen); +uint32 gbits(int numbits, guint8 * data, int dlen); void decryptinit3(void) { int i; lastchar = lastbits = s_bitstring = stakptr = 0; - numbits = 9; + s_numbits = 9; curtoken = 0x102; endtoken = 0x1ff; decryptstart = 0; @@ -71,7 +71,7 @@ int decrypt3(guint8 *dest, guint8 *src, int length, int complength) { switch (decryptstart) { case 0: case 1: - s_bitstring = gbits(numbits, src, complength); + s_bitstring = gbits(s_numbits, src, complength); if (s_bitstring == 0x101) { /* found end-of-data signal */ decryptstart = 4; return 0; @@ -84,7 +84,7 @@ int decrypt3(guint8 *dest, guint8 *src, int length, int complength) { return 0; } if (s_bitstring == 0x100) { /* start-over signal */ - numbits = 9; + s_numbits = 9; endtoken = 0x1ff; curtoken = 0x102; decryptstart = 0; @@ -114,8 +114,8 @@ int decrypt3(guint8 *dest, guint8 *src, int length, int complength) { tokens[curtoken].data = lastchar; tokens[curtoken].next = lastbits; curtoken++; - if (curtoken == endtoken && numbits != 12) { - numbits++; + if (curtoken == endtoken && s_numbits != 12) { + s_numbits++; endtoken <<= 1; endtoken++; } @@ -491,9 +491,9 @@ byte *view_reorder(byte *inbuffer, int dsize) { int decompress01(resource_t *result, Common::ReadStream &stream, int sci_version) { - guint16 compressedLength, result_size; - guint16 compressionMethod; - guint8 *buffer; + uint16 compressedLength, result_size; + uint16 compressionMethod; + uint8 *buffer; if (stream.read(&(result->id), 2) != 2) return SCI_ERROR_IO_ERROR; @@ -524,8 +524,7 @@ int decompress01(resource_t *result, Common::ReadStream &stream, int sci_version return SCI_ERROR_DECOMPRESSION_INSANE; */ /* This return will never happen in SCI0 or SCI1 (does it have any use?) */ - if ((result->size > SCI_MAX_RESOURCE_SIZE) || - (compressedLength > SCI_MAX_RESOURCE_SIZE)) + if (result->size > SCI_MAX_RESOURCE_SIZE) return SCI_ERROR_RESOURCE_TOO_BIG; if (compressedLength > 4) diff --git a/engines/sci/scicore/decompress1.cpp b/engines/sci/scicore/decompress1.cpp index 4a62eb940d..d9fbd72d77 100644 --- a/engines/sci/scicore/decompress1.cpp +++ b/engines/sci/scicore/decompress1.cpp @@ -274,10 +274,10 @@ void decryptinit3(void); int decrypt3(guint8* dest, guint8* src, int length, int complength); int decompress1(resource_t *result, Common::ReadStream &stream, int sci_version) { - guint16 compressedLength; - guint16 compressionMethod, result_size; - guint8 *buffer; - guint8 tempid; + uint16 compressedLength; + uint16 compressionMethod, result_size; + uint8 *buffer; + uint8 tempid; if (sci_version == SCI_VERSION_1_EARLY) { if (stream.read(&(result->id), 2) != 2) @@ -321,8 +321,7 @@ int decompress1(resource_t *result, Common::ReadStream &stream, int sci_version) #endif result->size = result_size; - if ((result->size > SCI_MAX_RESOURCE_SIZE) || - (compressedLength > SCI_MAX_RESOURCE_SIZE)) + if (result->size > SCI_MAX_RESOURCE_SIZE) return SCI_ERROR_RESOURCE_TOO_BIG; if (compressedLength > 4) diff --git a/engines/sci/scicore/decompress11.cpp b/engines/sci/scicore/decompress11.cpp index 41add67db7..4f7e808f1c 100644 --- a/engines/sci/scicore/decompress11.cpp +++ b/engines/sci/scicore/decompress11.cpp @@ -74,8 +74,7 @@ int decompress11(resource_t *result, Common::ReadStream &stream, int sci_version return SCI_ERROR_DECOMPRESSION_INSANE; */ /* This return will never happen in SCI0 or SCI1 (does it have any use?) */ - if ((result->size > SCI_MAX_RESOURCE_SIZE) || - (compressedLength > SCI_MAX_RESOURCE_SIZE)) + if (result->size > SCI_MAX_RESOURCE_SIZE) return SCI_ERROR_RESOURCE_TOO_BIG; if (compressedLength > 0) diff --git a/engines/sci/scicore/tools.cpp b/engines/sci/scicore/tools.cpp index c36c5275c8..b7a2327d75 100644 --- a/engines/sci/scicore/tools.cpp +++ b/engines/sci/scicore/tools.cpp @@ -62,7 +62,6 @@ #include "common/str.h" #ifdef UNIX -#define _GNU_SOURCE /* For FNM_CASEFOLD in fnmatch.h */ #include <fnmatch.h> #endif |
