[Scummvm-cvs-logs] SF.net SVN: scummvm:[38658] scummvm/trunk/engines/sci

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Feb 21 05:10:21 CET 2009


Revision: 38658
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38658&view=rev
Author:   fingolfin
Date:     2009-02-21 04:10:21 +0000 (Sat, 21 Feb 2009)

Log Message:
-----------
SCI: Fixed more warnings

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/scriptdebug.cpp
    scummvm/trunk/engines/sci/engine/vm.cpp
    scummvm/trunk/engines/sci/gfx/operations.cpp
    scummvm/trunk/engines/sci/scicore/console.cpp
    scummvm/trunk/engines/sci/scicore/decompress0.cpp
    scummvm/trunk/engines/sci/scicore/decompress01.cpp
    scummvm/trunk/engines/sci/scicore/decompress1.cpp
    scummvm/trunk/engines/sci/scicore/decompress11.cpp
    scummvm/trunk/engines/sci/scicore/tools.cpp
    scummvm/trunk/engines/sci/sfx/iterator.cpp

Modified: scummvm/trunk/engines/sci/engine/scriptdebug.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-02-21 03:59:57 UTC (rev 38657)
+++ scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-02-21 04:10:21 UTC (rev 38658)
@@ -2166,7 +2166,8 @@
 	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 @@
 
 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) {

Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp	2009-02-21 03:59:57 UTC (rev 38657)
+++ scummvm/trunk/engines/sci/engine/vm.cpp	2009-02-21 04:10:21 UTC (rev 38658)
@@ -1084,7 +1084,7 @@
 
 		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 @@
 
 				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 @@
 
 	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 

Modified: scummvm/trunk/engines/sci/gfx/operations.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.cpp	2009-02-21 03:59:57 UTC (rev 38657)
+++ scummvm/trunk/engines/sci/gfx/operations.cpp	2009-02-21 04:10:21 UTC (rev 38658)
@@ -1521,7 +1521,6 @@
 _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;
 

Modified: scummvm/trunk/engines/sci/scicore/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/console.cpp	2009-02-21 03:59:57 UTC (rev 38657)
+++ scummvm/trunk/engines/sci/scicore/console.cpp	2009-02-21 04:10:21 UTC (rev 38658)
@@ -42,12 +42,11 @@
 /****************************************/
 
 
-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 @@
 		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 @@
 	return 1;
 }
 
-void
-con_set_string_callback(void(*callback)(char *)) {
+void con_set_string_callback(void(*callback)(char *)) {
 	_con_string_callback = callback;
 }
 

Modified: scummvm/trunk/engines/sci/scicore/decompress0.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/decompress0.cpp	2009-02-21 03:59:57 UTC (rev 38657)
+++ scummvm/trunk/engines/sci/scicore/decompress0.cpp	2009-02-21 04:10:21 UTC (rev 38658)
@@ -249,10 +249,10 @@
 
 
 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 @@
 #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. */
 

Modified: scummvm/trunk/engines/sci/scicore/decompress01.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/decompress01.cpp	2009-02-21 03:59:57 UTC (rev 38657)
+++ scummvm/trunk/engines/sci/scicore/decompress01.cpp	2009-02-21 04:10:21 UTC (rev 38658)
@@ -44,16 +44,16 @@
 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 @@
 		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 @@
 				return 0;
 			}
 			if (s_bitstring == 0x100) { /* start-over signal */
-				numbits = 9;
+				s_numbits = 9;
 				endtoken = 0x1ff;
 				curtoken = 0x102;
 				decryptstart = 0;
@@ -114,8 +114,8 @@
 				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 @@
 
 
 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 @@
 	    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)

Modified: scummvm/trunk/engines/sci/scicore/decompress1.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/decompress1.cpp	2009-02-21 03:59:57 UTC (rev 38657)
+++ scummvm/trunk/engines/sci/scicore/decompress1.cpp	2009-02-21 04:10:21 UTC (rev 38658)
@@ -274,10 +274,10 @@
 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 @@
 #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)

Modified: scummvm/trunk/engines/sci/scicore/decompress11.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/decompress11.cpp	2009-02-21 03:59:57 UTC (rev 38657)
+++ scummvm/trunk/engines/sci/scicore/decompress11.cpp	2009-02-21 04:10:21 UTC (rev 38658)
@@ -74,8 +74,7 @@
 	    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)

Modified: scummvm/trunk/engines/sci/scicore/tools.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/tools.cpp	2009-02-21 03:59:57 UTC (rev 38657)
+++ scummvm/trunk/engines/sci/scicore/tools.cpp	2009-02-21 04:10:21 UTC (rev 38658)
@@ -62,7 +62,6 @@
 #include "common/str.h"
 
 #ifdef UNIX
-#define _GNU_SOURCE /* For FNM_CASEFOLD in fnmatch.h */
 #include <fnmatch.h>
 #endif
 

Modified: scummvm/trunk/engines/sci/sfx/iterator.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/iterator.cpp	2009-02-21 03:59:57 UTC (rev 38657)
+++ scummvm/trunk/engines/sci/sfx/iterator.cpp	2009-02-21 04:10:21 UTC (rev 38658)
@@ -780,7 +780,6 @@
 	self->next_sample = 0;
 //	self->device_id = 0x0c;
 
-	CHECK_FOR_END_ABSOLUTE(0);
 	if (SONGDATA(0) == 0xf0) {
 		self->priority = SONGDATA(1);
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list