From 2f567bdb7482f5b31559bd57b4940f5b20d8252c Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 12 Dec 2021 15:18:43 +1100 Subject: [PATCH] - Exhumed: Fix two signed/unsigned comparison warnings in `PlayFX2()`. * Lines in question: ** 606 | if (chan->SoundID == nSound + 1) ** 621 | if (chan->SoundID == nSound + 1) * All data sent to `PlayFX2()` and functions that wrap `PlayFX2()` are signed values, so keep signed all the way through. --- source/games/exhumed/src/sound.cpp | 4 ++-- source/games/exhumed/src/sound.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/games/exhumed/src/sound.cpp b/source/games/exhumed/src/sound.cpp index 7ef8b5af8..edea1e55e 100644 --- a/source/games/exhumed/src/sound.cpp +++ b/source/games/exhumed/src/sound.cpp @@ -553,7 +553,7 @@ void GameInterface::UpdateSounds() int soundx, soundy, soundz; -void PlayFX2(unsigned int nSound, DExhumedActor* pActor, int sectf, EChanFlags chanflags, int sprflags) +void PlayFX2(int nSound, DExhumedActor* pActor, int sectf, EChanFlags chanflags, int sprflags) { if (!SoundEnabled()) return; if ((nSound&0x1ff) >= kMaxSounds || !soundEngine->isValidSoundId((nSound & 0x1ff)+1)) @@ -654,7 +654,7 @@ void PlayFX2(unsigned int nSound, DExhumedActor* pActor, int sectf, EChanFlags c // //========================================================================== -void PlayFXAtXYZ(unsigned int ax, int x, int y, int z, EChanFlags chanflags, int sectf) +void PlayFXAtXYZ(int ax, int x, int y, int z, EChanFlags chanflags, int sectf) { soundx = x; soundy = y; diff --git a/source/games/exhumed/src/sound.h b/source/games/exhumed/src/sound.h index 0bc203283..29f9b5ebf 100644 --- a/source/games/exhumed/src/sound.h +++ b/source/games/exhumed/src/sound.h @@ -130,10 +130,10 @@ int LoadSound(const char* sound); void BendAmbientSound(); void CheckAmbience(sectortype* pSector); -void PlayFX2(unsigned int nSound, DExhumedActor* nSprite, int sectf = 0, EChanFlags chanflags = CHANF_NONE, int sprflags = 0); +void PlayFX2(int nSound, DExhumedActor* nSprite, int sectf = 0, EChanFlags chanflags = CHANF_NONE, int sprflags = 0); -void PlayFXAtXYZ(unsigned int nSound, int x, int y, int z, EChanFlags chanflags = CHANF_NONE, int sectf = 0); -inline void D3PlayFX(unsigned int nSound, DExhumedActor* actor, int flags = 0) +void PlayFXAtXYZ(int nSound, int x, int y, int z, EChanFlags chanflags = CHANF_NONE, int sectf = 0); +inline void D3PlayFX(int nSound, DExhumedActor* actor, int flags = 0) { PlayFX2(nSound, actor, 0, CHANF_NONE, flags); }