[Scummvm-cvs-logs] SF.net SVN: scummvm:[54007] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Nov 1 17:03:35 CET 2010


Revision: 54007
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54007&view=rev
Author:   fingolfin
Date:     2010-11-01 16:03:35 +0000 (Mon, 01 Nov 2010)

Log Message:
-----------
GUI: Add GCC_PRINTF to GUI::Debugger::DebugPrintf & fix resulting warnings

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/debugger.cpp
    scummvm/trunk/engines/lastexpress/debug.cpp
    scummvm/trunk/engines/m4/console.cpp
    scummvm/trunk/engines/queen/debug.cpp
    scummvm/trunk/engines/sci/console.cpp
    scummvm/trunk/engines/sci/parser/vocabulary.cpp
    scummvm/trunk/engines/sword2/console.cpp
    scummvm/trunk/engines/tinsel/debugger.cpp
    scummvm/trunk/gui/debugger.h

Modified: scummvm/trunk/engines/kyra/debugger.cpp
===================================================================
--- scummvm/trunk/engines/kyra/debugger.cpp	2010-11-01 16:03:02 UTC (rev 54006)
+++ scummvm/trunk/engines/kyra/debugger.cpp	2010-11-01 16:03:35 UTC (rev 54007)
@@ -331,7 +331,7 @@
 		return false;
 	}
 
-	DebugPrintf("Syntax: %d <scenenum> <direction>\n", argv[0]);
+	DebugPrintf("Syntax: %s <scenenum> <direction>\n", argv[0]);
 	return true;
 }
 

Modified: scummvm/trunk/engines/lastexpress/debug.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/debug.cpp	2010-11-01 16:03:02 UTC (rev 54006)
+++ scummvm/trunk/engines/lastexpress/debug.cpp	2010-11-01 16:03:35 UTC (rev 54007)
@@ -343,7 +343,7 @@
 
 				AnimFrame *frame = sequence.getFrame((uint16)getNumber(argv[2]));
 				if (!frame) {
-					DebugPrintf("Invalid frame index: %i\n", filename.c_str());
+					DebugPrintf("Invalid frame index '%s'\n", argv[2]);
 					resetCommand();
 					return true;
 				}
@@ -1012,7 +1012,7 @@
 #define OUTPUT_DUMP(name, text) \
 	DebugPrintf(#name "\n"); \
 	DebugPrintf("--------------------------------------------------------------------\n\n"); \
-	DebugPrintf(text); \
+	DebugPrintf("%s", text); \
 	DebugPrintf("\n");
 
 	if (argc == 2) {
@@ -1071,7 +1071,7 @@
 
 		DebugPrintf("Entity %s\n", ENTITY_NAME(index));
 		DebugPrintf("--------------------------------------------------------------------\n\n");
-		DebugPrintf(getEntities()->getData(index)->toString().c_str());
+		DebugPrintf("%s", getEntities()->getData(index)->toString().c_str());
 
 		// The Player entity does not have any callback data
 		if (index != kEntityPlayer) {

Modified: scummvm/trunk/engines/m4/console.cpp
===================================================================
--- scummvm/trunk/engines/m4/console.cpp	2010-11-01 16:03:02 UTC (rev 54006)
+++ scummvm/trunk/engines/m4/console.cpp	2010-11-01 16:03:35 UTC (rev 54007)
@@ -123,7 +123,7 @@
 bool Console::cmdPlayDSRSound(int argc, const char **argv) {
 	if (argc != 2 && argc != 3) {
 		DebugPrintf("Usage: %s <sound index> <DSR file>\n", argv[0]);
-		DebugPrintf("The DSR file parameter is optional, and specifies which DSR to load\n", argv[0]);
+		DebugPrintf("The DSR file parameter is optional, and specifies which DSR to load\n");
 	} else {
 		if (argc == 3)
 			_vm->_sound->loadDSRFile(argv[2]);

Modified: scummvm/trunk/engines/queen/debug.cpp
===================================================================
--- scummvm/trunk/engines/queen/debug.cpp	2010-11-01 16:03:02 UTC (rev 54006)
+++ scummvm/trunk/engines/queen/debug.cpp	2010-11-01 16:03:35 UTC (rev 54007)
@@ -149,12 +149,12 @@
 bool Debugger::Cmd_PrintBobs(int argc, const char**argv) {
 	int i;
 	BobSlot *bob = _vm->graphics()->bob(0);
-	DebugPrintf("+--------------------------------+\n");
-	DebugPrintf("|# |  x|  y|f|scl|frm|a|m| ex| ey|\n");
-	DebugPrintf("+--+---+---+-+---+---+-+-+---+---+\n");
+	DebugPrintf("+------------------------------------+\n");
+	DebugPrintf("|# |  x|  y|f|scl|frm|a|m|spd| ex| ey|\n");
+	DebugPrintf("+--+---+---+-+---+---+-+-+---+---+---+\n");
 	for (i = 0; i < Graphics::MAX_BOBS_NUMBER; ++i, ++bob) {
 		if (bob->active) {
-			DebugPrintf("|%2d|%3d|%3d|%1d|%3d|%3d|%1d|%1d|%3d|%3d|\n",
+			DebugPrintf("|%2d|%3d|%3d|%1d|%3d|%3d|%1d|%1d|%3d|%3d|%3d|\n",
 				i, bob->x, bob->y, bob->xflip, bob->scale, bob->frameNum,
 				bob->animating, bob->moving, bob->speed, bob->endx, bob->endy);
 		}

Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp	2010-11-01 16:03:02 UTC (rev 54006)
+++ scummvm/trunk/engines/sci/console.cpp	2010-11-01 16:03:35 UTC (rev 54007)
@@ -761,7 +761,7 @@
 	if (argc < 4) {
 		DebugPrintf("Searches some resources for a particular sequence of bytes, represented as hexadecimal numbers.\n");
 		DebugPrintf("Usage: %s <resource type> <resource number> <search string>\n", argv[0]);
-		DebugPrintf("<resource number> can be a specific resource number, or \"all\" for all of the resources of the specified type\n", argv[0]);
+		DebugPrintf("<resource number> can be a specific resource number, or \"all\" for all of the resources of the specified type\n");
 		DebugPrintf("EXAMPLES:\n  hexgrep script all e8 03 c8 00\n  hexgrep pic 042 fe");
 		cmdResourceTypes(argc, argv);
 		return true;

Modified: scummvm/trunk/engines/sci/parser/vocabulary.cpp
===================================================================
--- scummvm/trunk/engines/sci/parser/vocabulary.cpp	2010-11-01 16:03:02 UTC (rev 54006)
+++ scummvm/trunk/engines/sci/parser/vocabulary.cpp	2010-11-01 16:03:35 UTC (rev 54007)
@@ -673,9 +673,15 @@
 		con->DebugPrintf(" Node %03x: ", i);
 		if (_parserNodes[i].type == kParseTreeLeafNode)
 			con->DebugPrintf("Leaf: %04x\n", _parserNodes[i].value);
-		else
-			con->DebugPrintf("Branch: ->%04x, ->%04x\n", _parserNodes[i].left,
-			          _parserNodes[i].right);
+		else {
+			// FIXME: Do we really want to print the *addresses*
+			// of the left & right child?
+			// Note that one or both may be zero pointers, so we can't just
+			// print their values.
+			con->DebugPrintf("Branch: ->%p, ->%p\n",
+					(const void *)_parserNodes[i].left,
+					(const void *)_parserNodes[i].right);
+		}
 	}
 }
 

Modified: scummvm/trunk/engines/sword2/console.cpp
===================================================================
--- scummvm/trunk/engines/sword2/console.cpp	2010-11-01 16:03:02 UTC (rev 54006)
+++ scummvm/trunk/engines/sword2/console.cpp	2010-11-01 16:03:35 UTC (rev 54007)
@@ -237,13 +237,15 @@
 			break;
 		}
 
-		DebugPrintf("%9ld %-3d %-4d %-20s %s\n", blocks[i]->size, blocks[i]->id, blocks[i]->uid, type, _vm->_resman->fetchName(blocks[i]->ptr));
+		DebugPrintf("%9d %-3d %-4d %-20s %s\n",
+				blocks[i]->size, blocks[i]->id, blocks[i]->uid,
+				type, _vm->_resman->fetchName(blocks[i]->ptr));
 	}
 
 	free(blocks);
 
 	DebugPrintf("---------------------------------------------------------------------------\n");
-	DebugPrintf("%9ld\n", _vm->_memory->getTotAlloc());
+	DebugPrintf("%9d\n", _vm->_memory->getTotAlloc());
 
 	return true;
 }

Modified: scummvm/trunk/engines/tinsel/debugger.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/debugger.cpp	2010-11-01 16:03:02 UTC (rev 54006)
+++ scummvm/trunk/engines/tinsel/debugger.cpp	2010-11-01 16:03:35 UTC (rev 54007)
@@ -117,7 +117,7 @@
 
 	int param = strToInt(argv[1]);
 	if (param == 0) {
-		DebugPrintf("Track number/offset can't be 0!\n", argv[0]);
+		DebugPrintf("Track number/offset can't be 0!\n");
 	} else if (param > 0) {
 		// Track provided
 		PlayMidiSequence(GetTrackOffset(param - 1), false);

Modified: scummvm/trunk/gui/debugger.h
===================================================================
--- scummvm/trunk/gui/debugger.h	2010-11-01 16:03:02 UTC (rev 54006)
+++ scummvm/trunk/gui/debugger.h	2010-11-01 16:03:35 UTC (rev 54007)
@@ -41,7 +41,7 @@
 	Debugger();
 	virtual ~Debugger();
 
-	int DebugPrintf(const char *format, ...);
+	int DebugPrintf(const char *format, ...) GCC_PRINTF(2, 3);
 
 	/**
 	 * The onFrame() method should be invoked by the engine at regular


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