diff options
49 files changed, 289 insertions, 247 deletions
diff --git a/common/util.cpp b/common/util.cpp index 73e76fa94a..944d4fc192 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -85,9 +85,11 @@ bool StringTokenizer::empty() const { String StringTokenizer::nextToken() { // Seek to next token's start (i.e. jump over the delimiters before next token) - for (_tokenBegin = _tokenEnd; _tokenBegin < _str.size() && _delimiters.contains(_str[_tokenBegin]); _tokenBegin++); + for (_tokenBegin = _tokenEnd; _tokenBegin < _str.size() && _delimiters.contains(_str[_tokenBegin]); _tokenBegin++) + ; // Seek to the token's end (i.e. jump over the non-delimiters) - for (_tokenEnd = _tokenBegin; _tokenEnd < _str.size() && !_delimiters.contains(_str[_tokenEnd]); _tokenEnd++); + for (_tokenEnd = _tokenBegin; _tokenEnd < _str.size() && !_delimiters.contains(_str[_tokenEnd]); _tokenEnd++) + ; // Return the found token return String(_str.c_str() + _tokenBegin, _tokenEnd - _tokenBegin); } diff --git a/engines/agi/keyboard.cpp b/engines/agi/keyboard.cpp index a66ec12e3f..5525cfef99 100644 --- a/engines/agi/keyboard.cpp +++ b/engines/agi/keyboard.cpp @@ -289,7 +289,8 @@ void AgiEngine::handleKeys(int key) { _game.keypress = 0; /* Remove all leading spaces */ - for (p = _game.inputBuffer; *p && *p == 0x20; p++); + for (p = _game.inputBuffer; *p && *p == 0x20; p++) + ; /* Copy to internal buffer */ for (; *p; p++) { diff --git a/engines/agi/picture.cpp b/engines/agi/picture.cpp index 3ada698b79..01d66296b9 100644 --- a/engines/agi/picture.cpp +++ b/engines/agi/picture.cpp @@ -446,8 +446,7 @@ void PictureMgr::plotPattern(int x, int y) { circle_ptr = &circle_data[circle_list[pen_size]]; // SGEORGE : Fix v3 picture data for drawing circles. Manifests in goldrush - if(_pictureVersion == 3) - { + if (_pictureVersion == 3) { circle_data[1] = 0; circle_data[3] = 0; } diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp index da56db0493..8ebd24e6d9 100644 --- a/engines/agi/preagi_mickey.cpp +++ b/engines/agi/preagi_mickey.cpp @@ -974,10 +974,10 @@ bool Mickey::loadGame() { _game.nXtals = infile->readByte(); - for(i = 0; i < IDI_MSA_MAX_DAT; i++) + for (i = 0; i < IDI_MSA_MAX_DAT; i++) _game.iPlanetXtal[i] = infile->readByte(); - for(i = 0; i < IDI_MSA_MAX_PLANET; i++) + for (i = 0; i < IDI_MSA_MAX_PLANET; i++) _game.iClue[i] = infile->readUint16LE(); infile->read(_game.szAddr, IDI_MSA_MAX_BUTTON + 1); @@ -992,30 +992,30 @@ bool Mickey::loadGame() { _game.fTempleDoorOpen = infile->readByte() == 1; _game.fAnimXL30 = infile->readByte() == 1; - for(i = 0; i < IDI_MSA_MAX_ITEM; i++) + for (i = 0; i < IDI_MSA_MAX_ITEM; i++) _game.fItem[i] = infile->readByte() == 1; - for(i = 0; i < IDI_MSA_MAX_ITEM; i++) + for (i = 0; i < IDI_MSA_MAX_ITEM; i++) _game.fItemUsed[i] = infile->readByte() == 1; - for(i = 0; i < IDI_MSA_MAX_ITEM; i++) + for (i = 0; i < IDI_MSA_MAX_ITEM; i++) _game.iItem[i] = infile->readSByte(); _game.nItems = infile->readByte(); - for(i = 0; i < IDI_MSA_MAX_ROOM; i++) + for (i = 0; i < IDI_MSA_MAX_ROOM; i++) _game.iRmObj[i] = infile->readSByte(); - for(i = 0; i < IDI_MSA_MAX_ROOM; i++) + for (i = 0; i < IDI_MSA_MAX_ROOM; i++) _game.iRmPic[i] = infile->readByte(); - for(i = 0; i < IDI_MSA_MAX_ROOM; i++) + for (i = 0; i < IDI_MSA_MAX_ROOM; i++) _game.oRmTxt[i] = infile->readUint16LE(); - for(i = 0; i < IDI_MSA_MAX_ROOM; i++) + for (i = 0; i < IDI_MSA_MAX_ROOM; i++) _game.iRmMenu[i] = infile->readByte(); - for(i = 0; i < IDI_MSA_MAX_ROOM; i++) + for (i = 0; i < IDI_MSA_MAX_ROOM; i++) _game.nRmMenu[i] = infile->readByte(); _game.nFrame = infile->readSByte(); @@ -1079,10 +1079,10 @@ void Mickey::saveGame() { outfile->writeByte(_game.nXtals); - for(i = 0; i < IDI_MSA_MAX_DAT; i++) + for (i = 0; i < IDI_MSA_MAX_DAT; i++) outfile->writeByte(_game.iPlanetXtal[i]); - for(i = 0; i < IDI_MSA_MAX_PLANET; i++) + for (i = 0; i < IDI_MSA_MAX_PLANET; i++) outfile->writeUint16LE(_game.iClue[i]); outfile->write(_game.szAddr, IDI_MSA_MAX_BUTTON + 1); @@ -1097,30 +1097,30 @@ void Mickey::saveGame() { outfile->writeByte(_game.fTempleDoorOpen ? 1 : 0); outfile->writeByte(_game.fAnimXL30 ? 1 : 0); - for(i = 0; i < IDI_MSA_MAX_ITEM; i++) + for (i = 0; i < IDI_MSA_MAX_ITEM; i++) outfile->writeByte(_game.fItem[i] ? 1 : 0); - for(i = 0; i < IDI_MSA_MAX_ITEM; i++) + for (i = 0; i < IDI_MSA_MAX_ITEM; i++) outfile->writeByte(_game.fItemUsed[i] ? 1 : 0); - for(i = 0; i < IDI_MSA_MAX_ITEM; i++) + for (i = 0; i < IDI_MSA_MAX_ITEM; i++) outfile->writeSByte(_game.iItem[i]); outfile->writeByte(_game.nItems); - for(i = 0; i < IDI_MSA_MAX_ROOM; i++) + for (i = 0; i < IDI_MSA_MAX_ROOM; i++) outfile->writeSByte(_game.iRmObj[i]); - for(i = 0; i < IDI_MSA_MAX_ROOM; i++) + for (i = 0; i < IDI_MSA_MAX_ROOM; i++) outfile->writeByte(_game.iRmPic[i]); - for(i = 0; i < IDI_MSA_MAX_ROOM; i++) + for (i = 0; i < IDI_MSA_MAX_ROOM; i++) outfile->writeUint16LE(_game.oRmTxt[i]); - for(i = 0; i < IDI_MSA_MAX_ROOM; i++) + for (i = 0; i < IDI_MSA_MAX_ROOM; i++) outfile->writeByte(_game.iRmMenu[i]); - for(i = 0; i < IDI_MSA_MAX_ROOM; i++) + for (i = 0; i < IDI_MSA_MAX_ROOM; i++) outfile->writeByte(_game.nRmMenu[i]); outfile->writeSByte(_game.nFrame); diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp index c7a29b94af..ab9d59da3e 100644 --- a/engines/agi/preagi_winnie.cpp +++ b/engines/agi/preagi_winnie.cpp @@ -1150,13 +1150,13 @@ void Winnie::saveGame() { outfile->writeByte(_game.nObjRet); outfile->writeByte(_game.iObjHave); - for(i = 0; i < IDI_WTP_MAX_FLAG; i++) + for (i = 0; i < IDI_WTP_MAX_FLAG; i++) outfile->writeByte(_game.fGame[i]); - for(i = 0; i < IDI_WTP_MAX_OBJ_MISSING; i++) + for (i = 0; i < IDI_WTP_MAX_OBJ_MISSING; i++) outfile->writeByte(_game.iUsedObj[i]); - for(i = 0; i < IDI_WTP_MAX_ROOM_OBJ; i++) + for (i = 0; i < IDI_WTP_MAX_ROOM_OBJ; i++) outfile->writeByte(_game.iObjRoom[i]); outfile->finalize(); @@ -1216,13 +1216,13 @@ void Winnie::loadGame() { infile->readUint16LE(); // skip unused field } - for(i = 0; i < IDI_WTP_MAX_FLAG; i++) + for (i = 0; i < IDI_WTP_MAX_FLAG; i++) _game.fGame[i] = infile->readByte(); - for(i = 0; i < IDI_WTP_MAX_OBJ_MISSING; i++) + for (i = 0; i < IDI_WTP_MAX_OBJ_MISSING; i++) _game.iUsedObj[i] = infile->readByte(); - for(i = 0; i < IDI_WTP_MAX_ROOM_OBJ; i++) + for (i = 0; i < IDI_WTP_MAX_ROOM_OBJ; i++) _game.iObjRoom[i] = infile->readByte(); // Note that saved games from the original interpreter have 2 more 16-bit fields here diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp index 5dce7679b4..04cb9a579f 100644 --- a/engines/agi/sound.cpp +++ b/engines/agi/sound.cpp @@ -843,7 +843,8 @@ void SoundMgr::playSound() { if (!_playing) { if (_vm->_soundemu != SOUND_EMU_APPLE2GS) { - for (i = 0; i < NUM_CHANNELS; _chn[i++].vol = 0); + for (i = 0; i < NUM_CHANNELS; _chn[i++].vol = 0) + ; } if (_endflag != -1) diff --git a/engines/agi/sprite.cpp b/engines/agi/sprite.cpp index 2735809ac5..5ca0d5ca1e 100644 --- a/engines/agi/sprite.cpp +++ b/engines/agi/sprite.cpp @@ -105,8 +105,8 @@ void SpritesMgr::blitPixel(uint8 *p, uint8 *end, uint8 col, int spr, int width, if ((pr = *p & 0xf0) < 0x30) { uint8 *p1; /* Yes, get effective priority going down */ - for (p1 = p; p1 < end && (epr = *p1 & 0xf0) < 0x30; - p1 += width); + for (p1 = p; p1 < end && (epr = *p1 & 0xf0) < 0x30; p1 += width) + ; if (p1 >= end) epr = 0x40; } else { diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp index 853ede650e..ebce45ab2e 100644 --- a/engines/agi/text.cpp +++ b/engines/agi/text.cpp @@ -548,8 +548,8 @@ char *AgiEngine::agiSprintf(const char *s) { if (i == 99) { /* remove all leading 0 */ /* don't remove the 3rd zero if 000 */ - for (i = 0; - z[i] == '0' && i < 14; i++); + for (i = 0; z[i] == '0' && i < 14; i++) + ; } else { i = 15 - i; } diff --git a/engines/agi/words.cpp b/engines/agi/words.cpp index ed33b9463a..d3726731ca 100644 --- a/engines/agi/words.cpp +++ b/engines/agi/words.cpp @@ -193,7 +193,8 @@ void AgiEngine::dictionaryWords(char *msg) { } if (q != NULL) { - for (; (*q != 0 && *q != 0x20); q++); + for (; (*q != 0 && *q != 0x20); q++) + ; if (*q) { *q = 0; q++; diff --git a/engines/agos/string.cpp b/engines/agos/string.cpp index f4762d36ff..ee922299a2 100644 --- a/engines/agos/string.cpp +++ b/engines/agos/string.cpp @@ -80,7 +80,8 @@ byte *AGOSEngine::uncompressToken(byte a, byte *ptr) { } ptr1 = _byteTokenStrings; /* Find it */ while (count1--) { - while (*ptr1++); + while (*ptr1++) + ; } ptr1 = uncompressToken(b, ptr1); /* Try this one as a two byte token */ uncompressText(ptr1); /* Uncompress rest of this token */ @@ -88,7 +89,8 @@ byte *AGOSEngine::uncompressToken(byte a, byte *ptr) { } } while (count1--) { - while (*ptr2++); + while (*ptr2++) + ; } uncompressText(ptr2); } else { @@ -103,7 +105,8 @@ byte *AGOSEngine::uncompressToken(byte a, byte *ptr) { } ptr1 = _byteTokenStrings; while (count1--) { /* Is a byte token so count */ - while (*ptr1++); /* to start of token */ + while (*ptr1++) /* to start of token */ + ; } uncompressText(ptr1); /* and do it */ } @@ -183,7 +186,8 @@ void AGOSEngine::setupStringTable(byte *mem, int num) { _twoByteTokenStrings = mem; ct1 = i; while (*mem++) { - while (*mem++); + while (*mem++) + ; i--; if ((i == 0) && (ct1 != 0)) { _secondTwoByteTokenStrings = mem; @@ -194,10 +198,12 @@ void AGOSEngine::setupStringTable(byte *mem, int num) { _thirdTwoByteTokenStrings = mem; } _byteTokens = mem; - while (*mem++); + while (*mem++) + ; _byteTokenStrings = mem; while (*mem++) { - while(*mem++); + while (*mem++) + ; } i = 0; l1: _stringTabPtr[i++] = mem; @@ -206,14 +212,16 @@ l1: _stringTabPtr[i++] = mem; _stringTabPos = i; return; } - while (*mem++); + while (*mem++) + ; goto l1; } else { for (;;) { _stringTabPtr[i++] = mem; if (--num == 0) break; - for (; *mem; mem++); + for (; *mem; mem++) + ; mem++; } @@ -227,7 +235,8 @@ void AGOSEngine::setupLocalStringTable(byte *mem, int num) { _localStringtable[i++] = mem; if (--num == 0) break; - for (; *mem; mem++); + for (; *mem; mem++) + ; mem++; } } diff --git a/engines/cine/anim.cpp b/engines/cine/anim.cpp index 11ea4ea25c..049f22e7cf 100644 --- a/engines/cine/anim.cpp +++ b/engines/cine/anim.cpp @@ -208,7 +208,7 @@ AnimData::AnimData(const AnimData &src) : _width(src._width), memcpy(_data, src._data, _size*sizeof(byte)); } - if(src._mask) { + if (src._mask) { _mask = new byte[_size]; assert(_mask); memcpy(_mask, src._mask, _size*sizeof(byte)); diff --git a/engines/cine/script_fw.cpp b/engines/cine/script_fw.cpp index f594596e6d..e90dd6f151 100644 --- a/engines/cine/script_fw.cpp +++ b/engines/cine/script_fw.cpp @@ -428,7 +428,8 @@ int RawScript::getNextLabel(const FWScriptInfo &info, int offset) const { case 'l': // label return pos; case 's': // string - while (_data[pos++] != 0); + while (_data[pos++] != 0) + ; break; case 'x': // exit script return -pos-1; diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index a8e38f2143..b30cdceb70 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -70,7 +70,8 @@ void drawInfoStringSmallBlackBox(uint8 *string) { flipScreen(); - while (1); + while (1) + ; } void loadPakedFileToMem(int fileIdx, uint8 *buffer) { diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp index 5d4bc54e1d..b289e32855 100644 --- a/engines/cruise/saveload.cpp +++ b/engines/cruise/saveload.cpp @@ -851,7 +851,8 @@ int loadSavegameData(int saveGameIdx) { int j; int k; - for (j = i + 1; j < 257 && filesDatabase[j].subData.ptr && !strcmp(filesDatabase[i].subData.name, filesDatabase[j].subData.name) && (filesDatabase[j].subData.index == (j - i)); j++); + for (j = i + 1; j < 257 && filesDatabase[j].subData.ptr && !strcmp(filesDatabase[i].subData.name, filesDatabase[j].subData.name) && (filesDatabase[j].subData.index == (j - i)); j++) + ; for (k = i; k < j; k++) { if (filesDatabase[k].subData.ptrMask) diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp index 7aa4af059d..33ee526785 100644 --- a/engines/drascula/rooms.cpp +++ b/engines/drascula/rooms.cpp @@ -565,11 +565,11 @@ bool DrasculaEngine::room_21(int fl) { toggleDoor(0, 1, kOpenDoor); else if (pickedObject == kVerbClose && fl == 101) toggleDoor(0, 1, kCloseDoor); - else if(pickedObject == kVerbPick && fl == 141) { + else if (pickedObject == kVerbPick && fl == 141) { pickObject(19); visible[2] = 0; flags[10] = 1; - } else if(pickedObject == 7 && fl == 101) { + } else if (pickedObject == 7 && fl == 101) { flags[28] = 1; toggleDoor(0, 1, kOpenDoor); selectVerb(0); @@ -616,14 +616,14 @@ bool DrasculaEngine::room_23(int fl) { if (pickedObject == kVerbOpen && fl == 103) { toggleDoor(0, 0, kOpenDoor); updateVisible(); - } else if(pickedObject == kVerbClose && fl == 103) { + } else if (pickedObject == kVerbClose && fl == 103) { toggleDoor(0, 0, kCloseDoor); updateVisible(); - } else if(pickedObject == kVerbOpen && fl == 104) + } else if (pickedObject == kVerbOpen && fl == 104) toggleDoor(1, 1, kOpenDoor); - else if(pickedObject == kVerbClose && fl == 104) + else if (pickedObject == kVerbClose && fl == 104) toggleDoor(1, 1, kCloseDoor); - else if(pickedObject == kVerbPick && fl == 142) { + else if (pickedObject == kVerbPick && fl == 142) { pickObject(8); visible[2] = 0; flags[11] = 1; diff --git a/engines/drascula/talk.cpp b/engines/drascula/talk.cpp index 8fc52a18b5..7c94938c9b 100644 --- a/engines/drascula/talk.cpp +++ b/engines/drascula/talk.cpp @@ -943,7 +943,8 @@ void DrasculaEngine::grr() { updateScreen(); - while (!isTalkFinished()); + while (!isTalkFinished()) + ; updateRoom(); updateScreen(); diff --git a/engines/gob/game_v1.cpp b/engines/gob/game_v1.cpp index 701b4e82e7..4d392e4ce6 100644 --- a/engines/gob/game_v1.cpp +++ b/engines/gob/game_v1.cpp @@ -317,7 +317,8 @@ void Game_v1::popCollisions(void) { debugC(1, kDebugCollisions, "popCollision"); _collStackSize--; - for (destPtr = _collisionAreas; destPtr->left != 0xFFFF; destPtr++); + for (destPtr = _collisionAreas; destPtr->left != 0xFFFF; destPtr++) + ; srcPtr = _collStack[_collStackSize]; memcpy(destPtr, srcPtr, @@ -1429,7 +1430,8 @@ int16 Game_v1::inputArea(int16 xPos, int16 yPos, int16 width, int16 height, if (_vm->_global->_pressedKeys[1] == 0) continue; - while (_vm->_global->_pressedKeys[1] != 0); + while (_vm->_global->_pressedKeys[1] != 0) + ; continue; default: diff --git a/engines/gob/game_v2.cpp b/engines/gob/game_v2.cpp index ce145cd725..91996c15ab 100644 --- a/engines/gob/game_v2.cpp +++ b/engines/gob/game_v2.cpp @@ -398,7 +398,8 @@ void Game_v2::popCollisions(void) { _lastCollId = _collLasts[_collStackSize].id; _lastCollAreaIndex = _collLasts[_collStackSize].areaIndex; - for (destPtr = _collisionAreas; destPtr->left != 0xFFFF; destPtr++); + for (destPtr = _collisionAreas; destPtr->left != 0xFFFF; destPtr++) + ; srcPtr = _collStack[_collStackSize]; memcpy(destPtr, srcPtr, @@ -1583,7 +1584,8 @@ int16 Game_v2::inputArea(int16 xPos, int16 yPos, int16 width, int16 height, else handleMouse = 0; - while (_vm->_global->_pressedKeys[1] != 0); + while (_vm->_global->_pressedKeys[1] != 0) + ; continue; default: diff --git a/engines/gob/goblin.cpp b/engines/gob/goblin.cpp index 55758cdfdc..81671b8247 100644 --- a/engines/gob/goblin.cpp +++ b/engines/gob/goblin.cpp @@ -659,7 +659,8 @@ void Goblin::adjustDest(int16 posX, int16 posY) { resDeltaPix = 0; for (i = 1; (i <= _pressedMapX) && - (_vm->_map->getPass(_pressedMapX - i, _pressedMapY) == 0); i++); + (_vm->_map->getPass(_pressedMapX - i, _pressedMapY) == 0); i++) + ; if (i <= _pressedMapX) { resDeltaPix = (i - 1) * 12 + (posX % 12) + 1; @@ -667,7 +668,8 @@ void Goblin::adjustDest(int16 posX, int16 posY) { } for (i = 1; ((i + _pressedMapX) < _vm->_map->_mapWidth) && - (_vm->_map->getPass(_pressedMapX + i, _pressedMapY) == 0); i++); + (_vm->_map->getPass(_pressedMapX + i, _pressedMapY) == 0); i++) + ; if ((_pressedMapX + i) < _vm->_map->_mapWidth) { deltaPix = (i * 12) - (posX % 12); @@ -679,7 +681,8 @@ void Goblin::adjustDest(int16 posX, int16 posY) { } for (i = 1; ((i + _pressedMapY) < _vm->_map->_mapHeight) && - (_vm->_map->getPass(_pressedMapX, _pressedMapY + i) == 0); i++); + (_vm->_map->getPass(_pressedMapX, _pressedMapY + i) == 0); i++) + ; if ((_pressedMapY + i) < _vm->_map->_mapHeight) { deltaPix = (i * 6) - (posY % 6); @@ -691,7 +694,8 @@ void Goblin::adjustDest(int16 posX, int16 posY) { } for (i = 1; (i <= _pressedMapY) && - (_vm->_map->getPass(_pressedMapX, _pressedMapY - i) == 0); i++); + (_vm->_map->getPass(_pressedMapX, _pressedMapY - i) == 0); i++) + ; if (i <= _pressedMapY) { deltaPix = (i * 6) + (posY % 6); diff --git a/engines/gob/indeo3.cpp b/engines/gob/indeo3.cpp index cae66e4a5b..e7cd4aa594 100644 --- a/engines/gob/indeo3.cpp +++ b/engines/gob/indeo3.cpp @@ -169,11 +169,11 @@ void Indeo3::allocFrames() { offs += (chroma_pixels + chroma_width); _iv_frame[1].Vbuf = _iv_frame[0].the_buf + offs; - for(int i = 1; i <= luma_width; i++) + for (int i = 1; i <= luma_width; i++) _iv_frame[0].Ybuf[-i] = _iv_frame[1].Ybuf[-i] = _iv_frame[0].Ubuf[-i] = 0x80; - for(int i = 1; i <= chroma_width; i++) { + for (int i = 1; i <= chroma_width; i++) { _iv_frame[1].Ubuf[-i] = 0x80; _iv_frame[0].Vbuf[-i] = 0x80; _iv_frame[1].Vbuf[-i] = 0x80; @@ -207,7 +207,7 @@ bool Indeo3::decompressFrame(byte *inData, uint32 dataLen, uint8 flags2 = frame.readByte(); // Finding the reference frame - if(flags1 & 0x200) { + if (flags1 & 0x200) { _cur_frame = _iv_frame + 1; _ref_frame = _iv_frame; } else { @@ -353,8 +353,8 @@ typedef struct { /* ---------------------------------------------------------------------- */ #define LV1_CHECK(buf1,rle_v3,lv1,lp2) \ - if((lv1 & 0x80) != 0) { \ - if(rle_v3 != 0) \ + if ((lv1 & 0x80) != 0) { \ + if (rle_v3 != 0) \ rle_v3 = 0; \ else { \ rle_v3 = 1; \ @@ -365,10 +365,10 @@ typedef struct { #define RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3) \ - if(rle_v3 == 0) { \ + if (rle_v3 == 0) { \ rle_v2 = *buf1; \ rle_v1 = 1; \ - if(rle_v2 > 32) { \ + if (rle_v2 > 32) { \ rle_v2 -= 32; \ rle_v1 = 0; \ } \ @@ -378,7 +378,7 @@ typedef struct { #define LP2_CHECK(buf1,rle_v3,lp2) \ - if(lp2 == 0 && rle_v3 != 0) \ + if (lp2 == 0 && rle_v3 != 0) \ rle_v3 = 0; \ else { \ buf1--; \ @@ -388,7 +388,7 @@ typedef struct { #define RLE_V2_CHECK(buf1,rle_v2, rle_v3,lp2) \ rle_v2--; \ - if(rle_v2 == 0) { \ + if (rle_v2 == 0) { \ rle_v3 = 0; \ buf1 += 2; \ } \ @@ -417,15 +417,17 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, width_tbl = width_tbl_arr + 1; i = (width < 0 ? width + 3 : width)/4; - for(j = -1; j < 8; j++) + for (j = -1; j < 8; j++) width_tbl[j] = i * j; strip = strip_tbl; - for(region_160_width = 0; region_160_width < (width - min_width_160); region_160_width += min_width_160); + for (region_160_width = 0; region_160_width < (width - min_width_160); region_160_width += min_width_160) + ; strip->ypos = strip->xpos = 0; - for(strip->width = min_width_160; width > strip->width; strip->width *= 2); + for (strip->width = min_width_160; width > strip->width; strip->width *= 2) + ; strip->height = height; strip->split_direction = 0; strip->split_flag = 0; @@ -435,8 +437,8 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, rle_v1 = rle_v2 = rle_v3 = 0; - while(strip >= strip_tbl) { - if(bit_pos <= 0) { + while (strip >= strip_tbl) { + if (bit_pos <= 0) { bit_pos = 8; bit_buf = *buf1++; } @@ -444,28 +446,28 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, bit_pos -= 2; cmd = (bit_buf >> bit_pos) & 0x03; - if(cmd == 0) { + if (cmd == 0) { strip++; memcpy(strip, strip-1, sizeof(ustr_t)); strip->split_flag = 1; strip->split_direction = 0; strip->height = (strip->height > 8 ? ((strip->height+8)>>4)<<3 : 4); continue; - } else if(cmd == 1) { + } else if (cmd == 1) { strip++; memcpy(strip, strip-1, sizeof(ustr_t)); strip->split_flag = 1; strip->split_direction = 1; strip->width = (strip->width > 8 ? ((strip->width+8)>>4)<<3 : 4); continue; - } else if(cmd == 2) { - if(strip->usl7 == 0) { + } else if (cmd == 2) { + if (strip->usl7 == 0) { strip->usl7 = 1; ref_vectors = NULL; continue; } - } else if(cmd == 3) { - if(strip->usl7 == 0) { + } else if (cmd == 3) { + if (strip->usl7 == 0) { strip->usl7 = 1; ref_vectors = (const signed char*)buf2 + (*buf1 * 2); buf1++; @@ -475,19 +477,19 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, cur_frm_pos = cur + width * strip->ypos + strip->xpos; - if((blks_width = strip->width) < 0) + if ((blks_width = strip->width) < 0) blks_width += 3; blks_width >>= 2; blks_height = strip->height; - if(ref_vectors != NULL) { + if (ref_vectors != NULL) { ref_frm_pos = ref + (ref_vectors[0] + strip->ypos) * width + ref_vectors[1] + strip->xpos; } else ref_frm_pos = cur_frm_pos - width_tbl[4]; - if(cmd == 2) { - if(bit_pos <= 0) { + if (cmd == 2) { + if (bit_pos <= 0) { bit_pos = 8; bit_buf = *buf1++; } @@ -495,14 +497,14 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, bit_pos -= 2; cmd = (bit_buf >> bit_pos) & 0x03; - if(cmd == 0 || ref_vectors != NULL) { - for(lp1 = 0; lp1 < blks_width; lp1++) { - for(i = 0, j = 0; i < blks_height; i++, j += width_tbl[1]) + if (cmd == 0 || ref_vectors != NULL) { + for (lp1 = 0; lp1 < blks_width; lp1++) { + for (i = 0, j = 0; i < blks_height; i++, j += width_tbl[1]) ((uint32 *)cur_frm_pos)[j] = ((uint32 *)ref_frm_pos)[j]; cur_frm_pos += 4; ref_frm_pos += 4; } - } else if(cmd != 1) + } else if (cmd != 1) return; } else { k = *buf1 >> 4; @@ -510,16 +512,16 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, buf1++; lv = j + fflags2; - if((lv - 8) <= 7 && (k == 0 || k == 3 || k == 10)) { + if ((lv - 8) <= 7 && (k == 0 || k == 3 || k == 10)) { cp2 = _ModPred + ((lv - 8) << 7); cp = ref_frm_pos; - for(i = 0; i < blks_width << 2; i++) { + for (i = 0; i < blks_width << 2; i++) { int v = *cp >> 1; *(cp++) = cp2[v]; } } - if(k == 1 || k == 4) { + if (k == 1 || k == 4) { lv = (hdr[j] & 0xf) + fflags2; correction_type_sp[0] = _corrector_type + (lv << 8); correction_lp[0] = correction + (lv << 8); @@ -536,9 +538,9 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, switch(k) { case 1: case 0: /********** CASE 0 **********/ - for( ; blks_height > 0; blks_height -= 4) { - for(lp1 = 0; lp1 < blks_width; lp1++) { - for(lp2 = 0; lp2 < 4; ) { + for ( ; blks_height > 0; blks_height -= 4) { + for (lp1 = 0; lp1 < blks_width; lp1++) { + for (lp2 = 0; lp2 < 4; ) { k = *buf1++; cur_lp = ((uint32 *)cur_frm_pos) + width_tbl[lp2]; ref_lp = ((uint32 *)ref_frm_pos) + width_tbl[lp2]; @@ -557,25 +559,25 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, lp2++; break; case 2: - if(lp2 == 0) { - for(i = 0, j = 0; i < 2; i++, j += width_tbl[1]) + if (lp2 == 0) { + for (i = 0, j = 0; i < 2; i++, j += width_tbl[1]) cur_lp[j] = ref_lp[j]; lp2 += 2; } break; case 3: - if(lp2 < 2) { - for(i = 0, j = 0; i < (3 - lp2); i++, j += width_tbl[1]) + if (lp2 < 2) { + for (i = 0, j = 0; i < (3 - lp2); i++, j += width_tbl[1]) cur_lp[j] = ref_lp[j]; lp2 = 3; } break; case 8: - if(lp2 == 0) { + if (lp2 == 0) { RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3) - if(rle_v1 == 1 || ref_vectors != NULL) { - for(i = 0, j = 0; i < 4; i++, j += width_tbl[1]) + if (rle_v1 == 1 || ref_vectors != NULL) { + for (i = 0, j = 0; i < 4; i++, j += width_tbl[1]) cur_lp[j] = ref_lp[j]; } @@ -588,21 +590,21 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, case 5: LP2_CHECK(buf1,rle_v3,lp2) case 4: - for(i = 0, j = 0; i < (4 - lp2); i++, j += width_tbl[1]) + for (i = 0, j = 0; i < (4 - lp2); i++, j += width_tbl[1]) cur_lp[j] = ref_lp[j]; lp2 = 4; break; case 7: - if(rle_v3 != 0) + if (rle_v3 != 0) rle_v3 = 0; else { buf1--; rle_v3 = 1; } case 6: - if(ref_vectors != NULL) { - for(i = 0, j = 0; i < 4; i++, j += width_tbl[1]) + if (ref_vectors != NULL) { + for (i = 0, j = 0; i < 4; i++, j += width_tbl[1]) cur_lp[j] = ref_lp[j]; } lp2 = 4; @@ -613,7 +615,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, lv = (lv1 & 0x7F) << 1; lv += (lv << 8); lv += (lv << 16); - for(i = 0, j = 0; i < 4; i++, j += width_tbl[1]) + for (i = 0, j = 0; i < 4; i++, j += width_tbl[1]) cur_lp[j] = lv; LV1_CHECK(buf1,rle_v3,lv1,lp2) @@ -634,13 +636,13 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, case 4: case 3: /********** CASE 3 **********/ - if(ref_vectors != NULL) + if (ref_vectors != NULL) return; flag1 = 1; - for( ; blks_height > 0; blks_height -= 8) { - for(lp1 = 0; lp1 < blks_width; lp1++) { - for(lp2 = 0; lp2 < 4; ) { + for ( ; blks_height > 0; blks_height -= 8) { + for (lp1 = 0; lp1 < blks_width; lp1++) { + for (lp2 = 0; lp2 < 4; ) { k = *buf1++; cur_lp = ((uint32 *)cur_frm_pos) + width_tbl[lp2 * 2]; @@ -649,7 +651,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, switch(correction_type_sp[lp2 & 0x01][k]) { case 0: cur_lp[width_tbl[1]] = FROM_LE_32(((FROM_LE_32(*ref_lp) >> 1) + correction_lp[lp2 & 0x01][k]) << 1); - if(lp2 > 0 || flag1 == 0 || strip->ypos != 0) + if (lp2 > 0 || flag1 == 0 || strip->ypos != 0) cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE; else cur_lp[0] = FROM_LE_32(((FROM_LE_32(*ref_lp) >> 1) + correction_lp[lp2 & 0x01][k]) << 1); @@ -662,7 +664,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, res = ((FROM_LE_16(((uint16 *)ref_lp)[1]) >> 1) + correction_lp[lp2 & 0x01][k]) << 1; ((uint16 *)cur_lp)[width_tbl[2]+1] = FROM_LE_16(res); - if(lp2 > 0 || flag1 == 0 || strip->ypos != 0) + if (lp2 > 0 || flag1 == 0 || strip->ypos != 0) cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE; else cur_lp[0] = cur_lp[width_tbl[1]]; @@ -671,16 +673,16 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, break; case 2: - if(lp2 == 0) { - for(i = 0, j = 0; i < 4; i++, j += width_tbl[1]) + if (lp2 == 0) { + for (i = 0, j = 0; i < 4; i++, j += width_tbl[1]) cur_lp[j] = *ref_lp; lp2 += 2; } break; case 3: - if(lp2 < 2) { - for(i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1]) + if (lp2 < 2) { + for (i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1]) cur_lp[j] = *ref_lp; lp2 = 3; } @@ -691,7 +693,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, break; case 7: - if(rle_v3 != 0) + if (rle_v3 != 0) rle_v3 = 0; else { buf1--; @@ -701,11 +703,11 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, break; case 8: - if(lp2 == 0) { + if (lp2 == 0) { RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3) - if(rle_v1 == 1) { - for(i = 0, j = 0; i < 8; i++, j += width_tbl[1]) + if (rle_v1 == 1) { + for (i = 0, j = 0; i < 8; i++, j += width_tbl[1]) cur_lp[j] = ref_lp[j]; } @@ -718,7 +720,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, case 5: LP2_CHECK(buf1,rle_v3,lp2) case 4: - for(i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1]) + for (i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1]) cur_lp[j] = *ref_lp; lp2 = 4; break; @@ -730,7 +732,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, lv += (lv << 8); lv += (lv << 16); - for(i = 0, j = 0; i < 4; i++, j += width_tbl[1]) + for (i = 0, j = 0; i < 4; i++, j += width_tbl[1]) cur_lp[j] = lv; LV1_CHECK(buf1,rle_v3,lv1,lp2) @@ -750,18 +752,18 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, break; case 10: /********** CASE 10 **********/ - if(ref_vectors == NULL) { + if (ref_vectors == NULL) { flag1 = 1; - for( ; blks_height > 0; blks_height -= 8) { - for(lp1 = 0; lp1 < blks_width; lp1 += 2) { - for(lp2 = 0; lp2 < 4; ) { + for ( ; blks_height > 0; blks_height -= 8) { + for (lp1 = 0; lp1 < blks_width; lp1 += 2) { + for (lp2 = 0; lp2 < 4; ) { k = *buf1++; cur_lp = ((uint32 *)cur_frm_pos) + width_tbl[lp2 * 2]; ref_lp = ((uint32 *)cur_frm_pos) + width_tbl[(lp2 * 2) - 1]; lv1 = ref_lp[0]; lv2 = ref_lp[1]; - if(lp2 == 0 && flag1 != 0) { + if (lp2 == 0 && flag1 != 0) { #if defined(SCUMM_BIG_ENDIAN) lv1 = lv1 & 0xFF00FF00; lv1 = (lv1 >> 8) | lv1; @@ -779,7 +781,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, case 0: cur_lp[width_tbl[1]] = FROM_LE_32(((FROM_LE_32(lv1) >> 1) + correctionloworder_lp[lp2 & 0x01][k]) << 1); cur_lp[width_tbl[1]+1] = FROM_LE_32(((FROM_LE_32(lv2) >> 1) + correctionhighorder_lp[lp2 & 0x01][k]) << 1); - if(lp2 > 0 || strip->ypos != 0 || flag1 == 0) { + if (lp2 > 0 || strip->ypos != 0 || flag1 == 0) { cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE; cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE; } else { @@ -792,7 +794,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, case 1: cur_lp[width_tbl[1]] = FROM_LE_32(((FROM_LE_32(lv1) >> 1) + correctionloworder_lp[lp2 & 0x01][*buf1]) << 1); cur_lp[width_tbl[1]+1] = FROM_LE_32(((FROM_LE_32(lv2) >> 1) + correctionloworder_lp[lp2 & 0x01][k]) << 1); - if(lp2 > 0 || strip->ypos != 0 || flag1 == 0) { + if (lp2 > 0 || strip->ypos != 0 || flag1 == 0) { cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE; cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE; } else { @@ -804,16 +806,16 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, break; case 2: - if(lp2 == 0) { - if(flag1 != 0) { - for(i = 0, j = width_tbl[1]; i < 3; i++, j += width_tbl[1]) { + if (lp2 == 0) { + if (flag1 != 0) { + for (i = 0, j = width_tbl[1]; i < 3; i++, j += width_tbl[1]) { cur_lp[j] = lv1; cur_lp[j+1] = lv2; } cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE; cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE; } else { - for(i = 0, j = 0; i < 4; i++, j += width_tbl[1]) { + for (i = 0, j = 0; i < 4; i++, j += width_tbl[1]) { cur_lp[j] = lv1; cur_lp[j+1] = lv2; } @@ -823,16 +825,16 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, break; case 3: - if(lp2 < 2) { - if(lp2 == 0 && flag1 != 0) { - for(i = 0, j = width_tbl[1]; i < 5; i++, j += width_tbl[1]) { + if (lp2 < 2) { + if (lp2 == 0 && flag1 != 0) { + for (i = 0, j = width_tbl[1]; i < 5; i++, j += width_tbl[1]) { cur_lp[j] = lv1; cur_lp[j+1] = lv2; } cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE; cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE; } else { - for(i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1]) { + for (i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1]) { cur_lp[j] = lv1; cur_lp[j+1] = lv2; } @@ -842,18 +844,18 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, break; case 8: - if(lp2 == 0) { + if (lp2 == 0) { RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3) - if(rle_v1 == 1) { - if(flag1 != 0) { - for(i = 0, j = width_tbl[1]; i < 7; i++, j += width_tbl[1]) { + if (rle_v1 == 1) { + if (flag1 != 0) { + for (i = 0, j = width_tbl[1]; i < 7; i++, j += width_tbl[1]) { cur_lp[j] = lv1; cur_lp[j+1] = lv2; } cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE; cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE; } else { - for(i = 0, j = 0; i < 8; i++, j += width_tbl[1]) { + for (i = 0, j = 0; i < 8; i++, j += width_tbl[1]) { cur_lp[j] = lv1; cur_lp[j+1] = lv2; } @@ -868,15 +870,15 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, case 5: LP2_CHECK(buf1,rle_v3,lp2) case 4: - if(lp2 == 0 && flag1 != 0) { - for(i = 0, j = width_tbl[1]; i < 7; i++, j += width_tbl[1]) { + if (lp2 == 0 && flag1 != 0) { + for (i = 0, j = width_tbl[1]; i < 7; i++, j += width_tbl[1]) { cur_lp[j] = lv1; cur_lp[j+1] = lv2; } cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE; cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE; } else { - for(i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1]) { + for (i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1]) { cur_lp[j] = lv1; cur_lp[j+1] = lv2; } @@ -889,8 +891,8 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, break; case 7: - if(lp2 == 0) { - if(rle_v3 != 0) + if (lp2 == 0) { + if (rle_v3 != 0) rle_v3 = 0; else { buf1--; @@ -906,7 +908,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, lv = (lv1 & 0x7F) << 1; lv += (lv << 8); lv += (lv << 16); - for(i = 0, j = 0; i < 8; i++, j += width_tbl[1]) + for (i = 0, j = 0; i < 8; i++, j += width_tbl[1]) cur_lp[j] = lv; LV1_CHECK(buf1,rle_v3,lv1,lp2) break; @@ -923,9 +925,9 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, flag1 = 0; } } else { - for( ; blks_height > 0; blks_height -= 8) { - for(lp1 = 0; lp1 < blks_width; lp1 += 2) { - for(lp2 = 0; lp2 < 4; ) { + for ( ; blks_height > 0; blks_height -= 8) { + for (lp1 = 0; lp1 < blks_width; lp1 += 2) { + for (lp2 = 0; lp2 < 4; ) { k = *buf1++; cur_lp = ((uint32 *)cur_frm_pos) + width_tbl[lp2 * 2]; ref_lp = ((uint32 *)ref_frm_pos) + width_tbl[lp2 * 2]; @@ -952,8 +954,8 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, break; case 2: - if(lp2 == 0) { - for(i = 0, j = 0; i < 4; i++, j += width_tbl[1]) { + if (lp2 == 0) { + for (i = 0, j = 0; i < 4; i++, j += width_tbl[1]) { cur_lp[j] = ref_lp[j]; cur_lp[j+1] = ref_lp[j+1]; } @@ -962,8 +964,8 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, break; case 3: - if(lp2 < 2) { - for(i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1]) { + if (lp2 < 2) { + for (i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1]) { cur_lp[j] = ref_lp[j]; cur_lp[j+1] = ref_lp[j+1]; } @@ -972,9 +974,9 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, break; case 8: - if(lp2 == 0) { + if (lp2 == 0) { RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3) - for(i = 0, j = 0; i < 8; i++, j += width_tbl[1]) { + for (i = 0, j = 0; i < 8; i++, j += width_tbl[1]) { ((uint32 *)cur_frm_pos)[j] = ((uint32 *)ref_frm_pos)[j]; ((uint32 *)cur_frm_pos)[j+1] = ((uint32 *)ref_frm_pos)[j+1]; } @@ -989,7 +991,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, LP2_CHECK(buf1,rle_v3,lp2) case 6: case 4: - for(i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1]) { + for (i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1]) { cur_lp[j] = ref_lp[j]; cur_lp[j+1] = ref_lp[j+1]; } @@ -1002,7 +1004,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, lv = (lv1 & 0x7F) << 1; lv += (lv << 8); lv += (lv << 16); - for(i = 0, j = 0; i < 8; i++, j += width_tbl[1]) + for (i = 0, j = 0; i < 8; i++, j += width_tbl[1]) ((uint32 *)cur_frm_pos)[j] = ((uint32 *)cur_frm_pos)[j+1] = lv; LV1_CHECK(buf1,rle_v3,lv1,lp2) break; @@ -1023,12 +1025,12 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, break; case 11: /********** CASE 11 **********/ - if(ref_vectors == NULL) + if (ref_vectors == NULL) return; - for( ; blks_height > 0; blks_height -= 8) { - for(lp1 = 0; lp1 < blks_width; lp1++) { - for(lp2 = 0; lp2 < 4; ) { + for ( ; blks_height > 0; blks_height -= 8) { + for (lp1 = 0; lp1 < blks_width; lp1++) { + for (lp2 = 0; lp2 < 4; ) { k = *buf1++; cur_lp = ((uint32 *)cur_frm_pos) + width_tbl[lp2 * 2]; ref_lp = ((uint32 *)ref_frm_pos) + width_tbl[lp2 * 2]; @@ -1055,26 +1057,26 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, break; case 2: - if(lp2 == 0) { - for(i = 0, j = 0; i < 4; i++, j += width_tbl[1]) + if (lp2 == 0) { + for (i = 0, j = 0; i < 4; i++, j += width_tbl[1]) cur_lp[j] = ref_lp[j]; lp2 += 2; } break; case 3: - if(lp2 < 2) { - for(i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1]) + if (lp2 < 2) { + for (i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1]) cur_lp[j] = ref_lp[j]; lp2 = 3; } break; case 8: - if(lp2 == 0) { + if (lp2 == 0) { RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3) - for(i = 0, j = 0; i < 8; i++, j += width_tbl[1]) + for (i = 0, j = 0; i < 8; i++, j += width_tbl[1]) cur_lp[j] = ref_lp[j]; RLE_V2_CHECK(buf1,rle_v2, rle_v3,lp2) @@ -1088,7 +1090,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, LP2_CHECK(buf1,rle_v3,lp2) case 4: case 6: - for(i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1]) + for (i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1]) cur_lp[j] = ref_lp[j]; lp2 = 4; break; @@ -1099,7 +1101,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, lv = (lv1 & 0x7F) << 1; lv += (lv << 8); lv += (lv << 16); - for(i = 0, j = 0; i < 4; i++, j += width_tbl[1]) + for (i = 0, j = 0; i < 4; i++, j += width_tbl[1]) cur_lp[j] = lv; LV1_CHECK(buf1,rle_v3,lv1,lp2) break; @@ -1123,18 +1125,18 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height, } } - if(strip < strip_tbl) + if (strip < strip_tbl) return; - for( ; strip >= strip_tbl; strip--) { - if(strip->split_flag != 0) { + for ( ; strip >= strip_tbl; strip--) { + if (strip->split_flag != 0) { strip->split_flag = 0; strip->usl7 = (strip-1)->usl7; - if(strip->split_direction) { + if (strip->split_direction) { strip->xpos += strip->width; strip->width = (strip-1)->width - strip->width; - if(region_160_width <= strip->xpos && width < strip->width + strip->xpos) + if (region_160_width <= strip->xpos && width < strip->width + strip->xpos) strip->width = width - strip->xpos; } else { strip->ypos += strip->height; diff --git a/engines/gob/parse_v1.cpp b/engines/gob/parse_v1.cpp index ed8868397a..5345089b6c 100644 --- a/engines/gob/parse_v1.cpp +++ b/engines/gob/parse_v1.cpp @@ -267,7 +267,8 @@ int16 Parse_v1::parseValExpr(byte stopToken) { for (brackPos = (stkPos - 2); (brackPos > 0) && (operStack[brackPos] < 30) && (operStack[brackPos] != 9); - brackPos--); + brackPos--) + ; if ((operStack[brackPos] >= 30) || (operStack[brackPos] == 9)) brackPos++; @@ -587,7 +588,8 @@ int16 Parse_v1::parseExpr(byte stopToken, byte *arg_2) { for (brackStart = (stkPos - 2); (brackStart > 0) && (operStack[brackStart] < 30) && (operStack[brackStart] != 9); - brackStart--); + brackStart--) + ; if ((operStack[brackStart] >= 30) || (operStack[brackStart] == 9)) brackStart++; diff --git a/engines/gob/parse_v2.cpp b/engines/gob/parse_v2.cpp index fd2726d049..c48610d230 100644 --- a/engines/gob/parse_v2.cpp +++ b/engines/gob/parse_v2.cpp @@ -406,7 +406,8 @@ int16 Parse_v2::parseValExpr(byte stopToken) { for (brackPos = (stkPos - 2); (brackPos > 0) && (operStack[brackPos] < 30) && (operStack[brackPos] != 9); - brackPos--); + brackPos--) + ; if ((operStack[brackPos] >= 30) || (operStack[brackPos] == 9)) brackPos++; @@ -791,7 +792,8 @@ int16 Parse_v2::parseExpr(byte stopToken, byte *arg_2) { for (brackStart = (stkPos - 2); (brackStart > 0) && (operStack[brackStart] < 30) && (operStack[brackStart] != 9); - brackStart--); + brackStart--) + ; if ((operStack[brackStart] >= 30) || (operStack[brackStart] == 9)) brackStart++; diff --git a/engines/gob/saveload_v2.cpp b/engines/gob/saveload_v2.cpp index 69bda7de31..e58799a6db 100644 --- a/engines/gob/saveload_v2.cpp +++ b/engines/gob/saveload_v2.cpp @@ -113,7 +113,7 @@ bool SaveLoad_v2::loadVersioned(int type, int16 dataVar, int32 size, int32 offse break; case kSaveTempSprite: - if(loadTempSprite(_saveFiles[type], dataVar, size, offset)) + if (loadTempSprite(_saveFiles[type], dataVar, size, offset)) return true; warning("While loading the temporary sprite"); @@ -142,7 +142,7 @@ bool SaveLoad_v2::saveVersioned(int type, int16 dataVar, int32 size, int32 offse break; case kSaveTempSprite: - if(saveTempSprite(_saveFiles[type], dataVar, size, offset)) + if (saveTempSprite(_saveFiles[type], dataVar, size, offset)) return true; warning("While saving the temporary sprite"); @@ -319,7 +319,7 @@ bool SaveLoad_v2::saveGame(SaveFile &saveFile, byte sizes[40]; memset(sizes, 0, 40); - if(!_save->save(0, 40, 0, saveFile.destName, _indexBuffer + (slot * 40), sizes)) + if (!_save->save(0, 40, 0, saveFile.destName, _indexBuffer + (slot * 40), sizes)) return false; if (!_save->save(dataVar, size, 40, saveFile.destName, _vm->_inter->_variables)) diff --git a/engines/gob/saveload_v3.cpp b/engines/gob/saveload_v3.cpp index 265f8a2c62..806ac75939 100644 --- a/engines/gob/saveload_v3.cpp +++ b/engines/gob/saveload_v3.cpp @@ -130,7 +130,7 @@ bool SaveLoad_v3::loadVersioned(int type, int16 dataVar, int32 size, int32 offse break; case kSaveTempSprite: - if(loadTempSprite(_saveFiles[type], dataVar, size, offset)) + if (loadTempSprite(_saveFiles[type], dataVar, size, offset)) return true; warning("While loading the temporary sprite"); @@ -169,7 +169,7 @@ bool SaveLoad_v3::saveVersioned(int type, int16 dataVar, int32 size, int32 offse break; case kSaveTempSprite: - if(saveTempSprite(_saveFiles[type], dataVar, size, offset)) + if (saveTempSprite(_saveFiles[type], dataVar, size, offset)) return true; warning("While saving the temporary sprite"); @@ -489,10 +489,10 @@ bool SaveLoad_v3::saveGame(SaveFile &saveFile, _hasIndex = false; - if(!_save->save(0, 500, 0, saveFile.destName, _propBuffer, _propBuffer + 500)) + if (!_save->save(0, 500, 0, saveFile.destName, _propBuffer, _propBuffer + 500)) return false; - if(!_save->save(0, 40, 500, saveFile.destName, _indexBuffer + (saveFile.slot * 40), 0)) + if (!_save->save(0, 40, 500, saveFile.destName, _indexBuffer + (saveFile.slot * 40), 0)) return false; if (!_save->save(dataVar, size, 540, saveFile.destName, _vm->_inter->_variables)) diff --git a/engines/gob/saveload_v4.cpp b/engines/gob/saveload_v4.cpp index 28a2a61604..e7df11f6ad 100644 --- a/engines/gob/saveload_v4.cpp +++ b/engines/gob/saveload_v4.cpp @@ -397,10 +397,10 @@ bool SaveLoad_v4::saveGame(SaveFile &saveFile, _hasIndex = false; - if(!_save->save(0, 500, 0, saveFile.destName, _propBuffer, _propBuffer + 500)) + if (!_save->save(0, 500, 0, saveFile.destName, _propBuffer, _propBuffer + 500)) return false; - if(!_save->save(0, 40, 500, saveFile.destName, _indexBuffer + (slot * 40), 0)) + if (!_save->save(0, 40, 500, saveFile.destName, _indexBuffer + (slot * 40), 0)) return false; if (!_save->save(dataVar, size, 540, saveFile.destName, _vm->_inter->_variables)) diff --git a/engines/gob/saveload_v6.cpp b/engines/gob/saveload_v6.cpp index 408b9fa6bd..f0de4d934a 100644 --- a/engines/gob/saveload_v6.cpp +++ b/engines/gob/saveload_v6.cpp @@ -244,7 +244,7 @@ bool SaveLoad_v6::saveGame(SaveFile &saveFile, byte sizes[40]; memset(sizes, 0, 40); - if(!_save->save(0, 40, 0, saveFile.destName, _indexBuffer + 500 + (slot * 40), sizes)) + if (!_save->save(0, 40, 0, saveFile.destName, _indexBuffer + 500 + (slot * 40), sizes)) return false; if (!_save->save(dataVar, size, 40, saveFile.destName, _vm->_inter->_variables)) diff --git a/engines/gob/scenery.cpp b/engines/gob/scenery.cpp index 33e540ace4..16c6079f45 100644 --- a/engines/gob/scenery.cpp +++ b/engines/gob/scenery.cpp @@ -184,7 +184,8 @@ int16 Scenery::loadStatic(char search) { _spriteRefs[sprIndex]++; } else { for (sprIndex = 19; _vm->_draw->_spritesArray[sprIndex] != 0; - sprIndex--); + sprIndex--) + ; _staticPictToSprite[7 * sceneryIndex + i] = sprIndex; _spriteRefs[sprIndex] = 1; @@ -517,7 +518,8 @@ int16 Scenery::loadAnim(char search) { _spriteRefs[sprIndex]++; } else { for (sprIndex = 19; _vm->_draw->_spritesArray[sprIndex] != 0; - sprIndex--); + sprIndex--) + ; _animPictToSprite[7 * sceneryIndex + i] = sprIndex; _spriteRefs[sprIndex] = 1; diff --git a/engines/gob/sound/cdrom.cpp b/engines/gob/sound/cdrom.cpp index eef8025cc2..b68ebd0c5b 100644 --- a/engines/gob/sound/cdrom.cpp +++ b/engines/gob/sound/cdrom.cpp @@ -94,7 +94,8 @@ void CDROM::startTrack(const char *trackName) { stopPlaying(); _curTrackBuffer = matchPtr; - while (getTrackPos() >= 0); + while (getTrackPos() >= 0) + ; uint32 start = READ_LE_UINT32(matchPtr + 12); uint32 end = READ_LE_UINT32(matchPtr + 16); @@ -151,7 +152,8 @@ const char *CDROM::getCurTrack() const { void CDROM::stopPlaying() { stop(); - while (getTrackPos() != -1); + while (getTrackPos() != -1) + ; } void CDROM::stop() { diff --git a/engines/kyra/gui_v2.cpp b/engines/kyra/gui_v2.cpp index 012a5b901b..20ebf8d9aa 100644 --- a/engines/kyra/gui_v2.cpp +++ b/engines/kyra/gui_v2.cpp @@ -612,7 +612,7 @@ int GUI_v2::saveMenu(Button *caller) { initMenu(*_currentMenu); updateAllMenuButtons(); return 0; - } else if(_saveSlot <= -1) { + } else if (_saveSlot <= -1) { return 0; } diff --git a/engines/kyra/items_lol.cpp b/engines/kyra/items_lol.cpp index 805df9337b..372fc5809e 100644 --- a/engines/kyra/items_lol.cpp +++ b/engines/kyra/items_lol.cpp @@ -55,7 +55,7 @@ void LoLEngine::giveCredits(int credits, int redraw) { _moneyColumnHeight[d]++; } _credits++; - } while(++cnt < t); + } while (++cnt < t); } else if (_credits >= 60) { _credits += t; } @@ -114,7 +114,7 @@ int LoLEngine::makeItem(int itemIndex, int curFrame, int flags) { slot = r; } else { int ii = _itemsInPlay[slot].itemIndexUnk; - while(ii) { + while (ii) { if (testUnkItemFlags(ii)) { _itemsInPlay[slot].itemIndexUnk = _itemsInPlay[ii].itemIndexUnk; clearItemTableEntry(ii); diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp index 4eb727a617..2a763ad3ae 100644 --- a/engines/kyra/script_hof.cpp +++ b/engines/kyra/script_hof.cpp @@ -946,7 +946,7 @@ int KyraEngine_HoF::o2_useItemOnMainChar(EMCState *script) { int oldVocH = _vocHigh; _vocHigh = 0x5a; - while(_emc->isValid(&tmpScript)) + while (_emc->isValid(&tmpScript)) _emc->run(&tmpScript); _vocHigh = oldVocH; diff --git a/engines/kyra/sequences_hof.cpp b/engines/kyra/sequences_hof.cpp index 7048225891..4cb7040c34 100644 --- a/engines/kyra/sequences_hof.cpp +++ b/engines/kyra/sequences_hof.cpp @@ -2772,7 +2772,7 @@ void KyraEngine_HoF::seq_scrollPage(int bottom, int top) { _screen->fillRect(12, def->y - 8, 28, def->y + 8, 0, 4); _screen->drawShape(4, getShapePtr(def->itemIndex + def->frames[a->currentFrame]), 12, def->y - 8, 0, 0); - if(_seqFrameCounter % 2 == 0) + if (_seqFrameCounter % 2 == 0) a->currentFrame = ++a->currentFrame % 20; } } @@ -2807,7 +2807,7 @@ void KyraEngine_HoF::seq_showStarcraftLogo() { _screen->updateScreen(); delay(_seqEndTime - _system->getMillis()); } - if(!skipFlag()) { + if (!skipFlag()) { _seqEndTime = _system->getMillis() + 50; ci->displayFrame(0, 0); _screen->copyPage(2, 0); diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index 0417d4dfc5..8ccbc736f3 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -1932,7 +1932,7 @@ bool TownsPC98_OpnChannel::processVibrato() { _vbrCurDelay = _vbrInitDelayHi; _frequency += _vbrModCurVal; - if(!--_vbrDurLeft) { + if (!--_vbrDurLeft) { _vbrDurLeft = _vbrDuration; _vbrModCurVal = -_vbrModCurVal; } @@ -2425,7 +2425,7 @@ bool TownsPC98_OpnChannelSSG::control_fc_decOutLevel(uint8 para) { if (_drv->_fading) return true; - if(_totalLevel + 1 < 0x10) + if (_totalLevel + 1 < 0x10) _totalLevel++; return true; diff --git a/engines/m4/converse.cpp b/engines/m4/converse.cpp index 5567c8888a..61f4c1eac7 100644 --- a/engines/m4/converse.cpp +++ b/engines/m4/converse.cpp @@ -290,7 +290,7 @@ void ConversationView::playNextReply() { int previousWeight = 1; int currentWeight = 0; - for(uint32 j = 0; j < currentEntry->entries.size(); j++) { + for (uint32 j = 0; j < currentEntry->entries.size(); j++) { currentWeight += currentEntry->entries[j]->weight; if (selectedWeight >= previousWeight && selectedWeight <= currentWeight) { sprintf(buffer, "%s.raw", currentEntry->entries[j]->voiceFile); @@ -406,7 +406,7 @@ void Converse::loadConversation(const char *convName) { convS->read(buffer, 8); if (debugFlag) printf("Conversation name: %s\n", buffer); - while(true) { + while (true) { chunkPos = convS->pos(); chunk = convS->readUint32LE(); // read chunk if (convS->eos()) break; @@ -716,7 +716,7 @@ void Converse::loadConversationMads(const char *convName) { printf("Chunk 0\n"); printf("Conv stream size: %i\n", convS->size()); - while(!convS->eos()) { // FIXME (eos changed) + while (!convS->eos()) { // FIXME (eos changed) printf("%i ", convS->readByte()); } printf("\n"); @@ -727,7 +727,7 @@ void Converse::loadConversationMads(const char *convName) { printf("Chunk 1\n"); printf("Conv stream size: %i\n", convS->size()); - while(!convS->eos()) { // FIXME (eos changed) + while (!convS->eos()) { // FIXME (eos changed) printf("%i ", convS->readByte()); } printf("\n"); @@ -738,7 +738,7 @@ void Converse::loadConversationMads(const char *convName) { printf("Chunk 2\n"); printf("Conv stream size: %i\n", convS->size()); - while(!convS->eos()) { // FIXME (eos changed) + while (!convS->eos()) { // FIXME (eos changed) printf("%i ", convS->readByte()); } printf("\n"); @@ -792,7 +792,7 @@ void Converse::loadConversationMads(const char *convName) { convS->read(buffer, 14); // speech file printf("Speech file: %s\n", buffer); - while(!convS->eos()) { // FIXME: eos changed + while (!convS->eos()) { // FIXME: eos changed printf("%i ", convS->readByte()); } printf("\n"); @@ -805,7 +805,7 @@ void Converse::loadConversationMads(const char *convName) { printf("Chunk 1: conversation nodes\n"); printf("Conv stream size: %i\n", convS->size()); - while(true) { + while (true) { uint16 id = convS->readUint16LE(); if (convS->eos()) break; @@ -844,7 +844,7 @@ void Converse::loadConversationMads(const char *convName) { *buffer = 0; - while(true) { + while (true) { //if (curPos == 0) // printf("%i: Offset %i: ", _convStrings.size(), convS->pos()); uint8 b = convS->readByte(); @@ -900,7 +900,7 @@ void Converse::loadConversationMads(const char *convName) { //printf("Chunk 3 - MESG chunk data\n"); //printf("Conv stream size: %i\n", convS->size()); - while(true) { + while (true) { uint16 index = convS->readUint16LE(); if (convS->eos()) break; @@ -926,7 +926,7 @@ void Converse::loadConversationMads(const char *convName) { convS = convData.getItemStream(6); printf("Chunk 6\n"); printf("Conv stream size: %i\n", convS->size()); - /*while(!convS->eos()) { // FIXME (eos changed) + /*while (!convS->eos()) { // FIXME (eos changed) printf("%i ", convS->readByte()); printf("%i ", convS->readByte()); printf("%i ", convS->readByte()); @@ -965,7 +965,7 @@ void Converse::readConvEntryActions(Common::SubReadStream *convS, ConvEntry *cur int messageIndex = 0; int unk = 0; - while(true) { + while (true) { chunk = convS->readByte(); if (convS->eos()) break; diff --git a/engines/m4/globals.cpp b/engines/m4/globals.cpp index 56f78ce835..7028569c6b 100644 --- a/engines/m4/globals.cpp +++ b/engines/m4/globals.cpp @@ -273,11 +273,11 @@ Globals::Globals(M4Engine *vm): _vm(vm) { Globals::~Globals() { uint32 i; - for(i = 0; i < _madsVocab.size(); i++) + for (i = 0; i < _madsVocab.size(); i++) free(_madsVocab[i]); _madsVocab.clear(); - for(i = 0; i < _madsQuotes.size(); i++) + for (i = 0; i < _madsQuotes.size(); i++) free(_madsQuotes[i]); _madsQuotes.clear(); @@ -295,7 +295,7 @@ void Globals::loadMadsVocab() { char buffer[30]; strcpy(buffer, ""); - while(true) { + while (true) { uint8 b = vocabS->readByte(); if (vocabS->eos()) break; @@ -318,7 +318,7 @@ void Globals::loadMadsQuotes() { char buffer[128]; strcpy(buffer, ""); - while(true) { + while (true) { uint8 b = quoteS->readByte(); if (quoteS->eos()) break; diff --git a/engines/m4/graphics.cpp b/engines/m4/graphics.cpp index 6d933d476b..06bb358179 100644 --- a/engines/m4/graphics.cpp +++ b/engines/m4/graphics.cpp @@ -723,7 +723,7 @@ static void fadeRange(M4Engine *vm, RGB8 *srcPal, RGB8 *destPal, int startIndex RGB8 tempPal[256]; // perform the fade - for(int stepCtr = 1; stepCtr <= numSteps; ++stepCtr) { + for (int stepCtr = 1; stepCtr <= numSteps; ++stepCtr) { // Delay the specified amount uint32 startTime = g_system->getMillis(); while ((g_system->getMillis() - startTime) < delayAmount) { diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp index 60e74fd127..98944b2611 100644 --- a/engines/m4/m4.cpp +++ b/engines/m4/m4.cpp @@ -528,7 +528,7 @@ void M4Engine::dumpFile(const char* filename, bool uncompress) { printf("Dumping %s, size: %i\n", filename, fileS->size()); if (!uncompress) { - while(!fileS->eos()) { + while (!fileS->eos()) { bytesRead = fileS->read(buffer, 256); fwrite(buffer, bytesRead, 1, destFile); } @@ -538,7 +538,7 @@ void M4Engine::dumpFile(const char* filename, bool uncompress) { for (int i = 0; i < packData.getCount(); i++) { sourceUnc = packData.getItemStream(i); printf("Dumping compressed chunk %i of %i, size is %i\n", i + 1, packData.getCount(), sourceUnc->size()); - while(!sourceUnc->eos()) { + while (!sourceUnc->eos()) { bytesRead = sourceUnc->read(buffer, 256); fwrite(buffer, bytesRead, 1, destFile); } diff --git a/engines/scumm/akos.cpp b/engines/scumm/akos.cpp index 1777caa84c..39de31b5c9 100644 --- a/engines/scumm/akos.cpp +++ b/engines/scumm/akos.cpp @@ -1730,7 +1730,7 @@ bool ScummEngine_v6::akos_increaseAnim(Actor *a, int chan, const byte *aksq, con if (code2 & 0x80) code2 = READ_BE_UINT16(aksq + curpos); - if((code2 & 0xC000) == 0xC000 && code2 != AKC_ComplexChan && code2 != AKC_Return && code2 != AKC_EndSeq && code2 != AKC_C08E && code2 != AKC_ComplexChan2 && code2 != AKC_C021 && code2 != AKC_C022) + if ((code2 & 0xC000) == 0xC000 && code2 != AKC_ComplexChan && code2 != AKC_Return && code2 != AKC_EndSeq && code2 != AKC_C08E && code2 != AKC_ComplexChan2 && code2 != AKC_C021 && code2 != AKC_C022) error("Ending with undefined uSweat token %X", code2); a->_cost.curpos[chan] = curpos; diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index ce5ac4f323..a50dde5271 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -2064,7 +2064,8 @@ void ScummEngine_v5::o5_roomOps() { a = getVarOrDirectByte(PARAM_1); s = filename; - while ((*s++ = fetchScriptByte())); + while ((*s++ = fetchScriptByte())) + ; file = _saveFileMan->openForSaving(filename); if (file != NULL) { @@ -2083,7 +2084,8 @@ void ScummEngine_v5::o5_roomOps() { a = getVarOrDirectByte(PARAM_1); s = filename; - while ((*s++ = fetchScriptByte())); + while ((*s++ = fetchScriptByte())) + ; file = _saveFileMan->openForLoading(filename); if (file != NULL) { diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp index 00521048a1..3b3611ab50 100644 --- a/engines/scumm/string.cpp +++ b/engines/scumm/string.cpp @@ -1126,11 +1126,13 @@ int ScummEngine_v72he::convertMessageToString(const byte *msg, byte *dst, int ds // (pickup4) // (PU1) // (PU2) - while (src[num++] != ')'); + while (src[num++] != ')') + ; continue; } if ((_game.features & GF_HE_LOCALIZED) && chr == '[') { - while (src[num++] != ']'); + while (src[num++] != ']') + ; continue; } diff --git a/engines/sky/screen.cpp b/engines/sky/screen.cpp index 32487c1fdb..9ecb838c6b 100644 --- a/engines/sky/screen.cpp +++ b/engines/sky/screen.cpp @@ -401,7 +401,8 @@ void Screen::waitForTimer(void) { Common::Event event; _system->delayMillis(10); - while (eventMan->pollEvent(event)); + while (eventMan->pollEvent(event)) + ; } } @@ -411,7 +412,8 @@ void Screen::waitForSequence(void) { Common::Event event; _system->delayMillis(20); - while (eventMan->pollEvent(event)); + while (eventMan->pollEvent(event)) + ; } } diff --git a/engines/tinsel/coroutine.h b/engines/tinsel/coroutine.h index 30d90970b6..d2c2c21b3a 100644 --- a/engines/tinsel/coroutine.h +++ b/engines/tinsel/coroutine.h @@ -126,7 +126,7 @@ public: /** Stop the currently running coroutine */ #define CORO_KILL_SELF() \ - do { if (&coroParam != &nullContext) { coroParam->_sleep = -1; } return; } while(0) + do { if (&coroParam != &nullContext) { coroParam->_sleep = -1; } return; } while (0) /** Invoke another coroutine */ #define CORO_INVOKE_ARGS(subCoro, ARGS) \ @@ -139,7 +139,7 @@ public: coroParam->_sleep = coroParam->_subctx->_sleep;\ assert(&coroParam != &nullContext);\ return; case __LINE__:;\ - } while(1);\ + } while (1);\ } while (0) #define CORO_INVOKE_ARGS_V(subCoro, RESULT, ARGS) \ do {\ @@ -151,7 +151,7 @@ public: coroParam->_sleep = coroParam->_subctx->_sleep;\ assert(&coroParam != &nullContext);\ return RESULT; case __LINE__:;\ - } while(1);\ + } while (1);\ } while (0) #define CORO_INVOKE_0(subCoroutine) \ diff --git a/engines/tinsel/handle.cpp b/engines/tinsel/handle.cpp index b463244123..ba09675b3f 100644 --- a/engines/tinsel/handle.cpp +++ b/engines/tinsel/handle.cpp @@ -382,7 +382,7 @@ uint8 *LockMem(SCNHANDLE offset) { return (uint8 *)pH->pNode + sizeof(MEM_NODE) + (offset & OFFSETMASK); } else if (handle == cdPlayHandle) { // Must be in currently loaded/loadable range - if(offset < cdBaseHandle || offset >= cdTopHandle) + if (offset < cdBaseHandle || offset >= cdTopHandle) error("Overlapping (in time) CD-plays!"); if (pH->pNode->pBaseAddr && (pH->filesize & fLoaded)) @@ -394,7 +394,7 @@ uint8 *LockMem(SCNHANDLE offset) { MemoryReAlloc(pH->pNode, cdTopHandle-cdBaseHandle, DWM_MOVEABLE | DWM_DISCARDABLE); - if(pH->pNode->pBaseAddr == NULL) + if (pH->pNode->pBaseAddr == NULL) error("Out of memory"); LoadCDGraphData(pH); diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp index 670d87f021..657e0cbf92 100644 --- a/engines/tinsel/music.cpp +++ b/engines/tinsel/music.cpp @@ -801,7 +801,7 @@ bool PCMMusicPlayer::getNextChunk() { // Set parameters for this chunk of music id = _scriptNum; - while(id--) + while (id--) script = scriptBuffer + FROM_LE_32(*script); snum = FROM_LE_32(script[_scriptIndex++]); @@ -849,7 +849,7 @@ bool PCMMusicPlayer::getNextChunk() { script = scriptBuffer = (int32 *) LockMem(_hScript); id = _scriptNum; - while(id--) + while (id--) script = scriptBuffer + FROM_LE_32(*script); switch (script[_scriptIndex]) { diff --git a/engines/tinsel/polygons.cpp b/engines/tinsel/polygons.cpp index 184bd24f6b..4193eaa4d8 100644 --- a/engines/tinsel/polygons.cpp +++ b/engines/tinsel/polygons.cpp @@ -1056,7 +1056,7 @@ int GetBrightness(HPOLYGON hPath, int y) { top += zlen; if (y < top) return brightness; - } while(--brightness); + } while (--brightness); return FROM_LE_32(pp.bright2); } diff --git a/engines/tinsel/rince.cpp b/engines/tinsel/rince.cpp index f92b8800db..30eee3bc8b 100644 --- a/engines/tinsel/rince.cpp +++ b/engines/tinsel/rince.cpp @@ -361,11 +361,11 @@ static void InitMover(PMOVER pMover) { pMover->Tline = 0; - if(pMover->direction != FORWARD || pMover->direction != AWAY + if (pMover->direction != FORWARD || pMover->direction != AWAY || pMover->direction != LEFTREEL || pMover->direction != RIGHTREEL) pMover->direction = FORWARD; - if(pMover->scale < 0 || pMover->scale > TOTAL_SCALES) + if (pMover->scale < 0 || pMover->scale > TOTAL_SCALES) pMover->scale = 1; pMover->brightness = BOGUS_BRIGHTNESS; // Force initial setup diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp index 0a29a9fe82..221dde1bb1 100644 --- a/engines/tinsel/tinlib.cpp +++ b/engines/tinsel/tinlib.cpp @@ -386,7 +386,7 @@ static void ScrollMonitorProcess(CORO_PARAM, const void *param) { PlayfieldGetPos(FIELD_WORLD, &Loffset, &Toffset); - } while(Loffset != psm->x || Toffset != psm->y); + } while (Loffset != psm->x || Toffset != psm->y); CORO_END_CODE; } @@ -2152,7 +2152,7 @@ static void PrintObj(CORO_PARAM, const SCNHANDLE hText, const INV_OBJECT *pinvo, // Carry on until the cursor leaves this icon GetCursorXY(&x, &y, false); - } while(InvItemId(x, y) == pinvo->id); + } while (InvItemId(x, y) == pinvo->id); } else { /* * PrintObj() called from other event diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index 9481ea4859..2524c3e6a2 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -323,7 +323,7 @@ static void SingleLeftProcess(CORO_PARAM, const void *) { // Timeout a double click (may not work once every 49 days!) do { CORO_SLEEP(1); - } while(DwGetCurrentTime() < _ctx->endTicks); + } while (DwGetCurrentTime() < _ctx->endTicks); if (GetProvNotProcessed()) PlayerEvent(PLR_WALKTO, clickPos); @@ -1043,7 +1043,8 @@ Common::Error TinselEngine::go() { continue; // run flat-out #endif // Loop processing events while there are any pending - while (pollEvent()); + while (pollEvent()) + ; DoCdChange(); diff --git a/graphics/video/smk_player.cpp b/graphics/video/smk_player.cpp index 5f162b0815..909401a3a1 100644 --- a/graphics/video/smk_player.cpp +++ b/graphics/video/smk_player.cpp @@ -669,7 +669,7 @@ bool SMKPlayer::decodeNextFrame() { out += stride; break; case 2: - for(i = 0; i < 2; i++) { + for (i = 0; i < 2; i++) { // We first get p2 and then p1 // Check ffmpeg thread "[PATCH] Smacker video decoder bug fix" // http://article.gmane.org/gmane.comp.video.ffmpeg.devel/78768 |