Fixed bug #809
authorSam Lantinga <slouken@libsdl.org>
Sat, 26 Sep 2009 22:23:16 +0000
changeset 401ee71829d80e7
parent 400 bc35cb13c14b
child 402 2bfcf7edcb6f
Fixed bug #809

O.Sezer 2009-09-26 04:38:45 PDT

the filename argument of native_midi_loadsong() should be const char*, the attached patch does that and also removes the unnecessary char* cast in music.c where native_midi_loadsong() is called.
music.c
native_midi/native_midi.h
native_midi/native_midi_mac.c
native_midi/native_midi_win32.c
native_midi_gpl/native_midi_gpl.c
     1.1 --- a/music.c	Sat Sep 26 10:51:23 2009 +0000
     1.2 +++ b/music.c	Sat Sep 26 22:23:16 2009 +0000
     1.3 @@ -627,7 +627,7 @@
     1.4  		music->type = MUS_MID;
     1.5  #ifdef USE_NATIVE_MIDI
     1.6    		if ( native_midi_ok ) {
     1.7 -  			music->data.nativemidi = native_midi_loadsong((char *)file);
     1.8 +  			music->data.nativemidi = native_midi_loadsong(file);
     1.9  	  		if ( music->data.nativemidi == NULL ) {
    1.10  		  		Mix_SetError("%s", native_midi_error());
    1.11  			  	music->error = 1;
     2.1 --- a/native_midi/native_midi.h	Sat Sep 26 10:51:23 2009 +0000
     2.2 +++ b/native_midi/native_midi.h	Sat Sep 26 22:23:16 2009 +0000
     2.3 @@ -28,7 +28,7 @@
     2.4  typedef struct _NativeMidiSong NativeMidiSong;
     2.5  
     2.6  int native_midi_detect();
     2.7 -NativeMidiSong *native_midi_loadsong(char *midifile);
     2.8 +NativeMidiSong *native_midi_loadsong(const char *midifile);
     2.9  NativeMidiSong *native_midi_loadsong_RW(SDL_RWops *rw);
    2.10  void native_midi_freesong(NativeMidiSong *song);
    2.11  void native_midi_start(NativeMidiSong *song);
     3.1 --- a/native_midi/native_midi_mac.c	Sat Sep 26 10:51:23 2009 +0000
     3.2 +++ b/native_midi/native_midi_mac.c	Sat Sep 26 22:23:16 2009 +0000
     3.3 @@ -89,7 +89,7 @@
     3.4  	return 1;
     3.5  }
     3.6  
     3.7 -NativeMidiSong *native_midi_loadsong(char *midifile)
     3.8 +NativeMidiSong *native_midi_loadsong(const char *midifile)
     3.9  {
    3.10  	NativeMidiSong	*song = NULL;
    3.11  	MIDIEvent		*evntlist = NULL;
     4.1 --- a/native_midi/native_midi_win32.c	Sat Sep 26 10:51:23 2009 +0000
     4.2 +++ b/native_midi/native_midi_win32.c	Sat Sep 26 22:23:16 2009 +0000
     4.3 @@ -188,7 +188,7 @@
     4.4    return 1;
     4.5  }
     4.6  
     4.7 -NativeMidiSong *native_midi_loadsong(char *midifile)
     4.8 +NativeMidiSong *native_midi_loadsong(const char *midifile)
     4.9  {
    4.10  	NativeMidiSong *newsong;
    4.11  	MIDIEvent		*evntlist = NULL;
     5.1 --- a/native_midi_gpl/native_midi_gpl.c	Sat Sep 26 10:51:23 2009 +0000
     5.2 +++ b/native_midi_gpl/native_midi_gpl.c	Sat Sep 26 22:23:16 2009 +0000
     5.3 @@ -127,7 +127,7 @@
     5.4      return ret;
     5.5  }
     5.6  
     5.7 -NativeMidiSong *native_midi_loadsong(char *midifile)
     5.8 +NativeMidiSong *native_midi_loadsong(const char *midifile)
     5.9  {
    5.10      NativeMidiSong	*song = NULL;
    5.11      char 		*extra;