[pywin32-checkins] pywin32/com/win32com/src MiscTypes.cpp, 1.9, 1.10 PyRecord.cpp, 1.12, 1.13
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2008-12-03 22:34:26
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1177/com/win32com/src Modified Files: MiscTypes.cpp PyRecord.cpp Log Message: Many 'benign' changes from the py3k branch, mainly around using PYWIN_OBJECT_HEAD and whitespace related changes around the type defs. Index: PyRecord.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyRecord.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PyRecord.cpp 13 Nov 2008 04:04:51 -0000 1.12 --- PyRecord.cpp 3 Dec 2008 22:34:20 -0000 1.13 *************** *** 298,308 **** PyTypeObject PyRecord::Type = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "com_record", sizeof(PyRecord), 0, ! PyRecord::tp_dealloc, /* tp_dealloc */ ! 0, /* tp_print */ PyRecord::tp_getattr, /* tp_getattr */ PyRecord::tp_setattr, /* tp_setattr */ --- 298,307 ---- PyTypeObject PyRecord::Type = { ! PYWIN_OBJECT_HEAD "com_record", sizeof(PyRecord), 0, ! PyRecord::tp_dealloc, /* tp_dealloc */ ! 0, /* tp_print */ PyRecord::tp_getattr, /* tp_getattr */ PyRecord::tp_setattr, /* tp_setattr */ *************** *** 312,318 **** 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, 0, /* tp_call */ ! 0, /* tp_str */ }; --- 311,317 ---- 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ ! 0, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ }; *************** *** 420,424 **** ULONG i; PyRecord *pyrec = (PyRecord *)self; - ULONG num_names; PyObject *s = PyString_FromString("com_struct{"); --- 419,422 ---- *************** *** 453,457 **** PyObject *res; PyRecord *pyrec = (PyRecord *)self; - if (strcmp(name, "__members__")==0) { ULONG cnames = 0; --- 451,454 ---- *************** *** 467,486 **** return PyCom_BuildPyException(hr, pyrec->pri, g_IID_IRecordInfo); } ! PyObject *ret = PyList_New(cnames); ! for (ULONG i=0;i<cnames && ret != NULL;i++) { PyObject *item = PyString_FromUnicode(strs[i]); SysFreeString(strs[i]); if (item==NULL) { ! Py_DECREF(ret); ! ret = NULL; } else ! PyList_SET_ITEM(ret, i, item); // ref count swallowed. } free(strs); ! return ret; } res = Py_FindMethod(PyRecord_methods, self, name); if (res != NULL) return res; PyErr_Clear(); WCHAR *wname; --- 464,484 ---- return PyCom_BuildPyException(hr, pyrec->pri, g_IID_IRecordInfo); } ! res = PyList_New(cnames); ! for (ULONG i=0;i<cnames && res != NULL;i++) { PyObject *item = PyString_FromUnicode(strs[i]); SysFreeString(strs[i]); if (item==NULL) { ! Py_DECREF(res); ! res = NULL; } else ! PyList_SET_ITEM(res, i, item); // ref count swallowed. } free(strs); ! return res; } res = Py_FindMethod(PyRecord_methods, self, name); if (res != NULL) return res; + PyErr_Clear(); WCHAR *wname; Index: MiscTypes.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/MiscTypes.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MiscTypes.cpp 2 Nov 2008 12:42:58 -0000 1.9 --- MiscTypes.cpp 3 Dec 2008 22:34:20 -0000 1.10 *************** *** 11,16 **** // ### an object). static PyTypeObject PyInterfaceType_Type = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, /* Number of items for varobject */ "interface-type", /* Name of this type */ sizeof(PyTypeObject), /* Basic object size */ --- 11,15 ---- // ### an object). static PyTypeObject PyInterfaceType_Type = { ! PYWIN_OBJECT_HEAD "interface-type", /* Name of this type */ sizeof(PyTypeObject), /* Basic object size */ *************** *** 38,42 **** { // originally, this copied the typeobject of the parent, but as it is impossible ! // to gurantee order of static object construction, I went this way. This is // probably better, as is forces _all_ python objects have the same type sig. static const PyTypeObject type_template = { --- 37,41 ---- { // originally, this copied the typeobject of the parent, but as it is impossible ! // to guarantee order of static object construction, I went this way. This is // probably better, as is forces _all_ python objects have the same type sig. static const PyTypeObject type_template = { *************** *** 53,57 **** (destructor) PyIBase::dealloc, /*tp_dealloc*/ 0, /*tp_print*/ ! 0, /*tp_getattr*/ (setattrfunc) PyIBase::setattr, /*tp_setattr*/ PyIBase::cmp, /*tp_compare*/ --- 52,56 ---- (destructor) PyIBase::dealloc, /*tp_dealloc*/ 0, /*tp_print*/ ! 0, /*tp_getattr*/ (setattrfunc) PyIBase::setattr, /*tp_setattr*/ PyIBase::cmp, /*tp_compare*/ *************** *** 63,70 **** 0, /*tp_call*/ 0, /*tp_str*/ ! PyIBase::getattro, /* tp_getattro */ 0, /*tp_setattro */ 0, /* tp_as_buffer */ ! 0, /* tp_flags */ 0, /* tp_doc */ 0, /* tp_traverse */ --- 62,69 ---- 0, /*tp_call*/ 0, /*tp_str*/ ! PyIBase::getattro, /* tp_getattro */ 0, /*tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT, /* tp_flags */ 0, /* tp_doc */ 0, /* tp_traverse */ *************** *** 96,99 **** --- 95,99 ---- tp_basicsize = typeSize; } + PyComTypeObject::~PyComTypeObject() { *************** *** 217,222 **** PyTypeObject PyOleEmptyType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyOleEmpty", sizeof(PyOleEmpty), --- 217,221 ---- PyTypeObject PyOleEmptyType = { ! PYWIN_OBJECT_HEAD "PyOleEmpty", sizeof(PyOleEmpty), *************** *** 248,253 **** PYCOM_EXPORT PyTypeObject PyOleMissingType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "PyOleMissing", sizeof(PyOleMissing), --- 247,251 ---- PYCOM_EXPORT PyTypeObject PyOleMissingType = { ! PYWIN_OBJECT_HEAD "PyOleMissing", sizeof(PyOleMissing), *************** *** 278,283 **** PyTypeObject PyOleArgNotFoundType = { ! PyObject_HEAD_INIT(&PyType_Type) ! 0, "ArgNotFound", sizeof(PyOleArgNotFound), --- 276,280 ---- PyTypeObject PyOleArgNotFoundType = { ! PYWIN_OBJECT_HEAD "ArgNotFound", sizeof(PyOleArgNotFound), |