Fixed SDL_PollEvent() so it only returns a boolean value (not -1)
authorSam Lantinga <slouken@libsdl.org>
Mon, 15 Apr 2002 04:51:26 +0000
changeset 352b49fc922e7f6
parent 351 b1cae30740a2
child 353 d47637068e52
Fixed SDL_PollEvent() so it only returns a boolean value (not -1)
src/events/SDL_events.c
     1.1 --- a/src/events/SDL_events.c	Sun Apr 14 22:17:50 2002 +0000
     1.2 +++ b/src/events/SDL_events.c	Mon Apr 15 04:51:26 2002 +0000
     1.3 @@ -372,7 +372,10 @@
     1.4  {
     1.5  	SDL_PumpEvents();
     1.6  
     1.7 -	return(SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS));
     1.8 +	/* We can't return -1, just return 0 (no event) on error */
     1.9 +	if ( SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS) <= 0 )
    1.10 +		return 0;
    1.11 +	return 1;
    1.12  }
    1.13  
    1.14  int SDL_WaitEvent (SDL_Event *event)