Skip to content

Commit

Permalink
Fixed bug #829
Browse files Browse the repository at this point in the history
 Ozkan Sezer      2009-10-07 12:02:40 PDT

Here is another batch of constifications for timidity.  Regards.
  • Loading branch information
slouken committed Oct 10, 2009
1 parent b6372ef commit fcf93c6
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion music.c
Expand Up @@ -475,7 +475,7 @@ Mix_Music *Mix_LoadMUS(const char *file)
#endif
#ifdef USE_TIMIDITY_MIDI
if ( timidity_ok ) {
music->data.midi = Timidity_LoadSong((char *)file);
music->data.midi = Timidity_LoadSong(file);
if ( music->data.midi == NULL ) {
Mix_SetError("%s", Timidity_Error());
music->error = 1;
Expand Down
5 changes: 3 additions & 2 deletions timidity/common.c
Expand Up @@ -40,7 +40,7 @@ static PathList *pathlist=NULL;

/* Try to open a file for reading. If the filename ends in one of the
defined compressor extensions, pipe the file through the decompressor */
static FILE *try_to_open(char *name, int decompress, int noise_mode)
static FILE *try_to_open(const char *name, int decompress, int noise_mode)
{
FILE *fp;

Expand All @@ -54,7 +54,8 @@ static FILE *try_to_open(char *name, int decompress, int noise_mode)
{
int l,el;
static char *decompressor_list[] = DECOMPRESSOR_LIST, **dec;
char tmp[1024], tmp2[1024], *cp, *cp2;
const char *cp;
char tmp[1024], tmp2[1024], *cp2;
/* Check if it's a compressed file */
l=strlen(name);
for (dec=decompressor_list; *dec; dec+=2)
Expand Down
4 changes: 2 additions & 2 deletions timidity/instrum.c
Expand Up @@ -250,7 +250,7 @@ static void reverse_data(int16 *sp, int32 ls, int32 le)
undefined.
TODO: do reverse loops right */
static InstrumentLayer *load_instrument(char *name, int font_type, int percussion,
static InstrumentLayer *load_instrument(const char *name, int font_type, int percussion,
int panning, int amp, int cfg_tuning, int note_to_use,
int strip_loop, int strip_envelope,
int strip_tail, int bank, int gm_num, int sf_ix)
Expand Down Expand Up @@ -1012,7 +1012,7 @@ void free_instruments(void)
}
}

int set_default_instrument(char *name)
int set_default_instrument(const char *name)
{
InstrumentLayer *lp;
/* if (!(lp=load_instrument(name, 0, -1, -1, -1, 0, 0, 0))) */
Expand Down
2 changes: 1 addition & 1 deletion timidity/instrum.h
Expand Up @@ -163,7 +163,7 @@ extern int free_instruments_afterwards;
extern int load_missing_instruments(void);
extern void free_instruments(void);
extern void end_soundfont(void);
extern int set_default_instrument(char *name);
extern int set_default_instrument(const char *name);


extern int32 convert_tremolo_sweep(uint8 sweep);
Expand Down
2 changes: 1 addition & 1 deletion timidity/playmidi.c
Expand Up @@ -1691,7 +1691,7 @@ void Timidity_SetVolume(int volume)
ctl->master_volume(amplification);
}

MidiSong *Timidity_LoadSong(char *midifile)
MidiSong *Timidity_LoadSong(const char *midifile)
{
MidiSong *song;
int32 events;
Expand Down
2 changes: 1 addition & 1 deletion timidity/playmidi.h
Expand Up @@ -171,5 +171,5 @@ extern int XG_System_chorus_type;
extern int XG_System_variation_type;

extern int play_midi(MidiEvent *el, int32 events, int32 samples);
extern int play_midi_file(char *fn);
extern int play_midi_file(const char *fn);
extern void dumb_pass_playing_list(int number_of_files, char *list_of_files[]);
2 changes: 1 addition & 1 deletion timidity/readmidi.c
Expand Up @@ -258,7 +258,7 @@ static int sysex(uint32 len, uint8 *syschan, uint8 *sysa, uint8 *sysb, SDL_RWops

/* Print a string from the file, followed by a newline. Any non-ASCII
or unprintable characters will be converted to periods. */
static int dumpstring(int32 len, char *label)
static int dumpstring(int32 len, const char *label)
{
signed char *s=safe_malloc(len+1);
if (len != (int32)SDL_RWread(rw, s, 1, len))
Expand Down
2 changes: 1 addition & 1 deletion timidity/timidity.h
Expand Up @@ -25,7 +25,7 @@ extern int Timidity_Init(int rate, int format, int channels, int samples);
extern const char *Timidity_Error(void);
extern void Timidity_SetVolume(int volume);
extern int Timidity_PlaySome(void *stream, int samples);
extern MidiSong *Timidity_LoadSong(char *midifile);
extern MidiSong *Timidity_LoadSong(const char *midifile);
extern MidiSong *Timidity_LoadSong_RW(SDL_RWops *rw);
extern void Timidity_Start(MidiSong *song);
extern int Timidity_Active(void);
Expand Down

0 comments on commit fcf93c6

Please sign in to comment.