Mercurial > sdl-ios-xcode
comparison src/events/SDL_events.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 | c71e05b4dc2e |
comparison
equal
deleted
inserted
replaced
1335:c39265384763 | 1336:3692456e7b0f |
---|---|
149 | 149 |
150 static int SDL_StartEventThread(Uint32 flags) | 150 static int SDL_StartEventThread(Uint32 flags) |
151 { | 151 { |
152 /* Reset everything to zero */ | 152 /* Reset everything to zero */ |
153 SDL_EventThread = NULL; | 153 SDL_EventThread = NULL; |
154 memset(&SDL_EventLock, 0, sizeof(SDL_EventLock)); | 154 SDL_memset(&SDL_EventLock, 0, sizeof(SDL_EventLock)); |
155 | 155 |
156 /* Create the lock and set ourselves active */ | 156 /* Create the lock and set ourselves active */ |
157 #ifndef DISABLE_THREADS | 157 #ifndef DISABLE_THREADS |
158 SDL_EventQ.lock = SDL_CreateMutex(); | 158 SDL_EventQ.lock = SDL_CreateMutex(); |
159 if ( SDL_EventQ.lock == NULL ) { | 159 if ( SDL_EventQ.lock == NULL ) { |
237 SDL_EventQ.lock = NULL; | 237 SDL_EventQ.lock = NULL; |
238 SDL_StopEventLoop(); | 238 SDL_StopEventLoop(); |
239 | 239 |
240 /* No filter to start with, process most event types */ | 240 /* No filter to start with, process most event types */ |
241 SDL_EventOK = NULL; | 241 SDL_EventOK = NULL; |
242 memset(SDL_ProcessEvents,SDL_ENABLE,sizeof(SDL_ProcessEvents)); | 242 SDL_memset(SDL_ProcessEvents,SDL_ENABLE,sizeof(SDL_ProcessEvents)); |
243 SDL_eventstate = ~0; | 243 SDL_eventstate = ~0; |
244 /* It's not save to call SDL_EventState() yet */ | 244 /* It's not save to call SDL_EventState() yet */ |
245 SDL_eventstate &= ~(0x00000001 << SDL_SYSWMEVENT); | 245 SDL_eventstate &= ~(0x00000001 << SDL_SYSWMEVENT); |
246 SDL_ProcessEvents[SDL_SYSWMEVENT] = SDL_IGNORE; | 246 SDL_ProcessEvents[SDL_SYSWMEVENT] = SDL_IGNORE; |
247 | 247 |
304 } else | 304 } else |
305 /* We cut the middle -- shift everything over */ | 305 /* We cut the middle -- shift everything over */ |
306 { | 306 { |
307 int here, next; | 307 int here, next; |
308 | 308 |
309 /* This can probably be optimized with memcpy() -- careful! */ | 309 /* This can probably be optimized with SDL_memcpy() -- careful! */ |
310 if ( --SDL_EventQ.tail < 0 ) { | 310 if ( --SDL_EventQ.tail < 0 ) { |
311 SDL_EventQ.tail = MAXEVENTS-1; | 311 SDL_EventQ.tail = MAXEVENTS-1; |
312 } | 312 } |
313 for ( here=spot; here != SDL_EventQ.tail; here = next ) { | 313 for ( here=spot; here != SDL_EventQ.tail; here = next ) { |
314 next = (here+1)%MAXEVENTS; | 314 next = (here+1)%MAXEVENTS; |
491 int posted; | 491 int posted; |
492 | 492 |
493 posted = 0; | 493 posted = 0; |
494 if ( SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE ) { | 494 if ( SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE ) { |
495 SDL_Event event; | 495 SDL_Event event; |
496 memset(&event, 0, sizeof(event)); | 496 SDL_memset(&event, 0, sizeof(event)); |
497 event.type = SDL_SYSWMEVENT; | 497 event.type = SDL_SYSWMEVENT; |
498 event.syswm.msg = message; | 498 event.syswm.msg = message; |
499 if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { | 499 if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { |
500 posted = 1; | 500 posted = 1; |
501 SDL_PushEvent(&event); | 501 SDL_PushEvent(&event); |