src/audio/SDL_wave.c
changeset 1330 450721ad5436
parent 1312 c9b51268668f
child 1336 3692456e7b0f
--- a/src/audio/SDL_wave.c	Sat Feb 04 22:01:44 2006 +0000
+++ b/src/audio/SDL_wave.c	Mon Feb 06 08:28:51 2006 +0000
@@ -24,17 +24,13 @@
 
 /* Microsoft WAVE file loading routines */
 
-#include <stdlib.h>
-#include <string.h>
-
 #include "SDL_error.h"
 #include "SDL_audio.h"
+#include "SDL_stdlib.h"
+#include "SDL_string.h"
 #include "SDL_wave.h"
 #include "SDL_endian.h"
 
-#ifndef NELEMS
-#define NELEMS(array)	((sizeof array)/(sizeof array[0]))
-#endif
 
 static int ReadChunk(SDL_RWops *src, Chunk *chunk);
 
@@ -342,9 +338,9 @@
 
 	/* Check to make sure we have enough variables in the state array */
 	channels = IMA_ADPCM_state.wavefmt.channels;
-	if ( channels > NELEMS(IMA_ADPCM_state.state) ) {
+	if ( channels > SDL_arraysize(IMA_ADPCM_state.state) ) {
 		SDL_SetError("IMA ADPCM decoder can only handle %d channels",
-						NELEMS(IMA_ADPCM_state.state));
+					SDL_arraysize(IMA_ADPCM_state.state));
 		return(-1);
 	}
 	state = IMA_ADPCM_state.state;
@@ -564,7 +560,7 @@
 	}
 	else {
 		// seek to the end of the file (given by the RIFF chunk)
-		SDL_RWseek(src, wavelen - chunk.length - headerDiff, SEEK_CUR);
+		SDL_RWseek(src, wavelen - chunk.length - headerDiff, RW_SEEK_CUR);
 	}
 	if ( was_error ) {
 		spec = NULL;