From: Tobias Leich Date: Wed, 4 Nov 2009 17:24:09 +0000 (+0100) Subject: checking for corrent 'action' in peep_events() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=20cb1c1ba60b30f412fa1855eeb63aed4d34b05a;p=sdlgit%2FSDL_perl.git checking for corrent 'action' in peep_events() --- diff --git a/src/Core/Events.xs b/src/Core/Events.xs index 8a5d6b3..1e63a6e 100644 --- a/src/Core/Events.xs +++ b/src/Core/Events.xs @@ -33,14 +33,11 @@ events_peep_events( events, numevents, action, mask ) int action Uint32 mask CODE: - //if(action & (SDL_ADDEVENT | SDL_PEEKEVENT | SDL_GETEVENT)) - //{ - RETVAL = SDL_PeepEvents(events,numevents,action,mask); - /*} - else + if(!(action & (SDL_ADDEVENT | SDL_PEEKEVENT | SDL_GETEVENT))) { - RETVAL = -1; - }*/ + croak('Value of \'action\' should be SDL_ADDEVENT, SDL_PEEKEVENT or SDL_GETEVENT.'); + } + RETVAL = SDL_PeepEvents(events,numevents,action,mask); OUTPUT: RETVAL