diff src/video/cybergfx/SDL_cgximage.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/cybergfx/SDL_cgximage.c	Mon Feb 06 17:28:04 2006 +0000
+++ b/src/video/cybergfx/SDL_cgximage.c	Tue Feb 07 06:59:48 2006 +0000
@@ -57,7 +57,7 @@
 		ULONG pitch;
 
 		if(!screen->hwdata) {
-			if(!(screen->hwdata=malloc(sizeof(struct private_hwdata))))
+			if(!(screen->hwdata=SDL_malloc(sizeof(struct private_hwdata))))
 				return -1;
 
 			D(bug("Creating system accel struct\n"));
@@ -71,7 +71,7 @@
 		if(!(screen->hwdata->lock=LockBitMapTags(screen->hwdata->bmap,
 				LBMI_BASEADDRESS,(ULONG)&screen->pixels,
 				LBMI_BYTESPERROW,(ULONG)&pitch,TAG_DONE))) {
-			free(screen->hwdata);
+			SDL_free(screen->hwdata);
 			screen->hwdata=NULL;
 			return -1;
 		}
@@ -88,7 +88,7 @@
 		return 0;
 	}
 
-	screen->pixels = malloc(screen->h*screen->pitch);
+	screen->pixels = SDL_malloc(screen->h*screen->pitch);
 
 	if ( screen->pixels == NULL ) {
 		SDL_OutOfMemory();
@@ -110,14 +110,14 @@
 void CGX_DestroyImage(_THIS, SDL_Surface *screen)
 {
 	if ( SDL_Ximage ) {
-		free(SDL_Ximage);
+		SDL_free(SDL_Ximage);
 		SDL_Ximage = NULL;
 	}
 	if ( screen ) {
 		screen->pixels = NULL;
 
 		if(screen->hwdata) {
-			free(screen->hwdata);
+			SDL_free(screen->hwdata);
 			screen->hwdata=NULL;
 		}
 	}
@@ -163,7 +163,7 @@
 
 	if(!surface->hwdata)
 	{
-		if(!(surface->hwdata=malloc(sizeof(struct private_hwdata))))
+		if(!(surface->hwdata=SDL_malloc(sizeof(struct private_hwdata))))
 			return -1;
 	}
 
@@ -181,7 +181,7 @@
 	}
 	else
 	{
-		free(surface->hwdata);
+		SDL_free(surface->hwdata);
 		surface->hwdata=NULL;
 	}
 
@@ -194,12 +194,12 @@
 		D(bug("Free hw surface.\n"));
 
 		if(surface->hwdata->mask)
-			free(surface->hwdata->mask);
+			SDL_free(surface->hwdata->mask);
 
 		if(surface->hwdata->bmap&&surface->hwdata->allocated)
 			FreeBitMap(surface->hwdata->bmap);
 
-		free(surface->hwdata);
+		SDL_free(surface->hwdata);
 		surface->hwdata=NULL;
 		surface->pixels=NULL;
 		D(bug("end of free hw surface\n"));
@@ -654,7 +654,7 @@
 
 				for(j=rects[i].h;j;--j)
 				{
-					memcpy(dest,src,srcwidth);
+					SDL_memcpy(dest,src,srcwidth);
 					src+=this->screen->pitch;
 					dest+=destpitch;
 				}
@@ -883,13 +883,13 @@
 
 			if(this->screen->pitch==destpitch)
 			{
-				memcpy(dest,src,this->screen->pitch*this->screen->h);
+				SDL_memcpy(dest,src,this->screen->pitch*this->screen->h);
 			}
 			else
 			{
 				for(j=this->screen->h;j;--j)
 				{
-					memcpy(dest,src,this->screen->pitch);
+					SDL_memcpy(dest,src,this->screen->pitch);
 					src+=this->screen->pitch;
 					dest+=destpitch;
 				}