Mercurial > sdl-ios-xcode
diff src/video/photon/SDL_ph_image.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/photon/SDL_ph_image.c Mon Feb 06 17:28:04 2006 +0000 +++ b/src/video/photon/SDL_ph_image.c Tue Feb 07 06:59:48 2006 +0000 @@ -77,7 +77,7 @@ if ((bpp==8) && (desktoppal==SDLPH_PAL_EMULATE)) { /* creating image palette */ - palette=malloc(_Pg_MAX_PALETTE*sizeof(PgColor_t)); + palette=SDL_malloc(_Pg_MAX_PALETTE*sizeof(PgColor_t)); if (palette==NULL) { SDL_SetError("ph_SetupImage(): can't allocate memory for palette !\n"); @@ -89,7 +89,7 @@ if ((SDL_Image = PhCreateImage(NULL, screen->w, screen->h, type, palette, _Pg_MAX_PALETTE, 1)) == NULL) { SDL_SetError("ph_SetupImage(): PhCreateImage() failed for bpp=8 !\n"); - free(palette); + SDL_free(palette); return -1; } } @@ -254,11 +254,11 @@ for (i=0; i<40; i++) { - memset(screen->pixels+screen->pitch*i, 0x00, screen->pitch); + SDL_memset(screen->pixels+screen->pitch*i, 0x00, screen->pitch); } for (i=440; i<480; i++) { - memset(screen->pixels+screen->pitch*i, 0x00, screen->pitch); + SDL_memset(screen->pixels+screen->pitch*i, 0x00, screen->pitch); } screen->pixels+=screen->pitch*40; } @@ -278,11 +278,11 @@ for (i=0; i<40; i++) { - memset(screen->pixels+screen->pitch*i, 0x00, screen->pitch); + SDL_memset(screen->pixels+screen->pitch*i, 0x00, screen->pitch); } for (i=440; i<480; i++) { - memset(screen->pixels+screen->pitch*i, 0x00, screen->pitch); + SDL_memset(screen->pixels+screen->pitch*i, 0x00, screen->pitch); } screen->pixels+=screen->pitch*40; } @@ -391,10 +391,10 @@ /* if palette allocated, free it */ if (SDL_Image->palette) { - free(SDL_Image->palette); + SDL_free(SDL_Image->palette); } PgShmemDestroy(SDL_Image->image); - free(SDL_Image); + SDL_free(SDL_Image); } /* Must be zeroed everytime */ @@ -531,8 +531,8 @@ SDL_SetError("ph_AllocHWSurface(): hwdata already exists!\n"); return -1; } - surface->hwdata=malloc(sizeof(struct private_hwdata)); - memset(surface->hwdata, 0x00, sizeof(struct private_hwdata)); + surface->hwdata=SDL_malloc(sizeof(struct private_hwdata)); + SDL_memset(surface->hwdata, 0x00, sizeof(struct private_hwdata)); surface->hwdata->offscreenctx=PdCreateOffscreenContext(0, surface->w, surface->h, Pg_OSC_MEM_PAGE_ALIGN); if (surface->hwdata->offscreenctx == NULL) { @@ -601,7 +601,7 @@ PhDCRelease(surface->hwdata->offscreenctx); - free(surface->hwdata); + SDL_free(surface->hwdata); surface->hwdata=NULL; /* Update video ram amount */