]> granicus.if.org Git - python/commitdiff
debug_instance(): Use the same %p format directive as with
authorBarry Warsaw <barry@python.org>
Wed, 12 Jul 2000 05:18:36 +0000 (05:18 +0000)
committerBarry Warsaw <barry@python.org>
Wed, 12 Jul 2000 05:18:36 +0000 (05:18 +0000)
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).

Modules/gcmodule.c

index 4d55a08e88d17b445b2c7bc64cc8115df27f75da..60b4fe7f14abf0e69206b9c69a18644925df563d 100644 (file)
@@ -277,8 +277,7 @@ debug_instance(PyObject *output, char *msg, PyInstanceObject *inst)
                cname = PyString_AsString(classname);
        else
                cname = "?";
-       sprintf(buf, "gc: %s<%.100s instance at %lx>\n", 
-                       msg, cname, (long)inst);
+       sprintf(buf, "gc: %s<%.100s instance at %p>\n", msg, cname, inst);
        PyFile_WriteString(buf, output);
 }
 
@@ -289,10 +288,8 @@ debug_cycle(PyObject *output, char *msg, PyObject *op)
                debug_instance(output, msg, (PyInstanceObject *)op);
        } else if (debug & DEBUG_OBJECTS) {
                char buf[200];
-               sprintf(buf, "gc: %s<%.100s 0x%p>\n",
-                               msg,
-                               op->ob_type->tp_name,
-                               op);
+               sprintf(buf, "gc: %s<%.100s %p>\n", msg,
+                       op->ob_type->tp_name, op);
                PyFile_WriteString(buf, output);
        }
 }