From: Willem J. P. <wjp...@us...> - 2006-11-28 22:29:22
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/GUIScript In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv9872/plugins/GUIScript Modified Files: GUIScript.cpp Log Message: More 64-bit fixes: Get values in GemRB_GetVar as signed integers because sometimes variables are set to -1. even though ieDword is unsigned. Index: GUIScript.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp,v retrieving revision 1.420 retrieving revision 1.421 diff -C2 -d -r1.420 -r1.421 *** GUIScript.cpp 25 Nov 2006 16:53:46 -0000 1.420 --- GUIScript.cpp 28 Nov 2006 22:29:18 -0000 1.421 *************** *** 3048,3055 **** if (!core->GetDictionary()->Lookup( Variable, value )) { ! return PyInt_FromLong( ( unsigned long ) 0 ); } ! return PyInt_FromLong( (unsigned long) value ); } --- 3048,3058 ---- if (!core->GetDictionary()->Lookup( Variable, value )) { ! return PyInt_FromLong( 0 ); } ! // A PyInt is internally (probably) a long. Since we sometimes set ! // variables to -1, cast value to a signed integer first, so it is ! // sign-extended into a long if long is larger than int. ! return PyInt_FromLong( (int)value ); } |