From 77e70d25938fe44eae495ffa6c9540cadb46b31a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 17 Dec 2001 05:03:10 +0000 Subject: [PATCH] *** empty log message *** --- load_voc.c | 10 +++++----- timidity/instrum.c | 9 +++++---- timidity/playmidi.c | 3 --- timidity/readmidi.c | 11 +---------- 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/load_voc.c b/load_voc.c index 33ebcfbc..329ab261 100644 --- a/load_voc.c +++ b/load_voc.c @@ -50,7 +50,7 @@ typedef struct vocstuff { Uint32 samples; /* number of samples output */ Uint32 size; /* word length of data */ Uint8 channels; /* number of sound channels */ - int extended; /* Has an extended block been read? */ + int has_extended; /* Has an extended block been read? */ } vs_t; /* Size field */ @@ -150,7 +150,7 @@ static int voc_get_block(SDL_RWops *src, vs_t *v, SDL_AudioSpec *spec) /* When DATA block preceeded by an EXTENDED */ /* block, the DATA blocks rate value is invalid */ - if (!v->extended) + if (!v->has_extended) { if (uc == 0) { @@ -178,7 +178,7 @@ static int voc_get_block(SDL_RWops *src, vs_t *v, SDL_AudioSpec *spec) return 0; } - v->extended = 0; + v->has_extended = 0; v->rest = sblen - 2; v->size = ST_SIZE_BYTE; return 1; @@ -265,7 +265,7 @@ static int voc_get_block(SDL_RWops *src, vs_t *v, SDL_AudioSpec *spec) /* Set this byte so we know to use the rate */ /* value from the extended block and not the */ /* data block. */ - v->extended = 1; + v->has_extended = 1; if (SDL_RWread(src, &new_rate_short, sizeof (new_rate_short), 1) != 1) return 0; new_rate_short = SDL_SwapLE16(new_rate_short); @@ -389,7 +389,7 @@ SDL_AudioSpec *Mix_LoadVOC_RW (SDL_RWops *src, int freesrc, v.rate = -1; v.rest = 0; - v.extended = 0; + v.has_extended = 0; *audio_buf = NULL; *audio_len = 0; memset(spec, '\0', sizeof (SDL_AudioSpec)); diff --git a/timidity/instrum.c b/timidity/instrum.c index cbc759e4..ad535d6f 100644 --- a/timidity/instrum.c +++ b/timidity/instrum.c @@ -188,7 +188,7 @@ static Instrument *load_instrument(char *name, int percussion, if (!name) return 0; /* Open patch file */ - if (!(fp=open_file(name, 1, OF_NORMAL))) + if ((fp=open_file(name, 1, OF_NORMAL)) == NULL) { noluck=1; #ifdef PATCH_EXT_LIST @@ -197,9 +197,10 @@ static Instrument *load_instrument(char *name, int percussion, { if (strlen(name)+strlen(patch_ext[i])<1024) { - strcpy(tmp, name); - strcat(tmp, patch_ext[i]); - if ((fp=open_file(tmp, 1, OF_NORMAL))) + char path[1024]; + strcpy(path, name); + strcat(path, patch_ext[i]); + if ((fp=open_file(path, 1, OF_NORMAL)) != NULL) { noluck=0; break; diff --git a/timidity/playmidi.c b/timidity/playmidi.c index adeac2b8..8221de6c 100644 --- a/timidity/playmidi.c +++ b/timidity/playmidi.c @@ -22,9 +22,6 @@ */ #include -#ifndef WIN32 -#include -#endif #include #include diff --git a/timidity/readmidi.c b/timidity/readmidi.c index 5864628a..0137bfac 100644 --- a/timidity/readmidi.c +++ b/timidity/readmidi.c @@ -22,16 +22,7 @@ #include #include #include - -#if defined(SOLARIS) | defined(WIN32) -# include -#else -#include -#endif - -#ifndef WIN32 -#include -#endif +#include #include "config.h" #include "common.h"