From c01863687ef79a0745d956143636e2d7ec3c9c02 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 4 May 2013 02:56:20 -0700 Subject: [PATCH] Fixed Xcode warnings --- dynamic_ogg.h | 2 +- load_flac.c | 5 +---- music.c | 2 +- music_flac.c | 5 +---- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/dynamic_ogg.h b/dynamic_ogg.h index 7856218a..b87ff551 100644 --- a/dynamic_ogg.h +++ b/dynamic_ogg.h @@ -31,7 +31,7 @@ typedef struct { void *handle; int (*ov_clear)(OggVorbis_File *vf); vorbis_info *(*ov_info)(OggVorbis_File *vf,int link); - int (*ov_open_callbacks)(void *datasource, OggVorbis_File *vf, char *initial, long ibytes, ov_callbacks callbacks); + int (*ov_open_callbacks)(void *datasource, OggVorbis_File *vf, const char *initial, long ibytes, ov_callbacks callbacks); ogg_int64_t (*ov_pcm_total)(OggVorbis_File *vf,int i); #ifdef OGG_USE_TREMOR long (*ov_read)(OggVorbis_File *vf,char *buffer,int length, int *bitstream); diff --git a/load_flac.c b/load_flac.c index e343c862..a9a93f37 100644 --- a/load_flac.c +++ b/load_flac.c @@ -61,10 +61,7 @@ static FLAC__StreamDecoderReadStatus flac_read_load_cb( *bytes = SDL_RWread (data->sdl_src, buffer, sizeof (FLAC__byte), *bytes); - if(*bytes < 0) { // error in read - return FLAC__STREAM_DECODER_READ_STATUS_ABORT; - } - else if(*bytes == 0) { // no data was read (EOF) + if (*bytes == 0) { // error or no data was read (EOF) return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; } else { // data was read, continue diff --git a/music.c b/music.c index 28e6a726..9287f145 100644 --- a/music.c +++ b/music.c @@ -530,7 +530,7 @@ Mix_Music *Mix_LoadMUS(const char *file) music->data.cmd = MusicCMD_LoadSong(music_cmd, file); if ( music->data.cmd == NULL ) { SDL_free(music); - music == NULL; + music = NULL; } return music; } diff --git a/music_flac.c b/music_flac.c index 6ae7989a..dd00790b 100644 --- a/music_flac.c +++ b/music_flac.c @@ -62,10 +62,7 @@ static FLAC__StreamDecoderReadStatus flac_read_music_cb( if (*bytes > 0) { *bytes = SDL_RWread (data->rwops, buffer, sizeof (FLAC__byte), *bytes); - if (*bytes < 0) { // error in read - return FLAC__STREAM_DECODER_READ_STATUS_ABORT; - } - else if (*bytes == 0 ) { // no data was read (EOF) + if (*bytes == 0 ) { // error or no data was read (EOF) return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; } else { // data was read, continue