diff src/cdrom/beos/SDL_syscdrom.cc @ 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/cdrom/beos/SDL_syscdrom.cc	Mon Feb 06 17:28:04 2006 +0000
+++ b/src/cdrom/beos/SDL_syscdrom.cc	Tue Feb 07 06:59:48 2006 +0000
@@ -116,12 +116,12 @@
 	if ( SDL_numcds < MAX_DRIVES ) {
 		/* Add this drive to our list */
 		i = SDL_numcds;
-		SDL_cdlist[i] = (char *)malloc(strlen(drive)+1);
+		SDL_cdlist[i] = (char *)SDL_malloc(SDL_strlen(drive)+1);
 		if ( SDL_cdlist[i] == NULL ) {
 			SDL_OutOfMemory();
 			return;
 		}
-		strcpy(SDL_cdlist[i], drive);
+		SDL_strcpy(SDL_cdlist[i], drive);
 		++SDL_numcds;
 #ifdef CDROM_DEBUG
   fprintf(stderr, "Added CD-ROM drive: %s\n", drive);
@@ -165,15 +165,15 @@
 	SDL_CDcaps.Close = SDL_SYS_CDClose;
 
 	/* Look in the environment for our CD-ROM drive list */
-	SDLcdrom = getenv("SDL_CDROM");	/* ':' separated list of devices */
+	SDLcdrom = SDL_getenv("SDL_CDROM");	/* ':' separated list of devices */
 	if ( SDLcdrom != NULL ) {
 		char *cdpath, *delim;
-		cdpath = (char *)malloc(strlen(SDLcdrom)+1);
+		cdpath = (char *)SDL_malloc(SDL_strlen(SDLcdrom)+1);
 		if ( cdpath != NULL ) {
-			strcpy(cdpath, SDLcdrom);
+			SDL_strcpy(cdpath, SDLcdrom);
 			SDLcdrom = cdpath;
 			do {
-				delim = strchr(SDLcdrom, ':');
+				delim = SDL_strchr(SDLcdrom, ':');
 				if ( delim ) {
 					*delim++ = '\0';
 				}
@@ -186,7 +186,7 @@
 					SDLcdrom = NULL;
 				}
 			} while ( SDLcdrom );
-			free(cdpath);
+			SDL_free(cdpath);
 		}
 
 		/* If we found our drives, there's nothing left to do */
@@ -223,7 +223,7 @@
 			continue; 
 
 		if(entry.IsDirectory()) { 
-			if(strcmp(e.name, "floppy") == 0) 
+			if(SDL_strcmp(e.name, "floppy") == 0) 
 				continue; /* ignore floppy (it is not silent)  */
 			int devfd = try_dir(name);
 			if(devfd >= 0)
@@ -233,7 +233,7 @@
 			int devfd; 
 			device_geometry g; 
 
-			if(strcmp(e.name, "raw") != 0) 
+			if(SDL_strcmp(e.name, "raw") != 0) 
 				continue; /* ignore partitions */
 
 			devfd = open(name, O_RDONLY); 
@@ -401,7 +401,7 @@
 
 	if ( SDL_numcds > 0 ) {
 		for ( i=0; i<SDL_numcds; ++i ) {
-			free(SDL_cdlist[i]);
+			SDL_free(SDL_cdlist[i]);
 		}
 		SDL_numcds = 0;
 	}