Mercurial > sdl-ios-xcode
diff src/video/dummy/SDL_nullvideo.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 |
line wrap: on
line diff
--- a/src/video/dummy/SDL_nullvideo.c Mon Feb 06 17:28:04 2006 +0000 +++ b/src/video/dummy/SDL_nullvideo.c Tue Feb 07 06:59:48 2006 +0000 @@ -73,8 +73,8 @@ static int DUMMY_Available(void) { - const char *envr = getenv("SDL_VIDEODRIVER"); - if ((envr) && (strcmp(envr, DUMMYVID_DRIVER_NAME) == 0)) { + const char *envr = SDL_getenv("SDL_VIDEODRIVER"); + if ((envr) && (SDL_strcmp(envr, DUMMYVID_DRIVER_NAME) == 0)) { return(1); } @@ -83,8 +83,8 @@ static void DUMMY_DeleteDevice(SDL_VideoDevice *device) { - free(device->hidden); - free(device); + SDL_free(device->hidden); + SDL_free(device); } static SDL_VideoDevice *DUMMY_CreateDevice(int devindex) @@ -92,20 +92,20 @@ SDL_VideoDevice *device; /* Initialize all variables that we clean on shutdown */ - device = (SDL_VideoDevice *)malloc(sizeof(SDL_VideoDevice)); + device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice)); if ( device ) { - memset(device, 0, (sizeof *device)); + SDL_memset(device, 0, (sizeof *device)); device->hidden = (struct SDL_PrivateVideoData *) - malloc((sizeof *device->hidden)); + SDL_malloc((sizeof *device->hidden)); } if ( (device == NULL) || (device->hidden == NULL) ) { SDL_OutOfMemory(); if ( device ) { - free(device); + SDL_free(device); } return(0); } - memset(device->hidden, 0, (sizeof *device->hidden)); + SDL_memset(device->hidden, 0, (sizeof *device->hidden)); /* Set the function pointers */ device->VideoInit = DUMMY_VideoInit; @@ -165,10 +165,10 @@ int width, int height, int bpp, Uint32 flags) { if ( this->hidden->buffer ) { - free( this->hidden->buffer ); + SDL_free( this->hidden->buffer ); } - this->hidden->buffer = malloc(width * height * (bpp / 8)); + this->hidden->buffer = SDL_malloc(width * height * (bpp / 8)); if ( ! this->hidden->buffer ) { SDL_SetError("Couldn't allocate buffer for requested mode"); return(NULL); @@ -176,11 +176,11 @@ /* printf("Setting mode %dx%d\n", width, height); */ - memset(this->hidden->buffer, 0, width * height * (bpp / 8)); + SDL_memset(this->hidden->buffer, 0, width * height * (bpp / 8)); /* Allocate the new pixel format for the screen */ if ( ! SDL_ReallocFormat(current, bpp, 0, 0, 0, 0) ) { - free(this->hidden->buffer); + SDL_free(this->hidden->buffer); this->hidden->buffer = NULL; SDL_SetError("Couldn't allocate new pixel format for requested mode"); return(NULL); @@ -236,7 +236,7 @@ { if (this->screen->pixels != NULL) { - free(this->screen->pixels); + SDL_free(this->screen->pixels); this->screen->pixels = NULL; } }