From 7ebbb12dfb77d82958390ee71801bc900961d10f Mon Sep 17 00:00:00 2001 From: Adrian Frühwirth Date: Sun, 6 May 2018 15:02:10 +0200 Subject: 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. --- engines/scumm/imuse/imuse.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'engines/scumm') 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; -- cgit v1.2.3