From f1d51688a76a7203326b35145e34f74a61d9917e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 17 Dec 2001 02:39:12 +0000 Subject: [PATCH] *** empty log message *** --- configure.in | 8 -------- load_aiff.c | 12 +++++++----- load_voc.c | 13 ------------- mikmod/virtch_common.c | 14 +++++++------- mixer.c | 2 -- music.c | 4 ++-- native_midi/native_midi_mac.c | 2 +- timidity/playmidi.c | 2 +- wavestream.c | 8 ++++---- 9 files changed, 22 insertions(+), 43 deletions(-) diff --git a/configure.in b/configure.in index c3a491df..7580555d 100644 --- a/configure.in +++ b/configure.in @@ -90,14 +90,6 @@ CFLAGS="$CFLAGS -DUSE_RWOPS" dnl Check command-line options -dnl rcg06052001 VOC file support by Ryan C. Gordon (icculus@linuxgames.com). -AC_ARG_ENABLE(samples-voc, -[ --enable-samples-voc enable support for VOC samples [default=yes]], - , enable_samples_voc=yes) -if test x$enable_samples_voc = xyes; then - CFLAGS="$CFLAGS -DVOC_SAMPLES" -fi - AC_ARG_ENABLE(music-cmd, [ --enable-music-cmd support an external music player [default=yes]], , enable_music_cmd=yes) diff --git a/load_aiff.c b/load_aiff.c index 83684864..23e39480 100644 --- a/load_aiff.c +++ b/load_aiff.c @@ -26,8 +26,10 @@ /* $Id$ */ +#include #include +#include "SDL_endian.h" #include "SDL_mixer.h" #include "load_aiff.h" @@ -62,7 +64,7 @@ SDL_AudioSpec *Mix_LoadAIFF_RW (SDL_RWops *src, int freesrc, int was_error; int found_SSND; int found_COMM; - long start; + long start = 0; Uint32 chunk_type; Uint32 chunk_length; @@ -77,11 +79,11 @@ SDL_AudioSpec *Mix_LoadAIFF_RW (SDL_RWops *src, int freesrc, Uint32 blocksize; /* COMM format chunk */ - Uint16 channels; - Uint32 numsamples; - Uint16 samplesize; + Uint16 channels = 0; + Uint32 numsamples = 0; + Uint16 samplesize = 0; Uint8 sane_freq[10]; - Uint32 frequency; + Uint32 frequency = 0; /* Make sure we are passed a valid data source */ was_error = 0; diff --git a/load_voc.c b/load_voc.c index 5fa84fe0..33ebcfbc 100644 --- a/load_voc.c +++ b/load_voc.c @@ -40,8 +40,6 @@ #include "SDL_mixer.h" #include "load_voc.h" -#ifdef VOC_SAMPLES - /* Private data for VOC file */ typedef struct vocstuff { Uint32 rest; /* bytes remaining in current block */ @@ -458,15 +456,4 @@ SDL_AudioSpec *Mix_LoadVOC_RW (SDL_RWops *src, int freesrc, return(spec); } /* Mix_LoadVOC_RW */ -#else - -SDL_AudioSpec *Mix_LoadVOC_RW (SDL_RWops *src, int freesrc, - SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len) -{ - SDL_SetError("VOC file loading not supported"); - return(NULL); -} - -#endif /* VOC_SAMPLES */ - /* end of load_voc.c ... */ diff --git a/mikmod/virtch_common.c b/mikmod/virtch_common.c index 6ae03fd3..2d0cee0c 100644 --- a/mikmod/virtch_common.c +++ b/mikmod/virtch_common.c @@ -105,22 +105,22 @@ static ULONG (*VC_VoiceRealVolume_ptr)(UBYTE); #ifdef __STDC__ #define VC_PROC0(suffix) \ -void VC_##suffix##(void) { VC_##suffix##_ptr(); } +void VC_##suffix (void) { VC_##suffix##_ptr(); } #define VC_FUNC0(suffix,ret) \ -ret VC_##suffix##(void) { return VC_##suffix##_ptr(); } +ret VC_##suffix (void) { return VC_##suffix##_ptr(); } #define VC_PROC1(suffix,typ1) \ -void VC_##suffix##(typ1 a) { VC_##suffix##_ptr(a); } +void VC_##suffix (typ1 a) { VC_##suffix##_ptr(a); } #define VC_FUNC1(suffix,ret,typ1) \ -ret VC_##suffix##(typ1 a) { return VC_##suffix##_ptr(a); } +ret VC_##suffix (typ1 a) { return VC_##suffix##_ptr(a); } #define VC_PROC2(suffix,typ1,typ2) \ -void VC_##suffix##(typ1 a,typ2 b) { VC_##suffix##_ptr(a,b); } +void VC_##suffix (typ1 a,typ2 b) { VC_##suffix##_ptr(a,b); } #define VC_FUNC2(suffix,ret,typ1,typ2) \ -ret VC_##suffix##(typ1 a,typ2 b) { return VC_##suffix##_ptr(a,b); } +ret VC_##suffix (typ1 a,typ2 b) { return VC_##suffix##_ptr(a,b); } #else #define VC_PROC0(suffix) \ void VC_/**/suffix/**/(void) { VC_/**/suffix/**/_ptr(); } @@ -141,7 +141,7 @@ void VC_/**/suffix/**/(typ1 a,typ2 b) { VC_/**/suffix/**/_ptr(a,b); } ret VC_/**/suffix/**/(typ1 a,typ2 b) { return VC_/**/suffix/**/_ptr(a,b); } #endif -VC_FUNC0(Init,BOOL) +VC_FUNC0(Init,BOOL); VC_PROC0(Exit) VC_FUNC0(SetNumVoices,BOOL) VC_FUNC1(SampleSpace,ULONG,int) diff --git a/mixer.c b/mixer.c index cf435e2f..6872545b 100644 --- a/mixer.c +++ b/mixer.c @@ -105,8 +105,6 @@ const SDL_version *Mix_Linked_Version(void) /* rcg06122001 Cleanup effect callbacks. */ static void Mix_ChannelDonePlaying(int channel) { - effect_info *i = NULL; - if (channel_done_callback) { channel_done_callback(channel); } diff --git a/music.c b/music.c index f2a36a99..559002ab 100644 --- a/music.c +++ b/music.c @@ -81,7 +81,6 @@ int volatile music_active = 1; static int volatile music_stopped = 0; static int music_loops = 0; static char *music_cmd = NULL; -static int samplesize; static Mix_Music * volatile music_playing = NULL; static int music_volume = MIX_MAX_VOLUME; static int music_swap8; @@ -130,6 +129,7 @@ struct _Mix_Music { #ifdef MID_MUSIC #ifdef USE_TIMIDITY_MIDI static int timidity_ok; +static int samplesize; #endif #ifdef USE_NATIVE_MIDI static int native_midi_ok; @@ -338,7 +338,7 @@ int open_music(SDL_AudioSpec *mixer) #endif #ifdef MID_MUSIC #ifdef USE_TIMIDITY_MIDI - samplesize = mixer->size/mixer->samples; + samplesize = mixer->size / mixer->samples; if ( Timidity_Init(mixer->freq, mixer->format, mixer->channels, mixer->samples) == 0 ) { timidity_ok = 1; diff --git a/native_midi/native_midi_mac.c b/native_midi/native_midi_mac.c index d7b8331b..dfeb1f63 100644 --- a/native_midi/native_midi_mac.c +++ b/native_midi/native_midi_mac.c @@ -498,7 +498,7 @@ Uint32 *BuildTuneSequence(MIDIEvent *evntlist, int ppqn, int part_poly_max[32], but for QTMA, we specify it as a 8.8 fixed point of semitones TODO: detect "pitch bend range changes" & honor them! */ - bend = eventPos->data[0] & 0x7f | (eventPos->data[1] & 0x7f) << 7; + bend = (eventPos->data[0] & 0x7f) | ((eventPos->data[1] & 0x7f) << 7); /* "Center" the bend */ bend -= 0x2000; diff --git a/timidity/playmidi.c b/timidity/playmidi.c index 78156a54..adeac2b8 100644 --- a/timidity/playmidi.c +++ b/timidity/playmidi.c @@ -761,7 +761,7 @@ static int compute_data(void *stream, int32 count) int Timidity_PlaySome(void *stream, int samples) { - int rc; + int rc = RC_NONE; int32 end_sample; if ( ! midi_playing ) { diff --git a/wavestream.c b/wavestream.c index 0a7a667c..c46098fa 100644 --- a/wavestream.c +++ b/wavestream.c @@ -446,11 +446,11 @@ static FILE *LoadAIFFStream (const char *file, SDL_AudioSpec *spec, Uint32 offset; Uint32 blocksize; /* COMM format chunk */ - Uint16 channels; - Uint32 numsamples; - Uint16 samplesize; + Uint16 channels = 0; + Uint32 numsamples = 0; + Uint16 samplesize = 0; Uint8 sane_freq[10]; - Uint32 frequency; + Uint32 frequency = 0; /* Make sure we are passed a valid data source */