diff src/audio/SDL_audiodev.c @ 1336:3692456e7b0f

Use SDL_ prefixed versions of C library functions. FIXME: Change #include <stdlib.h> to #include "SDL_stdlib.h" Change #include <string.h> to #include "SDL_string.h" Make sure nothing else broke because of this...
author Sam Lantinga <slouken@libsdl.org>
date Tue, 07 Feb 2006 06:59:48 +0000
parents c9b51268668f
children 604d73db6802
line wrap: on
line diff
--- a/src/audio/SDL_audiodev.c	Mon Feb 06 17:28:04 2006 +0000
+++ b/src/audio/SDL_audiodev.c	Tue Feb 07 06:59:48 2006 +0000
@@ -55,8 +55,8 @@
 	char audiopath[1024];
 
 	/* Figure out what our audio device is */
-	if ( ((audiodev=getenv("SDL_PATH_DSP")) == NULL) &&
-	     ((audiodev=getenv("AUDIODEV")) == NULL) ) {
+	if ( ((audiodev=SDL_getenv("SDL_PATH_DSP")) == NULL) &&
+	     ((audiodev=SDL_getenv("AUDIODEV")) == NULL) ) {
 		if ( classic ) {
 			audiodev = _PATH_DEV_AUDIO;
 		} else {
@@ -74,7 +74,7 @@
 	audio_fd = open(audiodev, flags, 0);
 
 	/* If the first open fails, look for other devices */
-	if ( (audio_fd < 0) && (strlen(audiodev) < (sizeof(audiopath)-3)) ) {
+	if ( (audio_fd < 0) && (SDL_strlen(audiodev) < (sizeof(audiopath)-3)) ) {
 		int exists, instance;
 		struct stat sb;
 
@@ -90,7 +90,7 @@
 		audiodev = audiopath;
 	}
 	if ( path != NULL ) {
-		strncpy(path, audiodev, maxlen);
+		SDL_strncpy(path, audiodev, maxlen);
 		path[maxlen-1] = '\0';
 	}
 	return(audio_fd);
@@ -130,15 +130,15 @@
 	int  audio_fd;
 
 	/* Figure out what our audio device is */
-	if ((audiodev=getenv("SDL_PATH_DSP")) == NULL) {
-	    audiodev=getenv("AUDIODEV");
+	if ((audiodev=SDL_getenv("SDL_PATH_DSP")) == NULL) {
+	    audiodev=SDL_getenv("AUDIODEV");
 	}
 	if ( audiodev == NULL ) {
 	    return -1;
 	}
 	audio_fd = open(audiodev, flags, 0);
 	if ( path != NULL ) {
-		strncpy(path, audiodev, maxlen);
+		SDL_strncpy(path, audiodev, maxlen);
 		path[maxlen-1] = '\0';
 	}
 	return audio_fd;
@@ -168,7 +168,7 @@
 	    audio_fd = open(audiopath, flags, 0);
 	    if ( audio_fd > 0 ) {
 		if ( path != NULL ) {
-		    strncpy( path, audiopath, maxlen );
+		    SDL_strncpy( path, audiopath, maxlen );
 		    path[maxlen-1] = '\0';
 		}
 	        return audio_fd;