Mercurial > sdl-ios-xcode
comparison src/video/bwindow/SDL_sysyuv.cc @ 1338:604d73db6802
Removed uses of stdlib.h and string.h
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 07 Feb 2006 09:29:18 +0000 |
parents | 3692456e7b0f |
children | c71e05b4dc2e |
comparison
equal
deleted
inserted
replaced
1337:c687f06c7473 | 1338:604d73db6802 |
---|---|
20 slouken@libsdl.org | 20 slouken@libsdl.org |
21 */ | 21 */ |
22 | 22 |
23 /* This is the BeOS version of SDL YUV video overlays */ | 23 /* This is the BeOS version of SDL YUV video overlays */ |
24 | 24 |
25 #include <stdlib.h> | 25 #include "SDL_stdlib.h" |
26 #include <string.h> | |
27 #include <errno.h> | |
28 | |
29 #include "SDL_error.h" | 26 #include "SDL_error.h" |
30 #include "SDL_video.h" | 27 #include "SDL_video.h" |
31 #include "SDL_sysyuv.h" | 28 #include "SDL_sysyuv.h" |
32 #include "SDL_yuvfuncs.h" | 29 #include "SDL_yuvfuncs.h" |
33 | 30 |
156 { | 153 { |
157 return NULL; | 154 return NULL; |
158 } | 155 } |
159 | 156 |
160 /* Create the overlay structure */ | 157 /* Create the overlay structure */ |
161 overlay = (SDL_Overlay*)calloc(1, sizeof(SDL_Overlay)); | 158 overlay = (SDL_Overlay*)SDL_calloc(1, sizeof(SDL_Overlay)); |
162 | 159 |
163 if (overlay == NULL) | 160 if (overlay == NULL) |
164 { | 161 { |
165 SDL_OutOfMemory(); | 162 SDL_OutOfMemory(); |
166 return NULL; | 163 return NULL; |
174 | 171 |
175 /* Set up the YUV surface function structure */ | 172 /* Set up the YUV surface function structure */ |
176 overlay->hwfuncs = &be_yuvfuncs; | 173 overlay->hwfuncs = &be_yuvfuncs; |
177 | 174 |
178 /* Create the pixel data and lookup tables */ | 175 /* Create the pixel data and lookup tables */ |
179 hwdata = (struct private_yuvhwdata*)calloc(1, sizeof(struct private_yuvhwdata)); | 176 hwdata = (struct private_yuvhwdata*)SDL_calloc(1, sizeof(struct private_yuvhwdata)); |
180 | 177 |
181 if (hwdata == NULL) | 178 if (hwdata == NULL) |
182 { | 179 { |
183 SDL_OutOfMemory(); | 180 SDL_OutOfMemory(); |
184 SDL_FreeYUVOverlay(overlay); | 181 SDL_FreeYUVOverlay(overlay); |
213 return NULL; | 210 return NULL; |
214 } | 211 } |
215 overlay->hwdata->bbitmap = bbitmap; | 212 overlay->hwdata->bbitmap = bbitmap; |
216 | 213 |
217 overlay->planes = planes; | 214 overlay->planes = planes; |
218 overlay->pitches = (Uint16*)calloc(overlay->planes, sizeof(Uint16)); | 215 overlay->pitches = (Uint16*)SDL_calloc(overlay->planes, sizeof(Uint16)); |
219 overlay->pixels = (Uint8**)calloc(overlay->planes, sizeof(Uint8*)); | 216 overlay->pixels = (Uint8**)SDL_calloc(overlay->planes, sizeof(Uint8*)); |
220 if (!overlay->pitches || !overlay->pixels) | 217 if (!overlay->pitches || !overlay->pixels) |
221 { | 218 { |
222 SDL_OutOfMemory(); | 219 SDL_OutOfMemory(); |
223 SDL_FreeYUVOverlay(overlay); | 220 SDL_FreeYUVOverlay(overlay); |
224 return(NULL); | 221 return(NULL); |