diff options
Diffstat (limited to 'Include/bytearrayobject.h')
-rw-r--r-- | Include/bytearrayobject.h | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Include/bytearrayobject.h b/Include/bytearrayobject.h index 647a17a..e1281a6 100644 --- a/Include/bytearrayobject.h +++ b/Include/bytearrayobject.h @@ -19,15 +19,13 @@ extern "C" { */ /* Object layout */ -#ifndef Py_LIMITED_API typedef struct { PyObject_VAR_HEAD - Py_ssize_t ob_alloc; /* How many bytes allocated in ob_bytes */ - char *ob_bytes; /* Physical backing buffer */ - char *ob_start; /* Logical start inside ob_bytes */ - Py_ssize_t ob_exports; /* How many buffer exports */ + /* XXX(nnorwitz): should ob_exports be Py_ssize_t? */ + int ob_exports; /* how many buffer exports */ + Py_ssize_t ob_alloc; /* How many bytes allocated */ + char *ob_bytes; } PyByteArrayObject; -#endif /* Type object */ PyAPI_DATA(PyTypeObject) PyByteArray_Type; @@ -46,14 +44,12 @@ PyAPI_FUNC(char *) PyByteArray_AsString(PyObject *); PyAPI_FUNC(int) PyByteArray_Resize(PyObject *, Py_ssize_t); /* Macros, trading safety for speed */ -#ifndef Py_LIMITED_API #define PyByteArray_AS_STRING(self) \ (assert(PyByteArray_Check(self)), \ - Py_SIZE(self) ? ((PyByteArrayObject *)(self))->ob_start : _PyByteArray_empty_string) -#define PyByteArray_GET_SIZE(self) (assert(PyByteArray_Check(self)), Py_SIZE(self)) + Py_SIZE(self) ? ((PyByteArrayObject *)(self))->ob_bytes : _PyByteArray_empty_string) +#define PyByteArray_GET_SIZE(self) (assert(PyByteArray_Check(self)),Py_SIZE(self)) PyAPI_DATA(char) _PyByteArray_empty_string[]; -#endif #ifdef __cplusplus } |