[Scummvm-git-logs] scummvm master -> 8ed05adaea5514018b65f823c7e1aad6d9d5a165

lephilousophe lephilousophe at users.noreply.github.com
Thu Jul 4 08:38:26 CEST 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
8ed05adaea CRYOMNI3D: Silence more warnings


Commit: 8ed05adaea5514018b65f823c7e1aad6d9d5a165
    https://github.com/scummvm/scummvm/commit/8ed05adaea5514018b65f823c7e1aad6d9d5a165
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2019-07-04T08:37:37+02:00

Commit Message:
CRYOMNI3D: Silence more warnings

Changed paths:
    engines/cryomni3d/font_manager.cpp
    engines/cryomni3d/image/codecs/hlz.cpp
    engines/cryomni3d/versailles/documentation.cpp
    engines/cryomni3d/versailles/engine.cpp
    engines/cryomni3d/versailles/logic.cpp
    engines/cryomni3d/versailles/saveload.cpp


diff --git a/engines/cryomni3d/font_manager.cpp b/engines/cryomni3d/font_manager.cpp
index 9b37d27..b882b51 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 6f550c7..adbea2d 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, &reg, &regBits)
 
diff --git a/engines/cryomni3d/versailles/documentation.cpp b/engines/cryomni3d/versailles/documentation.cpp
index 8defe0e..c74aaa9 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 b901ee9..e279915 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 cd76c3f..0911a16 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 1cdf8e9..813dc76 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





More information about the Scummvm-git-logs mailing list