summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Lantinga <slouken@libsdl.org>2010-05-09 15:33:10 -0700
committerSam Lantinga <slouken@libsdl.org>2010-05-09 15:33:10 -0700
commit5bda4be1001a82a9cdad136249a33ebdacb4fc65 (patch)
treefa764c458602ff1b03e48199ff7dd466320ab901
parent4db9ba56c0ef8ada67275de8ed42dd42cc021054 (diff)
downloadsdl-5bda4be1001a82a9cdad136249a33ebdacb4fc65.tar.gz
Fixed compiler warnings
-rw-r--r--src/video/cocoa/SDL_cocoavideo.m7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/video/cocoa/SDL_cocoavideo.m b/src/video/cocoa/SDL_cocoavideo.m
index fac6df5b3..86e19fda7 100644
--- a/src/video/cocoa/SDL_cocoavideo.m
+++ b/src/video/cocoa/SDL_cocoavideo.m
@@ -39,8 +39,6 @@ Cocoa_Available(void)
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 @@ Cocoa_CreateDevice(int devindex)
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 @@ SDL_PromptAssertion_cocoa(const SDL_assert_data *data)
}
/* vim: set ts=4 sw=4 expandtab: */
-