diff options
author | Adrian Frühwirth | 2018-05-06 15:02:10 +0200 |
---|---|---|
committer | Adrian Frühwirth | 2018-05-07 22:21:42 +0200 |
commit | 7ebbb12dfb77d82958390ee71801bc900961d10f (patch) | |
tree | 74c201d40dd1f50b7ca05824a59bb908755f1791 /engines/scumm | |
parent | f58731cfae973c95a79520b2462ee991218509d2 (diff) | |
download | scummvm-rg350-7ebbb12dfb77d82958390ee71801bc900961d10f.tar.gz scummvm-rg350-7ebbb12dfb77d82958390ee71801bc900961d10f.tar.bz2 scummvm-rg350-7ebbb12dfb77d82958390ee71801bc900961d10f.zip |
SCUMM: Remove superfluous 'else' in IMuseInternal::ImSetTrigger()
Both means to calculate `diff` are essentially equal because
wraparound of unsigned integers is well-defined and does what
the 'else' branch is simulating manually. Because of this,
gcc complains when compiling with -Wduplicated-branches.
Diffstat (limited to 'engines/scumm')
-rw-r--r-- | engines/scumm/imuse/imuse.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/engines/scumm/imuse/imuse.cpp b/engines/scumm/imuse/imuse.cpp index 5de921bc6b..f5526ab11d 100644 --- a/engines/scumm/imuse/imuse.cpp +++ b/engines/scumm/imuse/imuse.cpp @@ -1236,11 +1236,8 @@ int32 IMuseInternal::ImSetTrigger(int sound, int id, int a, int b, int c, int d, if (trig->id == id && trig->sound == sound && trig->command[0] == a) break; - uint16 diff; - if (trig->expire <= _snm_trigger_index) - diff = _snm_trigger_index - trig->expire; - else - diff = 0x10000 - trig->expire + _snm_trigger_index; + // The wraparound if trig->expire > _snm_trigger_index is intentional + uint16 diff = _snm_trigger_index - trig->expire; if (!oldest_ptr || oldest_trigger < diff) { oldest_ptr = trig; |