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 | |
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
-rw-r--r-- | engines/sci/engine/scriptdebug.cpp | 4 | ||||
-rw-r--r-- | engines/sci/engine/vm.cpp | 7 | ||||
-rw-r--r-- | engines/sci/gfx/operations.cpp | 1 | ||||
-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 | ||||
-rw-r--r-- | engines/sci/sfx/iterator.cpp | 1 |
10 files changed, 32 insertions, 44 deletions
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index af072e2451..d3cd82a22f 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -2166,7 +2166,8 @@ static int c_send(state_t *s) { reg_t object = cmd_params[0].reg; char *selector_name = cmd_params[1].str; stack_ptr_t stackframe = s->execution_stack->sp; - unsigned int i, selector_id, selector_type; + int selector_id; + unsigned int i, selector_type; exec_stack_t *xstack; object_t *o; reg_t *vptr; @@ -2877,7 +2878,6 @@ static int c_gc_list_reachable(state_t *s) { void script_debug(state_t *s, reg_t *pc, stack_ptr_t *sp, stack_ptr_t *pp, reg_t *objp, int *restadjust, seg_id_t *segids, reg_t **variables, reg_t **variables_base, int *variables_nr, int bp) { - static int last_step; // Do we support a separate console? if (sci_debug_flags & _DEBUG_FLAG_LOGGING) { diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 12fa5b19d8..d272f68e66 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -1084,7 +1084,7 @@ void run_vm(state_t *s, int restoring) { case 0x24: // ret do { - stack_ptr_t old_sp = xs->sp; + stack_ptr_t old_sp2 = xs->sp; stack_ptr_t old_fp = xs->fp; exec_stack_t *old_xs = s->execution_stack + s->execution_stack_pos; @@ -1114,7 +1114,7 @@ void run_vm(state_t *s, int restoring) { if (xs->sp == CALL_SP_CARRY // Used in sends to 'carry' the stack pointer || xs->type != EXEC_STACK_TYPE_CALL) { - xs->sp = old_sp; + xs->sp = old_sp2; xs->fp = old_fp; } @@ -1765,9 +1765,6 @@ int script_instantiate_sci0(state_t *s, int script_nr) { if (s->version < SCI_VERSION_FTU_NEW_SCRIPT_HEADER) { // - int locals_size = getUInt16(script->data)*2; - int locals = (locals_size)? script->size : 0; - int locals_nr = getUInt16(script->data); // Old script block diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp index 7045583b56..52eb946170 100644 --- a/engines/sci/gfx/operations.cpp +++ b/engines/sci/gfx/operations.cpp @@ -1521,7 +1521,6 @@ int _gfxop_set_pointer(gfx_state_t *state, gfx_pixmap_t *pxm) { rect_t old_pointer_bounds = {0, 0, 0, 0}; rect_t pointer_bounds = {0, 0, 0, 0}; - int retval = -1; int draw_old; int draw_new = 0; 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 diff --git a/engines/sci/sfx/iterator.cpp b/engines/sci/sfx/iterator.cpp index 68a85e33ad..ae1f2fa588 100644 --- a/engines/sci/sfx/iterator.cpp +++ b/engines/sci/sfx/iterator.cpp @@ -780,7 +780,6 @@ _sci1_song_init(sci1_song_iterator_t *self) { self->next_sample = 0; // self->device_id = 0x0c; - CHECK_FOR_END_ABSOLUTE(0); if (SONGDATA(0) == 0xf0) { self->priority = SONGDATA(1); |