diff src/video/svga/SDL_svgavideo.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/video/svga/SDL_svgavideo.c	Mon Feb 06 17:28:04 2006 +0000
+++ b/src/video/svga/SDL_svgavideo.c	Tue Feb 07 06:59:48 2006 +0000
@@ -104,8 +104,8 @@
 
 static void SVGA_DeleteDevice(SDL_VideoDevice *device)
 {
-	free(device->hidden);
-	free(device);
+	SDL_free(device->hidden);
+	SDL_free(device);
 }
 
 static SDL_VideoDevice *SVGA_CreateDevice(int devindex)
@@ -113,20 +113,20 @@
 	SDL_VideoDevice *device;
 
 	/* Initialize all variables that we clean on shutdown */
-	device = (SDL_VideoDevice *)malloc(sizeof(SDL_VideoDevice));
+	device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
 	if ( device ) {
-		memset(device, 0, (sizeof *device));
+		SDL_memset(device, 0, (sizeof *device));
 		device->hidden = (struct SDL_PrivateVideoData *)
-				malloc((sizeof *device->hidden));
+				SDL_malloc((sizeof *device->hidden));
 	}
 	if ( (device == NULL) || (device->hidden == NULL) ) {
 		SDL_OutOfMemory();
 		if ( device ) {
-			free(device);
+			SDL_free(device);
 		}
 		return(0);
 	}
-	memset(device->hidden, 0, (sizeof *device->hidden));
+	SDL_memset(device->hidden, 0, (sizeof *device->hidden));
 
 	/* Set the function pointers */
 	device->VideoInit = SVGA_VideoInit;
@@ -278,24 +278,24 @@
 		return(-1);
 	}
 	for ( i=0; i<NUM_MODELISTS; ++i ) {
-		SDL_vgamode[i] = (int *)malloc(SDL_nummodes[i]*sizeof(int));
+		SDL_vgamode[i] = (int *)SDL_malloc(SDL_nummodes[i]*sizeof(int));
 		if ( SDL_vgamode[i] == NULL ) {
 			SDL_OutOfMemory();
 			return(-1);
 		}
 		SDL_modelist[i] = (SDL_Rect **)
-				malloc((SDL_nummodes[i]+1)*sizeof(SDL_Rect *));
+				SDL_malloc((SDL_nummodes[i]+1)*sizeof(SDL_Rect *));
 		if ( SDL_modelist[i] == NULL ) {
 			SDL_OutOfMemory();
 			return(-1);
 		}
 		for ( j=0; j<SDL_nummodes[i]; ++j ) {
-			SDL_modelist[i][j]=(SDL_Rect *)malloc(sizeof(SDL_Rect));
+			SDL_modelist[i][j]=(SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
 			if ( SDL_modelist[i][j] == NULL ) {
 				SDL_OutOfMemory();
 				return(-1);
 			}
-			memset(SDL_modelist[i][j], 0, sizeof(SDL_Rect));
+			SDL_memset(SDL_modelist[i][j], 0, sizeof(SDL_Rect));
 		}
 		SDL_modelist[i][j] = NULL;
 	}
@@ -313,7 +313,7 @@
 			j++;
 		}
 		while ( SDL_modelist[i][j] ) {
-			free(SDL_modelist[i][j]);
+			SDL_free(SDL_modelist[i][j]);
 			SDL_modelist[i][j] = NULL;
 			j++;
 		}
@@ -497,12 +497,12 @@
 	for ( i=0; i<NUM_MODELISTS; ++i ) {
 		if ( SDL_modelist[i] != NULL ) {
 			for ( j=0; SDL_modelist[i][j]; ++j )
-				free(SDL_modelist[i][j]);
-			free(SDL_modelist[i]);
+				SDL_free(SDL_modelist[i][j]);
+			SDL_free(SDL_modelist[i]);
 			SDL_modelist[i] = NULL;
 		}
 		if ( SDL_vgamode[i] != NULL ) {
-			free(SDL_vgamode[i]);
+			SDL_free(SDL_vgamode[i]);
 			SDL_vgamode[i] = NULL;
 		}
 	}