Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2147
Modified Files:
PyWinTypes.h PyWinTypesmodule.cpp
Log Message:
Let PyWinLong_FromVoidPtr take a const pointer.
Index: PyWinTypesmodule.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypesmodule.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** PyWinTypesmodule.cpp 27 May 2007 17:32:14 -0000 1.29
--- PyWinTypesmodule.cpp 3 Jun 2007 12:32:09 -0000 1.30
***************
*** 557,561 ****
}
! PyObject *PyWinLong_FromVoidPtr(void *ptr)
{
#ifdef _WIN64
--- 557,561 ----
}
! PyObject *PyWinLong_FromVoidPtr(const void *ptr)
{
#ifdef _WIN64
Index: PyWinTypes.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** PyWinTypes.h 29 May 2007 12:28:45 -0000 1.42
--- PyWinTypes.h 3 Jun 2007 12:32:09 -0000 1.43
***************
*** 188,191 ****
--- 188,198 ----
PYWINTYPES_EXPORT BOOL PyWinObject_AsWriteBuffer(PyObject *ob, void **buf, DWORD *buf_len, BOOL bNoneOk=FALSE);
+ // an 'int' version (but aren't 'int' and 'DWORD' the same size?
+ // Maybe a signed-ness issue?
+ inline BOOL PyWinObject_AsReadBuffer(PyObject *ob, void **buf, int *buf_len, BOOL bNoneOk=FALSE)
+ {
+ return PyWinObject_AsReadBuffer(ob, buf, (DWORD *)buf_len, bNoneOk);
+ }
+
/* ANSI/Unicode Support */
/* If UNICODE defined, will be a BSTR - otherwise a char *
***************
*** 240,244 ****
// Substitute for Python's inconsistent PyLong_AsVoidPtr
PYWINTYPES_EXPORT BOOL PyWinLong_AsVoidPtr(PyObject *ob, void **pptr);
! PYWINTYPES_EXPORT PyObject *PyWinLong_FromVoidPtr(void *ptr);
/*
--- 247,251 ----
// Substitute for Python's inconsistent PyLong_AsVoidPtr
PYWINTYPES_EXPORT BOOL PyWinLong_AsVoidPtr(PyObject *ob, void **pptr);
! PYWINTYPES_EXPORT PyObject *PyWinLong_FromVoidPtr(const void *ptr);
/*
|