[Scummvm-cvs-logs] scummvm master -> c456b0e0e3f22333c0267692fe939b648e7a96c1

Strangerke Strangerke at scummvm.org
Fri Feb 28 23:41:12 CET 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c456b0e0e3 TOON: Reduce the scope of some more variables.


Commit: c456b0e0e3f22333c0267692fe939b648e7a96c1
    https://github.com/scummvm/scummvm/commit/c456b0e0e3f22333c0267692fe939b648e7a96c1
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-02-28T14:39:35-08:00

Commit Message:
TOON: Reduce the scope of some more variables.

Changed paths:
    engines/toon/detection.cpp
    engines/toon/toon.cpp



diff --git a/engines/toon/detection.cpp b/engines/toon/detection.cpp
index 7c6eae6..4f82514 100644
--- a/engines/toon/detection.cpp
+++ b/engines/toon/detection.cpp
@@ -179,10 +179,9 @@ SaveStateList ToonMetaEngine::listSaves(const char *target) const {
 	sort(filenames.begin(), filenames.end());   // Sort (hopefully ensuring we are sorted numerically..)
 
 	SaveStateList saveList;
-	int slotNum = 0;
 	for (Common::StringArray::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename) {
 		// Obtain the last 3 digits of the filename, since they correspond to the save slot
-		slotNum = atoi(filename->c_str() + filename->size() - 3);
+		int slotNum = atoi(filename->c_str() + filename->size() - 3);
 
 		if (slotNum >= 0 && slotNum <= 99) {
 			Common::InSaveFile *file = saveFileMan->openForLoading(*filename);
diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp
index 3671422..14e7d10 100644
--- a/engines/toon/toon.cpp
+++ b/engines/toon/toon.cpp
@@ -634,7 +634,6 @@ bool ToonEngine::showMainmenu(bool &loadedGame) {
 
 	bool doExit = false;
 	bool exitGame = false;
-	int clickingOn, clickRelease;
 	int menuMask = MAINMENUMASK_BASE;
 	Common::SeekableReadStream *mainmenuMusicFile = NULL;
 	AudioStreamInstance *mainmenuMusic = NULL;
@@ -644,8 +643,8 @@ bool ToonEngine::showMainmenu(bool &loadedGame) {
 	dirtyAllScreen();
 
 	while (!doExit) {
-		clickingOn = MAINMENUHOTSPOT_NONE;
-		clickRelease = false;
+		int clickingOn = MAINMENUHOTSPOT_NONE;
+		int clickRelease = false;
 
 		if (!musicPlaying) {
 			mainmenuMusicFile = resources()->openFile("BR091013.MUS");
@@ -4617,15 +4616,13 @@ void ToonEngine::unloadToonDat() {
 }
 
 char **ToonEngine::loadTextsVariants(Common::File &in) {
-	int  numTexts;
-	int  entryLen;
 	int  len;
 	char **res = 0;
 	char *pos = 0;
 
 	for (int varnt = 0; varnt < _numVariant; varnt++) {
-		numTexts = in.readUint16BE();
-		entryLen = in.readUint16BE();
+		int numTexts = in.readUint16BE();
+		int entryLen = in.readUint16BE();
 		pos = (char *)malloc(entryLen);
 		if (varnt == _gameVariant) {
 			res = (char **)malloc(sizeof(char *) * numTexts);






More information about the Scummvm-git-logs mailing list