diff options
author | Anthony Baxter <anthonybaxter@gmail.com> | 2006-04-11 06:54:30 (GMT) |
---|---|---|
committer | Anthony Baxter <anthonybaxter@gmail.com> | 2006-04-11 06:54:30 (GMT) |
commit | 377be11ee1fab015f4cc77975374f86cf436536e (patch) | |
tree | 3181b8a7ebd32101aa56048eaa2f96a98b8bf013 /Objects/intobject.c | |
parent | bbfe4fad361e7190675f28702332ddc377bd8cfd (diff) | |
download | cpython-377be11ee1fab015f4cc77975374f86cf436536e.zip cpython-377be11ee1fab015f4cc77975374f86cf436536e.tar.gz cpython-377be11ee1fab015f4cc77975374f86cf436536e.tar.bz2 |
More C++-compliance. Note especially listobject.c - to get C++ to accept the
PyTypeObject structures, I had to make prototypes for the functions, and
move the structure definition ahead of the functions. I'd dearly like a better
way to do this - to change this would make for a massive set of changes to
the codebase.
There's still some warnings - this is purely to get rid of errors first.
Diffstat (limited to 'Objects/intobject.c')
-rw-r--r-- | Objects/intobject.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Objects/intobject.c b/Objects/intobject.c index a88d51f..e3af063 100644 --- a/Objects/intobject.c +++ b/Objects/intobject.c @@ -376,7 +376,7 @@ PyObject * PyInt_FromUnicode(Py_UNICODE *s, Py_ssize_t length, int base) { PyObject *result; - char *buffer = PyMem_MALLOC(length+1); + char *buffer = (char *)PyMem_MALLOC(length+1); if (buffer == NULL) return NULL; @@ -982,7 +982,7 @@ int_new(PyTypeObject *type, PyObject *args, PyObject *kwds) static PyObject * int_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { - PyObject *tmp, *new; + PyObject *tmp, *newobj; long ival; assert(PyType_IsSubtype(type, &PyInt_Type)); @@ -999,14 +999,14 @@ int_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) ival = ((PyIntObject *)tmp)->ob_ival; } - new = type->tp_alloc(type, 0); - if (new == NULL) { + newobj = type->tp_alloc(type, 0); + if (newobj == NULL) { Py_DECREF(tmp); return NULL; } - ((PyIntObject *)new)->ob_ival = ival; + ((PyIntObject *)newobj)->ob_ival = ival; Py_DECREF(tmp); - return new; + return newobj; } static PyObject * |