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

aquadran aquadran at gmail.com
Mon Mar 8 09:00:13 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:
ed4ae57063 ICB: Fixed several compiler warnings


Commit: ed4ae570637e7f53653a6c48b5f2c60cf68b8211
    https://github.com/scummvm/scummvm/commit/ed4ae570637e7f53653a6c48b5f2c60cf68b8211
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2021-03-08T10:00:06+01:00

Commit Message:
ICB: Fixed several compiler warnings

Changed paths:
    engines/icb/common/px_scriptengine.cpp
    engines/icb/common/px_string.cpp
    engines/icb/common/px_string.h
    engines/icb/jpeg.cpp
    engines/icb/jpeg.h
    engines/icb/main_menu_pc.cpp
    engines/icb/mission_functions.cpp
    engines/icb/movie_pc.cpp
    engines/icb/remora_pc.cpp
    engines/icb/remora_sprite_pc.cpp
    engines/icb/session.cpp
    engines/icb/speech.cpp
    engines/icb/text_sprites.cpp
    engines/icb/tracer.cpp


diff --git a/engines/icb/common/px_scriptengine.cpp b/engines/icb/common/px_scriptengine.cpp
index 05b8cedc8b..f8c24be1e3 100644
--- a/engines/icb/common/px_scriptengine.cpp
+++ b/engines/icb/common/px_scriptengine.cpp
@@ -138,9 +138,6 @@ scriptInterpreterReturnCodes RunScript(const char *&scriptData, // A pointer to
 	int32 parameter1, parameter2, value;
 	bool8 isInExpression = FALSE8;
 
-	// Reset the fn routine control return value
-	int32 fn_routines_control_return_flag = (-1);
-
 	// Variable to prevent infinite loops
 	uint32 infiniteLoopCounter = 0;
 
@@ -265,7 +262,6 @@ scriptInterpreterReturnCodes RunScript(const char *&scriptData, // A pointer to
 				// Push the fn_routine return value
 				PushOnStack(routineReturnParameter);
 				// save the mcode return value
-				fn_routines_control_return_flag = mcodeRetVal;
 			} else {
 				// Check return value in case we want to pause the script
 
diff --git a/engines/icb/common/px_string.cpp b/engines/icb/common/px_string.cpp
index 9fb8d2efea..c04a57473d 100644
--- a/engines/icb/common/px_string.cpp
+++ b/engines/icb/common/px_string.cpp
@@ -32,8 +32,6 @@
 
 namespace ICB {
 
-#define SLEN_CHECK (slen < 0)
-
 const char *pxString::operator=(const char *str) {
 	// Assign a value
 
@@ -236,7 +234,7 @@ const pxString &pxString::Format(const char *format, ...) {
 	uint32 slen;
 
 	// Keep doubling the size of the buffer until it fits
-	while (va_start(arglist, format), slen = vsnprintf(s, startBufferSize, const_cast<char *>(format), arglist), SLEN_CHECK) {
+	while (va_start(arglist, format), slen = vsnprintf(s, startBufferSize, const_cast<char *>(format), arglist)) {
 		delete[] s;
 
 		startBufferSize += startBufferSize;
diff --git a/engines/icb/common/px_string.h b/engines/icb/common/px_string.h
index 88e61f9dc9..a10ca23491 100644
--- a/engines/icb/common/px_string.h
+++ b/engines/icb/common/px_string.h
@@ -108,7 +108,7 @@ public:
 	~pxFlexiCharBuffer();
 
 	char &operator[](uint); // Allow array access
-	void CheckSize(uint);   // Make sure we have enough room
+	void CheckSize(uint32);   // Make sure we have enough room
 	char *GetBuffer() {
 		return (m_buffer); // Make it a little more difficult to pass the pointer
 	}
diff --git a/engines/icb/jpeg.cpp b/engines/icb/jpeg.cpp
index 31df012be1..964fdfe04d 100644
--- a/engines/icb/jpeg.cpp
+++ b/engines/icb/jpeg.cpp
@@ -307,10 +307,6 @@ void JpegDecoder::ReadImage(uint8 *inputData, uint32 surface_Id) {
 	eoi_found = false;
 	sof_found = false;
 
-	_bit_count = 0;
-	_buf_pointer = (uint32 *)input_buffer;
-	_end_buf = (uint32 *)(input_buffer + (1024 * 1024)); // blantantly wrong... need to make cash sized buffer
-
 	data = ReadByte();
 	while (!eoi_found) {
 		if (data == SOB) {
diff --git a/engines/icb/jpeg.h b/engines/icb/jpeg.h
index d3ff6825b4..5c94f7462f 100644
--- a/engines/icb/jpeg.h
+++ b/engines/icb/jpeg.h
@@ -34,10 +34,6 @@ namespace ICB {
 
 class _surface;
 
-static uint32 _bit_count;
-static uint32 *_buf_pointer;
-static uint32 *_end_buf;
-
 const int32 JpegMaxHuffmanTables = 4;
 const int32 MaxQuantizationTables = 4;
 const int32 JpegMaxComponentsPerFrame = 255;
diff --git a/engines/icb/main_menu_pc.cpp b/engines/icb/main_menu_pc.cpp
index 70e46a963a..2f350c4837 100644
--- a/engines/icb/main_menu_pc.cpp
+++ b/engines/icb/main_menu_pc.cpp
@@ -70,17 +70,6 @@ void Credits() {
 }
 
 void InitisliaseScrollingText(const char *textFileName, const char *movieFileName, int32 frameStart) {
-	// Movies are streamed from the CD
-	char *_root;
-
-#if 1 // was ifdef FROM_PC_CD
-#ifndef PC_DEMO
-
-	_root = g_theClusterManager->GetCDRoot();
-
-#endif
-#endif
-
 	// Find movie to play
 	pxString fullMovieName;
 
diff --git a/engines/icb/mission_functions.cpp b/engines/icb/mission_functions.cpp
index db6ba1b522..5b37d53566 100644
--- a/engines/icb/mission_functions.cpp
+++ b/engines/icb/mission_functions.cpp
@@ -39,7 +39,7 @@
 
 namespace ICB {
 
-int32 LoadMission(int32 m, void *usr) {
+int32 LoadMission(int32 m, void * /*usr*/) {
 	int32 demo = g_globalScriptVariables.GetVariable("demo");
 	Init_globals(); // reload the global vars for the new mission
 	g_globalScriptVariables.SetVariable("missionelapsedtime", 0);
@@ -60,9 +60,6 @@ int32 LoadMission(int32 m, void *usr) {
 	rs_anims->Res_purge_all();
 	rs_bg->Res_purge_all();
 
-	// To remove compiler warning
-	usr = NULL;
-
 	warning("rs_anims %d files %dKB rs_bg %d files %dKB", rs_anims->Fetch_files_open(), (rs_anims->Fetch_mem_used() / 1024), rs_bg->Fetch_files_open(),
 	        (rs_bg->Fetch_mem_used() / 1024));
 
diff --git a/engines/icb/movie_pc.cpp b/engines/icb/movie_pc.cpp
index 01e6fb9fde..17070fc96d 100644
--- a/engines/icb/movie_pc.cpp
+++ b/engines/icb/movie_pc.cpp
@@ -187,7 +187,7 @@ uint32 MovieManager::drawFrame(uint32 surface_id) {
 	uint32 height = surface_manager->Get_height(surface_id);
 
 	for (int32 i = 0; i < surface->h; i++) {
-		if (i + _y >= height) {
+		if (i + _y >= (int32)height) {
 			break;
 		}
 		memcpy(surface_address + (i + _y) * pitch, surface->getBasePtr(0, i), MIN(surface->pitch, pitch));
diff --git a/engines/icb/remora_pc.cpp b/engines/icb/remora_pc.cpp
index 6fad929307..f084db2040 100644
--- a/engines/icb/remora_pc.cpp
+++ b/engines/icb/remora_pc.cpp
@@ -255,16 +255,6 @@ void _remora::ActivateRemora(RemoraMode eMode) {
 }
 
 void _remora::DoPlatformSpecificInitialisation() {
-
-	uint32 nFileNameHash, nClusterHash;
-	char pcFileName[ENGINE_STRING_LEN];
-
-	// Load the Map Data.  When clustered the session files have the base stripped.
-	strcpy(pcFileName, REMORA_MAP_FILENAME);
-
-	nClusterHash = MS->Fetch_session_cluster_hash();
-	nFileNameHash = NULL_HASH;
-
 	// Allocate a text buffer if one hasn't been allocated already.
 	if (!m_pDisplayBuffer)
 		m_pDisplayBuffer = new _remora_line[REMORA_TEXT_BUFFER_ROWS];
@@ -1372,11 +1362,6 @@ void _remora::ColourToRGB(uint8 nAttributes, uint8 &nRed, uint8 &nGreen, uint8 &
 }
 
 void _remora::SetUpM08LockControl() {
-	uint32 oBitmapNameHash;
-
-	// We need the size of the scan screen for clipping the barriers.
-	oBitmapNameHash = NULL_HASH;
-
 	// Here we build a list of the door names and what object ID they are.
 	BuildM08DoorList();
 }
diff --git a/engines/icb/remora_sprite_pc.cpp b/engines/icb/remora_sprite_pc.cpp
index 495c152b84..708ae4593c 100644
--- a/engines/icb/remora_sprite_pc.cpp
+++ b/engines/icb/remora_sprite_pc.cpp
@@ -34,7 +34,6 @@ namespace ICB {
 
 void _remora_sprite::GenericSpriteDraw(int32 nX, int32 nY, bool8 bPosition, const _rs_params *pParams) {
 	_pxBitmap *psBitmap;
-	_pxSprite *psSprite;
 	uint8 *pSurfaceBitmap;
 	uint32 nPitch;
 	uint32 nSurfaceWidth, nSurfaceHeight;
@@ -64,8 +63,6 @@ void _remora_sprite::GenericSpriteDraw(int32 nX, int32 nY, bool8 bPosition, cons
 	if (psBitmap->schema != PC_BITMAP_SCHEMA)
 		Fatal_error("Incorrect versions loading [%s] (engine has %d, data has %d", m_pcName, PC_BITMAP_SCHEMA, psBitmap->schema);
 
-	psSprite = psBitmap->Fetch_item_by_number(m_nFramePC);
-
 	// Lock the surface and get the pitch.
 	uint32 remoraSurfaceId = g_oRemora->GetRemoraSurfaceId();
 	pSurfaceBitmap = surface_manager->Lock_surface(remoraSurfaceId);
diff --git a/engines/icb/session.cpp b/engines/icb/session.cpp
index 26522a698b..a2d60cf7ca 100644
--- a/engines/icb/session.cpp
+++ b/engines/icb/session.cpp
@@ -1209,16 +1209,16 @@ _linked_data_file *LoadTranslatedFile(const char *mission, const char *session)
 	uint32 len = stream->size();
 
 	//      make space for file
-	char *mem = new char[len + 1];
+	char *memPtr = new char[len + 1];
 
 	//      read it in
-	stream->read(mem, len);
+	stream->read(memPtr, len);
 	delete stream; // close the file
 
 	//      0 terminate the string
-	mem[len] = 0;
+	memPtr[len] = 0;
 
-	return ((_linked_data_file *)mem);
+	return ((_linked_data_file *)memPtr);
 }
 
 } // End of namespace ICB
diff --git a/engines/icb/speech.cpp b/engines/icb/speech.cpp
index d196120c0d..8c39138a47 100644
--- a/engines/icb/speech.cpp
+++ b/engines/icb/speech.cpp
@@ -144,7 +144,7 @@ mcodeFunctionReturnCodes _game_session::fn_request_speech(int32 &result, int32 *
 
 	//	conversation script doesnt exist
 	if (!S.script_pc)
-		Fatal_error("object [%d] tried to start conversation script [%s] which doesnt exist", cur_id, (const char *const)temp_buf);
+		Fatal_error("object [%d] tried to start conversation script [%s] which doesnt exist", cur_id, (const char *)temp_buf);
 
 	// reset number of subs
 	S.total_subscribers = 0; // everyone but us initially
diff --git a/engines/icb/text_sprites.cpp b/engines/icb/text_sprites.cpp
index 5940e69d79..7da2950cbd 100644
--- a/engines/icb/text_sprites.cpp
+++ b/engines/icb/text_sprites.cpp
@@ -58,6 +58,7 @@ _TSrtn text_sprite::GetRenderCoords(const int32 pinX,           // screen x-coor
 	case PIN_AT_CENTRE:
 		renderX = pinX - spriteWidth / 2;
 		renderY = pinY - spriteHeight / 2;
+		break;
 
 	case PIN_AT_CENTRE_OF_TOP:
 		renderX = pinX - spriteWidth / 2;
diff --git a/engines/icb/tracer.cpp b/engines/icb/tracer.cpp
index 43b131eeb6..d0d214adb9 100644
--- a/engines/icb/tracer.cpp
+++ b/engines/icb/tracer.cpp
@@ -43,7 +43,7 @@ bool8 _tracer::Trace(const px3DRealPoint &oFrom,      // IN:  Point to plot from
                      const px3DRealPoint &oTo,        // IN:  Point to plot to.
                      _barrier_ray_type eRayType,      // IN:  The type of the ray being plotted.
                      px3DRealPoint &oPointOfImpact,   // OUT: The first point of impact.
-                     _barrier_logic_value eImpactType // OUT: For interpretation by high-level logic.
+                     _barrier_logic_value /*eImpactType*/ // OUT: For interpretation by high-level logic.
                      ) {
 	uint32 i;
 	uint32 nLoopCount;
@@ -98,7 +98,7 @@ bool8 _tracer::Trace(const px3DRealPoint &oFrom,      // IN:  Point to plot from
 		if (!GetCubeAndIndices(oCurrentPoint, oThisIndex, oThisCube)) {
 			// We have gone outside the game world, so we can't have hit anything.
 			oPointOfImpact = oCurrentPoint;
-			eImpactType = BLOCKS;
+			//eImpactType = BLOCKS;
 			return (FALSE8);
 		}
 
@@ -186,7 +186,7 @@ bool8 _tracer::Trace(const px3DRealPoint &oFrom,      // IN:  Point to plot from
 						    ((int32)oCurrentPoint.GetZ() >= (int32)psFloor->rect.z1) && ((int32)oCurrentPoint.GetZ() <= (int32)psFloor->rect.z2)) {
 							// The ray has hit a floor rectangle.
 							oPointOfImpact = oCurrentPoint;
-							eImpactType = BLOCKS;
+							//eImpactType = BLOCKS;
 							return (FALSE8);
 						}
 					} // end if
@@ -203,7 +203,7 @@ bool8 _tracer::Trace(const px3DRealPoint &oFrom,      // IN:  Point to plot from
 			// In final release, we'll let this go back, but it may have the wrong answer.  The effects of
 			// this should be benign enough to allow this.
 			oPointOfImpact = oTo;
-			eImpactType = NO_IMPACT;
+			//eImpactType = NO_IMPACT;
 			return (FALSE8);
 		}
 	} // end while




More information about the Scummvm-git-logs mailing list