[Scummvm-cvs-logs] SF.net SVN: scummvm:[52406] scummvm/trunk/engines/hugo

strangerke at users.sourceforge.net strangerke at users.sourceforge.net
Fri Aug 27 11:48:54 CEST 2010


Revision: 52406
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52406&view=rev
Author:   strangerke
Date:     2010-08-27 09:48:53 +0000 (Fri, 27 Aug 2010)

Log Message:
-----------
HUGO: Hopefully fix GCC_PRINTF issue in util

* Add a mask in each call of Warn(), Error() and Box() not using one
* cleanup: use the same wording for 'End of namespace Hugo' in all files

Modified Paths:
--------------
    scummvm/trunk/engines/hugo/detection.cpp
    scummvm/trunk/engines/hugo/display.cpp
    scummvm/trunk/engines/hugo/display.h
    scummvm/trunk/engines/hugo/engine.cpp
    scummvm/trunk/engines/hugo/engine.h
    scummvm/trunk/engines/hugo/file.cpp
    scummvm/trunk/engines/hugo/file.h
    scummvm/trunk/engines/hugo/global.h
    scummvm/trunk/engines/hugo/hugo.cpp
    scummvm/trunk/engines/hugo/intro.cpp
    scummvm/trunk/engines/hugo/intro.h
    scummvm/trunk/engines/hugo/inventory.h
    scummvm/trunk/engines/hugo/mouse.cpp
    scummvm/trunk/engines/hugo/mouse.h
    scummvm/trunk/engines/hugo/parser.cpp
    scummvm/trunk/engines/hugo/parser.h
    scummvm/trunk/engines/hugo/route.cpp
    scummvm/trunk/engines/hugo/route.h
    scummvm/trunk/engines/hugo/schedule.cpp
    scummvm/trunk/engines/hugo/schedule.h
    scummvm/trunk/engines/hugo/sound.cpp
    scummvm/trunk/engines/hugo/sound.h
    scummvm/trunk/engines/hugo/util.cpp
    scummvm/trunk/engines/hugo/util.h

Modified: scummvm/trunk/engines/hugo/detection.cpp
===================================================================
--- scummvm/trunk/engines/hugo/detection.cpp	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/detection.cpp	2010-08-27 09:48:53 UTC (rev 52406)
@@ -231,4 +231,5 @@
 		break;
 	}
 }
+
 } // End of namespace Hugo

Modified: scummvm/trunk/engines/hugo/display.cpp
===================================================================
--- scummvm/trunk/engines/hugo/display.cpp	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/display.cpp	2010-08-27 09:48:53 UTC (rev 52406)
@@ -278,7 +278,7 @@
 		break;
 	case D_ADD:                                     // Add a rectangle to list
 		if (addIndex >= DMAX) {
-			Utils::Warn(false, "Display list exceeded");
+			Utils::Warn(false, "%s", "Display list exceeded");
 			return;
 		}
 		va_start(marker, update);                   // Initialize variable arguments
@@ -440,7 +440,8 @@
 void Screen::userHelp() {
 // Introduce user to the game
 // DOS versions Only
-	Utils::Box(BOX_ANY , "F1  - Press F1 again\n"
+	Utils::Box(BOX_ANY , "%s", 
+	           "F1  - Press F1 again\n"
 	           "      for instructions\n"
 	           "F2  - Sound on/off\n"
 	           "F3  - Recall last line\n"
@@ -452,4 +453,4 @@
 	           "ESC - Return to game");
 }
 
-} // end of namespace Hugo
+} // End of namespace Hugo

Modified: scummvm/trunk/engines/hugo/display.h
===================================================================
--- scummvm/trunk/engines/hugo/display.h	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/display.h	2010-08-27 09:48:53 UTC (rev 52406)
@@ -98,5 +98,6 @@
 	int16 center(char *s);
 };
 
-} // end of namespace Hugo
+} // End of namespace Hugo
+
 #endif //HUGO_DISPLAY_H

Modified: scummvm/trunk/engines/hugo/engine.cpp
===================================================================
--- scummvm/trunk/engines/hugo/engine.cpp	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/engine.cpp	2010-08-27 09:48:53 UTC (rev 52406)
@@ -848,7 +848,7 @@
 					// Deselect dragged icon if inventory not active
 					if (_status.inventoryState != I_ACTIVE)
 						_status.inventoryObjId  = -1;
-					Utils::Box(BOX_ANY, _textData[use->dataIndex]);
+					Utils::Box(BOX_ANY, "%s", _textData[use->dataIndex]);
 					return;
 				}
 			}
@@ -988,9 +988,9 @@
 	debugC(1, kDebugEngine, "endGame");
 
 	if (!_boot.registered)
-		Utils::Box(BOX_ANY, _textEngine[kEsAdvertise]);
+		Utils::Box(BOX_ANY, "%s", _textEngine[kEsAdvertise]);
 	Utils::Box(BOX_ANY, "%s\n%s", _episode, COPYRIGHT);
 	_status.viewState = V_EXIT;
 }
 
-} // end of namespace Hugo
+} // End of namespace Hugo

Modified: scummvm/trunk/engines/hugo/engine.h
===================================================================
--- scummvm/trunk/engines/hugo/engine.h	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/engine.h	2010-08-27 09:48:53 UTC (rev 52406)
@@ -39,5 +39,6 @@
 	kEsAdvertise = 0
 };
 
-} // end of namespace Hugo
+} // End of namespace Hugo
+
 #endif // HUGO_ENGINE_H

Modified: scummvm/trunk/engines/hugo/file.cpp
===================================================================
--- scummvm/trunk/engines/hugo/file.cpp	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/file.cpp	2010-08-27 09:48:53 UTC (rev 52406)
@@ -108,12 +108,12 @@
 	f.read(PCC_header.fill2, sizeof(PCC_header.fill2));
 
 	if (PCC_header.mfctr != 10)
-		Utils::Error(PCCH_ERR, name);
+		Utils::Error(PCCH_ERR, "%s", name);
 
 	// Allocate memory for seq_t if NULL
 	if (seqPtr == NULL)
 		if ((seqPtr = (seq_t *)malloc(sizeof(seq_t))) == NULL)
-			Utils::Error(HEAP_ERR, name);
+			Utils::Error(HEAP_ERR, "%s", name);
 
 	// Find size of image data in 8-bit DIB format
 	// Note save of x2 - marks end of valid data before garbage
@@ -126,7 +126,7 @@
 	// Allocate memory for image data if NULL
 	if (imagePtr == NULL)
 		if ((imagePtr = (byte *)malloc((size_t) size)) == NULL)
-			Utils::Error(HEAP_ERR, name);
+			Utils::Error(HEAP_ERR, "%s", name);
 	seqPtr->imagePtr = imagePtr;
 
 	// Process the image data, converting to 8-bit DIB format
@@ -176,7 +176,7 @@
 			warning("File %s not found, trying again with %s%s", buf, _vm._arrayNouns[objPtr->nounIndex][0], OBJEXT);
 			strcat(strcpy(buf, _vm._arrayNouns[objPtr->nounIndex][0]), OBJEXT);
 			if (!_objectsArchive.open(buf))
-				Utils::Error(FILE_ERR, buf);
+				Utils::Error(FILE_ERR, "%s", buf);
 		}
 	}
 
@@ -262,7 +262,7 @@
 			warning("File %s not found, trying again with %s.ART", buf, _vm._screenNames[screenIndex]);
 			strcat(strcpy(buf, _vm._screenNames[screenIndex]), ".ART");
 			if (!_sceneryArchive.open(buf))
-				Utils::Error(FILE_ERR, buf);
+				Utils::Error(FILE_ERR, "%s", buf);
 		}
 	}
 
@@ -290,7 +290,7 @@
 
 	// Open sounds file
 	if (!fp.open(SOUND_FILE)) {
-//		Error(FILE_ERR, SOUND_FILE);
+//		Error(FILE_ERR, "%s", SOUND_FILE);
 		warning("Hugo Error: File not found %s", SOUND_FILE);
 		return(NULL);
 	}
@@ -299,24 +299,24 @@
 	static bool has_read_header = false;
 	if (!has_read_header) {
 		if (fp.read(s_hdr, sizeof(s_hdr)) != sizeof(s_hdr))
-			Utils::Error(FILE_ERR, SOUND_FILE);
+			Utils::Error(FILE_ERR, "%s", SOUND_FILE);
 		has_read_header = true;
 	}
 
 	*size = s_hdr[sound].size;
 	if (*size == 0)
-		Utils::Error(SOUND_ERR, SOUND_FILE);
+		Utils::Error(SOUND_ERR, "%s", SOUND_FILE);
 
 	// Allocate memory for sound or music, if possible
 	if ((soundPtr = (byte *)malloc(s_hdr[sound].size)) == 0) {
-		Utils::Warn(false, "Low on memory");
+		Utils::Warn(false, "%s", "Low on memory");
 		return(NULL);
 	}
 
 	// Seek to data and read it
 	fp.seek(s_hdr[sound].offset, SEEK_SET);
 	if (fp.read(soundPtr, s_hdr[sound].size) != s_hdr[sound].size)
-		Utils::Error(FILE_ERR, SOUND_FILE);
+		Utils::Error(FILE_ERR, "%s", SOUND_FILE);
 
 	fp.close();
 
@@ -369,7 +369,7 @@
 			i = sceneBlock.ob_len;
 			break;
 		default:
-			Utils::Error(FILE_ERR, "Bad ovl_type");
+			Utils::Error(FILE_ERR, "%s", "Bad ovl_type");
 			break;
 		}
 		if (i == 0) {
@@ -390,7 +390,7 @@
 		}
 
 		if (!_sceneryArchive.open(buf))
-			Utils::Error(FILE_ERR, buf);
+			Utils::Error(FILE_ERR, "%s", buf);
 
 //		if (eof(f_scenery)) {
 //			_lclose(f_scenery);
@@ -560,7 +560,7 @@
 	int saveVersion;
 	in->read(&saveVersion, sizeof(saveVersion));
 	if (saveVersion != kSavegameVersion) {
-		Utils::Error(GEN_ERR, "Savegame of incompatible version");
+		Utils::Error(GEN_ERR, "%s", "Savegame of incompatible version");
 		return;
 	}
 
@@ -644,7 +644,7 @@
 	if (!(in = _vm.getSaveFileManager()->openForLoading(path))) {
 		saveGame(-1, "");
 		if (!(in = _vm.getSaveFileManager()->openForLoading(path))) {
-			Utils::Error(WRITE_ERR, path);
+			Utils::Error(WRITE_ERR, "%s", path);
 			return;
 		}
 	}
@@ -655,7 +655,7 @@
 
 	// Check sanity - maybe disk full or path set to read-only drive?
 	if (_vm.getGameStatus().saveSize == -1)
-		Utils::Error(WRITE_ERR, path);
+		Utils::Error(WRITE_ERR, "%s", path);
 }
 
 // Record and playback handling stuff:
@@ -671,7 +671,7 @@
 
 	if (playbackFl) {
 		if (!(fpb = fopen(PBFILE, "r+b")))
-			Utils::Error(FILE_ERR, PBFILE);
+			Utils::Error(FILE_ERR, "%s", PBFILE);
 	} else if (recordFl)
 		fpb = fopen(PBFILE, "wb");
 	pbdata.time = 0;                                // Say no key available
@@ -687,13 +687,13 @@
 	debugC(1, kDebugFile, "openDatabaseFiles");
 
 	if (!_stringArchive.open(STRING_FILE))
-//		Error(FILE_ERR, STRING_FILE);
+//		Error(FILE_ERR, "%s", STRING_FILE);
 		warning("Hugo Error: File not found %s", STRING_FILE);
 	if (_vm.isPacked()) {
 		if (!_sceneryArchive.open(SCENERY_FILE))
-			Utils::Error(FILE_ERR, SCENERY_FILE);
+			Utils::Error(FILE_ERR, "%s", SCENERY_FILE);
 		if (!_objectsArchive.open(OBJECTS_FILE))
-			Utils::Error(FILE_ERR, OBJECTS_FILE);
+			Utils::Error(FILE_ERR, "%s", OBJECTS_FILE);
 	}
 }
 
@@ -718,18 +718,18 @@
 	// Get offset to string[index] (and next for length calculation)
 	_stringArchive.seek((uint32)index * sizeof(uint32), SEEK_SET);
 	if (_stringArchive.read((char *)&off1, sizeof(uint32)) == 0)
-		Utils::Error(FILE_ERR, "String offset");
+		Utils::Error(FILE_ERR, "%s", "String offset");
 	if (_stringArchive.read((char *)&off2, sizeof(uint32)) == 0)
-		Utils::Error(FILE_ERR, "String offset");
+		Utils::Error(FILE_ERR, "%s", "String offset");
 
 	// Check size of string
 	if ((off2 - off1) >= MAX_BOX)
-		Utils::Error(FILE_ERR, "Fetched string too long!");
+		Utils::Error(FILE_ERR, "%s", "Fetched string too long!");
 
 	// Position to string and read it into gen purpose _textBoxBuffer
 	_stringArchive.seek(off1, SEEK_SET);
 	if (_stringArchive.read(_textBoxBuffer, (uint16)(off2 - off1)) == 0)
-		Utils::Error(FILE_ERR, "Fetch_string");
+		Utils::Error(FILE_ERR, "%s", "Fetch_string");
 
 	// Null terminate, decode and return it
 	_textBoxBuffer[off2-off1] = '\0';
@@ -751,7 +751,7 @@
 			warning("printBootText - Skipping as H1 Dos may be a freeware");
 			return;
 		} else
-			Utils::Error(FILE_ERR, BOOTFILE);
+			Utils::Error(FILE_ERR, "%s", BOOTFILE);
 	}
 
 	// Allocate space for the text and print it
@@ -760,14 +760,14 @@
 		// Skip over the boot structure (already read) and read exit text
 		ofp.seek((long)sizeof(_boot), SEEK_SET);
 		if (ofp.read(buf, _boot.exit_len) != (size_t)_boot.exit_len)
-			Utils::Error(FILE_ERR, BOOTFILE);
+			Utils::Error(FILE_ERR, "%s", BOOTFILE);
 
 		// Decrypt the exit text, using CRYPT substring
 		for (i = 0; i < _boot.exit_len; i++)
 			buf[i] ^= CRYPT[i % strlen(CRYPT)];
 
 		buf[i] = '\0';
-		//Box(BOX_OK, buf_p);
+		//Box(BOX_OK, "%s", buf_p);
 		//MessageBox(hwnd, buf_p, "License", MB_ICONINFORMATION);
 		warning("printBootText(): License: %s", buf);
 	}
@@ -792,11 +792,11 @@
 			warning("readBootFile - Skipping as H1 Dos may be a freeware");
 			return;
 		} else
-			Utils::Error(FILE_ERR, BOOTFILE);
+			Utils::Error(FILE_ERR, "%s", BOOTFILE);
 	}
 
 	if (ofp.size() < (int32)sizeof(_boot))
-		Utils::Error(FILE_ERR, BOOTFILE);
+		Utils::Error(FILE_ERR, "%s", BOOTFILE);
 
 	_boot.checksum = ofp.readByte();
 	_boot.registered = ofp.readByte();
@@ -812,7 +812,7 @@
 	ofp.close();
 
 	if (checksum)
-		Utils::Error(GEN_ERR, "Program startup file invalid");
+		Utils::Error(GEN_ERR, "%s", "Program startup file invalid");
 }
 
 void FileManager::readConfig() {
@@ -862,10 +862,10 @@
 		firstFl = false;
 		// Open unbuffered to do far read
 		if (!ip.open(UIF_FILE))
-			Utils::Error(FILE_ERR, UIF_FILE);
+			Utils::Error(FILE_ERR, "%s", UIF_FILE);
 
 		if (ip.size() < (int32)sizeof(UIFHeader))
-			Utils::Error(FILE_ERR, UIF_FILE);
+			Utils::Error(FILE_ERR, "%s", UIF_FILE);
 
 		for (int i = 0; i < MAX_UIFS; ++i) {
 			UIFHeader[i].size = ip.readUint16LE();
@@ -887,7 +887,7 @@
 
 	// Open uif file to read data
 	if (!ip.open(UIF_FILE))
-		Utils::Error(FILE_ERR, UIF_FILE);
+		Utils::Error(FILE_ERR, "%s", UIF_FILE);
 
 	// Seek to data
 	UIFHeaderPtr = getUIFHeader((uif_t)id);
@@ -900,7 +900,7 @@
 		break;
 	default:                                        // Read file data into supplied array
 		if (ip.read(buf, UIFHeaderPtr->size) != UIFHeaderPtr->size)
-			Utils::Error(FILE_ERR, UIF_FILE);
+			Utils::Error(FILE_ERR, "%s", UIF_FILE);
 		break;
 	}
 
@@ -928,11 +928,11 @@
 			f.read(wrkLine, 1);
 		} while (*wrkLine++ != EOP);
 		wrkLine[-2] = '\0';      /* Remove EOP and previous CR */
-		Utils::Box(BOX_ANY, line);
+		Utils::Box(BOX_ANY, "%s", line);
 		wrkLine = line;
 		f.read(readBuf, 2);    /* Remove CRLF after EOP */
 	}
 	f.close();
 }
 
-} // end of namespace Hugo
+} // End of namespace Hugo

Modified: scummvm/trunk/engines/hugo/file.h
===================================================================
--- scummvm/trunk/engines/hugo/file.h	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/file.h	2010-08-27 09:48:53 UTC (rev 52406)
@@ -85,6 +85,6 @@
 //	char     pbget();
 };
 
+} // End of namespace Hugo
 
-} // end of namespace Hugo
 #endif //HUGO_FILE_H

Modified: scummvm/trunk/engines/hugo/global.h
===================================================================
--- scummvm/trunk/engines/hugo/global.h	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/global.h	2010-08-27 09:48:53 UTC (rev 52406)
@@ -51,5 +51,5 @@
 #define UIF_FILE   "uif.dat"
 
 static const int kSavegameVersion = 1;
-} // Namespace Hugo
 
+} // End of namespace Hugo

Modified: scummvm/trunk/engines/hugo/hugo.cpp
===================================================================
--- scummvm/trunk/engines/hugo/hugo.cpp	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/hugo.cpp	2010-08-27 09:48:53 UTC (rev 52406)
@@ -1442,5 +1442,4 @@
 	free(ptr);
 }
 
-
 } // End of namespace Hugo

Modified: scummvm/trunk/engines/hugo/intro.cpp
===================================================================
--- scummvm/trunk/engines/hugo/intro.cpp	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/intro.cpp	2010-08-27 09:48:53 UTC (rev 52406)
@@ -116,13 +116,13 @@
 		// Text boxes at various times
 		switch (introTicks) {
 		case 4:
-			Utils::Box(BOX_OK, _vm._textIntro[kIntro1]);
+			Utils::Box(BOX_OK, "%s", _vm._textIntro[kIntro1]);
 			break;
 		case 9:
-			Utils::Box(BOX_OK, _vm._textIntro[kIntro2]);
+			Utils::Box(BOX_OK, "%s", _vm._textIntro[kIntro2]);
 			break;
 		case 35:
-			Utils::Box(BOX_OK, _vm._textIntro[kIntro3]);
+			Utils::Box(BOX_OK, "%s", _vm._textIntro[kIntro3]);
 			break;
 		}
 	}
@@ -183,5 +183,4 @@
 	return true;
 }
 
-} // end of namespace Hugo
-
+} // End of namespace Hugo

Modified: scummvm/trunk/engines/hugo/intro.h
===================================================================
--- scummvm/trunk/engines/hugo/intro.h	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/intro.h	2010-08-27 09:48:53 UTC (rev 52406)
@@ -115,6 +115,6 @@
 	bool introPlay();
 };
 
+} // End of namespace Hugo
 
-} // Namespace Hugo
 #endif

Modified: scummvm/trunk/engines/hugo/inventory.h
===================================================================
--- scummvm/trunk/engines/hugo/inventory.h	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/inventory.h	2010-08-27 09:48:53 UTC (rev 52406)
@@ -51,5 +51,6 @@
 	void constructInventory(int16 imageTotNumb, int displayNumb, bool scrollFl, int16 firstObjId);
 };
 
-} // end of namespace Hugo
+} // End of namespace Hugo
+
 #endif // HUGO_INVENTORY_H

Modified: scummvm/trunk/engines/hugo/mouse.cpp
===================================================================
--- scummvm/trunk/engines/hugo/mouse.cpp	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/mouse.cpp	2010-08-27 09:48:53 UTC (rev 52406)
@@ -135,7 +135,7 @@
 				if (_vm._hero->cycling == INVISIBLE)    // If invisible do
 					_vm.useObject(objId);           // immediate use
 				else
-					Utils::Box(BOX_ANY, _vm._textMouse[kMsNoWayText]);      // Can't get there
+					Utils::Box(BOX_ANY, "%s", _vm._textMouse[kMsNoWayText]);      // Can't get there
 			}
 			break;
 		}
@@ -189,7 +189,7 @@
 				else if (_vm._hotspots[i].direction == Common::KEYCODE_LEFT)
 					x += HERO_MAX_WIDTH;
 				if (!_vm.route().startRoute(GO_EXIT, i, x, y))
-					Utils::Box(BOX_ANY, _vm._textMouse[kMsNoWayText]);      // Can't get there
+					Utils::Box(BOX_ANY, "%s", _vm._textMouse[kMsNoWayText]);      // Can't get there
 			}
 
 			// Get rid of any attached icon
@@ -218,7 +218,7 @@
 					if (_vm._hero->cycling == INVISIBLE)    // If invisible do
 						_vm.lookObject(obj);            // immediate decription
 					else
-						Utils::Box(BOX_ANY, _vm._textMouse[kMsNoWayText]);  // Can't get there
+						Utils::Box(BOX_ANY, "%s", _vm._textMouse[kMsNoWayText]);  // Can't get there
 				}
 				break;
 			}
@@ -308,4 +308,4 @@
 	gameStatus.rightButtonFl = false;
 }
 
-} // end of namespace Hugo
+} // End of namespace Hugo

Modified: scummvm/trunk/engines/hugo/mouse.h
===================================================================
--- scummvm/trunk/engines/hugo/mouse.h	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/mouse.h	2010-08-27 09:48:53 UTC (rev 52406)
@@ -49,5 +49,6 @@
 	void  processLeftClick(int16 objId, int16 cx, int16 cy);
 };
 
-} // end of namespace Hugo
+} // End of namespace Hugo
+
 #endif //HUGO_MOUSE_H

Modified: scummvm/trunk/engines/hugo/parser.cpp
===================================================================
--- scummvm/trunk/engines/hugo/parser.cpp	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/parser.cpp	2010-08-27 09:48:53 UTC (rev 52406)
@@ -304,7 +304,7 @@
 	// Special meta commands
 	// EXIT/QUIT
 	if (!strcmp("exit", _line) || strstr(_line, "quit")) {
-		Utils::Box(BOX_ANY, _vm._textParser[kTBExit]);
+		Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBExit]);
 		return;
 	}
 
@@ -362,7 +362,7 @@
 
 	// If a not-near comment was generated, print it
 	if (*farComment != '\0') {
-		Utils::Box(BOX_ANY, farComment);
+		Utils::Box(BOX_ANY, "%s", farComment);
 		return;
 	}
 
@@ -370,16 +370,16 @@
 	verb = findVerb(_line);
 	noun = findNoun(_line);
 	if (verb == _vm._arrayVerbs[_vm._look][0] && _maze.enabledFl) {
-		Utils::Box(BOX_ANY, _vm._textParser[kTBMaze]);
+		Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBMaze]);
 		showTakeables();
 	} else if (verb && noun)                          // A combination I didn't think of
-		Utils::Box(BOX_ANY, _vm._textParser[kTBNoPoint]);
+		Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBNoPoint]);
 	else if (noun)
-		Utils::Box(BOX_ANY, _vm._textParser[kTBNoun]);
+		Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBNoun]);
 	else if (verb)
-		Utils::Box(BOX_ANY, _vm._textParser[kTBVerb]);
+		Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBVerb]);
 	else
-		Utils::Box(BOX_ANY, _vm._textParser[kTBEh]);
+		Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBEh]);
 }
 
 // Search for matching verb/noun pairs in background command list
@@ -392,7 +392,7 @@
 		        isWordPresent(_vm._arrayNouns[obj[i].nounIndex]) &&
 		        ((obj[i].roomState == DONT_CARE) ||
 		         (obj[i].roomState == _vm._screenStates[*_vm._screen_p]))) {
-			Utils::Box(BOX_ANY, _vm.file().fetchString(obj[i].commentIndex));
+			Utils::Box(BOX_ANY, "%s", _vm.file().fetchString(obj[i].commentIndex));
 			_vm.scheduler().processBonus(obj[i].bonusIndex);
 			return true;
 		}
@@ -411,7 +411,7 @@
 		        (!obj[i].matchFl || !findNoun(line)) &&
 		        ((obj[i].roomState == DONT_CARE) ||
 		         (obj[i].roomState == _vm._screenStates[*_vm._screen_p]))) {
-			Utils::Box(BOX_ANY, _vm.file().fetchString(obj[i].commentIndex));
+			Utils::Box(BOX_ANY, "%s", _vm.file().fetchString(obj[i].commentIndex));
 			_vm.scheduler().processBonus(obj[i].bonusIndex);
 
 			// If this is LOOK (without a noun), show any takeable objects
@@ -524,8 +524,8 @@
 		if ((obj->cycling != INVISIBLE) &&
 		        (obj->screenIndex == *_vm._screen_p) &&
 		        (((TAKE & obj->genericCmd) == TAKE) || obj->objValue)) {
-			sprintf(_textBoxBuffer, "You can also see:\n%s.", _vm._arrayNouns[obj->nounIndex][LOOK_NAME]);
-			Utils::Box(BOX_ANY, _textBoxBuffer);
+//			sprintf(_textBoxBuffer, "You can also see:\n%s.", _vm._arrayNouns[obj->nounIndex][LOOK_NAME]);
+			Utils::Box(BOX_ANY, "You can also see:\n%s.", _vm._arrayNouns[obj->nounIndex][LOOK_NAME]);
 		}
 	}
 }
@@ -561,7 +561,7 @@
 	obj->y = _vm._hero->y + _vm._hero->currImagePtr->y2 - 1;
 	obj->y = (obj->y + obj->currImagePtr->y2 < YPIX) ? obj->y : YPIX - obj->currImagePtr->y2 - 10;
 	_vm.adjustScore(-obj->objValue);
-	Utils::Box(BOX_ANY, _vm._textParser[kTBOk]);
+	Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBOk]);
 }
 
 // Test whether command line contains one of the generic actions
@@ -575,35 +575,35 @@
 	if (isWordPresent(_vm._arrayVerbs[_vm._look]) && isNear(obj, _vm._arrayVerbs[_vm._look][0], comment)) {
 		// Test state-dependent look before general look
 		if ((obj->genericCmd & LOOK_S) == LOOK_S) {
-			Utils::Box(BOX_ANY, _vm._textData[obj->stateDataIndex[obj->state]]);
+			Utils::Box(BOX_ANY, "%s", _vm._textData[obj->stateDataIndex[obj->state]]);
 			warning("isGenericVerb: use of state dependant look - To be validated");
 		} else {
 			if ((LOOK & obj->genericCmd) == LOOK)
 				if (_vm._textData[obj->dataIndex])
-					Utils::Box(BOX_ANY, _vm._textData[obj->dataIndex]);
+					Utils::Box(BOX_ANY, "%s", _vm._textData[obj->dataIndex]);
 				else
 					return(false);
 			else
-				Utils::Box(BOX_ANY, _vm._textParser[kTBUnusual]);
+				Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBUnusual]);
 		}
 	} else if (isWordPresent(_vm._arrayVerbs[_vm._take]) && isNear(obj, _vm._arrayVerbs[_vm._take][0], comment)) {
 		if (obj->carriedFl)
-			Utils::Box(BOX_ANY, _vm._textParser[kTBHave]);
+			Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBHave]);
 		else if ((TAKE & obj->genericCmd) == TAKE)
 			takeObject(obj);
 		else if (obj->cmdIndex != 0)                // No comment if possible commands
 			return false;
 		else if (!obj->verbOnlyFl && (TAKE & obj->genericCmd) == TAKE)  // Make sure not taking object in context!
-			Utils::Box(BOX_ANY, _vm._textParser[kTBNoUse]);
+			Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBNoUse]);
 		else
 			return false;
 	} else if (isWordPresent(_vm._arrayVerbs[_vm._drop])) {
 		if (!obj->carriedFl && ((DROP & obj->genericCmd) == DROP))
-			Utils::Box(BOX_ANY, _vm._textParser[kTBDontHave]);
+			Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBDontHave]);
 		else if (obj->carriedFl && ((DROP & obj->genericCmd) == DROP))
 			dropObject(obj);
 		else if (obj->cmdIndex == 0)
-			Utils::Box(BOX_ANY, _vm._textParser[kTBNeed]);
+			Utils::Box(BOX_ANY, "%s", _vm._textParser[kTBNeed]);
 		else
 			return false;
 	} else                                  // It was not a generic cmd
@@ -656,21 +656,21 @@
 		reqs = _vm._arrayReqs[cmnd->reqIndex];      // ptr to list of required objects
 		for (i = 0; reqs[i]; i++)                   // for each obj
 			if (!isCarrying(reqs[i])) {
-				Utils::Box(BOX_ANY, _vm._textData[cmnd->textDataNoCarryIndex]);
+				Utils::Box(BOX_ANY, "%s", _vm._textData[cmnd->textDataNoCarryIndex]);
 				return true;
 			}
 	}
 
 	// Required objects are present, now check state is correct
 	if ((obj->state != cmnd->reqState) && (cmnd->reqState != DONT_CARE)) {
-		Utils::Box(BOX_ANY, _vm._textData[cmnd->textDataWrongIndex]);
+		Utils::Box(BOX_ANY, "%s", _vm._textData[cmnd->textDataWrongIndex]);
 		return true;
 	}
 
 	// Everything checked.  Change the state and carry out any actions
 	if (cmnd->reqState != DONT_CARE)                // Don't change new state if required state didn't care
 		obj->state = cmnd->newState;
-	Utils::Box(BOX_ANY, _vm._textData[cmnd->textDataDoneIndex]);
+	Utils::Box(BOX_ANY, "%s", _vm._textData[cmnd->textDataDoneIndex]);
 	_vm.scheduler().insertActionList(cmnd->actIndex);
 
 	// See if any additional generic actions
@@ -714,8 +714,7 @@
 		strcat(buffer, "\n");
 	strcat(buffer, _vm._textParser[kTBOutro]);
 
-	Utils::Box(BOX_ANY, buffer);
+	Utils::Box(BOX_ANY, "%s", buffer);
 }
 
-
-} // end of namespace Hugo
+} // End of namespace Hugo

Modified: scummvm/trunk/engines/hugo/parser.h
===================================================================
--- scummvm/trunk/engines/hugo/parser.h	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/parser.h	2010-08-27 09:48:53 UTC (rev 52406)
@@ -81,5 +81,6 @@
 	void  takeObject(object_t *obj);
 };
 
-} // end of namespace Hugo
+} // End of namespace Hugo
+
 #endif //HUGO_PARSER_H

Modified: scummvm/trunk/engines/hugo/route.cpp
===================================================================
--- scummvm/trunk/engines/hugo/route.cpp	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/route.cpp	2010-08-27 09:48:53 UTC (rev 52406)
@@ -469,4 +469,4 @@
 	return foundFl;
 }
 
-} // end of namespace Hugo
+} // End of namespace Hugo

Modified: scummvm/trunk/engines/hugo/route.h
===================================================================
--- scummvm/trunk/engines/hugo/route.h	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/route.h	2010-08-27 09:48:53 UTC (rev 52406)
@@ -80,5 +80,6 @@
 	Point *newNode();
 };
 
-} // end of namespace Hugo
+} // End of namespace Hugo
+
 #endif //HUGO_ROUTE_H

Modified: scummvm/trunk/engines/hugo/schedule.cpp
===================================================================
--- scummvm/trunk/engines/hugo/schedule.cpp	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/schedule.cpp	2010-08-27 09:48:53 UTC (rev 52406)
@@ -76,7 +76,7 @@
 	event_t *resEvent;
 
 	if (!_freeEvent)                                // Error: no more events available
-		Utils::Error(EVNT_ERR, "getQueue");
+		Utils::Error(EVNT_ERR, "%s", "getQueue");
 	resEvent = _freeEvent;
 	_freeEvent = _freeEvent->nextEvent;
 	resEvent->nextEvent = 0;
@@ -216,7 +216,7 @@
 		break;
 	case PROMPT:                                    // act3: Prompt user for key phrase
 // TODO : Add specific code for Hugo 1 DOS, which is handled differently,
-		response = Utils::Box(BOX_PROMPT, _vm.file().fetchString(action->a3.promptIndex));
+		response = Utils::Box(BOX_PROMPT, "%s", _vm.file().fetchString(action->a3.promptIndex));
 
 		warning("STUB: doAction(act3), expecting answer %s", response);
 
@@ -273,7 +273,7 @@
 			insertActionList(action->a11.actFailIndex);
 		break;
 	case TEXT:                                      // act12: Text box (CF WARN)
-		Utils::Box(BOX_ANY, _vm.file().fetchString(action->a12.stringIndex));   // Fetch string from file
+		Utils::Box(BOX_ANY, "%s", _vm.file().fetchString(action->a12.stringIndex));   // Fetch string from file
 		break;
 	case SWAP_IMAGES:                               // act13: Swap 2 object images
 		swapImages(action->a13.obj1, action->a13.obj2);
@@ -427,7 +427,7 @@
 			_vm.endGame();
 		break;
 	case WARN:                                      // act40: Text box (CF TEXT)
-		Utils::Box(BOX_OK, _vm.file().fetchString(action->a40.stringIndex));
+		Utils::Box(BOX_OK, "%s", _vm.file().fetchString(action->a40.stringIndex));
 		break;
 	case COND_BONUS:                                // act41: Perform action if got bonus
 		if (_vm._points[action->a41.BonusIndex].scoredFl)
@@ -436,11 +436,11 @@
 			insertActionList(action->a41.actFailIndex);
 		break;
 	case TEXT_TAKE:                                 // act42: Text box with "take" message
-		Utils::Box(BOX_ANY, TAKE_TEXT, _vm._arrayNouns[_vm._objects[action->a42.objNumb].nounIndex][TAKE_NAME]);
+		Utils::Box(BOX_ANY, "%s", TAKE_TEXT, _vm._arrayNouns[_vm._objects[action->a42.objNumb].nounIndex][TAKE_NAME]);
 		break;
 	case YESNO:                                     // act43: Prompt user for Yes or No
 		warning("doAction(act43) - Yes/No Box");
-		if (Utils::Box(BOX_YESNO, _vm.file().fetchString(action->a43.promptIndex)) != NULL)
+		if (Utils::Box(BOX_YESNO, "%s", _vm.file().fetchString(action->a43.promptIndex)) != NULL)
 			insertActionList(action->a43.actYesIndex);
 		else
 			insertActionList(action->a43.actNoIndex);
@@ -479,7 +479,7 @@
 		warning("STUB: doAction(act49)");
 		break;
 	default:
-		Utils::Error(EVNT_ERR, "doAction");
+		Utils::Error(EVNT_ERR, "%s", "doAction");
 		break;
 	}
 
@@ -537,7 +537,7 @@
 		char line[32];
 		if (!_vm.file().fileExists(strcat(strncat(strcpy(line, _vm._picDir), _vm._screenNames[screenIndex], NAME_LEN), BKGEXT)) &&
 		        !_vm.file().fileExists(strcat(strcpy(line, _vm._screenNames[screenIndex]), ".ART"))) {
-			Utils::Box(BOX_ANY, _vm._textSchedule[kSsNoBackground]);
+			Utils::Box(BOX_ANY, "%s", _vm._textSchedule[kSsNoBackground]);
 			return;
 		}
 	}
@@ -675,4 +675,4 @@
 	_vm._objects[objNumb1].y += _vm._objects[objNumb2].currImagePtr->y2 - _vm._objects[objNumb1].currImagePtr->y2;
 }
 
-} // end of namespace Hugo
+} // End of namespace Hugo

Modified: scummvm/trunk/engines/hugo/schedule.h
===================================================================
--- scummvm/trunk/engines/hugo/schedule.h	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/schedule.h	2010-08-27 09:48:53 UTC (rev 52406)
@@ -81,5 +81,6 @@
 	event_t *doAction(event_t *curEvent);
 };
 
-} // end of namespace Hugo
+} // End of namespace Hugo
+
 #endif //HUGO_SCHEDULE_H

Modified: scummvm/trunk/engines/hugo/sound.cpp
===================================================================
--- scummvm/trunk/engines/hugo/sound.cpp	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/sound.cpp	2010-08-27 09:48:53 UTC (rev 52406)
@@ -328,4 +328,4 @@
 	_midiPlayer->open();
 }
 
-} // end of namespace Hugo
+} // End of namespace Hugo

Modified: scummvm/trunk/engines/hugo/sound.h
===================================================================
--- scummvm/trunk/engines/hugo/sound.h	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/sound.h	2010-08-27 09:48:53 UTC (rev 52406)
@@ -60,5 +60,6 @@
 	void playMIDI(sound_pt seq_p, uint16 size);
 };
 
-} // end of namespace Hugo
+} // End of namespace Hugo
+
 #endif //HUGO_SOUND_H

Modified: scummvm/trunk/engines/hugo/util.cpp
===================================================================
--- scummvm/trunk/engines/hugo/util.cpp	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/util.cpp	2010-08-27 09:48:53 UTC (rev 52406)
@@ -182,4 +182,4 @@
 	warning("STUB: Gameover_msg(): %s", HugoEngine::get()._textUtil[kGameOver]);
 }
 
-} // end of namespace Hugo
+} // End of namespace Hugo

Modified: scummvm/trunk/engines/hugo/util.h
===================================================================
--- scummvm/trunk/engines/hugo/util.h	2010-08-27 07:11:31 UTC (rev 52405)
+++ scummvm/trunk/engines/hugo/util.h	2010-08-27 09:48:53 UTC (rev 52406)
@@ -53,11 +53,11 @@
 int      lastBit(byte data);
 void     reverseByte(byte *data);
 void     Warn(bool technote, const char *format, ...) GCC_PRINTF(2, 3);
-void     Error(int code, const char *format, ...); // FIXME  GCC_PRINTF(2, 3);
+void     Error(int code, const char *format, ...) GCC_PRINTF(2, 3);
 void     gameOverMsg();
-//	void     Debug_out(char *format, ...) GCC_PRINTF(1, 2);
-char    *Box(box_t, const char *, ...); // FIXME GCC_PRINTF(2, 3);
+char    *Box(box_t, const char *, ...) GCC_PRINTF(2, 3);
 }
 
-} // Namespace Hugo
+} // End of namespace Hugo
+
 #endif


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