From 9f06065306bb0a0c0f3be451d8418ca38d1cd855 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 3 Oct 2009 03:35:05 +0000 Subject: [PATCH] Cleaned up compiler warnings --- SDL_mixer.h | 2 +- music.c | 11 ++++------- timidity/instrum.c | 12 ++++++------ timidity/playmidi.c | 10 ---------- wavestream.c | 2 +- 5 files changed, 12 insertions(+), 25 deletions(-) diff --git a/SDL_mixer.h b/SDL_mixer.h index d355bff8..e03ea607 100644 --- a/SDL_mixer.h +++ b/SDL_mixer.h @@ -105,7 +105,7 @@ typedef enum { MUS_OGG, MUS_MP3, MUS_MP3_MAD, - MUS_FLAC, + MUS_FLAC } Mix_MusicType; /* The internal format for a music chunk interpreted via mikmod */ diff --git a/music.c b/music.c index 34a4f959..d7ffaeeb 100644 --- a/music.c +++ b/music.c @@ -1505,17 +1505,14 @@ BOOL LMM_Eof(struct MREADER *mr) } MODULE *MikMod_LoadSongRW(SDL_RWops *rw, int maxchan) { - LMM_MREADER lmmmr={ - LMM_Seek, - LMM_Tell, - LMM_Read, - LMM_Get, - LMM_Eof, + LMM_MREADER lmmmr = { + { LMM_Seek, LMM_Tell, LMM_Read, LMM_Get, LMM_Eof }, 0, 0, - rw + 0 }; MODULE *m; + lmmmr.rw = rw; lmmmr.offset=SDL_RWtell(rw); SDL_RWseek(rw,0,SEEK_END); lmmmr.eof=SDL_RWtell(rw); diff --git a/timidity/instrum.c b/timidity/instrum.c index 8bfeb2dd..986ee2e0 100644 --- a/timidity/instrum.c +++ b/timidity/instrum.c @@ -255,7 +255,7 @@ static InstrumentLayer *load_instrument(char *name, int font_type, int percussio int strip_loop, int strip_envelope, int strip_tail, int bank, int gm_num, int sf_ix) { - InstrumentLayer *lp, *lastlp, *headlp; + InstrumentLayer *lp, *lastlp, *headlp = 0; Instrument *ip; FILE *fp; uint8 tmp[1024]; @@ -266,7 +266,7 @@ static InstrumentLayer *load_instrument(char *name, int font_type, int percussio int sf2flag = 0; int right_samples = 0; int stereo_channels = 1, stereo_layer; - int vlayer_list[19][4], vlayer, vlayer_count; + int vlayer_list[19][4], vlayer, vlayer_count = 0; if (!name) return 0; @@ -427,7 +427,7 @@ static InstrumentLayer *load_instrument(char *name, int font_type, int percussio for (stereo_layer = 0; stereo_layer < stereo_channels; stereo_layer++) { - int sample_count; + int sample_count = 0; if (stereo_layer == 0) sample_count = ip->left_samples; else if (stereo_layer == 1) sample_count = ip->right_samples; @@ -437,10 +437,10 @@ static InstrumentLayer *load_instrument(char *name, int font_type, int percussio uint8 fractions; int32 tmplong; uint16 tmpshort; - uint16 sample_volume; + uint16 sample_volume = 0; uint8 tmpchar; - Sample *sp; - uint8 sf2delay; + Sample *sp = 0; + uint8 sf2delay = 0; #define READ_CHAR(thing) \ if (1 != fread(&tmpchar, 1, 1, fp)) goto fail; \ diff --git a/timidity/playmidi.c b/timidity/playmidi.c index 737509bd..7e086fdb 100644 --- a/timidity/playmidi.c +++ b/timidity/playmidi.c @@ -40,18 +40,9 @@ #include "tables.h" -static int dont_cspline=0; -static int opt_dry = 1; static int opt_expression_curve = 2; static int opt_volume_curve = 2; static int opt_stereo_surround = 0; -static int dont_filter_melodic=1; -static int dont_filter_drums=1; -static int dont_chorus=0; -static int dont_reverb=0; -static int current_interpolation=1; -static int dont_keep_looping=0; -static int voice_reserve=0; Channel channel[MAXCHAN]; @@ -344,7 +335,6 @@ static void recompute_amp(int v) int vol = channel[chan].volume; int expr = channel[chan].expression; int vel = vcurve[voice[v].velocity]; - int drumpan = NO_PANNING; FLOAT_T curved_expression, curved_volume; if (channel[chan].kit) diff --git a/wavestream.c b/wavestream.c index 13ffe7ba..b1305d19 100644 --- a/wavestream.c +++ b/wavestream.c @@ -192,7 +192,7 @@ int WAVStream_PlaySome(Uint8 *stream, int len) worksize = original_len*music->cvt.len_mult; music->cvt.buf=(Uint8 *)malloc(worksize); if ( music->cvt.buf == NULL ) { - return; + return 0; } music->cvt.len = original_len; }