[Scummvm-git-logs] scummvm master -> 5ecc781ed081138a25871968a881830f7a8b19c0

digitall 547637+digitall at users.noreply.github.com
Sat Mar 20 00:20:23 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:
5ecc781ed0 ICB: Further Fixes for Various GCC Warnings


Commit: 5ecc781ed081138a25871968a881830f7a8b19c0
    https://github.com/scummvm/scummvm/commit/5ecc781ed081138a25871968a881830f7a8b19c0
Author: D G Turner (digitall at scummvm.org)
Date: 2021-03-20T00:19:47Z

Commit Message:
ICB: Further Fixes for Various GCC Warnings

Changed paths:
    engines/icb/common/px_string.cpp
    engines/icb/direct_input.cpp
    engines/icb/fn_movie_pc.cpp
    engines/icb/fn_remora_functions.cpp
    engines/icb/function.cpp
    engines/icb/global_vars.cpp
    engines/icb/jpeg.cpp
    engines/icb/sound/fx_manager.cpp
    engines/icb/tracer.h


diff --git a/engines/icb/common/px_string.cpp b/engines/icb/common/px_string.cpp
index bc0f35d0c0..a3e3be494b 100644
--- a/engines/icb/common/px_string.cpp
+++ b/engines/icb/common/px_string.cpp
@@ -255,7 +255,7 @@ const pxString &pxString::Format(const char *format, ...) {
 
 	// At this point the buffer in s is much larger than it needs to be
 	// In the interest of saving space, it will now be reduced
-	assert(slen == strlen(s));
+	assert(slen == (int32)strlen(s));
 	char *tempBuffer = new char[slen + 1];
 
 	// If this allocation fails leave the string as it is
diff --git a/engines/icb/direct_input.cpp b/engines/icb/direct_input.cpp
index 6d451c8901..74566f6d16 100644
--- a/engines/icb/direct_input.cpp
+++ b/engines/icb/direct_input.cpp
@@ -78,7 +78,7 @@ bool8 Read_DI_once_keys(uint32 key) {
 	//      1 pressed down
 
 	if (key >= Common::KEYCODE_LAST)
-		FALSE8;
+		return FALSE8;
 
 	// set repeat
 	if (keyboard_buf_scancodes[key] && (repeats_scancodes[key]))
@@ -98,7 +98,7 @@ bool8 Read_DI_keys(uint32 key) {
 	//      1 pressed down
 
 	if (key >= Common::KEYCODE_LAST)
-		FALSE8;
+		return FALSE8;
 
 	// set repeat
 	repeats_scancodes[key] = keyboard_buf_scancodes[key];
diff --git a/engines/icb/fn_movie_pc.cpp b/engines/icb/fn_movie_pc.cpp
index 5f2c0b45c2..897e0b55c2 100644
--- a/engines/icb/fn_movie_pc.cpp
+++ b/engines/icb/fn_movie_pc.cpp
@@ -89,12 +89,10 @@ void Init_play_movie(const char *param0, bool8 param1) {
 
 	pxString fullname;
 
-	// Non-global movies are streamed from the CD
-	char *_root;
-
 #ifndef PC_DEMO
 #if 1 // was #ifdef FROM_PC_CD
-	_root = g_theClusterManager->GetCDRoot();
+	// Non-global movies are streamed from the CD
+	// char *_root = g_theClusterManager->GetCDRoot();
 #endif
 #endif
 
diff --git a/engines/icb/fn_remora_functions.cpp b/engines/icb/fn_remora_functions.cpp
index 81b437e1d5..648c668ef6 100644
--- a/engines/icb/fn_remora_functions.cpp
+++ b/engines/icb/fn_remora_functions.cpp
@@ -468,7 +468,7 @@ mcodeFunctionReturnCodes _game_session::fn_remora_script_deactivate(int32 &, int
 	// Deactivate the Remora.
 	g_oRemora->SetMode(_remora::MOTION_SCAN);
 	g_oRemora->DeactivateRemora(TRUE8);
-	sInputState.UnSetButton((const ButtonEnums)(0xff));
+	sInputState.UnSetButton(__UNUSEDBUTTON);
 	g_oRemora->CycleRemoraLogic(sInputState);
 
 	// This tells the UI that the Remora is now gone and the player is back.
diff --git a/engines/icb/function.cpp b/engines/icb/function.cpp
index 1ed1237c54..fadadda69b 100644
--- a/engines/icb/function.cpp
+++ b/engines/icb/function.cpp
@@ -2391,7 +2391,7 @@ mcodeFunctionReturnCodes _game_session::fn_set_watch(int32 &, int32 *params) {
 				g_mission->remora_save_mode = (int32)g_oRemora->GetMode();
 				g_oRemora->SetMode(_remora::MOTION_SCAN);
 				g_oRemora->DeactivateRemora(TRUE8);
-				sInputState.UnSetButton((const ButtonEnums)(0xff));
+				sInputState.UnSetButton(__UNUSEDBUTTON);
 				g_oRemora->CycleRemoraLogic(sInputState);
 				MS->player.Pop_control_mode();
 				MS->player.Set_player_status(STOOD);
diff --git a/engines/icb/global_vars.cpp b/engines/icb/global_vars.cpp
index e8979d12b4..676b63c0b0 100644
--- a/engines/icb/global_vars.cpp
+++ b/engines/icb/global_vars.cpp
@@ -60,7 +60,7 @@ namespace ICB {
 
 void Init_globals() {
 	int32 len, index;
-	uint8 *mem;
+	uint8 *mem_tmp;
 	char buf[ENGINE_STRING_LEN];
 	char cluster[ENGINE_STRING_LEN];
 	char input[256];
@@ -77,7 +77,7 @@ void Init_globals() {
 
 		Tdebug("globals.txt", "found globals file - %s", (const char *)buf);
 
-		mem = rs_bg->Res_open(buf, fn_hash, cluster, cluster_hash);
+		mem_tmp = rs_bg->Res_open(buf, fn_hash, cluster, cluster_hash);
 
 		Tdebug("globals.txt", "loaded");
 
@@ -88,8 +88,8 @@ void Init_globals() {
 			// get name
 			i = 0;
 
-			while (ISGRAPH(mem[index]))
-				input[i++] = mem[index++];
+			while (ISGRAPH(mem_tmp[index]))
+				input[i++] = mem_tmp[index++];
 
 			input[i] = 0; // NULL terminate
 
@@ -98,7 +98,7 @@ void Init_globals() {
 			}
 
 			// ship white
-			while (!ISGRAPH(mem[index]))
+			while (!ISGRAPH(mem_tmp[index]))
 				index++;
 
 			if (index >= len) {
@@ -108,13 +108,13 @@ void Init_globals() {
 			// get value
 			i = 0;
 
-			while ((index < len) && (ISNUMBER(mem[index]))) // 0-9
-				value[i++] = mem[index++];              // toupper(buf[index++]);
+			while ((index < len) && (ISNUMBER(mem_tmp[index]))) // 0-9
+				value[i++] = mem_tmp[index++];              // toupper(buf[index++]);
 
 			value[i] = 0; // NULL terminate
 
 			// ship white
-			while ((index < len) && (!ISGRAPH(mem[index])))
+			while ((index < len) && (!ISGRAPH(mem_tmp[index])))
 				index++;
 
 			i = atoi(value);
diff --git a/engines/icb/jpeg.cpp b/engines/icb/jpeg.cpp
index fec93b4217..410125fd77 100644
--- a/engines/icb/jpeg.cpp
+++ b/engines/icb/jpeg.cpp
@@ -502,7 +502,7 @@ int32 JpegHuffmanDecoder::Decode(JpegDecoder &decoder) {
 
 	// Here we are taking advantage of the fact that 1 bits are used as
 	// a prefix to the longer codes.
-	for (codelength = 0; (code > maxcode[codelength] && codelength < JpegMaxHuffmanCodeLength); ++codelength) {
+	for (codelength = 0; (code > maxcode[codelength] && codelength < (int32) JpegMaxHuffmanCodeLength); ++codelength) {
 		code = (uint16)((code << 1) | decoder.NextBit());
 	}
 
diff --git a/engines/icb/sound/fx_manager.cpp b/engines/icb/sound/fx_manager.cpp
index 9e6c106b2f..92f696a470 100644
--- a/engines/icb/sound/fx_manager.cpp
+++ b/engines/icb/sound/fx_manager.cpp
@@ -97,6 +97,7 @@ bool8 FxManager::Poll() {
 			m_effects[id].delay--;
 			if (m_effects[id].delay != 0)
 				break;
+			// falls through
 			// FIXME: fallthrough intentional?
 
 		// It's waiting to play
diff --git a/engines/icb/tracer.h b/engines/icb/tracer.h
index 9629ddf438..9ecfdf17cf 100644
--- a/engines/icb/tracer.h
+++ b/engines/icb/tracer.h
@@ -68,8 +68,8 @@ private:
 	uint8 m_nPadding[1];
 
 	// Here I block the use of the default '='.
-	_tracer(const _tracer &) { ; }
-	void operator=(const _tracer &) { ; }
+	_tracer(const _tracer &t) : _game_volume(t) { ; }
+	void operator=(const _tracer &t) { ; }
 
 	// Private functions used only by this class.
 	void GetBarriersForCube(const _XYZ_index &oCubeIndices, uint32 *oThisCubesBarriers, int32 &nNumBarriers, int32 nExtraSliceIndex) const;




More information about the Scummvm-git-logs mailing list