From a2b377c58039bdf896dea0f79da1d6844b2e135b Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Wed, 30 Dec 2015 10:58:52 +0100 Subject: [PATCH] - Fixed Clang errors/warnings on wildMIDI code. --- src/sound/music_wildmidi_mididevice.cpp | 2 +- src/wildmidi/wildmidi_lib.cpp | 8 ++++---- src/wildmidi/wildmidi_lib.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sound/music_wildmidi_mididevice.cpp b/src/sound/music_wildmidi_mididevice.cpp index 332a97abe..c3fd674c9 100644 --- a/src/sound/music_wildmidi_mididevice.cpp +++ b/src/sound/music_wildmidi_mididevice.cpp @@ -193,7 +193,7 @@ void WildMIDIDevice::HandleEvent(int status, int parm1, int parm2) void WildMIDIDevice::HandleLongEvent(const BYTE *data, int len) { - Renderer->LongEvent((const char *)data, len); + Renderer->LongEvent(data, len); } //========================================================================== diff --git a/src/wildmidi/wildmidi_lib.cpp b/src/wildmidi/wildmidi_lib.cpp index 40e462b62..94a446e17 100644 --- a/src/wildmidi/wildmidi_lib.cpp +++ b/src/wildmidi/wildmidi_lib.cpp @@ -162,7 +162,7 @@ struct _mdi { patch_count = 0; amp = 0; mix_buffer = NULL; - mix_buffer_size = NULL; + mix_buffer_size = 0; reverb = NULL; } @@ -2926,7 +2926,7 @@ void WildMidi_Renderer::ShortEvent(int status, int parm1, int parm2) } } -void WildMidi_Renderer::LongEvent(const char *data, int len) +void WildMidi_Renderer::LongEvent(const unsigned char *data, int len) { // Check for Roland SysEx if (len >= 11 && // Must be at least 11 bytes @@ -2949,7 +2949,7 @@ void WildMidi_Renderer::LongEvent(const char *data, int len) { // Check destination address if (((data[6] & 0xF0) == 0x10) && data[7] == 0x15) { // Roland drum track setting - int sysex_ch = data[6] & 0x0F; + unsigned char sysex_ch = data[6] & 0x0F; if (sysex_ch == 0) { sysex_ch = 9; @@ -2958,7 +2958,7 @@ void WildMidi_Renderer::LongEvent(const char *data, int len) { sysex_ch -= 1; } - _event_data ev = { sysex_ch, data[8] }; + _event_data ev = { sysex_ch, static_cast(data[8]) }; do_sysex_roland_drum_track((_mdi *)handle, &ev); } else if (data[6] == 0x00 && data[7] == 0x7F && data[8] == 0x00) diff --git a/src/wildmidi/wildmidi_lib.h b/src/wildmidi/wildmidi_lib.h index 8f021d426..b5aa79849 100644 --- a/src/wildmidi/wildmidi_lib.h +++ b/src/wildmidi/wildmidi_lib.h @@ -74,7 +74,7 @@ public: ~WildMidi_Renderer(); void ShortEvent(int status, int parm1, int parm2); - void LongEvent(const char *data, int len); + void LongEvent(const unsigned char *data, int len); void ComputeOutput(float *buffer, int len); void LoadInstrument(int bank, int percussion, int instr); int GetVoiceCount();