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

dhewg at users.sourceforge.net dhewg at users.sourceforge.net
Sat Feb 28 14:41:43 CET 2009


Revision: 38965
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38965&view=rev
Author:   dhewg
Date:     2009-02-28 13:41:43 +0000 (Sat, 28 Feb 2009)

Log Message:
-----------
clean up some warnings

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/game.cpp
    scummvm/trunk/engines/sci/engine/kernel.cpp
    scummvm/trunk/engines/sci/engine/vm.cpp
    scummvm/trunk/engines/sci/scicore/decompress1.cpp
    scummvm/trunk/engines/sci/scicore/resource_map.cpp
    scummvm/trunk/engines/sci/scicore/script.cpp
    scummvm/trunk/engines/sci/scicore/versions.cpp
    scummvm/trunk/engines/sci/sfx/iterator.cpp

Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp	2009-02-28 13:39:56 UTC (rev 38964)
+++ scummvm/trunk/engines/sci/engine/game.cpp	2009-02-28 13:41:43 UTC (rev 38965)
@@ -245,7 +245,7 @@
 int game_init_graphics(EngineState *s) {
 #ifndef WITH_PIC_SCALING
 	if (s->gfx_state->options->pic0_unscaled == 0)
-		sciprintf("WARNING: Pic scaling was disabled; your version of FreeSCI has no support for scaled pic drawing built in.\n");
+		warning("Pic scaling was disabled; your version of FreeSCI has no support for scaled pic drawing built in.");
 
 	s->gfx_state->options->pic0_unscaled = 1;
 #endif

Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp	2009-02-28 13:39:56 UTC (rev 38964)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp	2009-02-28 13:41:43 UTC (rev 38965)
@@ -578,7 +578,7 @@
 		if (dest && src)
 			memcpy(dest, src, size);
 		else {
-			warning("Warning: Could not execute kMemory:memcpy of %d bytes:", size);
+			warning("Could not execute kMemory:memcpy of %d bytes:", size);
 			if (!dest) {
 				warning("  dest ptr ("PREG") invalid/memory region too small", PRINT_REG(argv[1]));
 			}
@@ -643,14 +643,12 @@
 reg_t kNOP(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	const char *problem = (const char*)(s->kfunct_table[funct_nr].orig_name ? "unmapped" : "NOP");
 
-	warning("Warning: Kernel function 0x%02x invoked: %s", funct_nr, problem);
+	warning("Kernel function 0x%02x invoked: %s", funct_nr, problem);
 
 	if (s->kfunct_table[funct_nr].orig_name && strcmp(s->kfunct_table[funct_nr].orig_name, SCRIPT_UNKNOWN_FUNCTION_STRING)) {
-		sciprintf(" (but its name is known to be %s)", s->kfunct_table[funct_nr].orig_name);
+		warning(" (but its name is known to be %s)", s->kfunct_table[funct_nr].orig_name);
 	}
 
-	sciprintf("\n");
-
 	return NULL_REG;
 }
 
@@ -741,8 +739,8 @@
 	int max_functions_nr = sci_max_allowed_unknown_kernel_functions[s->resmgr->sci_version];
 
 	if (functions_nr < max_functions_nr) {
-		sciprintf("Warning: SCI version believed to have %d kernel"
-		          " functions, but only %d reported-- filling up remaining %d\n",
+		warning("SCI version believed to have %d kernel"
+		        " functions, but only %d reported-- filling up remaining %d",
 		          max_functions_nr, functions_nr, max_functions_nr - functions_nr);
 
 		functions_nr = max_functions_nr;
@@ -765,10 +763,10 @@
 
 		if (found == -1) {
 			if (sought_name) {
-				sciprintf("Warning: Kernel function %s[%x] unmapped\n", s->kernel_names[functnr], functnr);
+				warning("Kernel function %s[%x] unmapped", s->kernel_names[functnr], functnr);
 				s->kfunct_table[functnr].fun = kNOP;
 			} else {
-				sciprintf("Warning: Flagging kernel function %x as unknown\n", functnr);
+				warning("Flagging kernel function %x as unknown", functnr);
 				s->kfunct_table[functnr].fun = k_Unknown;
 			}
 

Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp	2009-02-28 13:39:56 UTC (rev 38964)
+++ scummvm/trunk/engines/sci/engine/vm.cpp	2009-02-28 13:41:43 UTC (rev 38965)
@@ -658,7 +658,7 @@
 			scr = script_locate_by_segment(s, xs->addr.pc.segment);
 			if (!scr) {
 				// No script? Implicit return via fake instruction buffer
-				warning("Running on non-existant script in segment %x!\n", xs->addr.pc.segment);
+				warning("Running on non-existant script in segment %x!", xs->addr.pc.segment);
 				code_buf = _fake_return_buffer;
 #ifndef DISABLE_VALIDATIONS
 				code_buf_size = 2;
@@ -1978,7 +1978,7 @@
 	reg.segment = s->seg_manager->segGet(script_nr);
 
 	if (!s->seg_manager->scriptIsLoaded(script_nr, SCRIPT_ID) || reg.segment <= 0) {   // Is it already loaded?
-		//sciprintf("Warning: unloading script 0x%x requested although not loaded\n", script_nr);
+		//warning("unloading script 0x%x requested although not loaded", script_nr);
 		// This is perfectly valid SCI behaviour
 		return;
 	}

Modified: scummvm/trunk/engines/sci/scicore/decompress1.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/decompress1.cpp	2009-02-28 13:39:56 UTC (rev 38964)
+++ scummvm/trunk/engines/sci/scicore/decompress1.cpp	2009-02-28 13:41:43 UTC (rev 38965)
@@ -148,10 +148,10 @@
 	CALLC(length_param = getbits(reader, 8));
 
 	if (mode == DCL_ASCII_MODE) {
-		warning("DCL-INFLATE: Warning: Decompressing ASCII mode (untested)");
+		warning("DCL-INFLATE: Decompressing ASCII mode (untested)");
 		//DEBUG_DCL_INFLATE = 1;
 	} else if (mode) {
-		fprintf(stderr, "DCL-INFLATE: Error: Encountered mode %02x, expected 00 or 01\n", mode);
+		warning("DCL-INFLATE: Error: Encountered mode %02x, expected 00 or 01\n", mode);
 		return 1;
 	}
 
@@ -170,7 +170,7 @@
 
 
 	if (length_param < 3 || length_param > 6)
-		fprintf(stderr, "Warning: Unexpected length_param value %d (expected in [3,6])\n", length_param);
+		warning("Unexpected length_param value %d (expected in [3,6])\n", length_param);
 
 	while (write_pos < length) {
 		CALLC(value = getbits(reader, 1));

Modified: scummvm/trunk/engines/sci/scicore/resource_map.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/resource_map.cpp	2009-02-28 13:39:56 UTC (rev 38964)
+++ scummvm/trunk/engines/sci/scicore/resource_map.cpp	2009-02-28 13:41:43 UTC (rev 38965)
@@ -27,6 +27,7 @@
 #include "sci/scicore/resource.h"
 #include "sci/tools.h"
 
+#include "common/util.h"
 #include "common/file.h"
 
 namespace Sci {
@@ -295,7 +296,7 @@
 				++resource_index;
 
 			if (++resources_total_read >= resource_nr) {
-				sciprintf("Warning: After %d entries, resource.map is not terminated", resource_index);
+				warning("After %d entries, resource.map is not terminated", resource_index);
 				next_entry = 0;
 			}
 

Modified: scummvm/trunk/engines/sci/scicore/script.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/script.cpp	2009-02-28 13:39:56 UTC (rev 38964)
+++ scummvm/trunk/engines/sci/scicore/script.cpp	2009-02-28 13:41:43 UTC (rev 38965)
@@ -113,7 +113,7 @@
 			return pos;
 	}
 
-	sciprintf("Warning: Could not map '%s' to any selector!\n", selectorname);
+	warning("Could not map '%s' to any selector!", selectorname);
 
 	return -1;
 }

Modified: scummvm/trunk/engines/sci/scicore/versions.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/versions.cpp	2009-02-28 13:39:56 UTC (rev 38964)
+++ scummvm/trunk/engines/sci/scicore/versions.cpp	2009-02-28 13:41:43 UTC (rev 38965)
@@ -76,7 +76,7 @@
 	int patchlevel = strtol(vn + 6, &endptr[2], 10);
 
 	if (endptr[0] != vn + 1 || endptr[1] != vn + 5 || *endptr[2] != '\0') {
-		sciprintf("Warning: Failed to parse version string '%s'\n", vn);
+		warning("Failed to parse version string '%s'", vn);
 		return 1;
 	}
 

Modified: scummvm/trunk/engines/sci/sfx/iterator.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/iterator.cpp	2009-02-28 13:39:56 UTC (rev 38964)
+++ scummvm/trunk/engines/sci/sfx/iterator.cpp	2009-02-28 13:41:43 UTC (rev 38965)
@@ -82,14 +82,14 @@
 
 #define CHECK_FOR_END_ABSOLUTE(offset) \
 	if (offset > self->size) { \
-		fprintf(stderr, SIPFX "Reached end of song without terminator (%x/%x) at %d!\n", offset, self->size, __LINE__); \
+		warning(SIPFX "Reached end of song without terminator (%x/%x) at %d!", offset, self->size, __LINE__); \
 		return SI_FINISHED; \
 	}
 
 #define CHECK_FOR_END(offset_augment) \
 	if ((channel->offset + (offset_augment)) > channel->end) { \
 		channel->state = SI_STATE_FINISHED; \
-		fprintf(stderr, SIPFX "Reached end of track %d without terminator (%x+%x/%x) at %d!\n", channel->id, channel->offset, offset_augment, channel->end, __LINE__); \
+		warning(SIPFX "Reached end of track %d without terminator (%x+%x/%x) at %d!", channel->id, channel->offset, offset_augment, channel->end, __LINE__); \
 		return SI_FINISHED; \
 	}
 
@@ -380,7 +380,7 @@
 	}
 
 	case SI_STATE_UNINITIALISED:
-		fprintf(stderr, SIPFX "Attempt to read command from uninitialized iterator!\n");
+		warning(SIPFX "Attempt to read command from uninitialized iterator!");
 		self->init((song_iterator_t *) self);
 		return self->next((song_iterator_t *) self, buf, result);
 
@@ -436,8 +436,7 @@
 	}
 
 	default:
-		fprintf(stderr, SIPFX "Invalid iterator state %d!\n",
-		        channel->state);
+		warning(SIPFX "Invalid iterator state %d!", channel->state);
 		BREAKPOINT();
 		return SI_FINISHED;
 	}
@@ -486,8 +485,7 @@
 		                    self->size - offset);
 
 		if (!fc) {
-			fprintf(stderr, SIPFX "Warning: Playing unterminated"
-			        " song!\n");
+			warning(SIPFX "Playing unterminated song!");
 			return 1;
 		}
 
@@ -500,9 +498,8 @@
 	}
 
 	if (!found_it) {
-		fprintf(stderr, SIPFX
-		        "Warning: Song indicates presence of PCM, but"
-		        " none found (finally at offset %04x)\n", offset);
+		warning(SIPFX "Song indicates presence of PCM, but"
+		        " none found (finally at offset %04x)", offset);
 
 		return 1;
 	}
@@ -519,9 +516,8 @@
 	if (offset + SCI0_PCM_DATA_OFFSET + size != self->size) {
 		int d = offset + SCI0_PCM_DATA_OFFSET + size - self->size;
 
-		fprintf(stderr, SIPFX
-		        "Warning: PCM advertizes %d bytes of data, but %d"
-		        " bytes are trailing in the resource!\n",
+		warning(SIPFX "PCM advertizes %d bytes of data, but %d"
+		        " bytes are trailing in the resource!",
 		        size, self->size - (offset + SCI0_PCM_DATA_OFFSET));
 
 		if (d > 0)
@@ -1189,8 +1185,7 @@
 		}
 
 		default:
-			fprintf(stderr, SIPFX "Unsupported command %d to"
-			        " SCI1 iterator", msg.type);
+			warning(SIPFX "Unsupported command %d to SCI1 iterator", msg.type);
 		}
 		return (song_iterator_t *) self;
 	}
@@ -1802,8 +1797,7 @@
 	int i;
 
 	if (!data || size < 22) {
-		warning(SIPFX "Attempt to instantiate song iterator for null"
-		        " song data");
+		warning(SIPFX "Attempt to instantiate song iterator for null song data");
 		return NULL;
 	}
 
@@ -1853,7 +1847,7 @@
 	default:
 		/**-- Invalid/unsupported sound resources --**/
 		warning(SIPFX "Attempt to instantiate invalid/unknown"
-		        " song iterator type %d\n", type);
+		        " song iterator type %d", type);
 		return NULL;
 	}
 	it->ID = id;


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