diff options
author | Strangerke | 2015-11-27 23:18:15 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:33:43 +0100 |
commit | ff2def7da187c5160443fc6166728f1fc59ff66e (patch) | |
tree | ed3131ab4f1218e8f7b28d493254d34e1590ea92 /engines/lab/labfile.cpp | |
parent | b76a624c9ae59aac7df11ad5df7d39879d3344c8 (diff) | |
download | scummvm-rg350-ff2def7da187c5160443fc6166728f1fc59ff66e.tar.gz scummvm-rg350-ff2def7da187c5160443fc6166728f1fc59ff66e.tar.bz2 scummvm-rg350-ff2def7da187c5160443fc6166728f1fc59ff66e.zip |
LAB: Check all the 'for' loops, reduce the scope of variable accordingly
Diffstat (limited to 'engines/lab/labfile.cpp')
-rw-r--r-- | engines/lab/labfile.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/engines/lab/labfile.cpp b/engines/lab/labfile.cpp index 231c63ab67..fb6b17e759 100644 --- a/engines/lab/labfile.cpp +++ b/engines/lab/labfile.cpp @@ -86,16 +86,12 @@ static void *getCurMemLabFile(uint32 size) { ptr = MemPlace; MemPlace = (char *)MemPlace + size; - for (int counter = 0; counter < MAXMARKERS; counter++) { - if (FileMarkers[counter].name[0]) { - if (((FileMarkers[counter].Start >= ptr) && - (FileMarkers[counter].Start < MemPlace)) || - ((FileMarkers[counter].End >= ptr) && - (FileMarkers[counter].End < MemPlace)) || - ((ptr >= FileMarkers[counter].Start) && - (ptr <= FileMarkers[counter].End))) - - freeFile(counter); + for (int i = 0; i < MAXMARKERS; i++) { + if (FileMarkers[i].name[0]) { + if ( ((FileMarkers[i].Start >= ptr) && (FileMarkers[i].Start < MemPlace)) + || ((FileMarkers[i].End >= ptr) && (FileMarkers[i].End < MemPlace)) + || ((ptr >= FileMarkers[i].Start) && (ptr <= FileMarkers[i].End))) + freeFile(i); } } |