Fixed compiler warnings
authorSam Lantinga <slouken@libsdl.org>
Sun, 09 May 2010 15:33:10 -0700
changeset 4457 5e1f9cb9fa98
parent 4456 0a5dbe96c3be
child 4458 c9584df65367
Fixed compiler warnings
src/video/cocoa/SDL_cocoavideo.m
--- a/src/video/cocoa/SDL_cocoavideo.m	Sun May 09 15:24:31 2010 -0700
+++ b/src/video/cocoa/SDL_cocoavideo.m	Sun May 09 15:33:10 2010 -0700
@@ -39,8 +39,6 @@
 static void
 Cocoa_DeleteDevice(SDL_VideoDevice * device)
 {
-    SDL_VideoData *data = (SDL_VideoData *) device->driverdata;
-
     SDL_free(device->driverdata);
     SDL_free(device);
 }
@@ -57,8 +55,10 @@
     device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
     if (device) {
         data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
+    } else {
+        data = NULL;
     }
-    if (!device || !data) {
+    if (!data) {
         SDL_OutOfMemory();
         if (device) {
             SDL_free(device);
@@ -176,4 +176,3 @@
 }
 
 /* vim: set ts=4 sw=4 expandtab: */
-