Update of /cvsroot/pywin32/pywin32/com/win32com/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12983/win32com/src
Modified Files:
oleargs.cpp
Log Message:
Fix issue [ 1651025 ] Use the specified type for constant values
This makes constants in a typelib > sys.maxint to correctly be a long
Index: oleargs.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/oleargs.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** oleargs.cpp 21 Jun 2006 12:18:51 -0000 1.36
--- oleargs.cpp 7 Feb 2007 23:12:31 -0000 1.37
***************
*** 261,264 ****
--- 261,265 ----
case VT_UI2:
case VT_UI4:
+ case VT_UINT:
hr = VariantChangeType(&varValue, &varValue, 0, VT_UI4);
if ( FAILED(hr) )
***************
*** 271,275 ****
// The result may be too large for a simple "long". If so,
// we must return a long.
! if (V_UI4(&varValue) <= LONG_MAX)
result = PyInt_FromLong(V_UI4(&varValue));
else
--- 272,276 ----
// The result may be too large for a simple "long". If so,
// we must return a long.
! if (V_UI4(&varValue) <= (unsigned)PyInt_GetMax())
result = PyInt_FromLong(V_UI4(&varValue));
else
***************
*** 281,285 ****
case VT_I4:
case VT_INT:
- case VT_UINT:
hr = VariantChangeType(&varValue, &varValue, 0, VT_I4);
if ( FAILED(hr) )
--- 282,285 ----
|