[Scummvm-git-logs] scummvm master -> 6d434028a10b7d00f65e9d6498777bca9e211b11
AndywinXp
noreply at scummvm.org
Wed Aug 23 20:35:31 UTC 2023
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:
6d434028a1 SCUMM: HE: Fix initialization of mixer channels
Commit: 6d434028a10b7d00f65e9d6498777bca9e211b11
https://github.com/scummvm/scummvm/commit/6d434028a10b7d00f65e9d6498777bca9e211b11
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2023-08-23T22:35:27+02:00
Commit Message:
SCUMM: HE: Fix initialization of mixer channels
Detected by GCC 13:
mixer_he.cpp:278:15: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct Scumm::HEMixer::HEMixerChannel'; use assignment or value-initialization instead [-Wclass-memaccess]
278 | memset(_mixerChannels, 0, sizeof(_mixerChannels));
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Changed paths:
engines/scumm/he/mixer_he.cpp
engines/scumm/he/mixer_he.h
diff --git a/engines/scumm/he/mixer_he.cpp b/engines/scumm/he/mixer_he.cpp
index c76fce465d1..e30ce554424 100644
--- a/engines/scumm/he/mixer_he.cpp
+++ b/engines/scumm/he/mixer_he.cpp
@@ -274,9 +274,6 @@ int32 HEMixer::matchOffsetToSongId(int32 offset) {
/* --- SOFTWARE MIXER --- */
bool HEMixer::mixerInitMyMixerSubSystem() {
- // Init the channel buffers, and kick start the mixer...
- memset(_mixerChannels, 0, sizeof(_mixerChannels));
-
for (int i = 0; i < MIXER_MAX_CHANNELS; i++) {
_mixerChannels[i].stream = Audio::makeQueuingAudioStream(MIXER_DEFAULT_SAMPLE_RATE, false);
_mixer->playStream(
diff --git a/engines/scumm/he/mixer_he.h b/engines/scumm/he/mixer_he.h
index 205290172cb..3be7dda740e 100644
--- a/engines/scumm/he/mixer_he.h
+++ b/engines/scumm/he/mixer_he.h
@@ -132,20 +132,20 @@ protected:
Audio::SoundHandle handle;
Audio::QueuingAudioStream *stream = nullptr;
Common::File *fileHandle = nullptr;
- int number;
- int volume;
- int frequency;
- int globType;
- int globNum;
- int callbackID;
- int endSampleAdjustment;
- uint32 lastReadPosition;
- uint32 initialSpoolingFileOffset;
- uint32 sampleLen;
- uint32 dataOffset;
- uint32 flags;
- bool callbackOnNextFrame;
- bool isUsingStreamOverride;
+ int number = 0;
+ int volume = 0;
+ int frequency = 0;
+ int globType = 0;
+ int globNum = 0;
+ int callbackID = 0;
+ int endSampleAdjustment = 0;
+ uint32 lastReadPosition = 0;
+ uint32 initialSpoolingFileOffset = 0;
+ uint32 sampleLen = 0;
+ uint32 dataOffset = 0;
+ uint32 flags = 0;
+ bool callbackOnNextFrame = false;
+ bool isUsingStreamOverride = false;
byte *residualData = nullptr; // For early callbacks
};
More information about the Scummvm-git-logs
mailing list