Commit 03a873a7 authored by Barry Warsaw's avatar Barry Warsaw

debug_instance(): Use the same %p format directive as with

debug_cycle(), and don't cast the pointer to a long.  Neither needs
the literal `0x' prefix as %p automatically inserts this (on Linux at
least).
parent c1316c92
...@@ -277,8 +277,7 @@ debug_instance(PyObject *output, char *msg, PyInstanceObject *inst) ...@@ -277,8 +277,7 @@ debug_instance(PyObject *output, char *msg, PyInstanceObject *inst)
cname = PyString_AsString(classname); cname = PyString_AsString(classname);
else else
cname = "?"; cname = "?";
sprintf(buf, "gc: %s<%.100s instance at %lx>\n", sprintf(buf, "gc: %s<%.100s instance at %p>\n", msg, cname, inst);
msg, cname, (long)inst);
PyFile_WriteString(buf, output); PyFile_WriteString(buf, output);
} }
...@@ -289,10 +288,8 @@ debug_cycle(PyObject *output, char *msg, PyObject *op) ...@@ -289,10 +288,8 @@ debug_cycle(PyObject *output, char *msg, PyObject *op)
debug_instance(output, msg, (PyInstanceObject *)op); debug_instance(output, msg, (PyInstanceObject *)op);
} else if (debug & DEBUG_OBJECTS) { } else if (debug & DEBUG_OBJECTS) {
char buf[200]; char buf[200];
sprintf(buf, "gc: %s<%.100s 0x%p>\n", sprintf(buf, "gc: %s<%.100s %p>\n", msg,
msg, op->ob_type->tp_name, op);
op->ob_type->tp_name,
op);
PyFile_WriteString(buf, output); PyFile_WriteString(buf, output);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment