diff src/video/x11/SDL_x11yuv.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/x11/SDL_x11yuv.c	Mon Feb 06 17:28:04 2006 +0000
+++ b/src/video/x11/SDL_x11yuv.c	Tue Feb 07 06:59:48 2006 +0000
@@ -222,13 +222,13 @@
 	}
 
 	/* Create the overlay structure */
-	overlay = (SDL_Overlay *)malloc(sizeof *overlay);
+	overlay = (SDL_Overlay *)SDL_malloc(sizeof *overlay);
 	if ( overlay == NULL ) {
 		SDL_NAME(XvUngrabPort)(GFX_Display, xv_port, CurrentTime);
 		SDL_OutOfMemory();
 		return(NULL);
 	}
-	memset(overlay, 0, (sizeof *overlay));
+	SDL_memset(overlay, 0, (sizeof *overlay));
 
 	/* Fill in the basic members */
 	overlay->format = format;
@@ -240,7 +240,7 @@
 	overlay->hw_overlay = 1;
 
 	/* Create the pixel data and lookup tables */
-	hwdata = (struct private_yuvhwdata *)malloc(sizeof *hwdata);
+	hwdata = (struct private_yuvhwdata *)SDL_malloc(sizeof *hwdata);
 	overlay->hwdata = hwdata;
 	if ( hwdata == NULL ) {
 		SDL_NAME(XvUngrabPort)(GFX_Display, xv_port, CurrentTime);
@@ -251,7 +251,7 @@
 	hwdata->port = xv_port;
 #ifndef NO_SHARED_MEMORY
 	yuvshm = &hwdata->yuvshm;
-	memset(yuvshm, 0, sizeof(*yuvshm));
+	SDL_memset(yuvshm, 0, sizeof(*yuvshm));
 	hwdata->image = SDL_NAME(XvShmCreateImage)(GFX_Display, xv_port, format,
 						   0, width, height, yuvshm);
 #ifdef PITCH_WORKAROUND
@@ -312,7 +312,7 @@
 			SDL_FreeYUVOverlay(overlay);
 			return(NULL);
 		}
-		hwdata->image->data = malloc(hwdata->image->data_size);
+		hwdata->image->data = SDL_malloc(hwdata->image->data_size);
 		if ( hwdata->image->data == NULL ) {
 			SDL_OutOfMemory();
 			SDL_FreeYUVOverlay(overlay);
@@ -322,8 +322,8 @@
 
 	/* Find the pitch and offset values for the overlay */
 	overlay->planes = hwdata->image->num_planes;
-	overlay->pitches = (Uint16 *)malloc(overlay->planes * sizeof(Uint16));
-	overlay->pixels = (Uint8 **)malloc(overlay->planes * sizeof(Uint8 *));
+	overlay->pitches = (Uint16 *)SDL_malloc(overlay->planes * sizeof(Uint16));
+	overlay->pixels = (Uint8 **)SDL_malloc(overlay->planes * sizeof(Uint8 *));
 	if ( !overlay->pitches || !overlay->pixels ) {
 		SDL_OutOfMemory();
 		SDL_FreeYUVOverlay(overlay);
@@ -395,14 +395,14 @@
 		if ( hwdata->image ) {
 			pXFree(hwdata->image);
 		}
-		free(hwdata);
+		SDL_free(hwdata);
 	}
 	if ( overlay->pitches ) {
-		free(overlay->pitches);
+		SDL_free(overlay->pitches);
 		overlay->pitches = NULL;
 	}
 	if ( overlay->pixels ) {
-		free(overlay->pixels);
+		SDL_free(overlay->pixels);
 		overlay->pixels = NULL;
 	}
 #ifdef XFREE86_REFRESH_HACK