consistently use Py_TYPE, Py_REFCNT, and correct initializer macros (#3563)
This no-op change makes 2.7 more consistent with 3.x to ease comparison and backports.
diff --git a/Objects/intobject.c b/Objects/intobject.c
index 04e4d29..3ab00af 100644
--- a/Objects/intobject.c
+++ b/Objects/intobject.c
@@ -1486,7 +1486,7 @@
for (i = 0, p = &list->objects[0];
i < N_INTOBJECTS;
i++, p++) {
- if (PyInt_CheckExact(p) && p->ob_refcnt != 0)
+ if (PyInt_CheckExact(p) && Py_REFCNT(p) != 0)
u++;
}
next = list->next;
@@ -1497,7 +1497,7 @@
i < N_INTOBJECTS;
i++, p++) {
if (!PyInt_CheckExact(p) ||
- p->ob_refcnt == 0) {
+ Py_REFCNT(p) == 0) {
Py_TYPE(p) = (struct _typeobject *)
free_list;
free_list = p;
@@ -1560,14 +1560,14 @@
for (i = 0, p = &list->objects[0];
i < N_INTOBJECTS;
i++, p++) {
- if (PyInt_CheckExact(p) && p->ob_refcnt != 0)
+ if (PyInt_CheckExact(p) && Py_REFCNT(p) != 0)
/* XXX(twouters) cast refcount to
long until %zd is universally
available
*/
fprintf(stderr,
"# <int at %p, refcnt=%ld, val=%ld>\n",
- p, (long)p->ob_refcnt,
+ p, (long)Py_REFCNT(p),
p->ob_ival);
}
list = list->next;