mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-32240: Add the const qualifier to declarations of PyObject* array arguments. (#4746)
This commit is contained in:
parent
3325a6780c
commit
a5552f023e
88 changed files with 669 additions and 662 deletions
|
@ -135,7 +135,7 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode,
|
|||
const char *newline, int closefd, PyObject *opener);
|
||||
|
||||
static PyObject *
|
||||
_io_open(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
_io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"file", "mode", "buffering", "encoding", "errors", "newline", "closefd", "opener", NULL};
|
||||
|
@ -158,4 +158,4 @@ _io_open(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=7e0ab289d8465580 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=a9de1ae79c960e81 input=a9049054013a1b77]*/
|
||||
|
|
|
@ -97,7 +97,7 @@ static PyObject *
|
|||
_io__Buffered_peek_impl(buffered *self, Py_ssize_t size);
|
||||
|
||||
static PyObject *
|
||||
_io__Buffered_peek(buffered *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io__Buffered_peek(buffered *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t size = 0;
|
||||
|
@ -124,7 +124,7 @@ static PyObject *
|
|||
_io__Buffered_read_impl(buffered *self, Py_ssize_t n);
|
||||
|
||||
static PyObject *
|
||||
_io__Buffered_read(buffered *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io__Buffered_read(buffered *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t n = -1;
|
||||
|
@ -151,7 +151,7 @@ static PyObject *
|
|||
_io__Buffered_read1_impl(buffered *self, Py_ssize_t n);
|
||||
|
||||
static PyObject *
|
||||
_io__Buffered_read1(buffered *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io__Buffered_read1(buffered *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t n = -1;
|
||||
|
@ -240,7 +240,7 @@ static PyObject *
|
|||
_io__Buffered_readline_impl(buffered *self, Py_ssize_t size);
|
||||
|
||||
static PyObject *
|
||||
_io__Buffered_readline(buffered *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io__Buffered_readline(buffered *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t size = -1;
|
||||
|
@ -267,7 +267,7 @@ static PyObject *
|
|||
_io__Buffered_seek_impl(buffered *self, PyObject *targetobj, int whence);
|
||||
|
||||
static PyObject *
|
||||
_io__Buffered_seek(buffered *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io__Buffered_seek(buffered *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *targetobj;
|
||||
|
@ -295,7 +295,7 @@ static PyObject *
|
|||
_io__Buffered_truncate_impl(buffered *self, PyObject *pos);
|
||||
|
||||
static PyObject *
|
||||
_io__Buffered_truncate(buffered *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io__Buffered_truncate(buffered *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *pos = Py_None;
|
||||
|
@ -476,4 +476,4 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=2b817df0bf814ddc input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=9a20dd4eaabb5d58 input=a9049054013a1b77]*/
|
||||
|
|
|
@ -164,7 +164,7 @@ static PyObject *
|
|||
_io_BytesIO_read_impl(bytesio *self, Py_ssize_t size);
|
||||
|
||||
static PyObject *
|
||||
_io_BytesIO_read(bytesio *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io_BytesIO_read(bytesio *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t size = -1;
|
||||
|
@ -195,7 +195,7 @@ static PyObject *
|
|||
_io_BytesIO_read1_impl(bytesio *self, Py_ssize_t size);
|
||||
|
||||
static PyObject *
|
||||
_io_BytesIO_read1(bytesio *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io_BytesIO_read1(bytesio *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t size = -1;
|
||||
|
@ -227,7 +227,7 @@ static PyObject *
|
|||
_io_BytesIO_readline_impl(bytesio *self, Py_ssize_t size);
|
||||
|
||||
static PyObject *
|
||||
_io_BytesIO_readline(bytesio *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io_BytesIO_readline(bytesio *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t size = -1;
|
||||
|
@ -259,7 +259,7 @@ static PyObject *
|
|||
_io_BytesIO_readlines_impl(bytesio *self, PyObject *arg);
|
||||
|
||||
static PyObject *
|
||||
_io_BytesIO_readlines(bytesio *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io_BytesIO_readlines(bytesio *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *arg = Py_None;
|
||||
|
@ -326,7 +326,7 @@ static PyObject *
|
|||
_io_BytesIO_truncate_impl(bytesio *self, Py_ssize_t size);
|
||||
|
||||
static PyObject *
|
||||
_io_BytesIO_truncate(bytesio *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io_BytesIO_truncate(bytesio *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t size = self->pos;
|
||||
|
@ -360,7 +360,7 @@ static PyObject *
|
|||
_io_BytesIO_seek_impl(bytesio *self, Py_ssize_t pos, int whence);
|
||||
|
||||
static PyObject *
|
||||
_io_BytesIO_seek(bytesio *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io_BytesIO_seek(bytesio *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t pos;
|
||||
|
@ -444,4 +444,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=20946f5a2ed4492b input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=9ba9a68c8c5669e7 input=a9049054013a1b77]*/
|
||||
|
|
|
@ -208,7 +208,7 @@ static PyObject *
|
|||
_io_FileIO_read_impl(fileio *self, Py_ssize_t size);
|
||||
|
||||
static PyObject *
|
||||
_io_FileIO_read(fileio *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io_FileIO_read(fileio *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t size = -1;
|
||||
|
@ -280,7 +280,7 @@ static PyObject *
|
|||
_io_FileIO_seek_impl(fileio *self, PyObject *pos, int whence);
|
||||
|
||||
static PyObject *
|
||||
_io_FileIO_seek(fileio *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io_FileIO_seek(fileio *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *pos;
|
||||
|
@ -334,7 +334,7 @@ static PyObject *
|
|||
_io_FileIO_truncate_impl(fileio *self, PyObject *posobj);
|
||||
|
||||
static PyObject *
|
||||
_io_FileIO_truncate(fileio *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io_FileIO_truncate(fileio *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *posobj = NULL;
|
||||
|
@ -373,4 +373,4 @@ _io_FileIO_isatty(fileio *self, PyObject *Py_UNUSED(ignored))
|
|||
#ifndef _IO_FILEIO_TRUNCATE_METHODDEF
|
||||
#define _IO_FILEIO_TRUNCATE_METHODDEF
|
||||
#endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */
|
||||
/*[clinic end generated code: output=1af8b4031633b763 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=a8796438c8b7c49a input=a9049054013a1b77]*/
|
||||
|
|
|
@ -180,7 +180,7 @@ static PyObject *
|
|||
_io__IOBase_readline_impl(PyObject *self, Py_ssize_t limit);
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_readline(PyObject *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io__IOBase_readline(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t limit = -1;
|
||||
|
@ -212,7 +212,7 @@ static PyObject *
|
|||
_io__IOBase_readlines_impl(PyObject *self, Py_ssize_t hint);
|
||||
|
||||
static PyObject *
|
||||
_io__IOBase_readlines(PyObject *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io__IOBase_readlines(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t hint = -1;
|
||||
|
@ -247,7 +247,7 @@ static PyObject *
|
|||
_io__RawIOBase_read_impl(PyObject *self, Py_ssize_t n);
|
||||
|
||||
static PyObject *
|
||||
_io__RawIOBase_read(PyObject *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io__RawIOBase_read(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t n = -1;
|
||||
|
@ -279,4 +279,4 @@ _io__RawIOBase_readall(PyObject *self, PyObject *Py_UNUSED(ignored))
|
|||
{
|
||||
return _io__RawIOBase_readall_impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=1dc5cc1a9977d73f input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=64989ec3dbf44a7c input=a9049054013a1b77]*/
|
||||
|
|
|
@ -54,7 +54,7 @@ static PyObject *
|
|||
_io_StringIO_read_impl(stringio *self, Py_ssize_t size);
|
||||
|
||||
static PyObject *
|
||||
_io_StringIO_read(stringio *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io_StringIO_read(stringio *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t size = -1;
|
||||
|
@ -84,7 +84,7 @@ static PyObject *
|
|||
_io_StringIO_readline_impl(stringio *self, Py_ssize_t size);
|
||||
|
||||
static PyObject *
|
||||
_io_StringIO_readline(stringio *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io_StringIO_readline(stringio *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t size = -1;
|
||||
|
@ -116,7 +116,7 @@ static PyObject *
|
|||
_io_StringIO_truncate_impl(stringio *self, Py_ssize_t size);
|
||||
|
||||
static PyObject *
|
||||
_io_StringIO_truncate(stringio *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io_StringIO_truncate(stringio *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t size = self->pos;
|
||||
|
@ -150,7 +150,7 @@ static PyObject *
|
|||
_io_StringIO_seek_impl(stringio *self, Py_ssize_t pos, int whence);
|
||||
|
||||
static PyObject *
|
||||
_io_StringIO_seek(stringio *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io_StringIO_seek(stringio *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t pos;
|
||||
|
@ -286,4 +286,4 @@ _io_StringIO_seekable(stringio *self, PyObject *Py_UNUSED(ignored))
|
|||
{
|
||||
return _io_StringIO_seekable_impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=a5e963d90b4eedc0 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=73c4d6e5cc3b1a58 input=a9049054013a1b77]*/
|
||||
|
|
|
@ -53,7 +53,7 @@ _io_IncrementalNewlineDecoder_decode_impl(nldecoder_object *self,
|
|||
PyObject *input, int final);
|
||||
|
||||
static PyObject *
|
||||
_io_IncrementalNewlineDecoder_decode(nldecoder_object *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
_io_IncrementalNewlineDecoder_decode(nldecoder_object *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"input", "final", NULL};
|
||||
|
@ -193,7 +193,7 @@ _io_TextIOWrapper_reconfigure_impl(textio *self,
|
|||
PyObject *write_through_obj);
|
||||
|
||||
static PyObject *
|
||||
_io_TextIOWrapper_reconfigure(textio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
_io_TextIOWrapper_reconfigure(textio *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"line_buffering", "write_through", NULL};
|
||||
|
@ -266,7 +266,7 @@ static PyObject *
|
|||
_io_TextIOWrapper_read_impl(textio *self, Py_ssize_t n);
|
||||
|
||||
static PyObject *
|
||||
_io_TextIOWrapper_read(textio *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io_TextIOWrapper_read(textio *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t n = -1;
|
||||
|
@ -293,7 +293,7 @@ static PyObject *
|
|||
_io_TextIOWrapper_readline_impl(textio *self, Py_ssize_t size);
|
||||
|
||||
static PyObject *
|
||||
_io_TextIOWrapper_readline(textio *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io_TextIOWrapper_readline(textio *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t size = -1;
|
||||
|
@ -320,7 +320,7 @@ static PyObject *
|
|||
_io_TextIOWrapper_seek_impl(textio *self, PyObject *cookieObj, int whence);
|
||||
|
||||
static PyObject *
|
||||
_io_TextIOWrapper_seek(textio *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io_TextIOWrapper_seek(textio *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *cookieObj;
|
||||
|
@ -365,7 +365,7 @@ static PyObject *
|
|||
_io_TextIOWrapper_truncate_impl(textio *self, PyObject *pos);
|
||||
|
||||
static PyObject *
|
||||
_io_TextIOWrapper_truncate(textio *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io_TextIOWrapper_truncate(textio *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *pos = Py_None;
|
||||
|
@ -499,4 +499,4 @@ _io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored))
|
|||
{
|
||||
return _io_TextIOWrapper_close_impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=937989df0a8abfc3 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=679b3ac5284df4e0 input=a9049054013a1b77]*/
|
||||
|
|
|
@ -215,7 +215,7 @@ static PyObject *
|
|||
_io__WindowsConsoleIO_read_impl(winconsoleio *self, Py_ssize_t size);
|
||||
|
||||
static PyObject *
|
||||
_io__WindowsConsoleIO_read(winconsoleio *self, PyObject **args, Py_ssize_t nargs)
|
||||
_io__WindowsConsoleIO_read(winconsoleio *self, PyObject *const *args, Py_ssize_t nargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t size = -1;
|
||||
|
@ -328,4 +328,4 @@ _io__WindowsConsoleIO_isatty(winconsoleio *self, PyObject *Py_UNUSED(ignored))
|
|||
#ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF
|
||||
#define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF
|
||||
#endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */
|
||||
/*[clinic end generated code: output=7f74992fcd5bd89d input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=6d351a8200a8e848 input=a9049054013a1b77]*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue