#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT. Macros for b/w compatibility are available.
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index c24b9c5..5d0b920 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -42,8 +42,8 @@
p = &((PyFloatBlock *)p)->objects[0];
q = p + N_FLOATOBJECTS;
while (--q > p)
- Py_Type(q) = (struct _typeobject *)(q-1);
- Py_Type(q) = NULL;
+ Py_TYPE(q) = (struct _typeobject *)(q-1);
+ Py_TYPE(q) = NULL;
return p + N_FLOATOBJECTS - 1;
}
@@ -103,7 +103,7 @@
}
/* Inline PyObject_New */
op = free_list;
- free_list = (PyFloatObject *)Py_Type(op);
+ free_list = (PyFloatObject *)Py_TYPE(op);
PyObject_INIT(op, &PyFloat_Type);
op->ob_fval = fval;
return (PyObject *) op;
@@ -242,11 +242,11 @@
float_dealloc(PyFloatObject *op)
{
if (PyFloat_CheckExact(op)) {
- Py_Type(op) = (struct _typeobject *)free_list;
+ Py_TYPE(op) = (struct _typeobject *)free_list;
free_list = op;
}
else
- Py_Type(op)->tp_free((PyObject *)op);
+ Py_TYPE(op)->tp_free((PyObject *)op);
}
double
@@ -264,7 +264,7 @@
return -1;
}
- if ((nb = Py_Type(op)->tp_as_number) == NULL || nb->nb_float == NULL) {
+ if ((nb = Py_TYPE(op)->tp_as_number) == NULL || nb->nb_float == NULL) {
PyErr_SetString(PyExc_TypeError, "a float is required");
return -1;
}
@@ -1193,7 +1193,7 @@
if (!PyString_Check(arg)) {
PyErr_Format(PyExc_TypeError,
"__getformat__() argument must be string, not %.500s",
- Py_Type(arg)->tp_name);
+ Py_TYPE(arg)->tp_name);
return NULL;
}
s = PyString_AS_STRING(arg);
@@ -1476,7 +1476,7 @@
for (i = 0, p = &list->objects[0];
i < N_FLOATOBJECTS;
i++, p++) {
- if (PyFloat_CheckExact(p) && Py_Refcnt(p) != 0)
+ if (PyFloat_CheckExact(p) && Py_REFCNT(p) != 0)
frem++;
}
next = list->next;
@@ -1487,8 +1487,8 @@
i < N_FLOATOBJECTS;
i++, p++) {
if (!PyFloat_CheckExact(p) ||
- Py_Refcnt(p) == 0) {
- Py_Type(p) = (struct _typeobject *)
+ Py_REFCNT(p) == 0) {
+ Py_TYPE(p) = (struct _typeobject *)
free_list;
free_list = p;
}
@@ -1520,7 +1520,7 @@
i < N_FLOATOBJECTS;
i++, p++) {
if (PyFloat_CheckExact(p) &&
- Py_Refcnt(p) != 0) {
+ Py_REFCNT(p) != 0) {
char buf[100];
PyFloat_AsString(buf, p);
/* XXX(twouters) cast refcount to
@@ -1529,7 +1529,7 @@
*/
fprintf(stderr,
"# <float at %p, refcnt=%ld, val=%s>\n",
- p, (long)Py_Refcnt(p), buf);
+ p, (long)Py_REFCNT(p), buf);
}
}
list = list->next;