[Scummvm-git-logs] scummvm master -> 205d3c4c41184f161661e0157bf686e17abbebab

sev- noreply at scummvm.org
Sat Jul 8 19:02:11 UTC 2023


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

Summary:
067626137e AGS: Fix cast of integer to pointer of greater size warning
b6b0b35045 ASYLUM: Quiet switch with no cases warning
f10e9c6082 BLADERUNNER: Fix signed/unsigned mismatch
0b388b46a8 BURIED: Fix negation of unsigned integer
015fdd13b3 CHAMBER: Fix truncation of signed int to smaller unsigned int warnings
1daf4126f7 CINE: Fix signed/unsigned mismatch
9e92db3718 DIRECTOR: Fix signed/unsigned mismatch
08a22eae79 DRAGONS: Fix negation of unsigned integer warning (0x8000000 is out of range for signed int)
68396f9dc2 FREESCAPE: Fix signed/unsigned comparison, avoid use of "long" since it's the wrong size on Windows
116bf0a8bd GOB: Fix signed/unsigned comparison
bd3ac0f812 HYPNO: Fix signed/unsigned conversion
364e6b0bdd ICB: Fix negation of unsigned integer
1741e338ca ICB: Fix signed/unsigned conversion
5abae67266 ICB: Fix cast of integer to pointer of greater size warning
c0b27389b1 IMMORTAL: Fix signed/unsigned conversion
241aa641d5 IMMORTAL: Fix arithmetic on boolean
aef5ee1e66 MYST3: Fix signed/unsigned mismatch
2beab37b0e NANCY: Fix signed/unsigned conversion
c6893e2a60 PETKA: Fix signed/unsigned conversion warnings
c56086f6d5 WATCHMAKER: Fix switch with no cases warning
205d3c4c41 WATCHMAKER: Fix signed/unsigned conversion warning


Commit: 067626137eacab0538740ff19e210b88051c80f9
    https://github.com/scummvm/scummvm/commit/067626137eacab0538740ff19e210b88051c80f9
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
AGS: Fix cast of integer to pointer of greater size warning

Changed paths:
    engines/ags/engine/script/cc_instance.cpp


diff --git a/engines/ags/engine/script/cc_instance.cpp b/engines/ags/engine/script/cc_instance.cpp
index 654ba1ed0dd..029d5871510 100644
--- a/engines/ags/engine/script/cc_instance.cpp
+++ b/engines/ags/engine/script/cc_instance.cpp
@@ -1038,7 +1038,7 @@ int ccInstance::Run(int32_t curpc) {
 					// call only supports a 32-bit value. This is fine in most cases, since
 					// methods mostly set the ptr on GlobalReturnValue, so it doesn't reach here.
 					// But just in case, throw a wobbly if it reaches here with a 64-bit pointer
-					if (fnResult._ptr > (void *)0xffffffff)
+					if (fnResult._ptr > reinterpret_cast<void *>(static_cast<uintptr>(0xffffffffu)))
 						error("Uhandled 64-bit pointer result from plugin method call");
 
 					return_value.SetPluginArgument(fnResult);


Commit: b6b0b350450991baa7dad3f36c6caab971ff7cda
    https://github.com/scummvm/scummvm/commit/b6b0b350450991baa7dad3f36c6caab971ff7cda
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
ASYLUM: Quiet switch with no cases warning

Changed paths:
    engines/asylum/system/text.cpp


diff --git a/engines/asylum/system/text.cpp b/engines/asylum/system/text.cpp
index 6b2c476343e..bc5fa033f91 100644
--- a/engines/asylum/system/text.cpp
+++ b/engines/asylum/system/text.cpp
@@ -171,6 +171,7 @@ void Text::drawChinese(const Common::U32String &utext) {
 	uint8 color = 0;
 	// TODO: Add more colors
 	switch (_fontResource->getResourceId()) {
+	case 0: // Case to quiet VS C4065 warning
 	default:
 		debug(5, "Unrecognized font resource 0x%x for string %s", _fontResource->getResourceId(), utext.encode().c_str());
 		color = 1;


Commit: f10e9c60829d647c83cc1f6ec4024ae6592dc945
    https://github.com/scummvm/scummvm/commit/f10e9c60829d647c83cc1f6ec4024ae6592dc945
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
BLADERUNNER: Fix signed/unsigned mismatch

Changed paths:
    engines/bladerunner/vqa_decoder.cpp


diff --git a/engines/bladerunner/vqa_decoder.cpp b/engines/bladerunner/vqa_decoder.cpp
index 9b34455eebb..9557cdc1d4c 100644
--- a/engines/bladerunner/vqa_decoder.cpp
+++ b/engines/bladerunner/vqa_decoder.cpp
@@ -1206,7 +1206,7 @@ bool VQADecoder::VQAVideoTrack::decodeFrame(Graphics::Surface *surface) {
 		uint32 dst_y = 0;
 		void  *dstPtr = nullptr;
 
-		assert(_vpointerSize == 2 * (blocks_per_column * blocks_per_line));
+		assert(_vpointerSize == 2u * (blocks_per_column * blocks_per_line));
 		// Create a pointer to the second half of the frame data:
 		const uint8 *srcB = src + (blocks_per_column * blocks_per_line);
 


Commit: 0b388b46a8eefab09d494b702d2522b10f813e56
    https://github.com/scummvm/scummvm/commit/0b388b46a8eefab09d494b702d2522b10f813e56
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
BURIED: Fix negation of unsigned integer

Changed paths:
    engines/buried/scene_view.cpp


diff --git a/engines/buried/scene_view.cpp b/engines/buried/scene_view.cpp
index caba5bb49bd..43813583a24 100644
--- a/engines/buried/scene_view.cpp
+++ b/engines/buried/scene_view.cpp
@@ -1182,7 +1182,7 @@ bool SceneViewWindow::pushTransition(Graphics::Surface *curBackground, Graphics:
 		break;
 	case 2: // Push left
 		for (int i = 0; i < DIB_FRAME_WIDTH; i += stripSize) {
-			curBackground->move(-stripSize, 0, curBackground->h);
+			curBackground->move(-static_cast<int>(stripSize), 0, curBackground->h);
 
 			for (int j = 0; j < curBackground->h; j++)
 				memcpy(curBackground->getBasePtr(curBackground->w - (int)stripSize, j), newBackground->getBasePtr(i, j), stripSize * newBackground->format.bytesPerPixel);
@@ -1193,7 +1193,7 @@ bool SceneViewWindow::pushTransition(Graphics::Surface *curBackground, Graphics:
 		break;
 	case 3: // Push up
 		for (int i = 0; i < DIB_FRAME_HEIGHT; i += stripSize) {
-			curBackground->move(0, -stripSize, curBackground->h);
+			curBackground->move(0, -static_cast<int>(stripSize), curBackground->h);
 
 			for (uint j = 0; j < stripSize; j++)
 				memcpy(curBackground->getBasePtr(0, curBackground->h - stripSize + j), newBackground->getBasePtr(0, i + j), newBackground->w * newBackground->format.bytesPerPixel);


Commit: 015fdd13b3f370e7e2d5cc35ff435f90cfc4ca11
    https://github.com/scummvm/scummvm/commit/015fdd13b3f370e7e2d5cc35ff435f90cfc4ca11
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
CHAMBER: Fix truncation of signed int to smaller unsigned int warnings

Changed paths:
    engines/chamber/cga.cpp
    engines/chamber/input.cpp
    engines/chamber/room.cpp
    engines/chamber/script.cpp


diff --git a/engines/chamber/cga.cpp b/engines/chamber/cga.cpp
index c98b495df18..62b3fecf71e 100644
--- a/engines/chamber/cga.cpp
+++ b/engines/chamber/cga.cpp
@@ -417,7 +417,7 @@ NB! Line must not wrap around the edge
 void cga_DrawVLine(uint16 x, uint16 y, uint16 l, byte color, byte *target) {
 	uint16 ofs;
 	/*pixels are starting from top bits of byte*/
-	uint16 mask = ~(3 << ((CGA_PIXELS_PER_BYTE - 1) * CGA_BITS_PER_PIXEL));
+	uint16 mask = static_cast<uint16>((~(3 << ((CGA_PIXELS_PER_BYTE - 1) * CGA_BITS_PER_PIXEL))) & 0xffff);
 	byte pixel = color << ((CGA_PIXELS_PER_BYTE - 1) * CGA_BITS_PER_PIXEL);
 
 	mask >>= (x % CGA_PIXELS_PER_BYTE) * CGA_BITS_PER_PIXEL;
@@ -444,7 +444,7 @@ NB! Line must not wrap around the edge
 void cga_DrawHLine(uint16 x, uint16 y, uint16 l, byte color, byte *target) {
 	uint16 ofs;
 	/*pixels are starting from top bits of byte*/
-	uint16 mask = ~(3 << ((CGA_PIXELS_PER_BYTE - 1) * CGA_BITS_PER_PIXEL));
+	uint16 mask = static_cast<uint16>((~(3 << ((CGA_PIXELS_PER_BYTE - 1) * CGA_BITS_PER_PIXEL))) & 0xffff);
 	byte pixel = color << ((CGA_PIXELS_PER_BYTE - 1) * CGA_BITS_PER_PIXEL);
 
 	mask >>= (x % CGA_PIXELS_PER_BYTE) * CGA_BITS_PER_PIXEL;
@@ -458,7 +458,7 @@ void cga_DrawHLine(uint16 x, uint16 y, uint16 l, byte color, byte *target) {
 		pixel >>= CGA_BITS_PER_PIXEL;
 		if (mask == 0xFF) {
 			ofs++;
-			mask = ~(3 << ((CGA_PIXELS_PER_BYTE - 1) * CGA_BITS_PER_PIXEL));
+			mask = static_cast<uint16>((~(3 << ((CGA_PIXELS_PER_BYTE - 1) * CGA_BITS_PER_PIXEL))) & 0xffff);
 			pixel = color << ((CGA_PIXELS_PER_BYTE - 1) * CGA_BITS_PER_PIXEL);
 		}
 	}
diff --git a/engines/chamber/input.cpp b/engines/chamber/input.cpp
index 189991034ef..a303b3dbe3b 100644
--- a/engines/chamber/input.cpp
+++ b/engines/chamber/input.cpp
@@ -85,7 +85,7 @@ void clearKeyboard(void) {
 
 void setInputButtons(byte keys) {
 	if (keys & 2)
-		right_button = ~0;
+		right_button = 0xff;
 	if (keys & 1)
 		right_button = 0;
 	buttons = keys;
diff --git a/engines/chamber/room.cpp b/engines/chamber/room.cpp
index b5c218045d2..06fb5a7b38e 100644
--- a/engines/chamber/room.cpp
+++ b/engines/chamber/room.cpp
@@ -668,7 +668,7 @@ void beforeChangeZone(byte index) {
 
 	oldspot = script_byte_vars.cur_spot_idx;
 
-	script_byte_vars.need_draw_spots = ~0;
+	script_byte_vars.need_draw_spots = 0xff;
 
 	selectPerson(PersonOffset(kPersScifi));
 	animateSpot(&anim57);
diff --git a/engines/chamber/script.cpp b/engines/chamber/script.cpp
index 0a49485170d..01a63404ad2 100644
--- a/engines/chamber/script.cpp
+++ b/engines/chamber/script.cpp
@@ -523,17 +523,17 @@ Perform math/logic operation on two operands
 uint16 mathOp(byte op, uint16 op1, uint16 op2) {
 	if (op & MATHOP_CMP) {
 		if (op & MATHOP_EQ)
-			if (op1 == op2) return ~0;
+			if (op1 == op2) return 0xffff;
 		if (op & MATHOP_B)
-			if (op1 < op2) return ~0;
+			if (op1 < op2) return 0xffff;
 		if (op & MATHOP_A)
-			if (op1 > op2) return ~0;
+			if (op1 > op2) return 0xffff;
 		if (op & MATHOP_NEQ)
-			if (op1 != op2) return ~0;
+			if (op1 != op2) return 0xffff;
 		if (op & MATHOP_LE)
-			if ((int16)op1 <= (int16)op2) return ~0;
+			if ((int16)op1 <= (int16)op2) return 0xffff;
 		if (op & MATHOP_GE)
-			if ((int16)op1 >= (int16)op2) return ~0;
+			if ((int16)op1 >= (int16)op2) return 0xffff;
 		return 0;
 	} else {
 		if (op & MATHOP_ADD)
@@ -3262,7 +3262,7 @@ uint16 CMD_4_EnergyLevel(void) {
 	popDirtyRects(DirtyRectBubble);
 
 	cur_dlg_index = 0;
-	ifgm_flag2 = ~0;
+	ifgm_flag2 = 0xff;
 
 	if (script_byte_vars.psy_energy != 0)
 		anim = 41 + (script_byte_vars.psy_energy / 16);


Commit: 1daf4126f77d47f80686b83f96928e9cf60cc4a6
    https://github.com/scummvm/scummvm/commit/1daf4126f77d47f80686b83f96928e9cf60cc4a6
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
CINE: Fix signed/unsigned mismatch

Changed paths:
    engines/cine/anim.cpp


diff --git a/engines/cine/anim.cpp b/engines/cine/anim.cpp
index 814ab2c1536..590c7339e71 100644
--- a/engines/cine/anim.cpp
+++ b/engines/cine/anim.cpp
@@ -432,11 +432,11 @@ void freeAnimDataRange(byte startIdx, byte numIdx) {
 		}
 
 		// Make sure last accessed index is in bounds
-		if (startIdx + numIdx > g_cine->_animDataTable.size()) {
+		if (static_cast<uint>(startIdx + numIdx) > g_cine->_animDataTable.size()) {
 			numIdx = (byte)(g_cine->_animDataTable.size() - startIdx);
 		}
 		assert(startIdx < g_cine->_animDataTable.size());
-		assert(startIdx + numIdx <= g_cine->_animDataTable.size());
+		assert(static_cast<uint>(startIdx + numIdx) <= g_cine->_animDataTable.size());
 	}
 
 	for (byte i = 0; i < numIdx; i++) {


Commit: 9e92db3718e0774352d71b5268b56065ba6d25b1
    https://github.com/scummvm/scummvm/commit/9e92db3718e0774352d71b5268b56065ba6d25b1
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
DIRECTOR: Fix signed/unsigned mismatch

Changed paths:
    engines/director/sound.cpp


diff --git a/engines/director/sound.cpp b/engines/director/sound.cpp
index 601cd0fa0d0..b7b7b6d9f4a 100644
--- a/engines/director/sound.cpp
+++ b/engines/director/sound.cpp
@@ -374,7 +374,7 @@ void DirectorSound::loadSampleSounds(uint type) {
 		}
 		Common::Array<uint16> idList = g_director->_allSeenResFiles[it]->getResourceIDList(tag);
 		for (uint j = 0; j < idList.size(); j++) {
-			if ((idList[j] & 0xFF) == type) {
+			if (static_cast<uint>(idList[j] & 0xFF) == type) {
 				id = idList[j];
 				archive = g_director->_allSeenResFiles[it];
 				break;


Commit: 08a22eae79bf133946802611bedea4dcb14b874f
    https://github.com/scummvm/scummvm/commit/08a22eae79bf133946802611bedea4dcb14b874f
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
DRAGONS: Fix negation of unsigned integer warning (0x8000000 is out of range for signed int)

Changed paths:
    engines/dragons/background.cpp


diff --git a/engines/dragons/background.cpp b/engines/dragons/background.cpp
index d08e48e681c..5f27d07ee0b 100644
--- a/engines/dragons/background.cpp
+++ b/engines/dragons/background.cpp
@@ -393,11 +393,11 @@ uint16 ScaleLayer::getScale(uint16 y) {
 			local_v0_368 = pSVar4->_y - pSVar6->_y;
 			uVar1 = uVar5;
 			if (local_v0_368 != 0) {
-				iVar3 = ((uVar5 & 0xffffu) - (uVar7 & 0xffffu)) * (uint)(uint16)(y - pSVar6->_y);
+				uint uVar3 = ((uVar5 & 0xffffu) - (uVar7 & 0xffffu)) * (uint)(uint16)(y - pSVar6->_y);
 
-				assert(((uint16)local_v0_368 != 0xffffu) || (iVar3 != (int)-0x80000000));
+				assert(((uint16)local_v0_368 != 0xffffu) || (uVar3 != 0x80000000u));
 
-				return (uVar7 + iVar3 / (int)(uint)(uint16)local_v0_368) & 0xffff;
+				return (uVar7 + static_cast<int>(uVar3) / (int)(uint)(uint16)local_v0_368) & 0xffff;
 			}
 		}
 	}


Commit: 68396f9dc236af43f5057d401b88bbb086189203
    https://github.com/scummvm/scummvm/commit/68396f9dc236af43f5057d401b88bbb086189203
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
FREESCAPE: Fix signed/unsigned comparison, avoid use of "long" since it's the wrong size on Windows

Changed paths:
    engines/freescape/loaders/8bitBinaryLoader.cpp


diff --git a/engines/freescape/loaders/8bitBinaryLoader.cpp b/engines/freescape/loaders/8bitBinaryLoader.cpp
index b6db29dbcec..df7a726535e 100644
--- a/engines/freescape/loaders/8bitBinaryLoader.cpp
+++ b/engines/freescape/loaders/8bitBinaryLoader.cpp
@@ -529,9 +529,9 @@ Area *FreescapeEngine::load8bitArea(Common::SeekableReadStream *file, uint16 nco
 		} else if (!(isDemo() && isCastle()))
 			error("Failed to read an object!");
 	}
-	long int endLastObject = file->pos();
+	int64 endLastObject = file->pos();
 	debugC(1, kFreescapeDebugParser, "Last position %lx", endLastObject);
-	assert(endLastObject == base + cPtr || areaNumber == 192);
+	assert(endLastObject == static_cast<int64>(base + cPtr) || areaNumber == 192);
 	file->seek(base + cPtr);
 	uint8 numConditions = readField(file, 8);
 	debugC(1, kFreescapeDebugParser, "%d area conditions at %x of area %d", numConditions, base + cPtr, areaNumber);


Commit: 116bf0a8bd61386962db5a715534592de876e65f
    https://github.com/scummvm/scummvm/commit/116bf0a8bd61386962db5a715534592de876e65f
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
GOB: Fix signed/unsigned comparison

Changed paths:
    engines/gob/inter_v7.cpp


diff --git a/engines/gob/inter_v7.cpp b/engines/gob/inter_v7.cpp
index af9e2be3c45..25742a05a1e 100644
--- a/engines/gob/inter_v7.cpp
+++ b/engines/gob/inter_v7.cpp
@@ -1137,7 +1137,7 @@ void Inter_v7::o7_fillRect(OpFuncParams &params) {
 
 			for (int y = 0; y < _vm->_draw->_spriteBottom; y++) {
 				for (int x = 0; x < _vm->_draw->_spriteRight; x++) {
-					if ((colorToReplace & 0xFF) == newSurface->get(x, y).get())
+					if ((colorToReplace & 0xFFu) == newSurface->get(x, y).get())
 						newSurface->putPixel(x, y, _vm->_draw->_backColor);
 				}
 			}


Commit: bd3ac0f8129b163c0131f865e60550996791747a
    https://github.com/scummvm/scummvm/commit/bd3ac0f8129b163c0131f865e60550996791747a
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
HYPNO: Fix signed/unsigned conversion

Changed paths:
    engines/hypno/grammar_mis.y


diff --git a/engines/hypno/grammar_mis.y b/engines/hypno/grammar_mis.y
index 5ad0c8d5f9c..66a1b6bd274 100644
--- a/engines/hypno/grammar_mis.y
+++ b/engines/hypno/grammar_mis.y
@@ -76,7 +76,7 @@ init: {
 	if (smenu_idx)
 		delete smenu_idx;
 	smenu_idx = new Common::Array<uint32>();
-	smenu_idx->push_back(-1);
+	smenu_idx->push_back((uint32)-1);
 	if (stack)
 		delete stack;
 	stack = new Hypno::HotspotsStack();
@@ -134,7 +134,7 @@ line: MENUTOK mflag mflag mflag {
 		Hotspots *cur = stack->back();
 		Hotspot *hot = &(*cur)[idx];
 
-		smenu_idx->push_back(-1);
+		smenu_idx->push_back((uint32)-1);
 		hot->smenu = new Hotspots();
 		stack->push_back(hot->smenu);
 		debugC(1, kHypnoDebugParser, "SUBMENU");


Commit: 364e6b0bddb15e6f4fb5fc82971928719519d495
    https://github.com/scummvm/scummvm/commit/364e6b0bddb15e6f4fb5fc82971928719519d495
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
ICB: Fix negation of unsigned integer

Changed paths:
    engines/icb/breath.cpp


diff --git a/engines/icb/breath.cpp b/engines/icb/breath.cpp
index 6be9b57eac1..a1310584383 100644
--- a/engines/icb/breath.cpp
+++ b/engines/icb/breath.cpp
@@ -74,7 +74,7 @@ Breath::Breath() {
 #define SMOKE_IC (32)
 #define SMOKE_IS (4)
 
-#define BREATH_DY (-(g_icb->getRandomSource()->getRandomNumber(2 - 1)))
+#define BREATH_DY (-static_cast<int>(g_icb->getRandomSource()->getRandomNumber(2 - 1)))
 #define BREATH_DZ (g_icb->getRandomSource()->getRandomNumber(4 - 1))
 #define BREATH_DC (-4)
 #define BREATH_DS (2)


Commit: 1741e338ca42d980c3e6ac0debfc175585c5e5c1
    https://github.com/scummvm/scummvm/commit/1741e338ca42d980c3e6ac0debfc175585c5e5c1
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
ICB: Fix signed/unsigned conversion

Changed paths:
    engines/icb/function.cpp


diff --git a/engines/icb/function.cpp b/engines/icb/function.cpp
index 2858bcb888c..bede86addf5 100644
--- a/engines/icb/function.cpp
+++ b/engines/icb/function.cpp
@@ -3452,7 +3452,7 @@ mcodeFunctionReturnCodes _game_session::fn_set_manual_interact_object(int32 &, i
 
 mcodeFunctionReturnCodes _game_session::fn_cancel_manual_interact_object(int32 &, int32 *) {
 	// Clear the script-forced object interact id.
-	player.cur_interact_id = -1;
+	player.cur_interact_id = (uint32)-1;
 
 	// Calling script can continue.
 	return IR_CONT;


Commit: 5abae6726648552a6abf3113a3e7ea9cbc4db8a0
    https://github.com/scummvm/scummvm/commit/5abae6726648552a6abf3113a3e7ea9cbc4db8a0
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
ICB: Fix cast of integer to pointer of greater size warning

Changed paths:
    engines/icb/gfx/psx_pcgpu.cpp


diff --git a/engines/icb/gfx/psx_pcgpu.cpp b/engines/icb/gfx/psx_pcgpu.cpp
index a5c5b4930cd..7d6c0b9a0a4 100644
--- a/engines/icb/gfx/psx_pcgpu.cpp
+++ b/engines/icb/gfx/psx_pcgpu.cpp
@@ -34,7 +34,7 @@
 namespace ICB {
 
 // Defaults for the OT list
-#define UNLINKED_ADDR (void *)(0xDEADBEAF)
+#define UNLINKED_ADDR (reinterpret_cast<void *>(static_cast<uintptr>(0xDEADBEAF)))
 #define UNLINKED_LEN (0x6666)
 
 // For storing user data in the OT entry e.g. texture pointer


Commit: c0b27389b10e90d48d93f3640e6d186cbd40cedd
    https://github.com/scummvm/scummvm/commit/c0b27389b10e90d48d93f3640e6d186cbd40cedd
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
IMMORTAL: Fix signed/unsigned conversion

Changed paths:
    engines/immortal/immortal.h


diff --git a/engines/immortal/immortal.h b/engines/immortal/immortal.h
index c8063a054df..672f656a903 100644
--- a/engines/immortal/immortal.h
+++ b/engines/immortal/immortal.h
@@ -224,7 +224,7 @@ public:
 	const uint8  kTextLeft    = 8;
 	const uint8  kTextTop     = 4;
 	const uint8  kGaugeX      = 0;
-	const uint8  kGaugeY      = -13;                    // ???
+	const uint8  kGaugeY      = static_cast<uint8>((-13) & 0xff);                    // ???
 	const uint16 kScreenBMW   = 160;                    // Screen BitMap Width?
 	const uint16 kChrW        = 64;
 	const uint16 kChrH        = 32;


Commit: 241aa641d5ee43d7355b0a812dea6ddae47622da
    https://github.com/scummvm/scummvm/commit/241aa641d5ee43d7355b0a812dea6ddae47622da
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
IMMORTAL: Fix arithmetic on boolean

Changed paths:
    engines/immortal/logic.cpp


diff --git a/engines/immortal/logic.cpp b/engines/immortal/logic.cpp
index 038aa9223b4..919ea336ff5 100644
--- a/engines/immortal/logic.cpp
+++ b/engines/immortal/logic.cpp
@@ -118,9 +118,9 @@ void ImmortalEngine::logic() {
 			levelDrawAll();
 			updateHitGauge();
 
-			_dim = 0;
+			_dim = false;
 			if ((_level == 0) && (/*_currentLevel.getShowRoom()*/0 == 0) && (_rooms[_currentRoom]->roomLighted() == false) && (/*getNumBullets()*/ 0 == 0)) {
-				_dim += 1;
+				_dim = true;
 			}
 
 			if (_level == 7) {


Commit: aef5ee1e66631a995e3c436752b4a58ac9a6da94
    https://github.com/scummvm/scummvm/commit/aef5ee1e66631a995e3c436752b4a58ac9a6da94
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
MYST3: Fix signed/unsigned mismatch

Changed paths:
    engines/myst3/archive.cpp


diff --git a/engines/myst3/archive.cpp b/engines/myst3/archive.cpp
index ece2fe03a11..b2325997d48 100644
--- a/engines/myst3/archive.cpp
+++ b/engines/myst3/archive.cpp
@@ -275,7 +275,7 @@ Common::String ResourceDescription::getTextData(uint index) const {
 	memset(decrypted, 0, sizeof(decrypted));
 
 	uint8 *out = &decrypted[0];
-	while (cnt / 4 < (_subentry->metadata.size() + 2) && cnt < 89) {
+	while (cnt / 4u < (_subentry->metadata.size() + 2) && cnt < 89) {
 		// XORed text stored in little endian 32 bit words
 		*out++ = (getMiscData(cnt / 4) >> (8 * (3 - (cnt % 4)))) ^ key++;
 		cnt++;


Commit: 2beab37b0eec4d2f53f3f0499985e8f2341cd37d
    https://github.com/scummvm/scummvm/commit/2beab37b0eec4d2f53f3f0499985e8f2341cd37d
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
NANCY: Fix signed/unsigned conversion

Changed paths:
    engines/nancy/graphics.cpp


diff --git a/engines/nancy/graphics.cpp b/engines/nancy/graphics.cpp
index a7dc274a2ff..591d726c1a8 100644
--- a/engines/nancy/graphics.cpp
+++ b/engines/nancy/graphics.cpp
@@ -324,7 +324,7 @@ void GraphicsManager::rotateBlit(const Graphics::ManagedSurface &src, Graphics::
 void GraphicsManager::crossDissolve(const Graphics::ManagedSurface &from, const Graphics::ManagedSurface &to, byte alpha, Graphics::ManagedSurface &inResult) {
 	assert(from.getBounds() == to.getBounds() && to.getBounds() == inResult.getBounds());
 	inResult.blitFrom(from, Common::Point());
-	inResult.transBlitFrom(to, -1, false, 0, alpha);
+	inResult.transBlitFrom(to, (uint32)-1, false, 0, alpha);
 }
 
 void GraphicsManager::debugDrawToScreen(const Graphics::ManagedSurface &surf) {


Commit: c6893e2a60a3fecfa2e5e061b07a8ee97c4758fb
    https://github.com/scummvm/scummvm/commit/c6893e2a60a3fecfa2e5e061b07a8ee97c4758fb
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
PETKA: Fix signed/unsigned conversion warnings

Changed paths:
    engines/petka/interfaces/interface.cpp
    engines/petka/objects/heroes.cpp
    engines/petka/objects/object.cpp
    engines/petka/objects/text.cpp


diff --git a/engines/petka/interfaces/interface.cpp b/engines/petka/interfaces/interface.cpp
index 9cd00e3524b..1e1e6bc8d3f 100644
--- a/engines/petka/interfaces/interface.cpp
+++ b/engines/petka/interfaces/interface.cpp
@@ -72,7 +72,7 @@ void Interface::removeTexts() {
 	for (uint i = 0; i < _objs.size();) {
 		if (_objs[i]->_resourceId == -2) {
 			g_vm->videoSystem()->addDirtyRect(((QText *)_objs[i])->getRect());
-			g_vm->resMgr()->removeResource(-2);
+			g_vm->resMgr()->removeResource((uint32)-2);
 			delete _objs[i];
 			_objs.remove_at(i);
 		} else {
diff --git a/engines/petka/objects/heroes.cpp b/engines/petka/objects/heroes.cpp
index 209589fde8f..35e8e28e825 100644
--- a/engines/petka/objects/heroes.cpp
+++ b/engines/petka/objects/heroes.cpp
@@ -297,7 +297,7 @@ void QObjectPetka::stopWalk() {
 	Common::List<QMessage> &list = g_vm->getQSystem()->_messages;
 	for (Common::List<QMessage>::iterator it = list.begin(); it != list.end(); ++it) {
 		if (it->opcode == kWalked && it->objId == _id) {
-			it->objId = -1;
+			it->objId = (uint16)-1;
 		}
 
 	}
diff --git a/engines/petka/objects/object.cpp b/engines/petka/objects/object.cpp
index c8cac11e620..d453b733f84 100644
--- a/engines/petka/objects/object.cpp
+++ b/engines/petka/objects/object.cpp
@@ -53,7 +53,7 @@ QVisibleObject::QVisibleObject()
 	: _resourceId(-1), _z(240) {}
 
 QMessageObject::QMessageObject() {
-	_id = -1;
+	_id = (uint16)-1;
 	_status = 0;
 	_time = 0;
 	_dialogColor = -1;
diff --git a/engines/petka/objects/text.cpp b/engines/petka/objects/text.cpp
index e74446db7fd..9d6a0e4f1a8 100644
--- a/engines/petka/objects/text.cpp
+++ b/engines/petka/objects/text.cpp
@@ -45,14 +45,14 @@ QText::QText(const Common::U32String &text, uint16 textColor, uint16 outlineColo
 	rect.bottom += 4;
 
 	_rect = Common::Rect((640 - rect.width()) / 2, 479 - rect.height(), 639 - (640 - rect.width()) / 2, 479);
-	Graphics::Surface *s = g_vm->resMgr()->getSurface(-2, rect.width(), rect.height());
+	Graphics::Surface *s = g_vm->resMgr()->getSurface((uint32)-2, rect.width(), rect.height());
 
 	drawText(*s, 0, 630, text, textColor, *font, Graphics::kTextAlignCenter);
 	drawOutline(s, outlineColor);
 }
 
 void QText::draw() {
-	const Graphics::Surface *s = g_vm->resMgr()->getSurface(-2);
+	const Graphics::Surface *s = g_vm->resMgr()->getSurface((uint32)-2);
 	if (s) {
 		g_vm->videoSystem()->transBlitFrom(*s, Common::Point((640 - s->w) / 2, 479 - s->h));
 	}
@@ -138,7 +138,7 @@ QTextDescription::QTextDescription(const Common::U32String &desc, uint32 frame)
 	flc->setFrame(frame);
 
 	const Graphics::Surface *frameS = flc->getCurrentFrame();
-	Graphics::Surface *s = g_vm->resMgr()->getSurface(-2, 640, 480);
+	Graphics::Surface *s = g_vm->resMgr()->getSurface((uint32)-2, 640, 480);
 
 	Graphics::Surface *convS = frameS->convertTo(s->format, flc->getPalette());
 	s->copyRectToSurface(*convS, 0, 0, _rect);
@@ -161,7 +161,7 @@ void QTextDescription::onClick(Common::Point p) {
 void QTextDescription::draw() {
 	QManager *resMgr = g_vm->resMgr();
 	VideoSystem *videoSys = g_vm->videoSystem();
-	Graphics::Surface *s = resMgr->getSurface(-2);
+	Graphics::Surface *s = resMgr->getSurface((uint32)-2);
 	FlicDecoder *flc = resMgr->getFlic(6008);
 
 	for (auto &dirty : videoSys->rects()) {
@@ -195,7 +195,7 @@ QTextChoice::QTextChoice(const Common::Array<Common::U32String> &choices, uint16
 
 	_rect = Common::Rect((640 - w) / 2, 479 - h, 639 - (640 - w) / 2, 479);
 
-	Graphics::Surface *s = g_vm->resMgr()->getSurface(-2, w, h);
+	Graphics::Surface *s = g_vm->resMgr()->getSurface((uint32)-2, w, h);
 
 	int y = 0;
 	for (uint i = 0; i < _choices.size(); ++i) {
@@ -218,7 +218,7 @@ void QTextChoice::onMouseMove(Common::Point p) {
 	}
 
 	if (newChoice != _activeChoice) {
-		Graphics::Surface *s = g_vm->resMgr()->getSurface(-2);
+		Graphics::Surface *s = g_vm->resMgr()->getSurface((uint32)-2);
 		auto *font = g_vm->getTextFont();
 
 		s->fillRect(Common::Rect(s->w, s->h), 0);


Commit: c56086f6d5d7d163db0181b3561df5ecf891eede
    https://github.com/scummvm/scummvm/commit/c56086f6d5d7d163db0181b3561df5ecf891eede
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
WATCHMAKER: Fix switch with no cases warning

Changed paths:
    engines/watchmaker/classes/do_action.cpp


diff --git a/engines/watchmaker/classes/do_action.cpp b/engines/watchmaker/classes/do_action.cpp
index fc5d9beb3a3..170c82b1e07 100644
--- a/engines/watchmaker/classes/do_action.cpp
+++ b/engines/watchmaker/classes/do_action.cpp
@@ -66,6 +66,7 @@ void doDoor(WGame &game, int32 obj) {
 
 	anim = init.Obj[obj].anim[CurPlayer];
 	switch (obj) {
+	case 0: // Quiet VS C4065 warning
 	default:
 		anim = init.Obj[obj].anim[CurPlayer];
 		if (init.Obj[obj].goroom)


Commit: 205d3c4c41184f161661e0157bf686e17abbebab
    https://github.com/scummvm/scummvm/commit/205d3c4c41184f161661e0157bf686e17abbebab
Author: elasota (ejlasota at gmail.com)
Date: 2023-07-08T22:02:00+03:00

Commit Message:
WATCHMAKER: Fix signed/unsigned conversion warning

Changed paths:
    engines/watchmaker/ll/ll_anim.cpp


diff --git a/engines/watchmaker/ll/ll_anim.cpp b/engines/watchmaker/ll/ll_anim.cpp
index 3640ae4b34a..066d49aee29 100644
--- a/engines/watchmaker/ll/ll_anim.cpp
+++ b/engines/watchmaker/ll/ll_anim.cpp
@@ -1441,7 +1441,7 @@ void StartAnim(WGame &game, int32 an) {
 	h->flags = 0;
 	h->CurFrame = 0;
 	h->LastFrame = -3;
-	h->LoopStart = -1;
+	h->LoopStart = (uint16)-1;
 	h->LoopEnd = 0;
 	h->LoopMask = 0;
 	for (a = 0; a < MAX_SUBANIMS; a++) {




More information about the Scummvm-git-logs mailing list