diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-20 10:16:46 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-20 10:16:46 (GMT) |
commit | 460bd0d284caa00eb8ccc9a28836ba30765a19cb (patch) | |
tree | 41169cfce0d00587f4222d3237a608b70577adfc /Objects/abstract.c | |
parent | 6107f46bfbe4aa7b2ddb37ca5136d1d472c3f4aa (diff) | |
download | cpython-460bd0d284caa00eb8ccc9a28836ba30765a19cb.zip cpython-460bd0d284caa00eb8ccc9a28836ba30765a19cb.tar.gz cpython-460bd0d284caa00eb8ccc9a28836ba30765a19cb.tar.bz2 |
Issue #19569: Compiler warnings are now emitted if use most of deprecated
functions.
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r-- | Objects/abstract.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index f9afece..beb12c9 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -252,14 +252,6 @@ PyObject_DelItemString(PyObject *o, const char *key) cause issues later on. Don't use these functions in new code. */ int -PyObject_AsCharBuffer(PyObject *obj, - const char **buffer, - Py_ssize_t *buffer_len) -{ - return PyObject_AsReadBuffer(obj, (const void **)buffer, buffer_len); -} - -int PyObject_CheckReadBuffer(PyObject *obj) { PyBufferProcs *pb = obj->ob_type->tp_as_buffer; @@ -276,9 +268,8 @@ PyObject_CheckReadBuffer(PyObject *obj) return 1; } -int PyObject_AsReadBuffer(PyObject *obj, - const void **buffer, - Py_ssize_t *buffer_len) +static int +as_read_buffer(PyObject *obj, const void **buffer, Py_ssize_t *buffer_len) { Py_buffer view; @@ -295,6 +286,21 @@ int PyObject_AsReadBuffer(PyObject *obj, return 0; } +int +PyObject_AsCharBuffer(PyObject *obj, + const char **buffer, + Py_ssize_t *buffer_len) +{ + return as_read_buffer(obj, (const void **)buffer, buffer_len); +} + +int PyObject_AsReadBuffer(PyObject *obj, + const void **buffer, + Py_ssize_t *buffer_len) +{ + return as_read_buffer(obj, buffer, buffer_len); +} + int PyObject_AsWriteBuffer(PyObject *obj, void **buffer, Py_ssize_t *buffer_len) |