[Scummvm-git-logs] scummvm master -> 93ed8a2c47055f4b737d79925bf0bca30adda24f
digitall
dgturner at iee.org
Mon Aug 20 23:30:44 CEST 2018
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:
93ed8a2c47 AUDIO: Fix Compilation with Fluidsynth v1.1.6 or earlier.
Commit: 93ed8a2c47055f4b737d79925bf0bca30adda24f
https://github.com/scummvm/scummvm/commit/93ed8a2c47055f4b737d79925bf0bca30adda24f
Author: D G Turner (digitall at scummvm.org)
Date: 2018-08-20T22:31:15+01:00
Commit Message:
AUDIO: Fix Compilation with Fluidsynth v1.1.6 or earlier.
The function signature for these functions was changed from (char *) to
(const char *) in the v1.1.7 release, so compiling against
Fluidsynth v1.1.6 or earlier requires the copying of the strings to
prevent compilation errors such as "error: invalid conversion from
'const char*' to 'char*'".
Normally, we would break compatibility with older versions as platforms
should be using the latest Fluidsynth v1.X release of v1.1.11.
However, since this is trivial to fix and prevents breakage for legacy
platforms, am restoring the string duplication with scumm_strdup().
Apart from this, we should look at the Fluidsynth v2.X releases
currently in RC testing as the API is now changed for this.
Changed paths:
audio/softsynth/fluidsynth.cpp
diff --git a/audio/softsynth/fluidsynth.cpp b/audio/softsynth/fluidsynth.cpp
index 1e78a7b..5c14f33 100644
--- a/audio/softsynth/fluidsynth.cpp
+++ b/audio/softsynth/fluidsynth.cpp
@@ -88,15 +88,26 @@ MidiDriver_FluidSynth::MidiDriver_FluidSynth(Audio::Mixer *mixer)
}
void MidiDriver_FluidSynth::setInt(const char *name, int val) {
- fluid_settings_setint(_settings, name, val);
+ char *name2 = scumm_strdup(name);
+
+ fluid_settings_setint(_settings, name2, val);
+ free(name2);
}
void MidiDriver_FluidSynth::setNum(const char *name, double val) {
- fluid_settings_setnum(_settings, name, val);
+ char *name2 = scumm_strdup(name);
+
+ fluid_settings_setnum(_settings, name2, val);
+ free(name2);
}
void MidiDriver_FluidSynth::setStr(const char *name, const char *val) {
- fluid_settings_setstr(_settings, name, val);
+ char *name2 = scumm_strdup(name);
+ char *val2 = scumm_strdup(val);
+
+ fluid_settings_setstr(_settings, name2, val2);
+ free(name2);
+ free(val2);
}
int MidiDriver_FluidSynth::open() {
More information about the Scummvm-git-logs
mailing list