Fixed Xcode warnings
authorSam Lantinga <slouken@libsdl.org>
Sat, 04 May 2013 02:56:20 -0700
changeset 6136fa075aa693e
parent 612 e795460706d0
child 614 f3ca356a027a
Fixed Xcode warnings
dynamic_ogg.h
load_flac.c
music.c
music_flac.c
     1.1 --- a/dynamic_ogg.h	Tue Apr 16 19:38:03 2013 +0300
     1.2 +++ b/dynamic_ogg.h	Sat May 04 02:56:20 2013 -0700
     1.3 @@ -31,7 +31,7 @@
     1.4  	void *handle;
     1.5  	int (*ov_clear)(OggVorbis_File *vf);
     1.6  	vorbis_info *(*ov_info)(OggVorbis_File *vf,int link);
     1.7 -	int (*ov_open_callbacks)(void *datasource, OggVorbis_File *vf, char *initial, long ibytes, ov_callbacks callbacks);
     1.8 +	int (*ov_open_callbacks)(void *datasource, OggVorbis_File *vf, const char *initial, long ibytes, ov_callbacks callbacks);
     1.9  	ogg_int64_t (*ov_pcm_total)(OggVorbis_File *vf,int i);
    1.10  #ifdef OGG_USE_TREMOR
    1.11  	long (*ov_read)(OggVorbis_File *vf,char *buffer,int length, int *bitstream);
     2.1 --- a/load_flac.c	Tue Apr 16 19:38:03 2013 +0300
     2.2 +++ b/load_flac.c	Sat May 04 02:56:20 2013 -0700
     2.3 @@ -61,10 +61,7 @@
     2.4  		*bytes = SDL_RWread (data->sdl_src, buffer, sizeof (FLAC__byte),
     2.5  								*bytes);
     2.6  
     2.7 -		if(*bytes < 0) { // error in read
     2.8 -			return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
     2.9 -		}
    2.10 -		else if(*bytes == 0) { // no data was read (EOF)
    2.11 +		if (*bytes == 0) { // error or no data was read (EOF)
    2.12  			return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
    2.13  		}
    2.14  		else { // data was read, continue
     3.1 --- a/music.c	Tue Apr 16 19:38:03 2013 +0300
     3.2 +++ b/music.c	Sat May 04 02:56:20 2013 -0700
     3.3 @@ -530,7 +530,7 @@
     3.4  		music->data.cmd = MusicCMD_LoadSong(music_cmd, file);
     3.5  		if ( music->data.cmd == NULL ) {
     3.6  			SDL_free(music);
     3.7 -			music == NULL;
     3.8 +			music = NULL;
     3.9  		}
    3.10  		return music;
    3.11  	}
     4.1 --- a/music_flac.c	Tue Apr 16 19:38:03 2013 +0300
     4.2 +++ b/music_flac.c	Sat May 04 02:56:20 2013 -0700
     4.3 @@ -62,10 +62,7 @@
     4.4  	if (*bytes > 0) {
     4.5  		*bytes = SDL_RWread (data->rwops, buffer, sizeof (FLAC__byte), *bytes);
     4.6  
     4.7 -		if (*bytes < 0) { // error in read
     4.8 -			return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
     4.9 -		}
    4.10 -		else if (*bytes == 0 ) { // no data was read (EOF)
    4.11 +		if (*bytes == 0 ) { // error or no data was read (EOF)
    4.12  			return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
    4.13  		}
    4.14  		else { // data was read, continue