Skip to content

Commit

Permalink
TOON: Reduce the scope of some more variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Feb 28, 2014
1 parent 4606453 commit c456b0e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
3 changes: 1 addition & 2 deletions engines/toon/detection.cpp
Expand Up @@ -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);
Expand Down
11 changes: 4 additions & 7 deletions engines/toon/toon.cpp
Expand Up @@ -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;
Expand All @@ -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");
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c456b0e

Please sign in to comment.