Mercurial > sdl-ios-xcode
comparison src/video/macdsp/SDL_dspvideo.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 |
---|---|
236 if (device) { | 236 if (device) { |
237 | 237 |
238 if (device->hidden) { | 238 if (device->hidden) { |
239 | 239 |
240 if (device->hidden->dspinfo) | 240 if (device->hidden->dspinfo) |
241 free(device->hidden->dspinfo); | 241 SDL_free(device->hidden->dspinfo); |
242 | 242 |
243 free(device->hidden); | 243 SDL_free(device->hidden); |
244 } | 244 } |
245 free(device); | 245 SDL_free(device); |
246 } | 246 } |
247 } | 247 } |
248 | 248 |
249 static SDL_VideoDevice *DSp_CreateDevice(int devindex) | 249 static SDL_VideoDevice *DSp_CreateDevice(int devindex) |
250 { | 250 { |
251 SDL_VideoDevice *device; | 251 SDL_VideoDevice *device; |
252 | 252 |
253 /* Initialize all variables that we clean on shutdown */ | 253 /* Initialize all variables that we clean on shutdown */ |
254 device = (SDL_VideoDevice *)malloc(sizeof(SDL_VideoDevice)); | 254 device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice)); |
255 if ( device ) { | 255 if ( device ) { |
256 memset(device, 0, sizeof (*device)); | 256 SDL_memset(device, 0, sizeof (*device)); |
257 device->hidden = (struct SDL_PrivateVideoData *) | 257 device->hidden = (struct SDL_PrivateVideoData *) |
258 malloc((sizeof *device->hidden)); | 258 SDL_malloc((sizeof *device->hidden)); |
259 if (device->hidden) | 259 if (device->hidden) |
260 memset(device->hidden, 0, sizeof ( *(device->hidden) ) ); | 260 SDL_memset(device->hidden, 0, sizeof ( *(device->hidden) ) ); |
261 } | 261 } |
262 if ( (device == NULL) || (device->hidden == NULL) ) { | 262 if ( (device == NULL) || (device->hidden == NULL) ) { |
263 SDL_OutOfMemory(); | 263 SDL_OutOfMemory(); |
264 | 264 |
265 if ( device ) { | 265 if ( device ) { |
266 | 266 |
267 if (device->hidden) | 267 if (device->hidden) |
268 free (device->hidden); | 268 free (device->hidden); |
269 | 269 |
270 free(device); | 270 SDL_free(device); |
271 } | 271 } |
272 | 272 |
273 return(NULL); | 273 return(NULL); |
274 } | 274 } |
275 | 275 |
276 /* Allocate DrawSprocket information */ | 276 /* Allocate DrawSprocket information */ |
277 device->hidden->dspinfo = (struct DSpInfo *)malloc( | 277 device->hidden->dspinfo = (struct DSpInfo *)SDL_malloc( |
278 (sizeof *device->hidden->dspinfo)); | 278 (sizeof *device->hidden->dspinfo)); |
279 if ( device->hidden->dspinfo == NULL ) { | 279 if ( device->hidden->dspinfo == NULL ) { |
280 SDL_OutOfMemory(); | 280 SDL_OutOfMemory(); |
281 free(device->hidden); | 281 SDL_free(device->hidden); |
282 free(device); | 282 SDL_free(device); |
283 return(0); | 283 return(0); |
284 } | 284 } |
285 memset(device->hidden->dspinfo, 0, (sizeof *device->hidden->dspinfo)); | 285 SDL_memset(device->hidden->dspinfo, 0, (sizeof *device->hidden->dspinfo)); |
286 | 286 |
287 /* Set the function pointers */ | 287 /* Set the function pointers */ |
288 device->VideoInit = DSp_VideoInit; | 288 device->VideoInit = DSp_VideoInit; |
289 device->ListModes = DSp_ListModes; | 289 device->ListModes = DSp_ListModes; |
290 device->SetVideoMode = DSp_SetVideoMode; | 290 device->SetVideoMode = DSp_SetVideoMode; |
1382 DSp_DestroyPalette (this); | 1382 DSp_DestroyPalette (this); |
1383 | 1383 |
1384 /* Free list of video modes */ | 1384 /* Free list of video modes */ |
1385 if ( SDL_modelist != NULL ) { | 1385 if ( SDL_modelist != NULL ) { |
1386 for ( i=0; SDL_modelist[i]; i++ ) { | 1386 for ( i=0; SDL_modelist[i]; i++ ) { |
1387 free(SDL_modelist[i]); | 1387 SDL_free(SDL_modelist[i]); |
1388 } | 1388 } |
1389 free(SDL_modelist); | 1389 SDL_free(SDL_modelist); |
1390 SDL_modelist = NULL; | 1390 SDL_modelist = NULL; |
1391 } | 1391 } |
1392 | 1392 |
1393 /* Unload DrawSprocket */ | 1393 /* Unload DrawSprocket */ |
1394 DSpShutdown (); | 1394 DSpShutdown (); |