Mercurial > cpython-lru_cache-weakref
comparison Python/sysmodule.c @ 37819:61ac1e322da7 legacy-trunk
C++ compiler cleanup: extern "C" a couple declarations, cast int to size_t
| author | Skip Montanaro <skip@pobox.com> |
|---|---|
| date | Tue, 18 Apr 2006 00:55:46 +0000 |
| parents | 65ecb83ea7dd |
| children | 3fe3ccdf0155 |
comparison
equal
deleted
inserted
replaced
| 37818:2e3276dc231f | 37819:61ac1e322da7 |
|---|---|
| 698 8. generator calls\n\ | 698 8. generator calls\n\ |
| 699 9. All other calls\n\ | 699 9. All other calls\n\ |
| 700 10. Number of stack pops performed by call_function()" | 700 10. Number of stack pops performed by call_function()" |
| 701 ); | 701 ); |
| 702 | 702 |
| 703 #ifdef __cplusplus | |
| 704 extern "C" { | |
| 705 #endif | |
| 706 | |
| 703 #ifdef Py_TRACE_REFS | 707 #ifdef Py_TRACE_REFS |
| 704 /* Defined in objects.c because it uses static globals if that file */ | 708 /* Defined in objects.c because it uses static globals if that file */ |
| 705 extern PyObject *_Py_GetObjects(PyObject *, PyObject *); | 709 extern PyObject *_Py_GetObjects(PyObject *, PyObject *); |
| 706 #endif | 710 #endif |
| 707 | 711 |
| 708 #ifdef DYNAMIC_EXECUTION_PROFILE | 712 #ifdef DYNAMIC_EXECUTION_PROFILE |
| 709 /* Defined in ceval.c because it uses static globals if that file */ | 713 /* Defined in ceval.c because it uses static globals if that file */ |
| 710 extern PyObject *_Py_GetDXProfile(PyObject *, PyObject *); | 714 extern PyObject *_Py_GetDXProfile(PyObject *, PyObject *); |
| 715 #endif | |
| 716 | |
| 717 #ifdef __cplusplus | |
| 718 } | |
| 711 #endif | 719 #endif |
| 712 | 720 |
| 713 static PyMethodDef sys_methods[] = { | 721 static PyMethodDef sys_methods[] = { |
| 714 /* Might as well keep this in alphabetic order */ | 722 /* Might as well keep this in alphabetic order */ |
| 715 {"callstats", (PyCFunction)PyEval_GetCallStats, METH_NOARGS, | 723 {"callstats", (PyCFunction)PyEval_GetCallStats, METH_NOARGS, |
| 1412 format, va); | 1420 format, va); |
| 1413 if (PyFile_WriteString(buffer, file) != 0) { | 1421 if (PyFile_WriteString(buffer, file) != 0) { |
| 1414 PyErr_Clear(); | 1422 PyErr_Clear(); |
| 1415 fputs(buffer, fp); | 1423 fputs(buffer, fp); |
| 1416 } | 1424 } |
| 1417 if (written < 0 || written >= sizeof(buffer)) { | 1425 if (written < 0 || (size_t)written >= sizeof(buffer)) { |
| 1418 const char *truncated = "... truncated"; | 1426 const char *truncated = "... truncated"; |
| 1419 if (PyFile_WriteString(truncated, file) != 0) { | 1427 if (PyFile_WriteString(truncated, file) != 0) { |
| 1420 PyErr_Clear(); | 1428 PyErr_Clear(); |
| 1421 fputs(truncated, fp); | 1429 fputs(truncated, fp); |
| 1422 } | 1430 } |
