[Scummvm-git-logs] scummvm master -> a7050dc9dc3e334bd4dca31daf13699ba8ac3194
dwatteau
noreply at scummvm.org
Tue Dec 9 14:38:22 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
a7050dc9dc AUDIO: Silence GCC assert() warning in the CTMIDI AdLib driver
Commit: a7050dc9dc3e334bd4dca31daf13699ba8ac3194
https://github.com/scummvm/scummvm/commit/a7050dc9dc3e334bd4dca31daf13699ba8ac3194
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-12-09T15:37:45+01:00
Commit Message:
AUDIO: Silence GCC assert() warning in the CTMIDI AdLib driver
With `volumeModifierIndex` being declared as `uint16` just above the
assert() condition, the `volumeModifierIndex >= 0` check is redundant.
Changed paths:
audio/adlib_ctmidi.cpp
diff --git a/audio/adlib_ctmidi.cpp b/audio/adlib_ctmidi.cpp
index be0d1cf476d..48bdb92c697 100644
--- a/audio/adlib_ctmidi.cpp
+++ b/audio/adlib_ctmidi.cpp
@@ -565,7 +565,7 @@ uint8 MidiDriver_ADLIB_CTMIDI::calculateUnscaledVolume(uint8 channel, uint8 sour
// based on the note velocity and MIDI channel volume
uint16 volumeModifierIndex = (((velocity << 1) | 1) * (_controlData[source][channel].volume << 1)) >> 11;
volumeModifierIndex = (volumeModifierIndex >> 1) + (volumeModifierIndex & 0x1);
- assert(volumeModifierIndex >= 0 && volumeModifierIndex < 18);
+ assert(volumeModifierIndex < 18); // (volumeModifierIndex >= 0 implied by uint16)
int8 volumeModifier = NOTE_VOLUME_MODIFIER_VALUES[volumeModifierIndex];
uint8 operatorVolume = 0x3F - (instrumentDef.getOperatorDefinition(operatorNum).level & 0x3F);
More information about the Scummvm-git-logs
mailing list