[Scummvm-git-logs] scummvm master -> 1ff2bb3ed23aa2b8892bdff1b95997a8892dc29e
digitall
noreply at scummvm.org
Tue Oct 11 07:49:37 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
1ff2bb3ed2 SCUMM: Fix Memset of Non-Trivial Data Structure GCC Compiler Warning
Commit: 1ff2bb3ed23aa2b8892bdff1b95997a8892dc29e
https://github.com/scummvm/scummvm/commit/1ff2bb3ed23aa2b8892bdff1b95997a8892dc29e
Author: D G Turner (digitall at scummvm.org)
Date: 2022-10-11T08:49:09+01:00
Commit Message:
SCUMM: Fix Memset of Non-Trivial Data Structure GCC Compiler Warning
Changed paths:
engines/scumm/imuse/drivers/mac_m68k.cpp
engines/scumm/imuse/drivers/mac_m68k.h
diff --git a/engines/scumm/imuse/drivers/mac_m68k.cpp b/engines/scumm/imuse/drivers/mac_m68k.cpp
index 9f657cbe6ad..1dbfbbb98e6 100644
--- a/engines/scumm/imuse/drivers/mac_m68k.cpp
+++ b/engines/scumm/imuse/drivers/mac_m68k.cpp
@@ -453,7 +453,7 @@ bool IMuseDriver_MacM68k::MidiChannel_MacM68k::allocate() {
_allocated = true;
_voice = nullptr;
_priority = 0;
- memset(&_instrument, 0, sizeof(_instrument));
+ _instrument.reset();
_pitchBend = 0;
_pitchBendFactor = 2;
_volume = 0;
diff --git a/engines/scumm/imuse/drivers/mac_m68k.h b/engines/scumm/imuse/drivers/mac_m68k.h
index 954a3f72256..40fbe3e8420 100644
--- a/engines/scumm/imuse/drivers/mac_m68k.h
+++ b/engines/scumm/imuse/drivers/mac_m68k.h
@@ -62,7 +62,7 @@ private:
int _mixBufferLength;
struct Instrument {
- Instrument() : length(0), sampleRate(0), loopStart(0), loopEnd(0), baseFrequency(0), data(nullptr) {}
+ Instrument() { reset(); }
uint length;
uint sampleRate;
uint loopStart;
@@ -70,6 +70,15 @@ private:
int baseFrequency;
byte *data;
+
+ void reset() {
+ length = 0;
+ sampleRate = 0;
+ loopStart = 0;
+ loopEnd = 0;
+ baseFrequency = 0;
+ data = nullptr;
+ }
};
enum {
More information about the Scummvm-git-logs
mailing list