diff options
author | Max Horn | 2009-02-15 14:46:42 +0000 |
---|---|---|
committer | Max Horn | 2009-02-15 14:46:42 +0000 |
commit | 9daed50e0165f387f597fec4d06b57805e1f717c (patch) | |
tree | eca2f45cf9f2b90ef83be380e42d32e99ecb1862 /engines/sci/sfx/seq | |
parent | 0082a84b8d956bf25c6aaef153d401d641f0923d (diff) | |
download | scummvm-rg350-9daed50e0165f387f597fec4d06b57805e1f717c.tar.gz scummvm-rg350-9daed50e0165f387f597fec4d06b57805e1f717c.tar.bz2 scummvm-rg350-9daed50e0165f387f597fec4d06b57805e1f717c.zip |
Fixed lots of warnings and errors (on my system) by backporting a patch I had sent the FreeSCI folks some time ago (but apparently it never made it, or only made it to a branch not imported?)
svn-id: r38245
Diffstat (limited to 'engines/sci/sfx/seq')
-rw-r--r-- | engines/sci/sfx/seq/instrument-map.cpp | 7 | ||||
-rw-r--r-- | engines/sci/sfx/seq/map-mt32-to-gm.cpp | 16 |
2 files changed, 12 insertions, 11 deletions
diff --git a/engines/sci/sfx/seq/instrument-map.cpp b/engines/sci/sfx/seq/instrument-map.cpp index 0d829a0582..204ecfdc34 100644 --- a/engines/sci/sfx/seq/instrument-map.cpp +++ b/engines/sci/sfx/seq/instrument-map.cpp @@ -219,6 +219,7 @@ sfx_instrument_map_load_sci(byte *data, size_t size) /* Output with the instrument map */ #define MIDI_CHANNELS_NR 0x10 +// FIXME: Replace this ugly hack with simple subclassing once converting to C++ typedef struct decorated_midi_writer { MIDI_WRITER_BODY @@ -271,7 +272,7 @@ close_decorated(decorated_midi_writer_t *self) sfx_instrument_map_free(self->map); self->map = NULL; self->writer->close(self->writer); - sci_free(self->name); + sci_free((void *)self->name); self->name = NULL; sci_free(self); } @@ -279,7 +280,7 @@ close_decorated(decorated_midi_writer_t *self) #define BOUND_127(x) (((x) < 0)? 0 : (((x) > 0x7f)? 0x7f : (x))) static int -bound_hard_127(int i, char *descr) +bound_hard_127(int i, const char *descr) { int r = BOUND_127(i); if (r != i) @@ -325,7 +326,7 @@ write_decorated(decorated_midi_writer_t *self, byte *buf, int len) assert (len >= 1); if (op == 0xC0 && chan != MIDI_RHYTHM_CHANNEL) { /* Program change */ - int patch = bound_hard_127(buf[1], "program change"); + /*int*/ patch = bound_hard_127(buf[1], "program change"); int instrument = map->patch_map[patch].patch; int bend_range = map->patch_bend_range[patch]; diff --git a/engines/sci/sfx/seq/map-mt32-to-gm.cpp b/engines/sci/sfx/seq/map-mt32-to-gm.cpp index bcaf3556f1..b4c56f2602 100644 --- a/engines/sci/sfx/seq/map-mt32-to-gm.cpp +++ b/engines/sci/sfx/seq/map-mt32-to-gm.cpp @@ -37,7 +37,7 @@ #define DEBUG_MT32_TO_GM -static char +static const char *GM_Instrument_Names[] = { /*000*/ "Acoustic Grand Piano", /*001*/ "Bright Acoustic Piano", @@ -170,7 +170,7 @@ static char }; /* The GM Percussion map is downwards compatible to the MT32 map, which is used in SCI */ -static char +static const char *GM_Percussion_Names[] = { /*00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -232,7 +232,7 @@ static char static struct { - char *name; + const char *name; gint8 gm_instr; gint8 gm_rhythm_key; } MT32_PresetTimbreMaps[] = { @@ -367,7 +367,7 @@ static struct { }; static struct { - char *name; + const char *name; gint8 gm_instr; gint8 gm_rhythmkey; } MT32_RhythmTimbreMaps[] = { @@ -428,7 +428,7 @@ MT32_PresetRhythmKeymap[] = { ??? - I'm clueless? R - Rhythm... */ static struct { - char *name; + const char *name; gint8 gm_instr; gint8 gm_rhythm_key; } MT32_MemoryTimbreMaps[] = { @@ -562,11 +562,11 @@ static struct { {"Wind2 MS", SFX_UNMAPPED, SFX_UNMAPPED}, /* ? (CoC) */ {"Woodpecker", 115, SFX_UNMAPPED}, /* ? (CB) */ {"WtrFall MS", SFX_UNMAPPED, SFX_UNMAPPED}, /* ? (CoC, HQ, iceMan) */ - {0, 0} + {0, 0, 0} }; static gint8 -lookup_instrument(char *iname) +lookup_instrument(const char *iname) { int i = 0; @@ -579,7 +579,7 @@ lookup_instrument(char *iname) } static gint8 -lookup_rhythm_key(char *iname) +lookup_rhythm_key(const char *iname) { int i = 0; |