Mercurial > sdl-ios-xcode
diff src/video/SDL_RLEaccel.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 | 450721ad5436 |
children | 604d73db6802 |
line wrap: on
line diff
--- a/src/video/SDL_RLEaccel.c Mon Feb 06 17:28:04 2006 +0000 +++ b/src/video/SDL_RLEaccel.c Tue Feb 07 06:59:48 2006 +0000 @@ -1467,7 +1467,7 @@ } maxsize += sizeof(RLEDestFormat); - rlebuf = (Uint8 *)malloc(maxsize); + rlebuf = (Uint8 *)SDL_malloc(maxsize); if(!rlebuf) { SDL_OutOfMemory(); return -1; @@ -1597,13 +1597,13 @@ /* Now that we have it encoded, release the original pixels */ if((surface->flags & SDL_PREALLOC) != SDL_PREALLOC && (surface->flags & SDL_HWSURFACE) != SDL_HWSURFACE) { - free( surface->pixels ); + SDL_free( surface->pixels ); surface->pixels = NULL; } /* realloc the buffer to release unused memory */ { - Uint8 *p = realloc(rlebuf, dst - rlebuf); + Uint8 *p = SDL_realloc(rlebuf, dst - rlebuf); if(!p) p = rlebuf; surface->map->sw_data->aux_data = p; @@ -1675,7 +1675,7 @@ break; } - rlebuf = (Uint8 *)malloc(maxsize); + rlebuf = (Uint8 *)SDL_malloc(maxsize); if ( rlebuf == NULL ) { SDL_OutOfMemory(); return(-1); @@ -1731,14 +1731,14 @@ } len = MIN(run, maxn); ADD_COUNTS(skip, len); - memcpy(dst, srcbuf + runstart * bpp, len * bpp); + SDL_memcpy(dst, srcbuf + runstart * bpp, len * bpp); dst += len * bpp; run -= len; runstart += len; while(run) { len = MIN(run, maxn); ADD_COUNTS(0, len); - memcpy(dst, srcbuf + runstart * bpp, len * bpp); + SDL_memcpy(dst, srcbuf + runstart * bpp, len * bpp); dst += len * bpp; runstart += len; run -= len; @@ -1757,14 +1757,14 @@ /* Now that we have it encoded, release the original pixels */ if((surface->flags & SDL_PREALLOC) != SDL_PREALLOC && (surface->flags & SDL_HWSURFACE) != SDL_HWSURFACE) { - free( surface->pixels ); + SDL_free( surface->pixels ); surface->pixels = NULL; } /* realloc the buffer to release unused memory */ { /* If realloc returns NULL, the original block is left intact */ - Uint8 *p = realloc(rlebuf, dst - rlebuf); + Uint8 *p = SDL_realloc(rlebuf, dst - rlebuf); if(!p) p = rlebuf; surface->map->sw_data->aux_data = p; @@ -1845,12 +1845,12 @@ uncopy_opaque = uncopy_transl = uncopy_32; } - surface->pixels = malloc(surface->h * surface->pitch); + surface->pixels = SDL_malloc(surface->h * surface->pitch); if ( !surface->pixels ) { return(SDL_FALSE); } /* fill background with transparent pixels */ - memset(surface->pixels, 0, surface->h * surface->pitch); + SDL_memset(surface->pixels, 0, surface->h * surface->pitch); dst = surface->pixels; srcbuf = (Uint8 *)(df + 1); @@ -1909,7 +1909,7 @@ unsigned alpha_flag; /* re-create the original surface */ - surface->pixels = malloc(surface->h * surface->pitch); + surface->pixels = SDL_malloc(surface->h * surface->pitch); if ( !surface->pixels ) { /* Oh crap... */ surface->flags |= SDL_RLEACCEL; @@ -1937,7 +1937,7 @@ } if ( surface->map && surface->map->sw_data->aux_data ) { - free(surface->map->sw_data->aux_data); + SDL_free(surface->map->sw_data->aux_data); surface->map->sw_data->aux_data = NULL; } }