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/bufferobject.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/bufferobject.c')
-rw-r--r-- | Objects/bufferobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/bufferobject.c b/Objects/bufferobject.c index eff06aa..d2597b9 100644 --- a/Objects/bufferobject.c +++ b/Objects/bufferobject.c @@ -169,7 +169,7 @@ PyBuffer_New(Py_ssize_t size) } /* XXX: check for overflow in multiply */ /* Inline PyObject_New */ - o = PyObject_MALLOC(sizeof(*b) + size); + o = (PyObject *)PyObject_MALLOC(sizeof(*b) + size); if ( o == NULL ) return PyErr_NoMemory(); b = (PyBufferObject *) PyObject_INIT(o, &PyBuffer_Type); @@ -305,7 +305,7 @@ buffer_str(PyBufferObject *self) Py_ssize_t size; if (!get_buf(self, &ptr, &size)) return NULL; - return PyString_FromStringAndSize(ptr, size); + return PyString_FromStringAndSize((const char *)ptr, size); } /* Sequence methods */ |