diff options
-rw-r--r-- | engines/cryomni3d/font_manager.cpp | 6 | ||||
-rw-r--r-- | engines/cryomni3d/image/codecs/hlz.cpp | 2 | ||||
-rw-r--r-- | engines/cryomni3d/versailles/documentation.cpp | 4 | ||||
-rw-r--r-- | engines/cryomni3d/versailles/engine.cpp | 8 | ||||
-rw-r--r-- | engines/cryomni3d/versailles/logic.cpp | 2 | ||||
-rw-r--r-- | engines/cryomni3d/versailles/saveload.cpp | 3 |
6 files changed, 13 insertions, 12 deletions
diff --git a/engines/cryomni3d/font_manager.cpp b/engines/cryomni3d/font_manager.cpp index 9b37d27e10..b882b5106b 100644 --- a/engines/cryomni3d/font_manager.cpp +++ b/engines/cryomni3d/font_manager.cpp @@ -201,9 +201,9 @@ bool FontManager::displayBlockText(const Common::String &text, _blockPos.x += _spaceWidth; } else { double sp = (word_i + 1) * spaceWidthPerWord - spaceConsumed; - _blockPos.x += sp; - spaceConsumed += sp; - remainingSpace -= sp; + _blockPos.x += int16(sp); + spaceConsumed += uint(sp); + remainingSpace -= uint(sp); } } if (_blockPos.y + _lineHeight + getFontMaxHeight() >= _blockRect.bottom) { diff --git a/engines/cryomni3d/image/codecs/hlz.cpp b/engines/cryomni3d/image/codecs/hlz.cpp index 6f550c7720..adbea2d6ef 100644 --- a/engines/cryomni3d/image/codecs/hlz.cpp +++ b/engines/cryomni3d/image/codecs/hlz.cpp @@ -76,7 +76,7 @@ void HLZDecoder::decodeFrameInPlace(Common::SeekableReadStream &stream, uint32 s bool eof = false; bool checkSize = (size != (uint32) - 1); byte *orig = dst; - uint32 reg; + uint32 reg = 0; int regBits = 0; #define GETREG() getReg(stream, &size, ®, ®Bits) diff --git a/engines/cryomni3d/versailles/documentation.cpp b/engines/cryomni3d/versailles/documentation.cpp index 8defe0e707..c74aaa90c7 100644 --- a/engines/cryomni3d/versailles/documentation.cpp +++ b/engines/cryomni3d/versailles/documentation.cpp @@ -1081,11 +1081,11 @@ Common::String Versailles_Documentation::docAreaHandleCastleMap() { Common::Rect areaPos2; Area(const Common::Rect &areaPos_, const char *record_, bool fillArea_ = true, - uint messageId_ = -1) : + uint messageId_ = uint(-1)) : areaPos(areaPos_), record(record_), fillArea(fillArea_), messageId(messageId_) { } Area(const Common::Rect &areaPos_, const Common::Rect &areaPos1_, const Common::Rect &areaPos2_, const char *record_, bool fillArea_ = true, - uint messageId_ = -1) : + uint messageId_ = uint(-1)) : areaPos(areaPos_), areaPos1(areaPos1_), areaPos2(areaPos2_), record(record_), fillArea(fillArea_), messageId(messageId_) { } } areas[] = { diff --git a/engines/cryomni3d/versailles/engine.cpp b/engines/cryomni3d/versailles/engine.cpp index b901ee9422..e27991507d 100644 --- a/engines/cryomni3d/versailles/engine.cpp +++ b/engines/cryomni3d/versailles/engine.cpp @@ -551,7 +551,7 @@ void CryOmni3DEngine_Versailles::syncOmni3DSettings() { void CryOmni3DEngine_Versailles::syncSoundSettings() { CryOmni3DEngine::syncSoundSettings(); - int soundVolumeMusic = ConfMan.getInt("music_volume") / _musicVolumeFactor; + int soundVolumeMusic = int(ConfMan.getInt("music_volume") / _musicVolumeFactor); bool mute = false; if (ConfMan.hasKey("mute")) { @@ -1359,13 +1359,13 @@ void CryOmni3DEngine_Versailles::animateWarpTransition(const Transition *transit // We devide by 5 to slow down movement for modern CPUs int deltaAlphaI; if (deltaAlpha < M_PI) { - deltaAlphaI = -(deltaAlpha * 512. / 5.); + deltaAlphaI = int(-(deltaAlpha * 512. / 5.)); } else { - deltaAlphaI = (2.*M_PI - deltaAlpha) * 512. / 5.; + deltaAlphaI = int((2.*M_PI - deltaAlpha) * 512. / 5.); } double deltaBeta = -srcBeta - _omni3dMan.getBeta(); - int deltaBetaI = -(deltaBeta * 512. / 5.); + int deltaBetaI = int(-(deltaBeta * 512. / 5.)); if (_omni3dSpeed > 0) { deltaAlphaI <<= 2; diff --git a/engines/cryomni3d/versailles/logic.cpp b/engines/cryomni3d/versailles/logic.cpp index cd76c3f599..0911a16136 100644 --- a/engines/cryomni3d/versailles/logic.cpp +++ b/engines/cryomni3d/versailles/logic.cpp @@ -2679,7 +2679,7 @@ IMG_CB(88003) { // Dispatch to the correct state if (_gameVariables[GameVariables::kBombState] >= 1 && _gameVariables[GameVariables::kBombState] <= 5) { - FixedImgCallback callback; + FixedImgCallback callback = nullptr; switch (_gameVariables[GameVariables::kBombState]) { case 1: callback = &CryOmni3DEngine_Versailles::img_88003b; diff --git a/engines/cryomni3d/versailles/saveload.cpp b/engines/cryomni3d/versailles/saveload.cpp index 1cdf8e9a51..813dc7669d 100644 --- a/engines/cryomni3d/versailles/saveload.cpp +++ b/engines/cryomni3d/versailles/saveload.cpp @@ -134,7 +134,8 @@ void CryOmni3DEngine_Versailles::saveGame(bool visit, uint saveNum, // Write save name char saveNameC[kSaveDescriptionLen]; memset(saveNameC, 0, sizeof(saveNameC)); - strncpy(saveNameC, saveName.c_str(), sizeof(saveNameC)); + // Silence -Wstringop-truncation using parentheses, we don't have to have a null-terminated string here + (strncpy(saveNameC, saveName.c_str(), sizeof(saveNameC))); out->write(saveNameC, sizeof(saveNameC)); // dummy values |