bpo-35489: Use "const Py_UNICODE *" for the Py_UNICODE converter in AC. (GH-11150)

This commit is contained in:
Serhiy Storchaka 2018-12-14 11:19:51 +02:00 committed by GitHub
parent 7b36016a15
commit afb3e71a17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 110 additions and 98 deletions

View file

@ -995,13 +995,14 @@ process ID, and thread ID.
[clinic start generated code]*/
static PyObject *
_winapi_CreateProcess_impl(PyObject *module, Py_UNICODE *application_name,
_winapi_CreateProcess_impl(PyObject *module,
const Py_UNICODE *application_name,
PyObject *command_line, PyObject *proc_attrs,
PyObject *thread_attrs, BOOL inherit_handles,
DWORD creation_flags, PyObject *env_mapping,
Py_UNICODE *current_directory,
const Py_UNICODE *current_directory,
PyObject *startup_info)
/*[clinic end generated code: output=2ecaab46a05e3123 input=42ac293eaea03fc4]*/
/*[clinic end generated code: output=9b2423a609230132 input=42ac293eaea03fc4]*/
{
PyObject *ret = NULL;
BOOL result;

View file

@ -1712,9 +1712,9 @@ some other type.
[clinic start generated code]*/
static PyObject *
array_array_fromunicode_impl(arrayobject *self, Py_UNICODE *ustr,
array_array_fromunicode_impl(arrayobject *self, const Py_UNICODE *ustr,
Py_ssize_clean_t ustr_length)
/*[clinic end generated code: output=ebb72fc16975e06d input=150f00566ffbca6e]*/
/*[clinic end generated code: output=cf2f662908e2befc input=150f00566ffbca6e]*/
{
char typecode;

View file

@ -300,25 +300,26 @@ PyDoc_STRVAR(_winapi_CreateProcess__doc__,
{"CreateProcess", (PyCFunction)(void(*)(void))_winapi_CreateProcess, METH_FASTCALL, _winapi_CreateProcess__doc__},
static PyObject *
_winapi_CreateProcess_impl(PyObject *module, Py_UNICODE *application_name,
_winapi_CreateProcess_impl(PyObject *module,
const Py_UNICODE *application_name,
PyObject *command_line, PyObject *proc_attrs,
PyObject *thread_attrs, BOOL inherit_handles,
DWORD creation_flags, PyObject *env_mapping,
Py_UNICODE *current_directory,
const Py_UNICODE *current_directory,
PyObject *startup_info);
static PyObject *
_winapi_CreateProcess(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
{
PyObject *return_value = NULL;
Py_UNICODE *application_name;
const Py_UNICODE *application_name;
PyObject *command_line;
PyObject *proc_attrs;
PyObject *thread_attrs;
BOOL inherit_handles;
DWORD creation_flags;
PyObject *env_mapping;
Py_UNICODE *current_directory;
const Py_UNICODE *current_directory;
PyObject *startup_info;
if (!_PyArg_ParseStack(args, nargs, "ZOOOikOZO:CreateProcess",
@ -943,4 +944,4 @@ _winapi_GetFileType(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P
exit:
return return_value;
}
/*[clinic end generated code: output=1568ad4bd625f2af input=a9049054013a1b77]*/
/*[clinic end generated code: output=145d0d362167c1b1 input=a9049054013a1b77]*/

View file

@ -376,14 +376,14 @@ PyDoc_STRVAR(array_array_fromunicode__doc__,
{"fromunicode", (PyCFunction)array_array_fromunicode, METH_O, array_array_fromunicode__doc__},
static PyObject *
array_array_fromunicode_impl(arrayobject *self, Py_UNICODE *ustr,
array_array_fromunicode_impl(arrayobject *self, const Py_UNICODE *ustr,
Py_ssize_clean_t ustr_length);
static PyObject *
array_array_fromunicode(arrayobject *self, PyObject *arg)
{
PyObject *return_value = NULL;
Py_UNICODE *ustr;
const Py_UNICODE *ustr;
Py_ssize_clean_t ustr_length;
if (!PyArg_Parse(arg, "u#:fromunicode", &ustr, &ustr_length)) {
@ -505,4 +505,4 @@ PyDoc_STRVAR(array_arrayiterator___setstate____doc__,
#define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \
{"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__},
/*[clinic end generated code: output=3a4c6f3deb597bfd input=a9049054013a1b77]*/
/*[clinic end generated code: output=3d2bb1aa81541cbd input=a9049054013a1b77]*/

View file

@ -1329,7 +1329,7 @@ PyDoc_STRVAR(os_system__doc__,
{"system", (PyCFunction)(void(*)(void))os_system, METH_FASTCALL|METH_KEYWORDS, os_system__doc__},
static long
os_system_impl(PyObject *module, Py_UNICODE *command);
os_system_impl(PyObject *module, const Py_UNICODE *command);
static PyObject *
os_system(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
@ -1337,7 +1337,7 @@ os_system(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k
PyObject *return_value = NULL;
static const char * const _keywords[] = {"command", NULL};
static _PyArg_Parser _parser = {"u:system", _keywords, 0};
Py_UNICODE *command;
const Py_UNICODE *command;
long _return_value;
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
@ -5327,7 +5327,8 @@ PyDoc_STRVAR(os_startfile__doc__,
{"startfile", (PyCFunction)(void(*)(void))os_startfile, METH_FASTCALL|METH_KEYWORDS, os_startfile__doc__},
static PyObject *
os_startfile_impl(PyObject *module, path_t *filepath, Py_UNICODE *operation);
os_startfile_impl(PyObject *module, path_t *filepath,
const Py_UNICODE *operation);
static PyObject *
os_startfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
@ -5336,7 +5337,7 @@ os_startfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject
static const char * const _keywords[] = {"filepath", "operation", NULL};
static _PyArg_Parser _parser = {"O&|u:startfile", _keywords, 0};
path_t filepath = PATH_T_INITIALIZE("startfile", "filepath", 0, 0);
Py_UNICODE *operation = NULL;
const Py_UNICODE *operation = NULL;
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &filepath, &operation)) {
@ -6757,4 +6758,4 @@ exit:
#ifndef OS_GETRANDOM_METHODDEF
#define OS_GETRANDOM_METHODDEF
#endif /* !defined(OS_GETRANDOM_METHODDEF) */
/*[clinic end generated code: output=d62c0bb988141e70 input=a9049054013a1b77]*/
/*[clinic end generated code: output=7ebb53d872bab149 input=a9049054013a1b77]*/

View file

@ -4215,8 +4215,8 @@ Execute the command in a subshell.
[clinic start generated code]*/
static long
os_system_impl(PyObject *module, Py_UNICODE *command)
/*[clinic end generated code: output=96c4dffee36dfb48 input=303f5ce97df606b0]*/
os_system_impl(PyObject *module, const Py_UNICODE *command)
/*[clinic end generated code: output=5b7c3599c068ca42 input=303f5ce97df606b0]*/
{
long result;
Py_BEGIN_ALLOW_THREADS
@ -11224,8 +11224,9 @@ the underlying Win32 ShellExecute function doesn't work if it is.
[clinic start generated code]*/
static PyObject *
os_startfile_impl(PyObject *module, path_t *filepath, Py_UNICODE *operation)
/*[clinic end generated code: output=912ceba79acfa1c9 input=63950bf2986380d0]*/
os_startfile_impl(PyObject *module, path_t *filepath,
const Py_UNICODE *operation)
/*[clinic end generated code: output=66dc311c94d50797 input=63950bf2986380d0]*/
{
HINSTANCE rc;