diff options
author | Anthony Baxter <anthonybaxter@gmail.com> | 2006-04-11 06:54:30 +0000 |
---|---|---|
committer | Anthony Baxter <anthonybaxter@gmail.com> | 2006-04-11 06:54:30 +0000 |
commit | 377be11ee1fab015f4cc77975374f86cf436536e (patch) | |
tree | 3181b8a7ebd32101aa56048eaa2f96a98b8bf013 /Objects/longobject.c | |
parent | bbfe4fad361e7190675f28702332ddc377bd8cfd (diff) | |
download | cpython-git-377be11ee1fab015f4cc77975374f86cf436536e.tar.gz |
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/longobject.c')
-rw-r--r-- | Objects/longobject.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c index 49f5c3b625..2d3dce67e4 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -1476,7 +1476,7 @@ PyObject * PyLong_FromUnicode(Py_UNICODE *u, 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; @@ -3088,7 +3088,7 @@ long_new(PyTypeObject *type, PyObject *args, PyObject *kwds) static PyObject * long_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { - PyLongObject *tmp, *new; + PyLongObject *tmp, *newobj; Py_ssize_t i, n; assert(PyType_IsSubtype(type, &PyLong_Type)); @@ -3099,17 +3099,17 @@ long_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) n = tmp->ob_size; if (n < 0) n = -n; - new = (PyLongObject *)type->tp_alloc(type, n); - if (new == NULL) { + newobj = (PyLongObject *)type->tp_alloc(type, n); + if (newobj == NULL) { Py_DECREF(tmp); return NULL; } - assert(PyLong_Check(new)); - new->ob_size = tmp->ob_size; + assert(PyLong_Check(newobj)); + newobj->ob_size = tmp->ob_size; for (i = 0; i < n; i++) - new->ob_digit[i] = tmp->ob_digit[i]; + newobj->ob_digit[i] = tmp->ob_digit[i]; Py_DECREF(tmp); - return (PyObject *)new; + return (PyObject *)newobj; } static PyObject * |