summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2006-04-11 19:12:33 (GMT)
committerTim Peters <tim.peters@gmail.com>2006-04-11 19:12:33 (GMT)
commitcbd6f1896d3f5c960f1e93ea98b005a4778c2d07 (patch)
tree8f841e61f755a5ab1f06db66ea2dd32672e814b3 /Objects
parent075e0231f16ea37e5fdaa3438cd583f12938eca8 (diff)
downloadcpython-cbd6f1896d3f5c960f1e93ea98b005a4778c2d07.zip
cpython-cbd6f1896d3f5c960f1e93ea98b005a4778c2d07.tar.gz
cpython-cbd6f1896d3f5c960f1e93ea98b005a4778c2d07.tar.bz2
_Py_PrintReferenceAddresses,_Py_PrintReferences:
interpolate PY_FORMAT_SIZE_T for refcount display instead of casting refcounts to long. I understand that gcc on some boxes delivers nuisance warnings about this, but if any new ones appear because of this they'll get fixed by magic when the others get fixed.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/Objects/object.c b/Objects/object.c
index e73dad5..e15218f 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1900,9 +1900,7 @@ _Py_PrintReferences(FILE *fp)
PyObject *op;
fprintf(fp, "Remaining objects:\n");
for (op = refchain._ob_next; op != &refchain; op = op->_ob_next) {
- /* XXX(twouters) cast refcount to long until %zd is
- universally available */
- fprintf(fp, "%p [%ld] ", op, (long)op->ob_refcnt);
+ fprintf(fp, "%p [%" PY_FORMAT_SIZE_T "d] ", op, op->ob_refcnt);
if (PyObject_Print(op, fp, 0) != 0)
PyErr_Clear();
putc('\n', fp);
@@ -1918,10 +1916,8 @@ _Py_PrintReferenceAddresses(FILE *fp)
PyObject *op;
fprintf(fp, "Remaining object addresses:\n");
for (op = refchain._ob_next; op != &refchain; op = op->_ob_next)
- /* XXX(twouters) cast refcount to long until %zd is
- universally available */
- fprintf(fp, "%p [%ld] %s\n", op, (long)op->ob_refcnt,
- op->ob_type->tp_name);
+ fprintf(fp, "%p [%" PY_FORMAT_SIZE_T "d] %s\n", op,
+ op->ob_refcnt, op->ob_type->tp_name);
}
PyObject *