[pywin32-checkins] pywin32/win32/src PyWinTypes.h, 1.70, 1.71 PyWinObjects.h, 1.22, 1.23 PyTime.cpp
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2010-11-16 04:46:00
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11016 Modified Files: PyWinTypes.h PyWinObjects.h PyTime.cpp PyOVERLAPPED.cpp PyIID.cpp PyHANDLE.cpp Log Message: work with Py_hash_t introduced in py3.2 Index: PyWinObjects.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinObjects.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** PyWinObjects.h 15 Feb 2009 00:43:10 -0000 1.22 --- PyWinObjects.h 16 Nov 2010 04:45:52 -0000 1.23 *************** *** 19,23 **** /* Python support */ PyObject *richcompare(PyObject *other, int op); ! long hash(void); PyObject *str(void); PyObject *repr(void); --- 19,23 ---- /* Python support */ PyObject *richcompare(PyObject *other, int op); ! Py_hash_t hash(void); PyObject *str(void); PyObject *repr(void); *************** *** 26,30 **** static int printFunc(PyObject *ob, FILE *fp, int flags); static PyObject *richcompareFunc(PyObject *self, PyObject *other, int op); ! static long hashFunc(PyObject *ob); static PyObject * strFunc(PyObject *ob); static PyObject * reprFunc(PyObject *ob); --- 26,30 ---- static int printFunc(PyObject *ob, FILE *fp, int flags); static PyObject *richcompareFunc(PyObject *self, PyObject *other, int op); ! static Py_hash_t hashFunc(PyObject *ob); static PyObject * strFunc(PyObject *ob); static PyObject * reprFunc(PyObject *ob); *************** *** 56,60 **** int print(FILE *fp, int flags); ! long hash(void); //PyObject *str(void); long asLong(void); --- 56,60 ---- int print(FILE *fp, int flags); ! Py_hash_t hash(void); //PyObject *str(void); long asLong(void); *************** *** 68,72 **** static int compareFunc(PyObject *ob1, PyObject *ob2); static PyObject *richcompareFunc(PyObject *self, PyObject *other, int op); ! static long hashFunc(PyObject *ob); //static PyObject * strFunc(PyObject *ob); static int nonzeroFunc(PyObject *ob); --- 68,72 ---- static int compareFunc(PyObject *ob1, PyObject *ob2); static PyObject *richcompareFunc(PyObject *self, PyObject *other, int op); ! static Py_hash_t hashFunc(PyObject *ob); //static PyObject * strFunc(PyObject *ob); static int nonzeroFunc(PyObject *ob); *************** *** 108,112 **** static PyObject *getattro(PyObject *self, PyObject *obname); static int setattro(PyObject *self, PyObject *obname, PyObject *v); ! static long hashFunc(PyObject *self); static struct PYWINTYPES_EXPORT PyMemberDef members[]; --- 108,112 ---- static PyObject *getattro(PyObject *self, PyObject *obname); static int setattro(PyObject *self, PyObject *obname, PyObject *v); ! static Py_hash_t hashFunc(PyObject *self); static struct PYWINTYPES_EXPORT PyMemberDef members[]; *************** *** 139,143 **** int print(FILE *fp, int flags); PyObject *asStr(void); ! long hash(void); static void deallocFunc(PyObject *ob); --- 139,143 ---- int print(FILE *fp, int flags); PyObject *asStr(void); ! Py_hash_t hash(void); static void deallocFunc(PyObject *ob); *************** *** 145,149 **** static PyObject *richcompareFunc(PyObject *ob, PyObject *other, int op); static int nonzeroFunc(PyObject *ob); ! static long hashFunc(PyObject *ob); static PyObject * strFunc(PyObject *ob); --- 145,149 ---- static PyObject *richcompareFunc(PyObject *ob, PyObject *other, int op); static int nonzeroFunc(PyObject *ob); ! static Py_hash_t hashFunc(PyObject *ob); static PyObject * strFunc(PyObject *ob); Index: PyIID.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyIID.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PyIID.cpp 4 Feb 2009 04:07:54 -0000 1.12 --- PyIID.cpp 16 Nov 2010 04:45:52 -0000 1.13 *************** *** 250,254 **** } ! long PyIID::hash(void) { DWORD n[4]; --- 250,254 ---- } ! Py_hash_t PyIID::hash(void) { DWORD n[4]; *************** *** 287,291 **** // @pymethod int|PyIID|__hash__|Used when the hash value of an IID object is required ! long PyIID::hashFunc(PyObject *ob) { return ((PyIID *)ob)->hash(); --- 287,291 ---- // @pymethod int|PyIID|__hash__|Used when the hash value of an IID object is required ! Py_hash_t PyIID::hashFunc(PyObject *ob) { return ((PyIID *)ob)->hash(); Index: PyHANDLE.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyHANDLE.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** PyHANDLE.cpp 4 Feb 2009 11:27:05 -0000 1.22 --- PyHANDLE.cpp 16 Nov 2010 04:45:52 -0000 1.23 *************** *** 323,327 **** // @pymethod int|PyHANDLE|__hash__|Used when the hash value of a HANDLE object is required ! long PyHANDLE::hashFunc(PyObject *ob) { return ((PyHANDLE *)ob)->hash(); --- 323,327 ---- // @pymethod int|PyHANDLE|__hash__|Used when the hash value of a HANDLE object is required ! Py_hash_t PyHANDLE::hashFunc(PyObject *ob) { return ((PyHANDLE *)ob)->hash(); *************** *** 329,333 **** ! long PyHANDLE::hash(void) { // Just use the address. --- 329,333 ---- ! Py_hash_t PyHANDLE::hash(void) { // Just use the address. Index: PyOVERLAPPED.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyOVERLAPPED.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PyOVERLAPPED.cpp 15 Feb 2009 00:43:10 -0000 1.17 --- PyOVERLAPPED.cpp 16 Nov 2010 04:45:52 -0000 1.18 *************** *** 236,240 **** } ! /*static*/ long PyOVERLAPPED::hashFunc(PyObject *ob) { // Just use the address. --- 236,240 ---- } ! /*static*/ Py_hash_t PyOVERLAPPED::hashFunc(PyObject *ob) { // Just use the address. Index: PyWinTypes.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** PyWinTypes.h 15 Feb 2009 01:07:56 -0000 1.70 --- PyWinTypes.h 16 Nov 2010 04:45:52 -0000 1.71 *************** *** 166,169 **** --- 166,177 ---- #endif + // Py_hash_t was introduced as the size of a pointer in python 3.2 - it + // was a simple long before that. + #if PY_VERSION_HEX < 0x03020000 + typedef long Py_hash_t; + #else + typedef Py_ssize_t Py_hash_t; + #endif + #if PY_VERSION_HEX < 0x02030000 #define PyLong_AsUnsignedLongMask PyLong_AsUnsignedLong Index: PyTime.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyTime.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** PyTime.cpp 17 Mar 2009 04:32:48 -0000 1.29 --- PyTime.cpp 16 Nov 2010 04:45:52 -0000 1.30 *************** *** 470,477 **** } ! long PyTime::hash(void) { /* arbitrarily use seconds as the hash value */ ! return (long)(m_time * SECS_PER_DAY); } --- 470,477 ---- } ! Py_hash_t PyTime::hash(void) { /* arbitrarily use seconds as the hash value */ ! return (Py_hash_t)(m_time * SECS_PER_DAY); } *************** *** 637,641 **** // @pymethod int|PyTime|__hash__|Used when the hash value of an time object is required ! long PyTime::hashFunc(PyObject *ob) { return ((PyTime *)ob)->hash(); --- 637,641 ---- // @pymethod int|PyTime|__hash__|Used when the hash value of an time object is required ! Py_hash_t PyTime::hashFunc(PyObject *ob) { return ((PyTime *)ob)->hash(); |