[Scummvm-git-logs] scummvm master -> d3dc9d227667cbaac4bb4f3fafff1963a04d2f0e
athrxx
athrxx at scummvm.org
Sat Dec 19 02:20:56 UTC 2020
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:
d3dc9d2276 KYRA: fix gcc warnings
Commit: d3dc9d227667cbaac4bb4f3fafff1963a04d2f0e
https://github.com/scummvm/scummvm/commit/d3dc9d227667cbaac4bb4f3fafff1963a04d2f0e
Author: athrxx (athrxx at scummvm.org)
Date: 2020-12-19T03:16:47+01:00
Commit Message:
KYRA: fix gcc warnings
Changed paths:
engines/kyra/sound/drivers/adlib.cpp
engines/kyra/sound/drivers/pc_base.h
diff --git a/engines/kyra/sound/drivers/adlib.cpp b/engines/kyra/sound/drivers/adlib.cpp
index bcb3981b44..f01a0ec5c6 100644
--- a/engines/kyra/sound/drivers/adlib.cpp
+++ b/engines/kyra/sound/drivers/adlib.cpp
@@ -1374,7 +1374,7 @@ int AdLibDriver::update_jump(const uint8 *&dataptr, Channel &channel, uint8 valu
int16 add = READ_LE_UINT16(dataptr); dataptr += 2;
if (_version == 1) {
// Safety check: ignore jump to invalid address
- if (add < 191 || add - 191 >= _soundDataSize)
+ if (add < 191 || add - 191 >= (int32)_soundDataSize)
dataptr = nullptr;
else
dataptr = _soundData + add - 191;
@@ -1404,7 +1404,7 @@ int AdLibDriver::update_jumpToSubroutine(const uint8 *&dataptr, Channel &channel
}
channel.dataptrStack[channel.dataptrStackPos++] = dataptr;
if (_version < 3) {
- if (add < 191 || add - 191 >= _soundDataSize)
+ if (add < 191 || add - 191 >= (int32)_soundDataSize)
dataptr = nullptr;
else
dataptr = _soundData + add - 191;
@@ -1490,7 +1490,7 @@ int AdLibDriver::update_setupSecondaryEffect1(const uint8 *&dataptr, Channel &ch
// Safety check: don't enable effect when table location is invalid.
int start = channel.secondaryEffectData + channel.secondaryEffectSize;
- if (start < 0 || start >= _soundDataSize) {
+ if (start < 0 || start >= (int)_soundDataSize) {
warning("AdLibDriver::update_setupSecondaryEffect1: Ignoring due to invalid table location");
channel.secondaryEffect = nullptr;
}
diff --git a/engines/kyra/sound/drivers/pc_base.h b/engines/kyra/sound/drivers/pc_base.h
index 212efb0c12..05b0d42019 100644
--- a/engines/kyra/sound/drivers/pc_base.h
+++ b/engines/kyra/sound/drivers/pc_base.h
@@ -55,7 +55,7 @@ public:
protected:
uint8 *getProgram(int progId) {
// Safety check: invalid progId would crash.
- if (progId < 0 || progId >= _soundDataSize / 2)
+ if (progId < 0 || progId >= (int32)_soundDataSize / 2)
return nullptr;
const uint16 offset = READ_LE_UINT16(_soundData + 2 * progId);
More information about the Scummvm-git-logs
mailing list