[Scummvm-git-logs] scummvm master -> ab790486e54ebbae3c2d4f22a127c3ea60dd793d
sev-
noreply at scummvm.org
Mon Feb 5 11:41:02 UTC 2024
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c2fe238f20 FREESCAPE: Remove 'register' variable qualifier
ab790486e5 SCUMM: Fix warning
Commit: c2fe238f20b7d66d3dabc21f192e27f1445347e6
https://github.com/scummvm/scummvm/commit/c2fe238f20b7d66d3dabc21f192e27f1445347e6
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-02-05T12:38:10+01:00
Commit Message:
FREESCAPE: Remove 'register' variable qualifier
Changed paths:
engines/freescape/unpack.cpp
Commit: ab790486e54ebbae3c2d4f22a127c3ea60dd793d
https://github.com/scummvm/scummvm/commit/ab790486e54ebbae3c2d4f22a127c3ea60dd793d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-02-05T12:38:10+01:00
Commit Message:
SCUMM: Fix warning
The enum has range restriction, which could lead to an undefined
behavior when using as a variadic parameter. This is indicated
by the following wanring:
passing an object that undergoes default argument promotion to 'va_start' has undefined behavior
Switching it to 'int' type solves the problem while keeping
the functionality
Changed paths:
engines/scumm/players/player_mac_indy3.cpp
diff --git a/engines/scumm/players/player_mac_indy3.cpp b/engines/scumm/players/player_mac_indy3.cpp
index de808bcd7ff..3458c394d1d 100644
--- a/engines/scumm/players/player_mac_indy3.cpp
+++ b/engines/scumm/players/player_mac_indy3.cpp
@@ -167,7 +167,7 @@ public:
I3MMusicDriver(uint16 numChannels, Common::Mutex &mutex, bool isStereo, bool internal16Bit) : I3MSoundDriver(mutex, ASC_DEVICE_RATE, isStereo, false, internal16Bit), _numChan(numChannels) {}
virtual void start() = 0;
virtual void stop() = 0;
- virtual void setParameter(ParaType type, ...) = 0;
+ virtual void setParameter(int type, ...) = 0;
uint16 numChannels() const { return _numChan; }
protected:
const uint16 _numChan;
@@ -181,7 +181,7 @@ public:
void feed(int8 *dst, uint32 byteSize, Audio::Mixer::SoundType type, bool expectStereo) override;
void start() override;
void stop() override;
- void setParameter(ParaType type, ...) override;
+ void setParameter(int type, ...) override;
private:
void setWaveForm(uint8 chan, const uint8 *data, uint32 dataSize);
@@ -209,7 +209,7 @@ public:
void feed(int8 *dst, uint32 byteSize, Audio::Mixer::SoundType type, bool expectStereo) override;
void start() override;
void stop() override;
- void setParameter(ParaType argType, ...) override;
+ void setParameter(int argType, ...) override;
private:
void pushTriplet(uint16 count, uint16 amplitude, uint16 duration);
@@ -869,7 +869,7 @@ void I3MFourToneSynthDriver::stop() {
setDuration(0);
}
-void I3MFourToneSynthDriver::setParameter(ParaType type, ...) {
+void I3MFourToneSynthDriver::setParameter(int type, ...) {
Common::StackLock lock(_mutex);
va_list arg;
va_start(arg, type);
@@ -930,13 +930,13 @@ void I3MSquareWaveSynthDriver::stop() {
}
-void I3MSquareWaveSynthDriver::setParameter(ParaType type, ...) {
+void I3MSquareWaveSynthDriver::setParameter(int type, ...) {
Common::StackLock lock(_mutex);
va_list arg;
va_start(arg, type);
uint16 a = 0;
uint16 b = 0;
-
+
switch (type) {
case kSwTriplet:
a = (uint16)va_arg(arg, uint);
More information about the Scummvm-git-logs
mailing list