diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-10-12 11:12:54 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-10-12 11:12:54 (GMT) |
commit | c29e29bed1ea1efc1a0cd3178fac96be4d763ecf (patch) | |
tree | 2066552a3753b1d77a8bbee66f806af18c5058b0 /Include | |
parent | b031eaee3b099cfbfaa66ddddebf7b805fc87ea4 (diff) | |
download | cpython-c29e29bed1ea1efc1a0cd3178fac96be4d763ecf.zip cpython-c29e29bed1ea1efc1a0cd3178fac96be4d763ecf.tar.gz cpython-c29e29bed1ea1efc1a0cd3178fac96be4d763ecf.tar.bz2 |
Relax _PyBytesWriter API
Don't require _PyBytesWriter pointer to be a "char *". Same change for
_PyBytesWriter_WriteBytes() parameter.
For example, binascii uses "unsigned char*".
Diffstat (limited to 'Include')
-rw-r--r-- | Include/bytesobject.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Include/bytesobject.h b/Include/bytesobject.h index 2c4c4c4..b7a7c36 100644 --- a/Include/bytesobject.h +++ b/Include/bytesobject.h @@ -156,7 +156,7 @@ PyAPI_FUNC(void) _PyBytesWriter_Init(_PyBytesWriter *writer); Return a bytes object. Raise an exception and return NULL on error. */ PyAPI_FUNC(PyObject *) _PyBytesWriter_Finish(_PyBytesWriter *writer, - char *str); + void *str); /* Deallocate memory of a writer (clear its internal buffer). */ PyAPI_FUNC(void) _PyBytesWriter_Dealloc(_PyBytesWriter *writer); @@ -164,22 +164,22 @@ PyAPI_FUNC(void) _PyBytesWriter_Dealloc(_PyBytesWriter *writer); /* Allocate the buffer to write size bytes. Return the pointer to the beginning of buffer data. Raise an exception and return NULL on error. */ -PyAPI_FUNC(char*) _PyBytesWriter_Alloc(_PyBytesWriter *writer, +PyAPI_FUNC(void*) _PyBytesWriter_Alloc(_PyBytesWriter *writer, Py_ssize_t size); /* Add *size* bytes to the buffer. str is the current pointer inside the buffer. Return the updated current pointer inside the buffer. Raise an exception and return NULL on error. */ -PyAPI_FUNC(char*) _PyBytesWriter_Prepare(_PyBytesWriter *writer, - char *str, +PyAPI_FUNC(void*) _PyBytesWriter_Prepare(_PyBytesWriter *writer, + void *str, Py_ssize_t size); /* Write bytes. Raise an exception and return NULL on error. */ -PyAPI_FUNC(char*) _PyBytesWriter_WriteBytes(_PyBytesWriter *writer, - char *str, - char *bytes, +PyAPI_FUNC(void*) _PyBytesWriter_WriteBytes(_PyBytesWriter *writer, + void *str, + const void *bytes, Py_ssize_t size); #endif /* Py_LIMITED_API */ |