Mercurial > cpython-lru_cache-weakref
diff Python/pythonrun.c @ 37290:89142cadcfb9 legacy-trunk
In format strings slinging Py_ssize_t, unconditionally
interpolate PY_FORMAT_SIZE_T instead of #if'ing on
MS_WIN64.
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Tue, 28 Mar 2006 21:44:32 +0000 |
| parents | 6e1a899cac8e |
| children | 57b1ff138995 |
line wrap: on
line diff
--- a/Python/pythonrun.c Tue Mar 28 20:30:45 2006 +0000 +++ b/Python/pythonrun.c Tue Mar 28 21:44:32 2006 +0000 @@ -30,14 +30,11 @@ #endif #ifndef Py_REF_DEBUG -# define PRINT_TOTAL_REFS() +#define PRINT_TOTAL_REFS() #else /* Py_REF_DEBUG */ -# if defined(MS_WIN64) -# define PRINT_TOTAL_REFS() fprintf(stderr, "[%Id refs]\n", _Py_RefTotal); -# else /* ! MS_WIN64 */ -# define PRINT_TOTAL_REFS() fprintf(stderr, "[%ld refs]\n", \ - Py_SAFE_DOWNCAST(_Py_RefTotal, Py_ssize_t, long)); -# endif /* MS_WIN64 */ +#define PRINT_TOTAL_REFS() fprintf(stderr, \ + "[%" PY_FORMAT_SIZE_T "d refs]\n", \ + _Py_RefTotal) #endif extern char *Py_GetPath(void); @@ -393,7 +390,7 @@ dump_counts(); #endif - PRINT_TOTAL_REFS() + PRINT_TOTAL_REFS(); #ifdef Py_TRACE_REFS /* Display all objects still alive -- this can invoke arbitrary @@ -683,7 +680,7 @@ } for (;;) { ret = PyRun_InteractiveOneFlags(fp, filename, flags); - PRINT_TOTAL_REFS() + PRINT_TOTAL_REFS(); if (ret == E_EOF) return 0; /*
