Mercurial > sdl-ios-xcode
comparison src/video/dc/SDL_dcvideo.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 |
comparison
equal
deleted
inserted
replaced
1335:c39265384763 | 1336:3692456e7b0f |
---|---|
74 return 1; | 74 return 1; |
75 } | 75 } |
76 | 76 |
77 static void DC_DeleteDevice(SDL_VideoDevice *device) | 77 static void DC_DeleteDevice(SDL_VideoDevice *device) |
78 { | 78 { |
79 free(device->hidden); | 79 SDL_free(device->hidden); |
80 free(device); | 80 SDL_free(device); |
81 } | 81 } |
82 | 82 |
83 static SDL_VideoDevice *DC_CreateDevice(int devindex) | 83 static SDL_VideoDevice *DC_CreateDevice(int devindex) |
84 { | 84 { |
85 SDL_VideoDevice *device; | 85 SDL_VideoDevice *device; |
86 | 86 |
87 /* Initialize all variables that we clean on shutdown */ | 87 /* Initialize all variables that we clean on shutdown */ |
88 device = (SDL_VideoDevice *)malloc(sizeof(SDL_VideoDevice)); | 88 device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice)); |
89 if ( device ) { | 89 if ( device ) { |
90 memset(device, 0, (sizeof *device)); | 90 SDL_memset(device, 0, (sizeof *device)); |
91 device->hidden = (struct SDL_PrivateVideoData *) | 91 device->hidden = (struct SDL_PrivateVideoData *) |
92 malloc((sizeof *device->hidden)); | 92 SDL_malloc((sizeof *device->hidden)); |
93 } | 93 } |
94 if ( (device == NULL) || (device->hidden == NULL) ) { | 94 if ( (device == NULL) || (device->hidden == NULL) ) { |
95 SDL_OutOfMemory(); | 95 SDL_OutOfMemory(); |
96 if ( device ) { | 96 if ( device ) { |
97 free(device); | 97 SDL_free(device); |
98 } | 98 } |
99 return(0); | 99 return(0); |
100 } | 100 } |
101 memset(device->hidden, 0, (sizeof *device->hidden)); | 101 SDL_memset(device->hidden, 0, (sizeof *device->hidden)); |
102 | 102 |
103 /* Set the function pointers */ | 103 /* Set the function pointers */ |
104 device->VideoInit = DC_VideoInit; | 104 device->VideoInit = DC_VideoInit; |
105 device->ListModes = DC_ListModes; | 105 device->ListModes = DC_ListModes; |
106 device->SetVideoMode = DC_SetVideoMode; | 106 device->SetVideoMode = DC_SetVideoMode; |
384 | 384 |
385 ret = glKosGetProcAddress(proc); | 385 ret = glKosGetProcAddress(proc); |
386 if (ret) return ret; | 386 if (ret) return ret; |
387 | 387 |
388 for(i=0;i<sizeof(glfuncs)/sizeof(glfuncs[0]);i++) { | 388 for(i=0;i<sizeof(glfuncs)/sizeof(glfuncs[0]);i++) { |
389 if (strcmp(proc,glfuncs[i].name)==0) return glfuncs[i].addr; | 389 if (SDL_strcmp(proc,glfuncs[i].name)==0) return glfuncs[i].addr; |
390 } | 390 } |
391 | 391 |
392 return NULL; | 392 return NULL; |
393 } | 393 } |
394 | 394 |