aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorD G Turner2019-05-07 01:39:12 +0100
committerD G Turner2019-05-07 01:39:12 +0100
commit21450facee606e8303fb06b94b9c2a3306254442 (patch)
tree104ac911871b524093aa4264a3dc5a19676bc13b
parent24bf47a28b317853f1c9175a8f22d6b4ba3ffc5f (diff)
downloadscummvm-rg350-21450facee606e8303fb06b94b9c2a3306254442.tar.gz
scummvm-rg350-21450facee606e8303fb06b94b9c2a3306254442.tar.bz2
scummvm-rg350-21450facee606e8303fb06b94b9c2a3306254442.zip
MT32: Fix GCC Compiler Warning regarding memset usage
-rw-r--r--audio/softsynth/mt32/MidiEventQueue.h1
-rw-r--r--audio/softsynth/mt32/Synth.cpp8
2 files changed, 8 insertions, 1 deletions
diff --git a/audio/softsynth/mt32/MidiEventQueue.h b/audio/softsynth/mt32/MidiEventQueue.h
index c5174d6cc9..32a0bbe553 100644
--- a/audio/softsynth/mt32/MidiEventQueue.h
+++ b/audio/softsynth/mt32/MidiEventQueue.h
@@ -32,6 +32,7 @@ struct MidiEvent {
Bit32u sysexLength;
Bit32u timestamp;
+ MidiEvent();
~MidiEvent();
void setShortMessage(Bit32u shortMessageData, Bit32u timestamp);
void setSysex(const Bit8u *sysexData, Bit32u sysexLength, Bit32u timestamp);
diff --git a/audio/softsynth/mt32/Synth.cpp b/audio/softsynth/mt32/Synth.cpp
index 62810ba3e6..a0d6631fab 100644
--- a/audio/softsynth/mt32/Synth.cpp
+++ b/audio/softsynth/mt32/Synth.cpp
@@ -1753,6 +1753,13 @@ Bit32s Synth::getMasterTunePitchDelta() const {
return extensions.masterTunePitchDelta;
}
+MidiEvent::MidiEvent() {
+ shortMessageData = 0;
+ sysexData = NULL;
+ sysexLength = 0;
+ timestamp = 0;
+}
+
MidiEvent::~MidiEvent() {
if (sysexData != NULL) {
delete[] sysexData;
@@ -1782,7 +1789,6 @@ void MidiEvent::setSysex(const Bit8u *useSysexData, Bit32u useSysexLength, Bit32
}
MidiEventQueue::MidiEventQueue(Bit32u useRingBufferSize) : ringBuffer(new MidiEvent[useRingBufferSize]), ringBufferMask(useRingBufferSize - 1) {
- memset(ringBuffer, 0, useRingBufferSize * sizeof(MidiEvent));
reset();
}