Mercurial > cpython-lru_cache-weakref
diff Objects/bufferobject.c @ 37589:aeee85b6a5dd legacy-trunk
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.
| author | Anthony Baxter <anthonybaxter@gmail.com> |
|---|---|
| date | Tue, 11 Apr 2006 06:54:30 +0000 |
| parents | ed07c1a5e24c |
| children | 654c380cf8b9 5bc7272b81e5 |
line wrap: on
line diff
--- a/Objects/bufferobject.c Tue Apr 11 06:47:43 2006 +0000 +++ b/Objects/bufferobject.c Tue Apr 11 06:54:30 2006 +0000 @@ -169,7 +169,7 @@ } /* 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 @@ 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 */
