Mercurial > sdl-ios-xcode
comparison src/timer/SDL_timer.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 |
comparison
equal
deleted
inserted
replaced
1335:c39265384763 | 1336:3692456e7b0f |
---|---|
146 if ( prev ) { | 146 if ( prev ) { |
147 prev->next = next; | 147 prev->next = next; |
148 } else { | 148 } else { |
149 SDL_timers = next; | 149 SDL_timers = next; |
150 } | 150 } |
151 free(t); | 151 SDL_free(t); |
152 --SDL_timer_running; | 152 --SDL_timer_running; |
153 removed = SDL_TRUE; | 153 removed = SDL_TRUE; |
154 } | 154 } |
155 } | 155 } |
156 } | 156 } |
163 } | 163 } |
164 | 164 |
165 static SDL_TimerID SDL_AddTimerInternal(Uint32 interval, SDL_NewTimerCallback callback, void *param) | 165 static SDL_TimerID SDL_AddTimerInternal(Uint32 interval, SDL_NewTimerCallback callback, void *param) |
166 { | 166 { |
167 SDL_TimerID t; | 167 SDL_TimerID t; |
168 t = (SDL_TimerID) malloc(sizeof(struct _SDL_TimerID)); | 168 t = (SDL_TimerID) SDL_malloc(sizeof(struct _SDL_TimerID)); |
169 if ( t ) { | 169 if ( t ) { |
170 t->interval = ROUND_RESOLUTION(interval); | 170 t->interval = ROUND_RESOLUTION(interval); |
171 t->cb = callback; | 171 t->cb = callback; |
172 t->param = param; | 172 t->param = param; |
173 t->last_alarm = SDL_GetTicks(); | 173 t->last_alarm = SDL_GetTicks(); |
216 if(prev) { | 216 if(prev) { |
217 prev->next = t->next; | 217 prev->next = t->next; |
218 } else { | 218 } else { |
219 SDL_timers = t->next; | 219 SDL_timers = t->next; |
220 } | 220 } |
221 free(t); | 221 SDL_free(t); |
222 --SDL_timer_running; | 222 --SDL_timer_running; |
223 removed = SDL_TRUE; | 223 removed = SDL_TRUE; |
224 list_changed = SDL_TRUE; | 224 list_changed = SDL_TRUE; |
225 break; | 225 break; |
226 } | 226 } |
254 if ( SDL_timer_running ) { /* Stop any currently running timer */ | 254 if ( SDL_timer_running ) { /* Stop any currently running timer */ |
255 if ( SDL_timer_threaded ) { | 255 if ( SDL_timer_threaded ) { |
256 while ( SDL_timers ) { | 256 while ( SDL_timers ) { |
257 SDL_TimerID freeme = SDL_timers; | 257 SDL_TimerID freeme = SDL_timers; |
258 SDL_timers = SDL_timers->next; | 258 SDL_timers = SDL_timers->next; |
259 free(freeme); | 259 SDL_free(freeme); |
260 } | 260 } |
261 SDL_timer_running = 0; | 261 SDL_timer_running = 0; |
262 list_changed = SDL_TRUE; | 262 list_changed = SDL_TRUE; |
263 } else { | 263 } else { |
264 SDL_SYS_StopTimer(); | 264 SDL_SYS_StopTimer(); |