diff options
author | Tim Peters <tim.peters@gmail.com> | 2006-03-28 21:44:32 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2006-03-28 21:44:32 (GMT) |
commit | 62e97f023bf0c02f5f3c1a1552e8136c0b5c4cff (patch) | |
tree | 0c71da41d08f4e8c9922a049357b5cd76ee1ecbc /Modules | |
parent | efb6e752cfd4e5ea64bdfcdd3fb68d5951c13218 (diff) | |
download | cpython-62e97f023bf0c02f5f3c1a1552e8136c0b5c4cff.zip cpython-62e97f023bf0c02f5f3c1a1552e8136c0b5c4cff.tar.gz cpython-62e97f023bf0c02f5f3c1a1552e8136c0b5c4cff.tar.bz2 |
In format strings slinging Py_ssize_t, unconditionally
interpolate PY_FORMAT_SIZE_T instead of #if'ing on
MS_WIN64.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/gcmodule.c | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 3d49f6c..206d34a 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -413,7 +413,7 @@ has_finalizer(PyObject *op) assert(delstr != NULL); return _PyInstance_Lookup(op, delstr) != NULL; } - else + else return op->ob_type->tp_del != NULL; } @@ -741,15 +741,9 @@ collect(int generation) PySys_WriteStderr("gc: collecting generation %d...\n", generation); PySys_WriteStderr("gc: objects in each generation:"); - for (i = 0; i < NUM_GENERATIONS; i++) { -#ifdef MS_WIN64 - PySys_WriteStderr(" %Id", gc_list_size(GEN_HEAD(i))); -#else - PySys_WriteStderr(" %ld", - Py_SAFE_DOWNCAST(gc_list_size(GEN_HEAD(i)), - Py_ssize_t, long)); -#endif - } + for (i = 0; i < NUM_GENERATIONS; i++) + PySys_WriteStderr(" %" PY_FORMAT_SIZE_T "d", + gc_list_size(GEN_HEAD(i))); PySys_WriteStderr("\n"); } @@ -837,21 +831,14 @@ collect(int generation) debug_cycle("uncollectable", FROM_GC(gc)); } if (debug & DEBUG_STATS) { - if (m == 0 && n == 0) { + if (m == 0 && n == 0) PySys_WriteStderr("gc: done.\n"); - } - else { -#ifdef MS_WIN64 + else PySys_WriteStderr( - "gc: done, %Id unreachable, %Id uncollectable.\n", + "gc: done, " + "%" PY_FORMAT_SIZE_T "d unreachable, " + "%" PY_FORMAT_SIZE_T "d uncollectable.\n", n+m, n); -#else - PySys_WriteStderr( - "gc: done, %ld unreachable, %ld uncollectable.\n", - Py_SAFE_DOWNCAST(n+m, Py_ssize_t, long), - Py_SAFE_DOWNCAST(n, Py_ssize_t, long)); -#endif - } } /* Append instances in the uncollectable set to a Python |