From ae7c6406712dcc5f3567caaab9b2f95c379c9c10 Mon Sep 17 00:00:00 2001 From: Paweł Kołodziejski Date: Sun, 15 Apr 2007 15:40:24 +0000 Subject: fixed warnings svn-id: r26506 --- dists/msvc8/kyra.vcproj | 8 ++++---- dists/msvc8/scumm.vcproj | 2 +- dists/msvc8/scummvm.vcproj | 2 +- engines/gob/draw_v2.cpp | 2 +- engines/gob/game.cpp | 2 +- engines/gob/inter_v2.cpp | 8 ++++---- engines/gob/sound.cpp | 8 ++++---- engines/scumm/resource_v2.cpp | 8 ++++---- engines/scumm/resource_v3.cpp | 2 +- engines/scumm/sound.cpp | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/dists/msvc8/kyra.vcproj b/dists/msvc8/kyra.vcproj index 1634a4f432..3733f6089c 100644 --- a/dists/msvc8/kyra.vcproj +++ b/dists/msvc8/kyra.vcproj @@ -192,19 +192,19 @@ > = 100) diff --git a/engines/gob/game.cpp b/engines/gob/game.cpp index f146cded6d..4bc95d78cf 100644 --- a/engines/gob/game.cpp +++ b/engines/gob/game.cpp @@ -133,7 +133,7 @@ byte *Game::loadExtData(int16 itemId, int16 *pResWidth, offset = item->offset; size = item->size; - isPacked = (bool) (item->width & 0x8000); + isPacked = (item->width & 0x8000) != 0; if (pResWidth != 0) { *pResWidth = item->width & 0x7FFF; diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp index 5dc5edd823..d0677757d5 100644 --- a/engines/gob/inter_v2.cpp +++ b/engines/gob/inter_v2.cpp @@ -2004,12 +2004,12 @@ void Inter_v2::o2_stopInfogrames(OpGobParams ¶ms) { } void Inter_v2::o2_handleGoblins(OpGobParams ¶ms) { - _vm->_goblin->_gob1NoTurn = (bool) VAR(load16()); - _vm->_goblin->_gob2NoTurn = (bool) VAR(load16()); + _vm->_goblin->_gob1NoTurn = VAR(load16()) != 0; + _vm->_goblin->_gob2NoTurn = VAR(load16()) != 0; _vm->_goblin->_gob1RelaxTimeVar = load16(); _vm->_goblin->_gob2RelaxTimeVar = load16(); - _vm->_goblin->_gob1Busy = (bool) VAR(load16()); - _vm->_goblin->_gob2Busy = (bool) VAR(load16()); + _vm->_goblin->_gob1Busy = VAR(load16()) != 0; + _vm->_goblin->_gob2Busy = VAR(load16()) != 0; _vm->_goblin->handleGoblins(); } diff --git a/engines/gob/sound.cpp b/engines/gob/sound.cpp index 9759ea087e..b390510768 100644 --- a/engines/gob/sound.cpp +++ b/engines/gob/sound.cpp @@ -235,7 +235,7 @@ void Snd::stopSound(int16 fadeLength, SoundDesc *sndDesc) { _fade = true; _fadeVol = 65536; _fadeSamples = (int) (fadeLength * (((double) _rate) / 10.0)); - _fadeVolStep = MAX(1U, 65536 / _fadeSamples); + _fadeVolStep = MAX(1UL, 65536 / _fadeSamples); _curFadeSamples = 0; } @@ -341,7 +341,7 @@ void Snd::setSample(SoundDesc &sndDesc, int16 repCount, int16 frequency, _fade = true; _fadeVol = 0; _fadeSamples = (int) (fadeLength * (((double) _rate) / 10.0)); - _fadeVolStep = - MAX(1U, 65536 / _fadeSamples); + _fadeVolStep = - (int32)MAX(1UL, 65536 / _fadeSamples); } } @@ -404,8 +404,8 @@ int Snd::readBuffer(int16 *buffer, const int numSamples) { // Linear interpolation. See sound/rate.cpp - val = _last + (((_cur - _last) * _offsetFrac + - (1UL << (FRAC_BITS - 1))) >> FRAC_BITS) << 8; + val = _last + ((((_cur - _last) * _offsetFrac + + (1UL << (FRAC_BITS - 1))) >> FRAC_BITS) << 8); *buffer++ = (((int32) val) * _fadeVol) >> 16; oldOffset = _offset; diff --git a/engines/scumm/resource_v2.cpp b/engines/scumm/resource_v2.cpp index 08393da708..6a4f1ea30b 100644 --- a/engines/scumm/resource_v2.cpp +++ b/engines/scumm/resource_v2.cpp @@ -93,7 +93,7 @@ void ScummEngine_v2::readClassicIndexFile() { for (i = 0; i < _numRooms; i++) { _res->roomoffs[rtRoom][i] = _fileHandle->readUint16LE(); if (_res->roomoffs[rtRoom][i] == 0xFFFF) - _res->roomoffs[rtRoom][i] = RES_INVALID_OFFSET; + _res->roomoffs[rtRoom][i] = (uint32)RES_INVALID_OFFSET; } for (i = 0; i < _numCostumes; i++) { @@ -102,7 +102,7 @@ void ScummEngine_v2::readClassicIndexFile() { for (i = 0; i < _numCostumes; i++) { _res->roomoffs[rtCostume][i] = _fileHandle->readUint16LE(); if (_res->roomoffs[rtCostume][i] == 0xFFFF) - _res->roomoffs[rtCostume][i] = RES_INVALID_OFFSET; + _res->roomoffs[rtCostume][i] = (uint32)RES_INVALID_OFFSET; } for (i = 0; i < _numScripts; i++) { @@ -111,7 +111,7 @@ void ScummEngine_v2::readClassicIndexFile() { for (i = 0; i < _numScripts; i++) { _res->roomoffs[rtScript][i] = _fileHandle->readUint16LE(); if (_res->roomoffs[rtScript][i] == 0xFFFF) - _res->roomoffs[rtScript][i] = RES_INVALID_OFFSET; + _res->roomoffs[rtScript][i] = (uint32)RES_INVALID_OFFSET; } for (i = 0; i < _numSounds; i++) { @@ -120,7 +120,7 @@ void ScummEngine_v2::readClassicIndexFile() { for (i = 0; i < _numSounds; i++) { _res->roomoffs[rtSound][i] = _fileHandle->readUint16LE(); if (_res->roomoffs[rtSound][i] == 0xFFFF) - _res->roomoffs[rtSound][i] = RES_INVALID_OFFSET; + _res->roomoffs[rtSound][i] = (uint32)RES_INVALID_OFFSET; } } diff --git a/engines/scumm/resource_v3.cpp b/engines/scumm/resource_v3.cpp index 1ac159c9a5..2a4add52f3 100644 --- a/engines/scumm/resource_v3.cpp +++ b/engines/scumm/resource_v3.cpp @@ -54,7 +54,7 @@ void ScummEngine_v3old::readResTypeList(int id) { for (i = 0; i < num; i++) { _res->roomoffs[id][i] = _fileHandle->readUint16LE(); if (_res->roomoffs[id][i] == 0xFFFF) - _res->roomoffs[id][i] = RES_INVALID_OFFSET; + _res->roomoffs[id][i] = (uint32)RES_INVALID_OFFSET; } } diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index 9f29418ca6..c54eb25db5 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -1221,7 +1221,7 @@ int ScummEngine::readSoundResource(int type, int idx) { debugC(DEBUG_SOUND, "FMUS file %s", buffer); if (dmuFile.open(buffer) == false) { error("Can't open music file %s*", buffer); - _res->roomoffs[type][idx] = RES_INVALID_OFFSET; + _res->roomoffs[type][idx] = (uint32)RES_INVALID_OFFSET; return 0; } dmuFile.seek(4, SEEK_SET); @@ -1245,7 +1245,7 @@ int ScummEngine::readSoundResource(int type, int idx) { } error("Unrecognized base tag 0x%08x in sound %d", basetag, idx); } - _res->roomoffs[type][idx] = RES_INVALID_OFFSET; + _res->roomoffs[type][idx] = (uint32)RES_INVALID_OFFSET; return 0; } @@ -2107,7 +2107,7 @@ int ScummEngine::readSoundResourceSmallHeader(int type, int idx) { _fileHandle->read(_res->createResource(type, idx, ro_size - 4), ro_size - 4); return 1; } - _res->roomoffs[type][idx] = RES_INVALID_OFFSET; + _res->roomoffs[type][idx] = (uint32)RES_INVALID_OFFSET; return 0; } -- cgit v1.2.3