Mercurial > sdl-ios-xcode
comparison src/events/SDL_events.c @ 352:b49fc922e7f6
Fixed SDL_PollEvent() so it only returns a boolean value (not -1)
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 15 Apr 2002 04:51:26 +0000 |
parents | f6ffac90895c |
children | d47637068e52 |
comparison
equal
deleted
inserted
replaced
351:b1cae30740a2 | 352:b49fc922e7f6 |
---|---|
370 | 370 |
371 int SDL_PollEvent (SDL_Event *event) | 371 int SDL_PollEvent (SDL_Event *event) |
372 { | 372 { |
373 SDL_PumpEvents(); | 373 SDL_PumpEvents(); |
374 | 374 |
375 return(SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS)); | 375 /* We can't return -1, just return 0 (no event) on error */ |
376 if ( SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS) <= 0 ) | |
377 return 0; | |
378 return 1; | |
376 } | 379 } |
377 | 380 |
378 int SDL_WaitEvent (SDL_Event *event) | 381 int SDL_WaitEvent (SDL_Event *event) |
379 { | 382 { |
380 while ( 1 ) { | 383 while ( 1 ) { |