changeset 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 b1cae30740a2
children d47637068e52
files src/events/SDL_events.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/events/SDL_events.c	Sun Apr 14 22:17:50 2002 +0000
+++ b/src/events/SDL_events.c	Mon Apr 15 04:51:26 2002 +0000
@@ -372,7 +372,10 @@
 {
 	SDL_PumpEvents();
 
-	return(SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS));
+	/* We can't return -1, just return 0 (no event) on error */
+	if ( SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS) <= 0 )
+		return 0;
+	return 1;
 }
 
 int SDL_WaitEvent (SDL_Event *event)