[Scummvm-git-logs] scummvm master -> f8f0f09ef20a9d258aec258c3c5302b308c010ff

digitall 547637+digitall at users.noreply.github.com
Wed Mar 17 21:54:20 UTC 2021


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:
f8f0f09ef2 CINE: Fix GCC Compiler Warnings


Commit: f8f0f09ef20a9d258aec258c3c5302b308c010ff
    https://github.com/scummvm/scummvm/commit/f8f0f09ef20a9d258aec258c3c5302b308c010ff
Author: D G Turner (digitall at scummvm.org)
Date: 2021-03-17T21:53:28Z

Commit Message:
CINE: Fix GCC Compiler Warnings

These are mainly signed vs. unsigned comparison warnings apart from
a set, but unused variable in the main loop code which can be removed.

Changed paths:
    engines/cine/anim.cpp
    engines/cine/main_loop.cpp
    engines/cine/part.cpp
    engines/cine/sound.cpp


diff --git a/engines/cine/anim.cpp b/engines/cine/anim.cpp
index 6615cce41e..d5b9a44c50 100644
--- a/engines/cine/anim.cpp
+++ b/engines/cine/anim.cpp
@@ -199,7 +199,7 @@ int loadSet(const char *resourceName, int16 idx, int16 frameIndex = -1);
 void checkAnimDataTableBounds(int entry) {
 	if (entry < 0) {
 		error("Out of free animation space");
-	} else if (entry >= g_cine->_animDataTable.size()) {
+	} else if (entry >= (int)g_cine->_animDataTable.size()) {
 		error("Animation entry (%d) out of bounds", entry);
 	}
 }
@@ -209,7 +209,7 @@ int16 fixAnimDataTableEndFrame(int entry, int16 startFrame, int16 endFrame) {
 
 	// Ensure that a non-empty range [entry, entry + endFrame - startFrame) stays in bounds
 	if (endFrame > startFrame &&
-		entry + (endFrame - startFrame - 1) >= g_cine->_animDataTable.size()) {
+		entry + (endFrame - startFrame - 1) >= (int)g_cine->_animDataTable.size()) {
 		warning("Restricting out of bounds animation data table write to in bounds");
 		return (int16)(g_cine->_animDataTable.size() - entry + startFrame);
 	} else {
diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp
index 0444249786..09c64c4814 100644
--- a/engines/cine/main_loop.cpp
+++ b/engines/cine/main_loop.cpp
@@ -410,7 +410,6 @@ void purgeSeqList() {
 }
 
 void CineEngine::mainLoop(int bootScriptIdx) {
-	bool playerAction;
 	byte di;
 
 	if (_preLoad == false) {
@@ -540,8 +539,6 @@ void CineEngine::mainLoop(int bootScriptIdx) {
 		removeMessages();
 
 		if (waitForPlayerClick) {
-			playerAction = false;
-
 			_messageLen <<= 3;
 			if (_messageLen < 800)
 				_messageLen = 800;
diff --git a/engines/cine/part.cpp b/engines/cine/part.cpp
index e9161c309e..b41ef1829f 100644
--- a/engines/cine/part.cpp
+++ b/engines/cine/part.cpp
@@ -225,7 +225,7 @@ int16 findFileInBundle(const char *fileName) {
 		// Prefer current disk's resource file
 		Common::Array<VolumeResource> volRes = it->_value;
 		VolumeResource match = volRes[0];
-		for (int i = 0; i < volRes.size(); i++) {
+		for (uint i = 0; i < volRes.size(); i++) {
 			if (volRes[i].diskNum == currentDisk) {
 				match = volRes[i];
 				break;
diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp
index 07f4962e3a..d22982cca6 100644
--- a/engines/cine/sound.cpp
+++ b/engines/cine/sound.cpp
@@ -833,7 +833,7 @@ void MidiSoundDriverH32::selectInstrument2(int channel, int timbreGroup, int tim
 
 	byte checkSum = 0;
 
-	for (int i = 4; i < sizeof(sysEx) - 1; ++i)
+	for (uint i = 4; i < sizeof(sysEx) - 1; ++i)
 		checkSum += sysEx[i];
 
 	sysEx[sizeof(sysEx) - 1] = 0x80 - (checkSum & 0x7F);
@@ -872,7 +872,7 @@ void MidiSoundDriverH32::selectInstrument3(int channel, int offsetMode, int timb
 
 	byte checkSum = 0;
 
-	for (int i = 4; i < sizeof(sysEx) - 1; ++i)
+	for (uint i = 4; i < sizeof(sysEx) - 1; ++i)
 		checkSum += sysEx[i];
 
 	sysEx[sizeof(sysEx) - 1] = 0x80 - (checkSum & 0x7F);
@@ -934,7 +934,7 @@ void MidiSoundDriverH32::selectInstrument5(int messageNum) {
 
 	memset(sysEx + 7, 0x20, 20);
 
-	if (messageNum >= 0 && messageNum < g_cine->_messageTable.size()) {
+	if (messageNum >= 0 && messageNum < (int)g_cine->_messageTable.size()) {
 		Common::String msg = g_cine->_messageTable[messageNum];
 		memcpy(sysEx + 7, msg.c_str(), MIN<int>(20, msg.size()));
 	}
@@ -945,7 +945,7 @@ void MidiSoundDriverH32::selectInstrument5(int messageNum) {
 
 	byte checkSum = 0;
 
-	for (int i = 4; i < sizeof(sysEx) - 1; ++i)
+	for (uint i = 4; i < sizeof(sysEx) - 1; ++i)
 		checkSum += sysEx[i];
 
 	sysEx[sizeof(sysEx) - 1] = 0x80 - (checkSum & 0x7F);




More information about the Scummvm-git-logs mailing list