[Python-checkins] r42531 - in python/trunk: Include/object.h Objects/typeobject.c
georg.brandl
python-checkins at python.org
Mon Feb 20 23:27:29 CET 2006
Author: georg.brandl
Date: Mon Feb 20 23:27:28 2006
New Revision: 42531
Modified:
python/trunk/Include/object.h
python/trunk/Objects/typeobject.c
Log:
Bug #1086854: Rename PyHeapType members adding ht_ prefix.
Modified: python/trunk/Include/object.h
==============================================================================
--- python/trunk/Include/object.h (original)
+++ python/trunk/Include/object.h Mon Feb 20 23:27:28 2006
@@ -345,7 +345,7 @@
typedef struct _heaptypeobject {
/* Note: there's a dependency on the order of these members
in slotptr() in typeobject.c . */
- PyTypeObject type;
+ PyTypeObject ht_type;
PyNumberMethods as_number;
PyMappingMethods as_mapping;
PySequenceMethods as_sequence; /* as_sequence comes after as_mapping,
@@ -354,13 +354,13 @@
a given operator (e.g. __getitem__).
see add_operators() in typeobject.c . */
PyBufferProcs as_buffer;
- PyObject *name, *slots;
+ PyObject *ht_name, *ht_slots;
/* here are optional user slots, followed by the members. */
} PyHeapTypeObject;
/* access macro to the members which are floating "behind" the object */
#define PyHeapType_GET_MEMBERS(etype) \
- ((PyMemberDef *)(((char *)etype) + (etype)->type.ob_type->tp_basicsize))
+ ((PyMemberDef *)(((char *)etype) + (etype)->ht_type.ob_type->tp_basicsize))
/* Generic type check */
Modified: python/trunk/Objects/typeobject.c
==============================================================================
--- python/trunk/Objects/typeobject.c (original)
+++ python/trunk/Objects/typeobject.c Mon Feb 20 23:27:28 2006
@@ -26,8 +26,8 @@
if (type->tp_flags & Py_TPFLAGS_HEAPTYPE) {
PyHeapTypeObject* et = (PyHeapTypeObject*)type;
- Py_INCREF(et->name);
- return et->name;
+ Py_INCREF(et->ht_name);
+ return et->ht_name;
}
else {
s = strrchr(type->tp_name, '.');
@@ -71,8 +71,8 @@
Py_INCREF(value);
- Py_DECREF(et->name);
- et->name = value;
+ Py_DECREF(et->ht_name);
+ et->ht_name = value;
type->tp_name = PyString_AS_STRING(value);
@@ -1838,8 +1838,8 @@
/* Keep name and slots alive in the extended type object */
et = (PyHeapTypeObject *)type;
Py_INCREF(name);
- et->name = name;
- et->slots = slots;
+ et->ht_name = name;
+ et->ht_slots = slots;
/* Initialize tp_flags */
type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HEAPTYPE |
@@ -2147,8 +2147,8 @@
* of most other objects. It's okay to cast it to char *.
*/
PyObject_Free((char *)type->tp_doc);
- Py_XDECREF(et->name);
- Py_XDECREF(et->slots);
+ Py_XDECREF(et->ht_name);
+ Py_XDECREF(et->ht_slots);
type->ob_type->tp_free((PyObject *)type);
}
@@ -2215,7 +2215,7 @@
VISIT(type->tp_base);
/* There's no need to visit type->tp_subclasses or
- ((PyHeapTypeObject *)type)->slots, because they can't be involved
+ ((PyHeapTypeObject *)type)->ht_slots, because they can't be involved
in cycles; tp_subclasses is a list of weak references,
and slots is a tuple of strings. */
More information about the Python-checkins
mailing list