comparison Python/sysmodule.c @ 36866:9eb24f92a784 legacy-trunk

Change int to Py_ssize_t in several places. Add (int) casts to silence compiler warnings. Raise Python exceptions for overflows.
author Martin v. Löwis <martin@v.loewis.de>
date Tue, 07 Mar 2006 12:08:51 +0000
parents 3a3aed49b245
children 91a9e2e31e93
comparison
equal deleted inserted replaced
36864:1e191392ec5c 36866:9eb24f92a784
595 #endif /* USE_MALLOPT */ 595 #endif /* USE_MALLOPT */
596 596
597 static PyObject * 597 static PyObject *
598 sys_getrefcount(PyObject *self, PyObject *arg) 598 sys_getrefcount(PyObject *self, PyObject *arg)
599 { 599 {
600 return PyInt_FromLong(arg->ob_refcnt); 600 return PyInt_FromSsize_t(arg->ob_refcnt);
601 } 601 }
602 602
603 #ifdef Py_REF_DEBUG 603 #ifdef Py_REF_DEBUG
604 static PyObject * 604 static PyObject *
605 sys_gettotalrefcount(PyObject *self) 605 sys_gettotalrefcount(PyObject *self)