Mercurial > cpython-lru_cache-weakref
diff Objects/floatobject.c @ 44351:86a2679dca46
#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Wed, 19 Dec 2007 02:45:37 +0000 |
| parents | 4dc01402d78a |
| children | 1154158a199f |
line wrap: on
line diff
--- a/Objects/floatobject.c Wed Dec 19 02:07:34 2007 +0000 +++ b/Objects/floatobject.c Wed Dec 19 02:45:37 2007 +0000 @@ -44,8 +44,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; } @@ -105,7 +105,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; @@ -221,11 +221,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 @@ -243,7 +243,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; } @@ -1088,7 +1088,7 @@ if (!PyUnicode_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 = PyUnicode_AsString(arg); @@ -1412,7 +1412,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; @@ -1423,8 +1423,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; } @@ -1456,7 +1456,7 @@ i < N_FLOATOBJECTS; i++, p++) { if (PyFloat_CheckExact(p) && - Py_Refcnt(p) != 0) { + Py_REFCNT(p) != 0) { char buf[100]; format_float(buf, sizeof(buf), p, PREC_STR); /* XXX(twouters) cast refcount to @@ -1465,7 +1465,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;
