summaryrefslogtreecommitdiffstats
path: root/Modules/gcmodule.c
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-07-11 14:37:41 (GMT)
committerFred Drake <fdrake@acm.org>2000-07-11 14:37:41 (GMT)
commitb35de5b78a3c4c72048cfd2d53834ff0010593d5 (patch)
tree9c44d831596d9704f40263ea6fcef78d8604907c /Modules/gcmodule.c
parent5f1b27084aacc2975b3f94e7b225215066f4e1e2 (diff)
downloadcpython-b35de5b78a3c4c72048cfd2d53834ff0010593d5.zip
cpython-b35de5b78a3c4c72048cfd2d53834ff0010593d5.tar.gz
cpython-b35de5b78a3c4c72048cfd2d53834ff0010593d5.tar.bz2
Neil Schemenauer <nascheme@enme.ucalgary.ca>:
Change a cast, intialize a local, and make some sprintf() format strings type-appropriate (add the "l" to "%d"). Closes SourceForge patch #100737.
Diffstat (limited to 'Modules/gcmodule.c')
-rw-r--r--Modules/gcmodule.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c
index 5ceea01..eb63e19 100644
--- a/Modules/gcmodule.c
+++ b/Modules/gcmodule.c
@@ -289,10 +289,10 @@ 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<%s 0x%x>\n",
+ sprintf(buf, "gc: %s<%.100s 0x%p>\n",
msg,
op->ob_type->tp_name,
- (long)op);
+ op);
PyFile_WriteString(buf, output);
}
}
@@ -368,7 +368,7 @@ collect(PyGC_Head *young, PyGC_Head *old)
char buf[100];
sprintf(buf, "gc: collecting generation %d...\n", generation);
PyFile_WriteString(buf,output);
- sprintf(buf, "gc: objects in each generation: %d %d %d\n",
+ sprintf(buf, "gc: objects in each generation: %ld %ld %ld\n",
gc_list_size(&generation0),
gc_list_size(&generation1),
gc_list_size(&generation2));
@@ -434,7 +434,7 @@ collect(PyGC_Head *young, PyGC_Head *old)
} else {
char buf[200];
sprintf(buf,
- "gc: done, %d unreachable, %d uncollectable.\n",
+ "gc: done, %ld unreachable, %ld uncollectable.\n",
n+m, n);
PyFile_WriteString(buf, output);
}