From f9735c44dedc75986309b2c45d9e0b6657a82e27 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 23 Apr 2017 15:40:03 +0200 Subject: [PATCH] - fixed signedness issues in OPL code. --- src/sound/mididevices/music_opl_mididevice.cpp | 2 +- src/sound/oplsynth/musicblock.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sound/mididevices/music_opl_mididevice.cpp b/src/sound/mididevices/music_opl_mididevice.cpp index d584d3ebd..72ae555a8 100644 --- a/src/sound/mididevices/music_opl_mididevice.cpp +++ b/src/sound/mididevices/music_opl_mididevice.cpp @@ -296,7 +296,7 @@ FString OPLMIDIDevice::GetStats() char star[3] = { TEXTCOLOR_ESCAPE, 'A', '*' }; for (uint32_t i = 0; i < io->NumChannels; ++i) { - if (voices[i].index == -1) + if (voices[i].index == ~0u) { star[1] = CR_BRICK + 'A'; } diff --git a/src/sound/oplsynth/musicblock.cpp b/src/sound/oplsynth/musicblock.cpp index d905744d4..c2e23b0dc 100644 --- a/src/sound/oplsynth/musicblock.cpp +++ b/src/sound/oplsynth/musicblock.cpp @@ -140,7 +140,7 @@ void musicBlock::voiceKeyOn(uint32_t slot, uint32_t channo, GenMidiInstrument *i // Work out the note to use. This is normally the same as // the key, unless it is a fixed pitch instrument. - uint32_t note; + int note; if (instrument->flags & GENMIDI_FLAG_FIXED) note = instrument->fixed_note; else if (channo == CHAN_PERCUSSION) note = 60; else note = key; @@ -475,6 +475,6 @@ void musicBlock::stopAllVoices() { for (uint32_t i = 0; i < io->NumChannels; i++) { - if (voices[i].index >= 0) releaseVoice(i, 1); + if (voices[i].index != ~0u) releaseVoice(i, 1); } }