[Scummvm-git-logs] scummvm master -> c22f5ded21b010741c02b71ca9d78daf3db3eae3
digitall
noreply at scummvm.org
Mon Feb 20 00:29:51 UTC 2023
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:
c22f5ded21 CHAMBER: Fix Various GCC Compiler Warnings
Commit: c22f5ded21b010741c02b71ca9d78daf3db3eae3
https://github.com/scummvm/scummvm/commit/c22f5ded21b010741c02b71ca9d78daf3db3eae3
Author: D G Turner (digitall at scummvm.org)
Date: 2023-02-20T00:27:04Z
Commit Message:
CHAMBER: Fix Various GCC Compiler Warnings
This commit does change the behaviour of the memset call in room.cpp
in the loadZone() function to clear the entire array. As noted, this
is likely an original bug, but can be changed with the associated
preprocessor define of #if 0 / #if 1 for testing. This now uses the
type size in both cases to avoid warnings.
Changed paths:
engines/chamber/anim.cpp
engines/chamber/cga.cpp
engines/chamber/resdata.cpp
engines/chamber/room.cpp
diff --git a/engines/chamber/anim.cpp b/engines/chamber/anim.cpp
index ac01454876e..54d050e25c6 100644
--- a/engines/chamber/anim.cpp
+++ b/engines/chamber/anim.cpp
@@ -49,7 +49,6 @@ uint16 dot_effect_delay;
extern uint16 cpu_speed_delay;
-extern byte *seekToEntry(byte *bank, uint16 num, byte **end);
extern void loadLutinSprite(uint16 lutidx);
void getScratchBuffer(byte mode) {
diff --git a/engines/chamber/cga.cpp b/engines/chamber/cga.cpp
index 44b5828299d..c98b495df18 100644
--- a/engines/chamber/cga.cpp
+++ b/engines/chamber/cga.cpp
@@ -1227,6 +1227,9 @@ static uint16 FPDiv(uint16 a, byte b) {
/*is it really any better than (uint32)(a << 8) / b ?*/
}
+// call commented out in void cga_ZoomImage(byte *pixels, byte w, byte h, byte nw, byte nh, byte *target, uint16 ofs) currently
+// thus causes an unused function warning
+#if 0
/*
Draw scaled image
NB! tw/th specify target width/height in pixels
@@ -1301,6 +1304,7 @@ static void cga_Zoom(zoom_t *params, byte tw, byte th, byte *source, byte *targe
cga_BlitAndWait(scratch_mem2, params->fw, params->fw, th + 2, target, finofs);
}
+#endif
/*
Draw scaled image
diff --git a/engines/chamber/resdata.cpp b/engines/chamber/resdata.cpp
index e86845bdba3..29dd2733914 100644
--- a/engines/chamber/resdata.cpp
+++ b/engines/chamber/resdata.cpp
@@ -147,7 +147,7 @@ int16 loadStaticData() {
uint32 *modOffs = new uint32[numMods];
- for (int i = 0; i < numMods; i++)
+ for (uint i = 0; i < numMods; i++)
modOffs[i] = modBase + pxi.readUint32BE();
// So far, take only resource 0. Additional selection is required
@@ -182,7 +182,7 @@ int16 loadStaticData() {
const char *firstRes = "ARPLA.";
int32 resOffs = -1;
- for (int i = off; i < rawSize; i++)
+ for (uint i = off; i < rawSize; i++)
if (!strncmp((char *)rawData + i, firstRes, strlen(firstRes))) {
resOffs = i;
break;
diff --git a/engines/chamber/room.cpp b/engines/chamber/room.cpp
index 86a0b7bedf3..b5c218045d2 100644
--- a/engines/chamber/room.cpp
+++ b/engines/chamber/room.cpp
@@ -303,7 +303,11 @@ void loadZone(void) {
if (zone_obj_count != 0) {
uint16 i;
uint16 *zcmds = script_word_vars.zone_obj_cmds;
- memset(script_word_vars.zone_obj_cmds, 0, 15 * 5); /*half of list: TODO: bug? wipe whole list?*/
+#if 0
+ memset(script_word_vars.zone_obj_cmds, 0, 15 * 5 * sizeof(uint8)); /*Original code? - half of list: TODO: bug? wipe whole list?*/
+#else
+ memset(script_word_vars.zone_obj_cmds, 0, 15 * 5 * sizeof(uint16)); /* wipe whole list */
+#endif
for (i = 0; i < zone_obj_count; i++) {
/*load spot's reactions*/
uint16 flags = (*zptr++) << 8;
More information about the Scummvm-git-logs
mailing list