diff options
| -rw-r--r-- | engines/kyra/debugger.cpp | 2 | ||||
| -rw-r--r-- | engines/lastexpress/debug.cpp | 6 | ||||
| -rw-r--r-- | engines/m4/console.cpp | 2 | ||||
| -rw-r--r-- | engines/queen/debug.cpp | 8 | ||||
| -rw-r--r-- | engines/sci/console.cpp | 2 | ||||
| -rw-r--r-- | engines/sci/parser/vocabulary.cpp | 12 | ||||
| -rw-r--r-- | engines/sword2/console.cpp | 6 | ||||
| -rw-r--r-- | engines/tinsel/debugger.cpp | 2 | ||||
| -rw-r--r-- | gui/debugger.h | 2 | 
9 files changed, 25 insertions, 17 deletions
diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp index fc509700d7..8e264885a1 100644 --- a/engines/kyra/debugger.cpp +++ b/engines/kyra/debugger.cpp @@ -331,7 +331,7 @@ bool Debugger_v2::cmd_enterScene(int argc, const char **argv) {  		return false;  	} -	DebugPrintf("Syntax: %d <scenenum> <direction>\n", argv[0]); +	DebugPrintf("Syntax: %s <scenenum> <direction>\n", argv[0]);  	return true;  } diff --git a/engines/lastexpress/debug.cpp b/engines/lastexpress/debug.cpp index 35a87cf14b..50f0109a3f 100644 --- a/engines/lastexpress/debug.cpp +++ b/engines/lastexpress/debug.cpp @@ -343,7 +343,7 @@ bool Debugger::cmdShowFrame(int argc, const char **argv) {  				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 @@ bool Debugger::cmdShow(int argc, const char **argv) {  #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 @@ bool Debugger::cmdEntity(int argc, const char **argv) {  		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) { diff --git a/engines/m4/console.cpp b/engines/m4/console.cpp index 32ccdab787..88b4240901 100644 --- a/engines/m4/console.cpp +++ b/engines/m4/console.cpp @@ -123,7 +123,7 @@ bool Console::cmdPlaySound(int argc, const char **argv) {  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]); diff --git a/engines/queen/debug.cpp b/engines/queen/debug.cpp index 1abb2415d2..f4d7cf3b2e 100644 --- a/engines/queen/debug.cpp +++ b/engines/queen/debug.cpp @@ -149,12 +149,12 @@ bool Debugger::Cmd_Items(int argc, const char **argv) {  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);  		} diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index deab3dadd8..0dac0729cc 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -761,7 +761,7 @@ bool Console::cmdHexgrep(int argc, const char **argv) {  	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; diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp index f9989b22a8..3e35bd652a 100644 --- a/engines/sci/parser/vocabulary.cpp +++ b/engines/sci/parser/vocabulary.cpp @@ -673,9 +673,15 @@ void Vocabulary::printParserNodes(int num) {  		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); +		}  	}  } diff --git a/engines/sword2/console.cpp b/engines/sword2/console.cpp index 4bf7c0da19..20fd79bc38 100644 --- a/engines/sword2/console.cpp +++ b/engines/sword2/console.cpp @@ -237,13 +237,15 @@ bool Debugger::Cmd_Mem(int argc, const char **argv) {  			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;  } diff --git a/engines/tinsel/debugger.cpp b/engines/tinsel/debugger.cpp index 5d8b22116d..ed877587c7 100644 --- a/engines/tinsel/debugger.cpp +++ b/engines/tinsel/debugger.cpp @@ -117,7 +117,7 @@ bool Console::cmd_music(int argc, const char **argv) {  	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); diff --git a/gui/debugger.h b/gui/debugger.h index 6f06befdf1..4bac2e1f03 100644 --- a/gui/debugger.h +++ b/gui/debugger.h @@ -41,7 +41,7 @@ public:  	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  | 
