mirror of
https://github.com/python/cpython.git
synced 2025-07-30 14:44:10 +00:00
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.
This commit is contained in:
parent
bbfe4fad36
commit
377be11ee1
8 changed files with 148 additions and 137 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue