diff options
53 files changed, 149 insertions, 149 deletions
diff --git a/common/config-manager.cpp b/common/config-manager.cpp index add32cd00e..8cd2ed3222 100644 --- a/common/config-manager.cpp +++ b/common/config-manager.cpp @@ -81,7 +81,7 @@ ConfigManager::ConfigManager() { void ConfigManager::loadDefaultConfigFile() { char configFile[MAXPATHLEN]; #if defined(UNIX) - if(getenv("HOME") != NULL) + if (getenv("HOME") != NULL) sprintf(configFile,"%s/%s", getenv("HOME"), DEFAULT_CONFIG_FILE); else strcpy(configFile, DEFAULT_CONFIG_FILE); diff --git a/common/list.h b/common/list.h index 06f71297c7..6e9cf83dab 100644 --- a/common/list.h +++ b/common/list.h @@ -182,7 +182,7 @@ public: static_cast<Node<T> *>(i._node)->_data = static_cast<Node<T> *>(j._node)->_data; } - if(i == end()) + if (i == end()) insert(i, j, list.end()); else erase(i, end()); diff --git a/common/md5.cpp b/common/md5.cpp index d876072b73..f0e277172c 100644 --- a/common/md5.cpp +++ b/common/md5.cpp @@ -171,7 +171,7 @@ void md5_update( md5_context *ctx, const uint8 *input, uint32 length ) { uint32 left, fill; - if( ! length ) return; + if ( ! length ) return; left = ctx->total[0] & 0x3F; fill = 64 - left; @@ -179,10 +179,10 @@ void md5_update( md5_context *ctx, const uint8 *input, uint32 length ) ctx->total[0] += length; ctx->total[0] &= 0xFFFFFFFF; - if( ctx->total[0] < length ) + if ( ctx->total[0] < length ) ctx->total[1]++; - if( left && length >= fill ) + if ( left && length >= fill ) { memcpy( (void *) (ctx->buffer + left), (const void *) input, fill ); @@ -192,14 +192,14 @@ void md5_update( md5_context *ctx, const uint8 *input, uint32 length ) left = 0; } - while( length >= 64 ) + while ( length >= 64 ) { md5_process( ctx, input ); length -= 64; input += 64; } - if( length ) + if ( length ) { memcpy( (void *) (ctx->buffer + left), (const void *) input, length ); @@ -249,28 +249,28 @@ bool md5_file( const char *name, uint8 digest[16], const char *directory, uint32 int readlen; f.open(name, File::kFileReadMode, directory); - if( ! f.isOpen() ) + if ( ! f.isOpen() ) { warning( "md5_file couldn't open '%s'", name ); return false; } - if( ! restricted || sizeof( buf ) <= length ) + if ( ! restricted || sizeof( buf ) <= length ) readlen = sizeof( buf ); else readlen = length; md5_starts( &ctx ); - while( ( i = f.read( buf, readlen ) ) > 0 ) + while ( ( i = f.read( buf, readlen ) ) > 0 ) { md5_update( &ctx, buf, i ); length -= i; - if( restricted && length == 0 ) + if ( restricted && length == 0 ) break; - if( restricted && sizeof( buf ) > length ) + if ( restricted && sizeof( buf ) > length ) readlen = length; } @@ -317,11 +317,11 @@ int main( int argc, char *argv[] ) md5_context ctx; unsigned char md5sum[16]; - if( argc < 2 ) + if ( argc < 2 ) { printf( "\n MD5 Validation Tests:\n\n" ); - for( i = 0; i < 7; i++ ) + for ( i = 0; i < 7; i++ ) { printf( " Test %d ", i + 1 ); @@ -329,12 +329,12 @@ int main( int argc, char *argv[] ) md5_update( &ctx, (const uint8 *) msg[i], strlen( msg[i] ) ); md5_finish( &ctx, md5sum ); - for( j = 0; j < 16; j++ ) + for ( j = 0; j < 16; j++ ) { sprintf( output + j * 2, "%02x", md5sum[j] ); } - if( memcmp( output, val[i], 32 ) ) + if ( memcmp( output, val[i], 32 ) ) { printf( "failed!\n" ); return( 1 ); @@ -347,10 +347,10 @@ int main( int argc, char *argv[] ) } else { - for( i = 1; i < argc; i++ ) + for ( i = 1; i < argc; i++ ) { md5_file( argv[i], md5sum ); - for( j = 0; j < 16; j++ ) + for ( j = 0; j < 16; j++ ) { printf( "%02x", md5sum[j] ); } diff --git a/common/savefile.cpp b/common/savefile.cpp index 8f24db7686..2210f3d05a 100644 --- a/common/savefile.cpp +++ b/common/savefile.cpp @@ -69,7 +69,7 @@ public: fh = ::fopen(filename, (saveOrLoad? "wb" : "rb")); } ~StdioSaveFile() { - if(fh) + if (fh) ::fclose(fh); } @@ -99,7 +99,7 @@ public: fh = ::gzopen(filename, (saveOrLoad? "wb" : "rb")); } ~GzipSaveFile() { - if(fh) + if (fh) ::gzclose(fh); } diff --git a/common/scaler/hq2x.cpp b/common/scaler/hq2x.cpp index e0f29e8d85..3599c01b9b 100644 --- a/common/scaler/hq2x.cpp +++ b/common/scaler/hq2x.cpp @@ -49,7 +49,7 @@ static bool isAltiVecAvailable() { int hasVectorUnit = 0; size_t length = sizeof(hasVectorUnit); int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); - if( 0 == error ) + if ( 0 == error ) return hasVectorUnit != 0; return false; } diff --git a/common/scaler/hq3x.cpp b/common/scaler/hq3x.cpp index 8f077e6fe4..f0a92c533c 100644 --- a/common/scaler/hq3x.cpp +++ b/common/scaler/hq3x.cpp @@ -49,7 +49,7 @@ static bool isAltiVecAvailable() { int hasVectorUnit = 0; size_t length = sizeof(hasVectorUnit); int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); - if( 0 == error ) + if ( 0 == error ) return hasVectorUnit != 0; return false; } diff --git a/gob/draw.cpp b/gob/draw.cpp index 480d8b016d..2ea12fc3d4 100644 --- a/gob/draw.cpp +++ b/gob/draw.cpp @@ -604,7 +604,7 @@ void draw_animateCursor(int16 cursor) { draw_cursorAnim++; draw_cursorTimeKey = util_getTimeKey(); } else { -/* if(draw_noInvalidated && +/* if (draw_noInvalidated && inter_mouseX == draw_cursorX && inter_mouseY == draw_cursorY) return;*/ } @@ -696,7 +696,7 @@ void draw_interPalLoad(void) { draw_unusedPalette1[i] = *inter_execPtr; continue; } - //if(*inter_execPtr != 0) + //if (*inter_execPtr != 0) // var_B = 0; ind1 = *inter_execPtr >> 4; diff --git a/gob/game.cpp b/gob/game.cpp index 62c1ba2c91..ccb9a397ae 100644 --- a/gob/game.cpp +++ b/gob/game.cpp @@ -1688,7 +1688,7 @@ void game_loadExtTable(void) { game_extTable->itemsCount = FROM_LE_16(game_extTable->itemsCount); data_readData(game_extHandle, (char *)&game_extTable->unknown, 1); - for(i = 0; i < count; i++) { + for (i = 0; i < count; i++) { data_readData(game_extHandle, (char *)&game_extTable->items[i].offset, 4); game_extTable->items[i].offset = FROM_LE_32(game_extTable->items[i].offset); data_readData(game_extHandle, (char *)&game_extTable->items[i].size, 2); diff --git a/gob/pack.cpp b/gob/pack.cpp index 17601fbec5..e52a16f64d 100644 --- a/gob/pack.cpp +++ b/gob/pack.cpp @@ -47,7 +47,7 @@ int32 unpackData(char *sourceBuf, char *destBuf) { * Don't need this anymore :) */ /* - * if(realSize < 65000) + * if (realSize < 65000) * { * asm_unpackData(sourceBuf, destBuf, tmpBuf); * free(tmpBuf); diff --git a/gob/parse.cpp b/gob/parse.cpp index 99a92ab522..a5bffe402a 100644 --- a/gob/parse.cpp +++ b/gob/parse.cpp @@ -331,7 +331,7 @@ int16 parse_parseExpr(char arg_0, byte *arg_2) { if (operation != arg_0) break; - } // if(operPtr[-2] == 9 && ...) + } // if (operPtr[-2] == 9 && ...) for (brackStart = stkPos - 2; brackStart > 0 && operStack[brackStart] < 30 && @@ -535,7 +535,7 @@ int16 parse_parseExpr(char arg_0, byte *arg_2) { if (var_1A != 0) break; - } // while(stkPos >= 2) + } // while (stkPos >= 2) if (operation == 30 || operation == 31) { if (operPtr[-1] == 20) { @@ -696,7 +696,7 @@ void parse_skipExpr(char arg_0) { parse_skipExpr(10); } continue; - } // if(operation >= 19 && operation <= 29) + } // if (operation >= 19 && operation <= 29) if (operation == 9) { num++; @@ -844,7 +844,7 @@ int16 parse_parseValExpr() { valPtr[0] &= valPtr[2]; break; } - } // if(stkPos > 0 && cmdPtr[-1] > 4 && cmdPtr[-1] < 9) + } // if (stkPos > 0 && cmdPtr[-1] > 4 && cmdPtr[-1] < 9) continue; } @@ -1102,7 +1102,7 @@ void parse_printExpr(char arg_0) { break; } continue; - } // if(operation >= 19 && operation <= 29) + } // if (operation >= 19 && operation <= 29) switch (operation) { case 9: debug(5, "("); diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp index a6cf672f6d..929a8a8319 100644 --- a/gui/ListWidget.cpp +++ b/gui/ListWidget.cpp @@ -381,7 +381,7 @@ void ListWidget::startEditMode() { } void ListWidget::endEditMode() { - if(!_editMode) + if (!_editMode) return; // send a message that editing finished with a return/enter key press _editMode = false; diff --git a/gui/newgui.cpp b/gui/newgui.cpp index b46039a1fd..7267f65e29 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -75,7 +75,7 @@ void NewGui::updateColors() { } void NewGui::updateScaleFactor() { - if(!_scaleEnable) { + if (!_scaleEnable) { _scaleFactor = 1; } else { enum { @@ -477,9 +477,9 @@ void NewGui::drawBitmap(uint32 *bitmap, int tx, int ty, OverlayColor color, int if (ty + y < 0 || ty + y >= _screen.h) continue; for (int x = 0; x < 8 * _scaleFactor; x++) { - if(!(x % 2) && _scaleFactor != 1 && x != 0) + if (!(x % 2) && _scaleFactor != 1 && x != 0) mask >>= 4; - else if(_scaleFactor == 1) + else if (_scaleFactor == 1) mask >>= 4; if (tx + x < 0 || tx + x >= _screen.w) diff --git a/kyra/cpsimage.cpp b/kyra/cpsimage.cpp index e19476fa07..135f5ad27a 100644 --- a/kyra/cpsimage.cpp +++ b/kyra/cpsimage.cpp @@ -61,7 +61,7 @@ CPSImage::CPSImage(uint8* buffer, uint32 size) { _cpsHeader._pal = bufferstream.readUint32LE(); // lets check a bit - if(_cpsHeader._pal == 0x3000000) { + if (_cpsHeader._pal == 0x3000000) { // if this was a compressed palette you should have strange graphics uint8* palbuffer = new uint8[768]; @@ -79,9 +79,9 @@ CPSImage::CPSImage(uint8* buffer, uint32 size) { uint8* imagebuffer = &buffer[bufferstream.pos()]; assert(imagebuffer); - if(_cpsHeader._format == 4) { + if (_cpsHeader._format == 4) { Compression::decode80(imagebuffer, _image); - } else if(_cpsHeader._format == 3) { + } else if (_cpsHeader._format == 3) { Compression::decode3(imagebuffer, _image, _cpsHeader._imagesize); } else { error("unknown CPS format %d", _cpsHeader._format); @@ -89,7 +89,7 @@ CPSImage::CPSImage(uint8* buffer, uint32 size) { int16 width = getWidthFromCPSRes(_cpsHeader._imagesize); - if(width == -1) { + if (width == -1) { warning("unknown CPS width(imagesize: %d)", _cpsHeader._imagesize); delete [] buffer; return; diff --git a/kyra/font.cpp b/kyra/font.cpp index 48b2ee1ff2..999c9a4b0f 100644 --- a/kyra/font.cpp +++ b/kyra/font.cpp @@ -55,7 +55,7 @@ Font::Font(uint8* buffer, uint32 size) { _fontHeader._height = bufferstream.readByte(); // tests for the magic values - if(_fontHeader._magic1 != FontHeader_Magic1 || _fontHeader._magic2 != FontHeader_Magic2 || + if (_fontHeader._magic1 != FontHeader_Magic1 || _fontHeader._magic2 != FontHeader_Magic2 || _fontHeader._magic3 != FontHeader_Magic3) { error("magic vars in the fontheader are corrupt\n" "_magic1 = 0x%x, _magic2 = 0x%x, _magic3 = 0x%x", diff --git a/kyra/kyra.cpp b/kyra/kyra.cpp index 2aed994d55..595d820e54 100644 --- a/kyra/kyra.cpp +++ b/kyra/kyra.cpp @@ -235,7 +235,7 @@ int KyraEngine::go() { _midiDriver->playTrack(3); } - while(true) { + while (true) { OSystem::Event event; //if (_debugger->isAttached()) // _debugger->onFrame(); diff --git a/kyra/resource.cpp b/kyra/resource.cpp index da0c2bbed2..f661b979ed 100644 --- a/kyra/resource.cpp +++ b/kyra/resource.cpp @@ -212,7 +212,7 @@ PAKFile::PAKFile(/*const Common::String &path, */const Common::String& file) { // saves the name chunk->_name = reinterpret_cast<const char*>(_buffer + pos); pos += strlen(chunk->_name) + 1; - if(!(*chunk->_name)) + if (!(*chunk->_name)) break; endoffset = READ_LE_UINT32(_buffer + pos); diff --git a/kyra/resource.h b/kyra/resource.h index 514198fafb..67275e1dbc 100644 --- a/kyra/resource.h +++ b/kyra/resource.h @@ -122,7 +122,7 @@ public: // only for testing :) uint8 getColor(uint16 x, uint16 y) { return _image[y * _width + x]; } - uint8& operator[](uint16 index) { if(index > _width * _height) return _image[0]; return _image[index]; } + uint8& operator[](uint16 index) { if (index > _width * _height) return _image[0]; return _image[index]; } protected: diff --git a/kyra/script.cpp b/kyra/script.cpp index 755ca58925..9176f4a4f4 100644 --- a/kyra/script.cpp +++ b/kyra/script.cpp @@ -504,12 +504,12 @@ uint32 VMContext::contScript(void) { uint32 scriptStateAtStart = _scriptState; // runs the script - while(true) { + while (true) { if ((uint32)_instructionPos > _chunks[kData]._size) { debug("_instructionPos( = %d) > _chunks[kData]._size( = %d)", _instructionPos, _chunks[kData]._size); _error = true; break; - } else if(_instructionPos >= _nextScriptPos) { + } else if (_instructionPos >= _nextScriptPos) { _scriptState = kScriptStopped; break; } diff --git a/queen/command.cpp b/queen/command.cpp index 16cd5c805f..bb1c9a754c 100644 --- a/queen/command.cpp +++ b/queen/command.cpp @@ -954,7 +954,7 @@ void Command::openOrCloseAssociatedObject(Verb action, int16 otherObj) { int16 Command::setConditions(uint16 command, bool lastCmd) { debug(9, "Command::setConditions(%d, %d)", command, lastCmd); // Test conditions, if FAIL write && exit, Return -1 - // if(Joe speaks before he returns, -2 is returned + // if (Joe speaks before he returns, -2 is returned // This way a -1 return will allow Joe to speak normal description uint16 temp[21]; diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp index 874480f3d5..a369a19a2b 100644 --- a/queen/cutaway.cpp +++ b/queen/cutaway.cpp @@ -350,7 +350,7 @@ void Cutaway::changeRooms(CutawayObject &object) { } } - } // for() + } // for () } // set coordinates for Joe if he is on screen @@ -686,7 +686,7 @@ const byte *Cutaway::handleAnimation(const byte *ptr, CutawayObject &object) { if (objAnim[i].song > 0) _vm->sound()->playSong(objAnim[i].song); - } // for() + } // for () } bool moving = true; @@ -886,7 +886,7 @@ void Cutaway::run(char *nextFilename) { _roomFade = false; } - } // for() + } // for () _vm->display()->clearTexts(0, 198); // XXX lines 1887-1895 in cutaway.c @@ -1086,7 +1086,7 @@ void Cutaway::stop() { } } } - } // for() + } // for () int16 specialMove = (int16)READ_BE_INT16(ptr); ptr += 2; if (specialMove > 0) @@ -1162,7 +1162,7 @@ void Cutaway::updateGameState() { } } - } // for() + } // for () } void Cutaway::talk(char *nextFilename) { diff --git a/queen/display.cpp b/queen/display.cpp index aa4f6eeb12..78da49bb36 100644 --- a/queen/display.cpp +++ b/queen/display.cpp @@ -721,9 +721,9 @@ void Display::blit(uint8 *dstBuf, uint16 dstPitch, uint16 x, uint16 y, const uin } } else if (!xflip) { // Masked bitmap unflipped while (h--) { - for(int i = 0; i < w; ++i) { + for (int i = 0; i < w; ++i) { uint8 b = *(srcBuf + i); - if(b != 0) { + if (b != 0) { *(dstBuf + i) = b; } } @@ -732,9 +732,9 @@ void Display::blit(uint8 *dstBuf, uint16 dstPitch, uint16 x, uint16 y, const uin } } else { // Masked bitmap flipped while (h--) { - for(int i = 0; i < w; ++i) { + for (int i = 0; i < w; ++i) { uint8 b = *(srcBuf + i); - if(b != 0) { + if (b != 0) { *(dstBuf - i) = b; } } diff --git a/queen/talk.cpp b/queen/talk.cpp index 2a146a5300..bbf623e791 100644 --- a/queen/talk.cpp +++ b/queen/talk.cpp @@ -156,7 +156,7 @@ void Talk::talk(const char *filename, int personInRoom, char *cutawayFilename) { sprintf(_joeVoiceFilePrefix[i], "%2d%4xJ", _talkKey, _dialogueTree[level][i].head); } - // Check to see if(all the dialogue options have been selected. + // Check to see if (all the dialogue options have been selected. // if this is the case, and the last one left is the exit option, // then automatically set S to that and exit. @@ -495,7 +495,7 @@ int Talk::getSpeakCommand(const Person *person, const char *sentence, unsigned & else _vm->walk()->movePerson(person, x, y, _vm->graphics()->numFrames(), 0); index += 11; - // if(JOEWALK==3) CUTQUIT=0; + // if (JOEWALK==3) CUTQUIT=0; // XXX personWalking = true; } break; @@ -1312,7 +1312,7 @@ int16 Talk::selectSentence() { selectedSentence = zone; } - } // while() + } // while () } } diff --git a/saga/actor.h b/saga/actor.h index 2afc7ec806..6064e259ef 100644 --- a/saga/actor.h +++ b/saga/actor.h @@ -314,12 +314,12 @@ public: out.writeSint32LE(frameNumber); out.writeSint32LE(tileDirectionsAlloced); - for(int i = 0; i < tileDirectionsAlloced; i++) { + for (int i = 0; i < tileDirectionsAlloced; i++) { out.writeByte(tileDirections[i]); } out.writeSint32LE(walkStepsAlloced); - for(int i = 0; i < walkStepsAlloced; i++) { + for (int i = 0; i < walkStepsAlloced; i++) { out.writeSint16LE(walkStepsPoints[i].x); out.writeSint16LE(walkStepsPoints[i].y); } @@ -349,12 +349,12 @@ public: setTileDirectionsSize(in.readSint32LE(), true); - for(int i = 0; i < tileDirectionsAlloced; i++) { + for (int i = 0; i < tileDirectionsAlloced; i++) { tileDirections[i] = in.readByte(); } setWalkStepsPointsSize(in.readSint32LE(), true); - for(int i = 0; i < walkStepsAlloced; i++) { + for (int i = 0; i < walkStepsAlloced; i++) { walkStepsPoints[i].x = in.readSint16LE(); walkStepsPoints[i].y = in.readSint16LE(); } diff --git a/saga/isomap.cpp b/saga/isomap.cpp index 8a3e90a8c5..98fc236270 100644 --- a/saga/isomap.cpp +++ b/saga/isomap.cpp @@ -923,7 +923,7 @@ void IsoMap::pushPoint(int16 u, int16 v, uint16 cost, uint16 direction) { return; } - while(1) { + while (1) { mid = (upper + lower) / 2; tilePoint = _searchArray.getQueue(mid); @@ -1300,10 +1300,10 @@ void IsoMap::findTilePath(ActorData* actor, const Location &start, const Locatio if (terrainMask & SAGA_IMPASSABLE) { continue; } else { - if(terrainMask & (1 << kTerrRough)) { + if (terrainMask & (1 << kTerrRough)) { tdir = &hardDirTable[ dir ]; } else { - if(terrainMask & (1 << kTerrNone)) { + if (terrainMask & (1 << kTerrNone)) { tdir = &normalDirTable[ dir ]; } else { tdir = &easyDirTable[ dir ]; diff --git a/saga/list.h b/saga/list.h index b27a4f9ce6..f53dcd0b18 100644 --- a/saga/list.h +++ b/saga/list.h @@ -130,7 +130,7 @@ public: void remove(const T* val) { for (iterator i = Common::List<T>::begin(); i != Common::List<T>::end(); ++i) - if(val == i.operator->()) { + if (val == i.operator->()) { erase(i); return; } diff --git a/saga/saga.cpp b/saga/saga.cpp index d10ea7638b..462517d09b 100644 --- a/saga/saga.cpp +++ b/saga/saga.cpp @@ -296,7 +296,7 @@ int SagaEngine::go() { _scene->startScene(); uint32 currentTicks; - while(!_quit) { + while (!_quit) { if (_console->isAttached()) _console->onFrame(); diff --git a/saga/sdebug.cpp b/saga/sdebug.cpp index 7235023c67..83042ab953 100644 --- a/saga/sdebug.cpp +++ b/saga/sdebug.cpp @@ -101,7 +101,7 @@ int Script::SDebugPrintInstr(ScriptThread *thread) { sprintf(tmp_buf, "%02X", param); SD_ADDTXT(tmp_buf); /* - if((param >= 0) && (param < diag_list->n_dialogue)) { + if ((param >= 0) && (param < diag_list->n_dialogue)) { debug(2, " ; \"%.*s\"", SCRIPT_STRINGLIMIT, diag_list->str[param]); } else { diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp index 02881efef5..8c190a6a0b 100644 --- a/saga/sfuncs.cpp +++ b/saga/sfuncs.cpp @@ -186,7 +186,7 @@ void Script::sfTakeObject(SCRIPTFUNC_PARAMS) { obj = _vm->_actor->getObj(objectId); if (obj->sceneNumber != ITE_SCENE_INV) { obj->sceneNumber = ITE_SCENE_INV; - //4debug for(int j=0;j<17;j++) + //4debug for (int j=0;j<17;j++) _vm->_interface->addToInventory(objectId); } } diff --git a/saga/sprite.cpp b/saga/sprite.cpp index 038e6ba001..a7b0d09e90 100644 --- a/saga/sprite.cpp +++ b/saga/sprite.cpp @@ -432,7 +432,7 @@ void Sprite::scaleBuffer(const byte *src, int width, int height, int scale) { for (int i = 0; i < height; i++) { vskip += skip; - if(vskip < skip) { // We had an overflow + if (vskip < skip) { // We had an overflow src += width; } else { hskip = 0x80; diff --git a/scumm/charset.cpp b/scumm/charset.cpp index 9d14818394..e3c4c0b7bd 100644 --- a/scumm/charset.cpp +++ b/scumm/charset.cpp @@ -251,14 +251,14 @@ void CharsetRendererV3::setCurID(byte id) { } int CharsetRendererCommon::getFontHeight() { - if(_vm->_useCJKMode) + if (_vm->_useCJKMode) return MAX(_vm->_2byteHeight + 1, (int)_fontPtr[1]); else return _fontPtr[1]; } int CharsetRendererV3::getFontHeight() { - if(_vm->_useCJKMode) + if (_vm->_useCJKMode) return MAX(_vm->_2byteHeight + 1, 8); else return 8; @@ -289,7 +289,7 @@ int CharsetRenderer::getStringWidth(int arg, const byte *text) { if (_vm->_heversion >= 72 && chr == code) { chr = text[pos++]; if (chr == 84) { // Strings of speech offset/size - while(chr != code) + while (chr != code) chr = text[pos++]; continue; } @@ -303,7 +303,7 @@ int CharsetRenderer::getStringWidth(int arg, const byte *text) { break; if (chr == 254 || chr == 255) { //process in LE - if(chr == 254 && checkKSCode(text[pos], chr) && _vm->_useCJKMode) { + if (chr == 254 && checkKSCode(text[pos], chr) && _vm->_useCJKMode) { goto loc_avoid_ks_fe; } chr = text[pos++]; @@ -354,7 +354,7 @@ void CharsetRenderer::addLinebreaks(int a, byte *str, int pos, int maxwidth) { if (_vm->_heversion >= 72 && chr == code) { chr = str[pos++]; if (chr == 84) { // Strings of speech offset/size - while(chr != code) + while (chr != code) chr = str[pos++]; continue; } @@ -370,7 +370,7 @@ void CharsetRenderer::addLinebreaks(int a, byte *str, int pos, int maxwidth) { continue; if (chr == 254 || chr == 255) { //process in LE - if(chr == 254 && checkKSCode(str[pos], chr) && _vm->_useCJKMode) { + if (chr == 254 && checkKSCode(str[pos], chr) && _vm->_useCJKMode) { goto loc_avoid_ks_fe; } chr = str[pos++]; diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp index 0b74138248..847fb9ad27 100644 --- a/scumm/debugger.cpp +++ b/scumm/debugger.cpp @@ -546,7 +546,7 @@ bool ScummDebugger::Cmd_Debug(int argc, const char **argv) { if ((argc == 1) && (_vm->_debugFlags > 0)) { for (int i = 0; i < numChannels; i++) { - if(_vm->_debugFlags & debugChannels[i].flag) + if (_vm->_debugFlags & debugChannels[i].flag) DebugPrintf("%s - %s\n", debugChannels[i].channel, debugChannels[i].desc); } @@ -570,7 +570,7 @@ bool ScummDebugger::Cmd_Debug(int argc, const char **argv) { // Identify flag const char *realFlag = argv[1] + 1; for (int i = 0; i < numChannels; i++) { - if((scumm_stricmp(debugChannels[i].channel, realFlag)) == 0) { + if ((scumm_stricmp(debugChannels[i].channel, realFlag)) == 0) { if (setFlag) { _vm->_debugFlags |= debugChannels[i].flag; DebugPrintf("Enable "); diff --git a/scumm/help.cpp b/scumm/help.cpp index a3c3e09faf..22df7ecdb8 100644 --- a/scumm/help.cpp +++ b/scumm/help.cpp @@ -60,7 +60,7 @@ int ScummHelp::numPages(byte gameId) { } } -#define ADD_BIND(k,d) do { key[i] = k; dsc[i] = d; i++; } while(0) +#define ADD_BIND(k,d) do { key[i] = k; dsc[i] = d; i++; } while (0) #define ADD_TEXT(d) ADD_BIND("",d) #define ADD_LINE ADD_BIND("","") diff --git a/scumm/imuse_digi/dimuse_script.cpp b/scumm/imuse_digi/dimuse_script.cpp index 8a2e77f283..315ac03c0c 100644 --- a/scumm/imuse_digi/dimuse_script.cpp +++ b/scumm/imuse_digi/dimuse_script.cpp @@ -371,7 +371,7 @@ int32 IMuseDigital::getCurMusicLipSyncHeight(int syncId) { void IMuseDigital::stopAllSounds() { debug(5, "IMuseDigital::stopAllSounds"); - for(;;) { + for (;;) { bool foundNotRemoved = false; for (int l = 0; l < MAX_DIGITAL_TRACKS + MAX_DIGITAL_FADETRACKS; l++) { Track *track = _track[l]; diff --git a/scumm/imuse_internal.h b/scumm/imuse_internal.h index a0e05db9fb..46369f5d42 100644 --- a/scumm/imuse_internal.h +++ b/scumm/imuse_internal.h @@ -71,17 +71,17 @@ class ScummEngine; //////////////////////////////////////// inline int clamp(int val, int min, int max) { - if(val < min) + if (val < min) return min; - if(val > max) + if (val > max) return max; return val; } inline int transpose_clamp(int a, int b, int c) { - if(b > a) + if (b > a) a += (b - a + 11) / 12 * 12; - if(c < a) + if (c < a) a -= (a - c + 11) / 12 * 12; return a; } diff --git a/scumm/resource_v7he.cpp b/scumm/resource_v7he.cpp index 9e0be4efa9..2002ef8b99 100644 --- a/scumm/resource_v7he.cpp +++ b/scumm/resource_v7he.cpp @@ -1368,7 +1368,7 @@ bool MacResExtractor::init(File in) { // Length check int sumlen = MBI_INFOHDR + data_size_pad + rsrc_size_pad; - if(sumlen == filelen) + if (sumlen == filelen) _resOffset = MBI_INFOHDR + data_size_pad; } @@ -1581,7 +1581,7 @@ void MacResExtractor::convertIcons(byte *data, int datasize, byte **cursor, int palette = (byte *)malloc(ctSize * 4); // Read just high byte of 16-bit color - for(int c = 0; c < ctSize; c++) { + for (int c = 0; c < ctSize; c++) { // We just use indices 0..ctSize, so ignore color ID dis.readUint16BE(); // colorID[c] @@ -1608,7 +1608,7 @@ void MacResExtractor::convertIcons(byte *data, int datasize, byte **cursor, int // build a mask to make sure the pixels are properly shifted out bitmask = 0; - for(int m = 0; m < bpp; m++) { + for (int m = 0; m < bpp; m++) { bitmask <<= 1; bitmask |= 1; } diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index de487d2ae8..9b3ce60bdc 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -2055,7 +2055,7 @@ void ScummEngine_v72he::copyArray(int array1, int a1_dim2start, int a1_dim2end, for (; a1_dim2start <= a1_dim2end; ++a1_dim2start, ++a2_dim2start) { int a2dim1 = a2_dim1start; int a1dim1 = a1_dim1start; - for(; a1dim1 <= a1_dim1end; ++a1dim1, ++a2dim1) { + for (; a1dim1 <= a1_dim1end; ++a1dim1, ++a2dim1) { int val = readArray(array2, a2_dim2start, a2dim1); writeArray(array1, a1_dim2start, a1dim1, val); } diff --git a/scumm/smush/smush_font.cpp b/scumm/smush/smush_font.cpp index 914691f84a..683547f212 100644 --- a/scumm/smush/smush_font.cpp +++ b/scumm/smush/smush_font.cpp @@ -44,7 +44,7 @@ int SmushFont::getStringWidth(const char *str) { int width = 0; while (*str) { - if(*str & 0x80 && _vm->_useCJKMode) { + if (*str & 0x80 && _vm->_useCJKMode) { width += _vm->_2byteWidth + 1; str += 2; } else diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp index de24c74693..bfce7499e9 100644 --- a/scumm/smush/smush_player.cpp +++ b/scumm/smush/smush_player.cpp @@ -1145,7 +1145,7 @@ void SmushPlayer::insanity(bool flag) { void SmushPlayer::seekSan(const char *file, int32 pos, int32 contFrame) { Common::StackLock lock(_mutex); - if(_smixer) + if (_smixer) _smixer->stop(); if (file) { diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp index decc8afa96..d2d2e12713 100644 --- a/scumm/sprite_he.cpp +++ b/scumm/sprite_he.cpp @@ -203,7 +203,7 @@ int ScummEngine_v90he::findSpriteWithClassOf(int x_pos, int y_pos, int spriteGro y += h / 2; } - if(isWizPixelNonTransparent(resId, resState, x, y, spi->curImgFlags)) + if (isWizPixelNonTransparent(resId, resState, x, y, spi->curImgFlags)) return spi->id; } } diff --git a/scumm/string.cpp b/scumm/string.cpp index e847219ed4..e0b42a18c7 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -255,7 +255,7 @@ void ScummEngine::CHARSET_1() { i = 0; memset(value, 0, 32); c = *buffer++; - while(c != 44) { + while (c != 44) { value[i] = c; c = *buffer++; i++; @@ -266,7 +266,7 @@ void ScummEngine::CHARSET_1() { i = 0; memset(value, 0, 32); c = *buffer++; - while(c != code) { + while (c != code) { value[i] = c; c = *buffer++; i++; @@ -286,7 +286,7 @@ void ScummEngine::CHARSET_1() { i = 0; memset(value, 0, 32); c = *buffer++; - while(c != code) { + while (c != code) { value[i] = c; c = *buffer++; i++; @@ -307,7 +307,7 @@ void ScummEngine::CHARSET_1() { } } else if (c == 0xFE || c == 0xFF) { // WORKAROUND to avoid korean code 0xfe treated as charset message code. - if(c == 0xFE && checkKSCode(*(buffer + 1), c) && _useCJKMode) { + if (c == 0xFE && checkKSCode(*(buffer + 1), c) && _useCJKMode) { goto loc_avoid_ks_fe; } c = *buffer++; @@ -387,7 +387,7 @@ loc_avoid_ks_fe: c = 0x20; //not in S-JIS } else { c += *buffer++ * 256; //LE - if(_gameId == GID_CMI) { //HACK: This fixes korean text position in COMI (off by 6 pixel) + if (_gameId == GID_CMI) { //HACK: This fixes korean text position in COMI (off by 6 pixel) cmi_pos_hack = true; _charset->_top += 6; } @@ -407,7 +407,7 @@ loc_avoid_ks_fe: } else _charset->printChar(c); } - if(cmi_pos_hack) { + if (cmi_pos_hack) { cmi_pos_hack = false; _charset->_top -= 6; } @@ -554,7 +554,7 @@ void ScummEngine::drawString(int a, const byte *msg) { c = 0x20; //not in S-JIS } else { c += buf[i++] * 256; - if(_gameId == GID_CMI) { + if (_gameId == GID_CMI) { cmi_pos_hack = true; _charset->_top += 6; } @@ -563,7 +563,7 @@ void ScummEngine::drawString(int a, const byte *msg) { _charset->printChar(c); _charset->_blitAlso = false; - if(cmi_pos_hack) { + if (cmi_pos_hack) { cmi_pos_hack = false; _charset->_top -= 6; } diff --git a/simon/debug.cpp b/simon/debug.cpp index b8a274dacc..3d3c8dbb9a 100644 --- a/simon/debug.cpp +++ b/simon/debug.cpp @@ -409,7 +409,7 @@ void SimonEngine::dump_vga_bitmaps(const byte *vga, byte *vga1, int res) { i = 538; - for(i = 1; ; i++) { + for (i = 1; ; i++) { p2 = vga + i * 8; offs = READ_BE_UINT32(p2); diff --git a/simon/saveload.cpp b/simon/saveload.cpp index 0820a2eed5..f55f7d2fe8 100644 --- a/simon/saveload.cpp +++ b/simon/saveload.cpp @@ -71,7 +71,7 @@ int SimonEngine::display_savegame_list(int curpos, bool load, char *dst) { slot = curpos; while (curpos + 6 > slot) { - if(!(in = _saveFileMan->openForLoading(gen_savename(slot)))) + if (!(in = _saveFileMan->openForLoading(gen_savename(slot)))) break; in->read(dst, 18); @@ -95,7 +95,7 @@ int SimonEngine::display_savegame_list(int curpos, bool load, char *dst) { } } else { if (curpos + 6 == slot) { - if((in = _saveFileMan->openForLoading(gen_savename(slot)))) { + if ((in = _saveFileMan->openForLoading(gen_savename(slot)))) { slot++; delete in; } diff --git a/simon/simon.cpp b/simon/simon.cpp index 1eeae88131..963b3af147 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -3560,17 +3560,17 @@ void SimonEngine::talk_with_text(uint vgaSpriteId, uint color, const char *strin } \ (var) = bb & 1; \ bb >>= 1; \ -}while(0) +}while (0) #define SD_GETBITS(var, nbits) do { \ bc = (nbits); \ (var) = 0; \ - while(bc--) { \ + while (bc--) { \ (var) <<= 1; \ SD_GETBIT(bit); \ (var) |= bit; \ } \ -}while(0) +}while (0) #define SD_TYPE_LITERAL (0) #define SD_TYPE_MATCH (1) diff --git a/sky/screen.cpp b/sky/screen.cpp index c16c8a215c..ab2f3d66b5 100644 --- a/sky/screen.cpp +++ b/sky/screen.cpp @@ -605,7 +605,7 @@ void Screen::doSprites(uint8 layer) { drawListNum++; drawList = (uint16 *)_skyCompact->fetchCpt(idNum); - while(drawList[0]) { + while (drawList[0]) { // new_draw_list: while ((drawList[0] != 0) && (drawList[0] != 0xFFFF)) { // back_loop: diff --git a/sky/text.cpp b/sky/text.cpp index 9c6fc68da3..6f1019eb3f 100644 --- a/sky/text.cpp +++ b/sky/text.cpp @@ -328,7 +328,7 @@ void Text::getText(uint32 textNr) { //load text #"textNr" into textBuffer do { textChar = getTextChar(); *dest++ = textChar; - } while(textChar); + } while (textChar); } void Text::fnPointerText(uint32 pointedId, uint16 mouseX, uint16 mouseY) { diff --git a/sound/adpcm.cpp b/sound/adpcm.cpp index 9df92fa680..b20285a795 100644 --- a/sound/adpcm.cpp +++ b/sound/adpcm.cpp @@ -148,16 +148,16 @@ int16 ADPCMInputStream::okiADPCMDecode(byte code) { samp = _status.last + diff; // Clip the values to +/- 2^11 (supposed to be 12 bits) - if(samp > 2048) + if (samp > 2048) samp = 2048; - if(samp < -2048) + if (samp < -2048) samp = -2048; _status.last = samp; _status.stepIndex += stepAdjust(code); - if(_status.stepIndex < 0) + if (_status.stepIndex < 0) _status.stepIndex = 0; - if(_status.stepIndex > 48) + if (_status.stepIndex > 48) _status.stepIndex = 48; return samp; @@ -200,16 +200,16 @@ int16 ADPCMInputStream::imaADPCMDecode(byte code) { diff = (code & 0x08) ? -E : E; samp = _status.last + diff; - if(samp < -32768) + if (samp < -32768) samp = -32768; - else if(samp > 32767) + else if (samp > 32767) samp = 32767; _status.last = samp; _status.stepIndex += stepAdjust(code); - if(_status.stepIndex < 0) + if (_status.stepIndex < 0) _status.stepIndex = 0; - if(_status.stepIndex > 88) + if (_status.stepIndex > 88) _status.stepIndex = 88; return samp; diff --git a/sound/mixer.cpp b/sound/mixer.cpp index 5face1f8a9..18b55746cf 100644 --- a/sound/mixer.cpp +++ b/sound/mixer.cpp @@ -159,7 +159,7 @@ void SoundMixer::insertChannel(SoundHandle *handle, Channel *chan) { break; } } - if(index == -1) { + if (index == -1) { warning("SoundMixer::out of mixer slots"); delete chan; return; diff --git a/sound/softsynth/mt32/freeverb.cpp b/sound/softsynth/mt32/freeverb.cpp index 250be0eb5e..46193a5f4b 100644 --- a/sound/softsynth/mt32/freeverb.cpp +++ b/sound/softsynth/mt32/freeverb.cpp @@ -158,7 +158,7 @@ void revmodel::mute() { void revmodel::processreplace(float *inputL, float *inputR, float *outputL, float *outputR, long numsamples, int skip) { float outL, outR, input; - while(numsamples-- > 0) { + while (numsamples-- > 0) { int i; outL = outR = 0; diff --git a/sound/softsynth/mt32/partial.cpp b/sound/softsynth/mt32/partial.cpp index 4cbe4e015c..e7e7af2a7f 100644 --- a/sound/softsynth/mt32/partial.cpp +++ b/sound/softsynth/mt32/partial.cpp @@ -669,9 +669,9 @@ Bit32s Partial::getFiltEnvelope() { tStat->envsize = synth->tables.envTime[(int)patchCache->filtEnv.envtime[tStat->envstat]]; } else { Bit32u envTime = (int)patchCache->filtEnv.envtime[tStat->envstat]; - if(tStat->envstat > 1) { + if (tStat->envstat > 1) { int envDiff = abs(patchCache->filtEnv.envlevel[tStat->envstat] - patchCache->filtEnv.envlevel[tStat->envstat - 1]); - if(envTime > synth->tables.envDeltaMaxTime[envDiff]) { + if (envTime > synth->tables.envDeltaMaxTime[envDiff]) { envTime = synth->tables.envDeltaMaxTime[envDiff]; } } diff --git a/sound/softsynth/mt32/tables.cpp b/sound/softsynth/mt32/tables.cpp index 0acaa51df8..35b1672d40 100644 --- a/sound/softsynth/mt32/tables.cpp +++ b/sound/softsynth/mt32/tables.cpp @@ -161,11 +161,11 @@ void Tables::initEnvelopes(float samplerate) { envTime[lf] = samples; // Cap on envelope times depending on the level delta - if(elf == 0) { + if (elf == 0) { envDeltaMaxTime[lf] = 63; } else { float cap = 11 * log(elf) + 64; - if(cap > 100.0f) { + if (cap > 100.0f) { cap = 100.0f; } envDeltaMaxTime[lf] = (int)cap; @@ -380,7 +380,7 @@ void Tables::initMT32ConstantTables(Synth *synth) { // Distance of full volume reduction amplog = (float)(12.0f / (float)lf) * 24.0f; - if(distval > amplog) { + if (distval > amplog) { tvaBiasMult[lf][distval] = 0; } else { dval = (amplog - (float)distval) / amplog; diff --git a/sword1/logic.cpp b/sword1/logic.cpp index b38f046325..9151a8d05e 100644 --- a/sword1/logic.cpp +++ b/sword1/logic.cpp @@ -245,7 +245,7 @@ void Logic::processLogic(Object *compact, uint32 id) { error("Fatal error: compact %d's logic == %X!", id, compact->o_logic); break; } - } while(logicRet); + } while (logicRet); } int Logic::logicWaitTalk(Object *compact) { diff --git a/sword1/router.cpp b/sword1/router.cpp index 0526a2522c..e8c3296f45 100644 --- a/sword1/router.cpp +++ b/sword1/router.cpp @@ -190,7 +190,7 @@ int32 Router::routeFinder(int32 id, Object *megaObject, int32 x, int32 y, int32 solidFlag = SolidWalkAnimator(megaObject->o_route); } - if(!solidFlag) + if (!solidFlag) { SlidyPath(); SlidyWalkAnimator(megaObject->o_route); @@ -247,7 +247,7 @@ int32 Router::GetRoute() changed = Scan(level); level =level + 1; } - while(changed == 1); + while (changed == 1); // Check to see if the route reached the target if (node[nnodes].dist < 9999) @@ -869,7 +869,7 @@ void Router::SlidyWalkAnimator(WalkData *walkAnim) step += 1; module += 1; } - while( module < moduleEnd) ; + while ( module < moduleEnd) ; stepX = modX[modularPath[p].dir]; stepY = modY[modularPath[p].dir]; errorX = modularPath[p].x - moduleX; @@ -923,7 +923,7 @@ void Router::SlidyWalkAnimator(WalkData *walkAnim) frameCount += 1; walkAnim[lastCount + frameCount - 1].x += errorX*frameCount/frames; } - while(frameCount<frames); + while (frameCount<frames); } if (errorY != 0) { @@ -934,7 +934,7 @@ void Router::SlidyWalkAnimator(WalkData *walkAnim) frameCount += 1; walkAnim[lastCount + frameCount-1].y += errorY*frameCount/frames; } - while(frameCount<frames); + while (frameCount<frames); } // Now is the time to put in the turn frames for the last turn if (frames < framesPerStep) @@ -954,7 +954,7 @@ void Router::SlidyWalkAnimator(WalkData *walkAnim) walkAnim[frame].frame += 104;//turning left frame += 1; } - while(frame < lastCount ); + while (frame < lastCount ); } if (((lastDir == 1) || (lastDir == -7)) || ((lastDir == 2) || (lastDir == -6))) { @@ -965,7 +965,7 @@ void Router::SlidyWalkAnimator(WalkData *walkAnim) walkAnim[frame].frame += 200; //was 60 now 116 frame += 1; } - while(frame < lastCount ); + while (frame < lastCount ); } lastDir = currentDir; } @@ -1359,7 +1359,7 @@ int32 Router::SolidWalkAnimator(WalkData *walkAnim) do { - while(modularPath[p].num > 0) + while (modularPath[p].num > 0) { currentDir = modularPath[p].dir; if (currentDir< NO_DIRECTIONS) @@ -1388,7 +1388,7 @@ int32 Router::SolidWalkAnimator(WalkData *walkAnim) module += 1; step += 1; } - while( module < moduleEnd) ; + while ( module < moduleEnd) ; errorX = modularPath[p].x - moduleX; errorX = errorX * modX[modularPath[p].dir]; errorY = modularPath[p].y - moduleY; @@ -1432,7 +1432,7 @@ int32 Router::SolidWalkAnimator(WalkData *walkAnim) walkAnim[frame].frame += 104;//turning left frame += 1; } - while(frame < lastCount ); + while (frame < lastCount ); } if (((lastDir == 1) || (lastDir == -7)) || ((lastDir == 2) || (lastDir == -6))) { @@ -1443,7 +1443,7 @@ int32 Router::SolidWalkAnimator(WalkData *walkAnim) walkAnim[frame].frame += 200; //was 60 now 116 frame += 1; } - while(frame < lastCount ); + while (frame < lastCount ); } } // all turns checked @@ -1474,7 +1474,7 @@ int32 Router::SolidWalkAnimator(WalkData *walkAnim) walkAnim[frame].frame += 278;//stopping right frame += 1; } - while(frame < lastCount ); + while (frame < lastCount ); walkAnim[stepCount].frame = 308; walkAnim[stepCount].step = 7; walkAnim[stepCount].dir = currentDir; @@ -1489,7 +1489,7 @@ int32 Router::SolidWalkAnimator(WalkData *walkAnim) walkAnim[frame].frame += 279;//stopping right frame += 1; } - while(frame < lastCount ); + while (frame < lastCount ); walkAnim[stepCount].frame = 315; walkAnim[stepCount].step = 7; walkAnim[stepCount].dir = currentDir; @@ -1510,7 +1510,7 @@ int32 Router::SolidWalkAnimator(WalkData *walkAnim) walkAnim[frame].frame += 244;//stopping left frame += 1; } - while(frame < lastCount ); + while (frame < lastCount ); walkAnim[stepCount].frame = 322; walkAnim[stepCount].step = 7; walkAnim[stepCount].dir = currentDir; @@ -1525,7 +1525,7 @@ int32 Router::SolidWalkAnimator(WalkData *walkAnim) walkAnim[frame].frame += 245;//stopping left frame += 1; } - while(frame < lastCount ); + while (frame < lastCount ); walkAnim[stepCount].frame = 329; walkAnim[stepCount].step = 7; walkAnim[stepCount].dir = currentDir; @@ -1565,7 +1565,7 @@ int32 Router::SolidWalkAnimator(WalkData *walkAnim) #endif i += 1; } - while(i<p-1); + while (i<p-1); if (p != 0) { targetDir = modularPath[p-1].dir; @@ -1646,11 +1646,11 @@ int32 Router::Scan(int32 level) } k-=1; } - while(k > 0); + while (k > 0); } i=i+1; } - while(i < nnodes); + while (i < nnodes); return changed; } @@ -2046,7 +2046,7 @@ int32 Router::LineCheck(int32 x1 , int32 y1 , int32 x2 ,int32 y2) } i = i + 1; } - while((i < nbars) && linesCrossed); + while ((i < nbars) && linesCrossed); return linesCrossed; } @@ -2100,7 +2100,7 @@ int32 Router::HorizCheck(int32 x1 , int32 y , int32 x2) } i = i + 1; } - while((i < nbars) && linesCrossed); + while ((i < nbars) && linesCrossed); return linesCrossed; } @@ -2153,7 +2153,7 @@ int32 Router::VertCheck(int32 x, int32 y1, int32 y2) } i = i + 1; } - while((i < nbars) && linesCrossed); + while ((i < nbars) && linesCrossed); return linesCrossed; } @@ -2229,7 +2229,7 @@ int32 Router::CheckTarget(int32 x , int32 y) } i = i + 1; } - while((i < nbars) && (onLine == 0)); + while ((i < nbars) && (onLine == 0)); return onLine; } @@ -2313,7 +2313,7 @@ int32 Router::LoadWalkResources(Object *megaObject, int32 x, int32 y, int32 dir) fPolygrid += 2*sizeof(int16); j ++; } - while(j < nnodes);//array starts at 0*/ + while (j < nnodes);//array starts at 0*/ for (cnt = 1; cnt < nnodes; cnt++) { node[cnt].x = READ_LE_UINT16(fPolygrid); fPolygrid += 2; node[cnt].y = READ_LE_UINT16(fPolygrid); fPolygrid += 2; @@ -2338,7 +2338,7 @@ int32 Router::LoadWalkResources(Object *megaObject, int32 x, int32 y, int32 dir) // copy any extra nodes from extraNode array j = 0; - while(j < _numExtraNodes)//array starts at 0 + while (j < _numExtraNodes)//array starts at 0 { node[nnodes+j].x = _extraNodes[j].x ; node[nnodes+j].y = _extraNodes[j].y ; diff --git a/sword1/text.cpp b/sword1/text.cpp index 6bc9fbda8d..aa92b28aaa 100644 --- a/sword1/text.cpp +++ b/sword1/text.cpp @@ -64,7 +64,7 @@ uint32 Text::lowTextManager(uint8 *ascii, int32 width, uint8 pen) { uint32 textObjId = (TEXT_sect * ITM_PER_SEC) - 1; do { textObjId++; - } while(_objMan->fetchObject(textObjId)->o_status); + } while (_objMan->fetchObject(textObjId)->o_status); // okay, found a free text object _objMan->fetchObject(textObjId)->o_status = STAT_FORE; @@ -128,7 +128,7 @@ uint16 Text::analyzeSentence(uint8 *text, uint16 maxWidth, LineInfo *line) { text++; wordWidth += OVERLAP; // no overlap on final letter of word! - if( firstWord ) { // first word on first line, so no separating SPACE needed + if ( firstWord ) { // first word on first line, so no separating SPACE needed line[0].width = wordWidth; line[0].length = wordLength; firstWord = false; |