diff src/video/windx5/SDL_dx5yuv.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 450721ad5436
children 604d73db6802
line wrap: on
line diff
--- a/src/video/windx5/SDL_dx5yuv.c	Mon Feb 06 17:28:04 2006 +0000
+++ b/src/video/windx5/SDL_dx5yuv.c	Tue Feb 07 06:59:48 2006 +0000
@@ -57,7 +57,7 @@
 	DDSURFACEDESC ddsd;
 
 	/* Set up the surface description */
-	memset(&ddsd, 0, sizeof(ddsd));
+	SDL_memset(&ddsd, 0, sizeof(ddsd));
 	ddsd.dwSize = sizeof(ddsd);
 	ddsd.dwFlags = (DDSD_WIDTH|DDSD_HEIGHT|DDSD_CAPS|DDSD_PIXELFORMAT);
 	ddsd.dwWidth = width;
@@ -86,7 +86,7 @@
 	}
 
 	/* Make sure the surface format was set properly */
-	memset(&ddsd, 0, sizeof(ddsd));
+	SDL_memset(&ddsd, 0, sizeof(ddsd));
 	ddsd.dwSize = sizeof(ddsd);
 	result = IDirectDrawSurface3_Lock(dd_surface3, NULL,
 					  &ddsd, DDLOCK_NOSYSLOCK, NULL);
@@ -134,13 +134,13 @@
 	IDirectDraw2_GetFourCCCodes(ddraw2, &numcodes, NULL);
 	if ( numcodes ) {
 		DWORD i;
-		codes = malloc(numcodes*sizeof(*codes));
+		codes = SDL_malloc(numcodes*sizeof(*codes));
 		if ( codes ) {
 			IDirectDraw2_GetFourCCCodes(ddraw2, &numcodes, codes);
 			for ( i=0; i<numcodes; ++i ) {
 				fprintf(stderr, "Code %d: 0x%x\n", i, PrintFOURCC(codes[i]));
 			}
-			free(codes);
+			SDL_free(codes);
 		}
 	} else {
 		fprintf(stderr, "No FOURCC codes supported\n");
@@ -148,12 +148,12 @@
 #endif
 
 	/* Create the overlay structure */
-	overlay = (SDL_Overlay *)malloc(sizeof *overlay);
+	overlay = (SDL_Overlay *)SDL_malloc(sizeof *overlay);
 	if ( overlay == NULL ) {
 		SDL_OutOfMemory();
 		return(NULL);
 	}
-	memset(overlay, 0, (sizeof *overlay));
+	SDL_memset(overlay, 0, (sizeof *overlay));
 
 	/* Fill in the basic members */
 	overlay->format = format;
@@ -164,7 +164,7 @@
 	overlay->hwfuncs = &dx5_yuvfuncs;
 
 	/* 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_OutOfMemory();
@@ -202,7 +202,7 @@
 	DDSURFACEDESC ddsd;
 
 	surface = overlay->hwdata->surface;
-	memset(&ddsd, 0, sizeof(ddsd));
+	SDL_memset(&ddsd, 0, sizeof(ddsd));
 	ddsd.dwSize = sizeof(ddsd);
 	result = IDirectDrawSurface3_Lock(surface, NULL,
 					  &ddsd, DDLOCK_NOSYSLOCK, NULL);
@@ -291,7 +291,7 @@
 		if ( hwdata->surface ) {
 			IDirectDrawSurface_Release(hwdata->surface);
 		}
-		free(hwdata);
+		SDL_free(hwdata);
 	}
 }