Update of /cvsroot/pywin32/pywin32/com/win32com/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23340/com/win32com/src
Modified Files:
oleargs.cpp
Log Message:
Another pass at getting things working on x64. This change incorporates
most of Sidnei's work on the AMD64 branch, and updates most of the other
win32 and win32com modules that haven't already had 64bit love from Roger
(thanks guys!). Note this is not complete - among the outstanding issues
are fixing 's#' format strings (but most of the tests *do* pass on x64,
and the ones which don't fail for 'vista environment' reasons rather
than x64 reasons)
Index: oleargs.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/oleargs.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** oleargs.cpp 7 Feb 2007 23:12:31 -0000 1.37
--- oleargs.cpp 24 May 2007 06:01:04 -0000 1.38
***************
*** 398,407 ****
if (dimNo==nDims && vt==VT_UI1 && obj->ob_type->tp_as_buffer) {
PyBufferProcs *pb = obj->ob_type->tp_as_buffer;
! int bufSize;
if (pb->bf_getreadbuffer &&
pb->bf_getsegcount &&
(*pb->bf_getsegcount)(obj, &bufSize)==1)
{
! if (bufSize != numElements) {
OleSetTypeError("Internal error - the buffer length is not the sequence length!");
return FALSE;
--- 398,407 ----
if (dimNo==nDims && vt==VT_UI1 && obj->ob_type->tp_as_buffer) {
PyBufferProcs *pb = obj->ob_type->tp_as_buffer;
! Py_ssize_t bufSize;
if (pb->bf_getreadbuffer &&
pb->bf_getsegcount &&
(*pb->bf_getsegcount)(obj, &bufSize)==1)
{
! if (PyWin_SAFE_DOWNCAST(bufSize, Py_ssize_t, LONG) != numElements) {
OleSetTypeError("Internal error - the buffer length is not the sequence length!");
return FALSE;
***************
*** 492,499 ****
PyObject* ppyobDimensionSize;
PyObject* ppyobItem;
! long lIndex;
long lMinimalDimension = -1;
long lActualDimension = -1;
! long lObjectSize;
if (PyBuffer_Check(obItemCheck))
--- 492,499 ----
PyObject* ppyobDimensionSize;
PyObject* ppyobItem;
! Py_ssize_t lIndex;
long lMinimalDimension = -1;
long lActualDimension = -1;
! Py_ssize_t lObjectSize;
if (PyBuffer_Check(obItemCheck))
***************
*** 509,513 ****
}
if (lObjectSize != -1) { // A real sequence of size zero should be OK though.
! ppyobSize = PyInt_FromLong(lObjectSize);
// Retrieve the stored size in this dimension
--- 509,513 ----
}
if (lObjectSize != -1) { // A real sequence of size zero should be OK though.
! ppyobSize = PyInt_FromSsize_t(lObjectSize);
// Retrieve the stored size in this dimension
***************
*** 521,525 ****
} else {
// Check if stored size in this dimension equals the size of the element to check
! long lStoredSize = PyInt_AsLong(ppyobDimensionSize);
if (lStoredSize != lObjectSize)
{
--- 521,525 ----
} else {
// Check if stored size in this dimension equals the size of the element to check
! Py_ssize_t lStoredSize = PyInt_AsSsize_t(ppyobDimensionSize);
if (lStoredSize != lObjectSize)
{
|