diff src/video/x11/SDL_x11shape.c @ 4832:0c82f20327ec

Correcting minor bugs and adding assertions to help me track down a NULL pointer bug in Cocoa code.
author egottlieb
date Thu, 05 Aug 2010 00:53:38 -0400
parents c68e7490e4cf
children 34fb492cefe3
line wrap: on
line diff
--- a/src/video/x11/SDL_x11shape.c	Tue Aug 03 23:41:57 2010 -0400
+++ b/src/video/x11/SDL_x11shape.c	Thu Aug 05 00:53:38 2010 -0400
@@ -20,7 +20,8 @@
     eligottlieb@gmail.com
 */
 
-#include <assert.h>
+#include "SDL_assert.h"
+#include "SDL_malloc.h"
 #include "SDL_x11video.h"
 #include "SDL_x11shape.h"
 #include "SDL_x11window.h"
@@ -39,13 +40,13 @@
 		result->mode.mode = ShapeModeDefault;
 		result->mode.parameters.binarizationCutoff = 1;
 		result->usershownflag = 0;
-		SDL_ShapeData* data = malloc(sizeof(SDL_ShapeData));
+		SDL_ShapeData* data = SDL_malloc(sizeof(SDL_ShapeData));
 		result->driverdata = data;
 		data->bitmapsize = 0;
 		data->bitmap = NULL;
 		window->shaper = result;
 		int resized_properly = X11_ResizeWindowShape(window);
-		assert(resized_properly == 0);
+		SDL_assert(resized_properly == 0);
 	}
 #endif
 
@@ -54,7 +55,7 @@
 
 int X11_ResizeWindowShape(SDL_Window* window) {
 	SDL_ShapeData* data = window->shaper->driverdata;
-	assert(data != NULL);
+	SDL_assert(data != NULL);
 	
 	unsigned int bitmapsize = window->w / 8;
 	if(window->w % 8 > 0)