src/audio/SDL_wave.c
changeset 1330 450721ad5436
parent 1312 c9b51268668f
child 1336 3692456e7b0f
     1.1 --- a/src/audio/SDL_wave.c	Sat Feb 04 22:01:44 2006 +0000
     1.2 +++ b/src/audio/SDL_wave.c	Mon Feb 06 08:28:51 2006 +0000
     1.3 @@ -24,17 +24,13 @@
     1.4  
     1.5  /* Microsoft WAVE file loading routines */
     1.6  
     1.7 -#include <stdlib.h>
     1.8 -#include <string.h>
     1.9 -
    1.10  #include "SDL_error.h"
    1.11  #include "SDL_audio.h"
    1.12 +#include "SDL_stdlib.h"
    1.13 +#include "SDL_string.h"
    1.14  #include "SDL_wave.h"
    1.15  #include "SDL_endian.h"
    1.16  
    1.17 -#ifndef NELEMS
    1.18 -#define NELEMS(array)	((sizeof array)/(sizeof array[0]))
    1.19 -#endif
    1.20  
    1.21  static int ReadChunk(SDL_RWops *src, Chunk *chunk);
    1.22  
    1.23 @@ -342,9 +338,9 @@
    1.24  
    1.25  	/* Check to make sure we have enough variables in the state array */
    1.26  	channels = IMA_ADPCM_state.wavefmt.channels;
    1.27 -	if ( channels > NELEMS(IMA_ADPCM_state.state) ) {
    1.28 +	if ( channels > SDL_arraysize(IMA_ADPCM_state.state) ) {
    1.29  		SDL_SetError("IMA ADPCM decoder can only handle %d channels",
    1.30 -						NELEMS(IMA_ADPCM_state.state));
    1.31 +					SDL_arraysize(IMA_ADPCM_state.state));
    1.32  		return(-1);
    1.33  	}
    1.34  	state = IMA_ADPCM_state.state;
    1.35 @@ -564,7 +560,7 @@
    1.36  	}
    1.37  	else {
    1.38  		// seek to the end of the file (given by the RIFF chunk)
    1.39 -		SDL_RWseek(src, wavelen - chunk.length - headerDiff, SEEK_CUR);
    1.40 +		SDL_RWseek(src, wavelen - chunk.length - headerDiff, RW_SEEK_CUR);
    1.41  	}
    1.42  	if ( was_error ) {
    1.43  		spec = NULL;