diff src/video/SDL_cursor.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/SDL_cursor.c	Mon Feb 06 17:28:04 2006 +0000
+++ b/src/video/SDL_cursor.c	Tue Feb 07 06:59:48 2006 +0000
@@ -125,7 +125,7 @@
 	}
 
 	/* Allocate memory for the cursor */
-	cursor = (SDL_Cursor *)malloc(sizeof *cursor);
+	cursor = (SDL_Cursor *)SDL_malloc(sizeof *cursor);
 	if ( cursor == NULL ) {
 		SDL_OutOfMemory();
 		return(NULL);
@@ -137,9 +137,9 @@
 	cursor->area.h = h;
 	cursor->hot_x = hot_x;
 	cursor->hot_y = hot_y;
-	cursor->data = (Uint8 *)malloc((w/8)*h*2);
+	cursor->data = (Uint8 *)SDL_malloc((w/8)*h*2);
 	cursor->mask = cursor->data+((w/8)*h);
-	cursor->save[0] = (Uint8 *)malloc(savelen*2);
+	cursor->save[0] = (Uint8 *)SDL_malloc(savelen*2);
 	cursor->save[1] = cursor->save[0] + savelen;
 	cursor->wm_cursor = NULL;
 	if ( ! cursor->data || ! cursor->save[0] ) {
@@ -151,7 +151,7 @@
 		cursor->data[i] = data[i];
 		cursor->mask[i] = mask[i] | data[i];
 	}
-	memset(cursor->save[0], 0, savelen*2);
+	SDL_memset(cursor->save[0], 0, savelen*2);
 
 	/* If the window manager gives us a good cursor, we're done! */
 	if ( video->CreateWMCursor ) {
@@ -244,15 +244,15 @@
 			SDL_VideoDevice *this  = current_video;
 
 			if ( cursor->data ) {
-				free(cursor->data);
+				SDL_free(cursor->data);
 			}
 			if ( cursor->save[0] ) {
-				free(cursor->save[0]);
+				SDL_free(cursor->save[0]);
 			}
 			if ( video && cursor->wm_cursor ) {
 				video->FreeWMCursor(this, cursor->wm_cursor);
 			}
-			free(cursor);
+			SDL_free(cursor);
 		}
 	}
 }
@@ -448,7 +448,7 @@
 				datab = *data++;
 				for ( i=0; i<8; ++i ) {
 					if ( maskb & 0x80 ) {
-						memset(dst,pixels[datab>>7],3);
+						SDL_memset(dst,pixels[datab>>7],3);
 					}
 					maskb <<= 1;
 					datab <<= 1;
@@ -523,7 +523,7 @@
 				}
 				if ( (x >= minx) && (x < maxx) ) {
 					if ( maskb & 0x80 ) {
-						memset(dst, pixels8[datab>>7], dstbpp);
+						SDL_memset(dst, pixels8[datab>>7], dstbpp);
 					}
 				}
 				maskb <<= 1;
@@ -541,7 +541,7 @@
 				}
 				if ( (x >= minx) && (x < maxx) ) {
 					if ( maskb & 0x80 ) {
-						memset(dst, pixels[datab>>7], dstbpp);
+						SDL_memset(dst, pixels[datab>>7], dstbpp);
 					}
 				}
 				maskb <<= 1;
@@ -616,7 +616,7 @@
 	  w = area.w*screenbpp;
 	  h = area.h;
 	  while ( h-- ) {
-		  memcpy(dst, src, w);
+		  SDL_memcpy(dst, src, w);
 		  dst += w;
 		  src += screen->pitch;
 	  }
@@ -694,7 +694,7 @@
 	  w = area.w*screenbpp;
 	  h = area.h;
 	  while ( h-- ) {
-		  memcpy(dst, src, w);
+		  SDL_memcpy(dst, src, w);
 		  src += w;
 		  dst += screen->pitch;
 	  }
@@ -748,6 +748,6 @@
 		savelen = SDL_cursor->area.w*4*SDL_cursor->area.h;
 		SDL_cursor->area.x = 0;
 		SDL_cursor->area.y = 0;
-		memset(SDL_cursor->save[0], 0, savelen);
+		SDL_memset(SDL_cursor->save[0], 0, savelen);
 	}
 }