Mercurial > sdl-ios-xcode
diff src/video/SDL_yuv_sw.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_yuv_sw.c Mon Feb 06 17:28:04 2006 +0000 +++ b/src/video/SDL_yuv_sw.c Tue Feb 07 06:59:48 2006 +0000 @@ -960,12 +960,12 @@ } /* Create the overlay structure */ - overlay = (SDL_Overlay *)malloc(sizeof *overlay); + overlay = (SDL_Overlay *)SDL_malloc(sizeof *overlay); if ( overlay == NULL ) { SDL_OutOfMemory(); return(NULL); } - memset(overlay, 0, (sizeof *overlay)); + SDL_memset(overlay, 0, (sizeof *overlay)); /* Fill in the basic members */ overlay->format = format; @@ -976,7 +976,7 @@ overlay->hwfuncs = &sw_yuvfuncs; /* Create the pixel data and lookup tables */ - swdata = (struct private_yuvhwdata *)malloc(sizeof *swdata); + swdata = (struct private_yuvhwdata *)SDL_malloc(sizeof *swdata); overlay->hwdata = swdata; if ( swdata == NULL ) { SDL_OutOfMemory(); @@ -985,13 +985,13 @@ } swdata->stretch = NULL; swdata->display = display; - swdata->pixels = (Uint8 *) malloc(width*height*2); - swdata->colortab = (int *)malloc(4*256*sizeof(int)); + swdata->pixels = (Uint8 *) SDL_malloc(width*height*2); + swdata->colortab = (int *)SDL_malloc(4*256*sizeof(int)); Cr_r_tab = &swdata->colortab[0*256]; Cr_g_tab = &swdata->colortab[1*256]; Cb_g_tab = &swdata->colortab[2*256]; Cb_b_tab = &swdata->colortab[3*256]; - swdata->rgb_2_pix = (Uint32 *)malloc(3*768*sizeof(Uint32)); + swdata->rgb_2_pix = (Uint32 *)SDL_malloc(3*768*sizeof(Uint32)); r_2_pix_alloc = &swdata->rgb_2_pix[0*768]; g_2_pix_alloc = &swdata->rgb_2_pix[1*768]; b_2_pix_alloc = &swdata->rgb_2_pix[2*768]; @@ -1279,14 +1279,14 @@ SDL_FreeSurface(swdata->stretch); } if ( swdata->pixels ) { - free(swdata->pixels); + SDL_free(swdata->pixels); } if ( swdata->colortab ) { - free(swdata->colortab); + SDL_free(swdata->colortab); } if ( swdata->rgb_2_pix ) { - free(swdata->rgb_2_pix); + SDL_free(swdata->rgb_2_pix); } - free(swdata); + SDL_free(swdata); } }