From: Diederick Niehorster Date: Thu, 4 Apr 2013 10:20:43 +0000 (+0000) Subject: and with 0xFF to indicate to runtime that we want to strip out higher bits - otherwis... X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=80d83eb7ea1ae8d0907ec6deb5bb0de59580e707;p=freeglut and with 0xFF to indicate to runtime that we want to strip out higher bits - otherwise we get a runtime error when "Smaller Type Checks" is enabled Thanks Jason Wilkins! git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1584 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/src/mswin/fg_main_mswin.c b/src/mswin/fg_main_mswin.c index ad80055..6100ae1 100644 --- a/src/mswin/fg_main_mswin.c +++ b/src/mswin/fg_main_mswin.c @@ -296,7 +296,7 @@ static LRESULT fghWindowProcKeyPress(SFG_Window *window, UINT uMsg, GLboolean ke wParam=code[ 0 ]; INVOKE_WCB( *window, KeyboardUp, - ( (char)wParam, + ( (char)(wParam & 0xFF), /* and with 0xFF to indicate to runtime that we want to strip out higher bits - otherwise we get a runtime error when "Smaller Type Checks" is enabled */ window->State.MouseX, window->State.MouseY ) ); }