diff options
author | Steve Dower <steve.dower@microsoft.com> | 2017-02-04 16:46:53 -0800 |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2017-02-04 16:46:53 -0800 |
commit | b1a1742796fce8078f9f1f3d5e3161122fae3b0a (patch) | |
tree | 89c863764481b7c7fbe645be42b16e1d35e92751 /PC/clinic | |
parent | 391ed6c73cb1964b57d0b538370a76d03d30511b (diff) | |
parent | cf1f5444eb42a8dc252b295d3863288309996a5d (diff) | |
download | cpython-b1a1742796fce8078f9f1f3d5e3161122fae3b0a.tar.gz |
Merge from 3.6
Diffstat (limited to 'PC/clinic')
-rw-r--r-- | PC/clinic/_testconsole.c.h | 6 | ||||
-rw-r--r-- | PC/clinic/msvcrtmodule.c.h | 52 | ||||
-rw-r--r-- | PC/clinic/winreg.c.h | 132 | ||||
-rw-r--r-- | PC/clinic/winsound.c.h | 8 |
4 files changed, 133 insertions, 65 deletions
diff --git a/PC/clinic/_testconsole.c.h b/PC/clinic/_testconsole.c.h index 93860cf5b2..2baf2baa26 100644 --- a/PC/clinic/_testconsole.c.h +++ b/PC/clinic/_testconsole.c.h @@ -26,7 +26,7 @@ _testconsole_write_input(PyObject *module, PyObject **args, Py_ssize_t nargs, Py PyObject *file; PyBytesObject *s; - if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, &file, &s)) { goto exit; } @@ -60,7 +60,7 @@ _testconsole_read_output(PyObject *module, PyObject **args, Py_ssize_t nargs, Py static _PyArg_Parser _parser = {"O:read_output", _keywords, 0}; PyObject *file; - if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, &file)) { goto exit; } @@ -79,4 +79,4 @@ exit: #ifndef _TESTCONSOLE_READ_OUTPUT_METHODDEF #define _TESTCONSOLE_READ_OUTPUT_METHODDEF #endif /* !defined(_TESTCONSOLE_READ_OUTPUT_METHODDEF) */ -/*[clinic end generated code: output=3a8dc0c421807c41 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=30d2a80143b65e6f input=a9049054013a1b77]*/ diff --git a/PC/clinic/msvcrtmodule.c.h b/PC/clinic/msvcrtmodule.c.h index 6935cad7b0..db4f46ebce 100644 --- a/PC/clinic/msvcrtmodule.c.h +++ b/PC/clinic/msvcrtmodule.c.h @@ -37,23 +37,27 @@ PyDoc_STRVAR(msvcrt_locking__doc__, "individually."); #define MSVCRT_LOCKING_METHODDEF \ - {"locking", (PyCFunction)msvcrt_locking, METH_VARARGS, msvcrt_locking__doc__}, + {"locking", (PyCFunction)msvcrt_locking, METH_FASTCALL, msvcrt_locking__doc__}, static PyObject * msvcrt_locking_impl(PyObject *module, int fd, int mode, long nbytes); static PyObject * -msvcrt_locking(PyObject *module, PyObject *args) +msvcrt_locking(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; int mode; long nbytes; - if (!PyArg_ParseTuple(args, "iil:locking", + if (!_PyArg_ParseStack(args, nargs, "iil:locking", &fd, &mode, &nbytes)) { goto exit; } + + if (!_PyArg_NoStackKeywords("locking", kwnames)) { + goto exit; + } return_value = msvcrt_locking_impl(module, fd, mode, nbytes); exit: @@ -72,23 +76,27 @@ PyDoc_STRVAR(msvcrt_setmode__doc__, "Return value is the previous mode."); #define MSVCRT_SETMODE_METHODDEF \ - {"setmode", (PyCFunction)msvcrt_setmode, METH_VARARGS, msvcrt_setmode__doc__}, + {"setmode", (PyCFunction)msvcrt_setmode, METH_FASTCALL, msvcrt_setmode__doc__}, static long msvcrt_setmode_impl(PyObject *module, int fd, int flags); static PyObject * -msvcrt_setmode(PyObject *module, PyObject *args) +msvcrt_setmode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; int flags; long _return_value; - if (!PyArg_ParseTuple(args, "ii:setmode", + if (!_PyArg_ParseStack(args, nargs, "ii:setmode", &fd, &flags)) { goto exit; } + + if (!_PyArg_NoStackKeywords("setmode", kwnames)) { + goto exit; + } _return_value = msvcrt_setmode_impl(module, fd, flags); if ((_return_value == -1) && PyErr_Occurred()) { goto exit; @@ -110,23 +118,27 @@ PyDoc_STRVAR(msvcrt_open_osfhandle__doc__, "to os.fdopen() to create a file object."); #define MSVCRT_OPEN_OSFHANDLE_METHODDEF \ - {"open_osfhandle", (PyCFunction)msvcrt_open_osfhandle, METH_VARARGS, msvcrt_open_osfhandle__doc__}, + {"open_osfhandle", (PyCFunction)msvcrt_open_osfhandle, METH_FASTCALL, msvcrt_open_osfhandle__doc__}, static long msvcrt_open_osfhandle_impl(PyObject *module, intptr_t handle, int flags); static PyObject * -msvcrt_open_osfhandle(PyObject *module, PyObject *args) +msvcrt_open_osfhandle(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; intptr_t handle; int flags; long _return_value; - if (!PyArg_ParseTuple(args, ""_Py_PARSE_INTPTR"i:open_osfhandle", + if (!_PyArg_ParseStack(args, nargs, ""_Py_PARSE_INTPTR"i:open_osfhandle", &handle, &flags)) { goto exit; } + + if (!_PyArg_NoStackKeywords("open_osfhandle", kwnames)) { + goto exit; + } _return_value = msvcrt_open_osfhandle_impl(module, handle, flags); if ((_return_value == -1) && PyErr_Occurred()) { goto exit; @@ -424,23 +436,27 @@ PyDoc_STRVAR(msvcrt_CrtSetReportFile__doc__, "Only available on Debug builds."); #define MSVCRT_CRTSETREPORTFILE_METHODDEF \ - {"CrtSetReportFile", (PyCFunction)msvcrt_CrtSetReportFile, METH_VARARGS, msvcrt_CrtSetReportFile__doc__}, + {"CrtSetReportFile", (PyCFunction)msvcrt_CrtSetReportFile, METH_FASTCALL, msvcrt_CrtSetReportFile__doc__}, static long msvcrt_CrtSetReportFile_impl(PyObject *module, int type, int file); static PyObject * -msvcrt_CrtSetReportFile(PyObject *module, PyObject *args) +msvcrt_CrtSetReportFile(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int type; int file; long _return_value; - if (!PyArg_ParseTuple(args, "ii:CrtSetReportFile", + if (!_PyArg_ParseStack(args, nargs, "ii:CrtSetReportFile", &type, &file)) { goto exit; } + + if (!_PyArg_NoStackKeywords("CrtSetReportFile", kwnames)) { + goto exit; + } _return_value = msvcrt_CrtSetReportFile_impl(module, type, file); if ((_return_value == -1) && PyErr_Occurred()) { goto exit; @@ -464,23 +480,27 @@ PyDoc_STRVAR(msvcrt_CrtSetReportMode__doc__, "Only available on Debug builds."); #define MSVCRT_CRTSETREPORTMODE_METHODDEF \ - {"CrtSetReportMode", (PyCFunction)msvcrt_CrtSetReportMode, METH_VARARGS, msvcrt_CrtSetReportMode__doc__}, + {"CrtSetReportMode", (PyCFunction)msvcrt_CrtSetReportMode, METH_FASTCALL, msvcrt_CrtSetReportMode__doc__}, static long msvcrt_CrtSetReportMode_impl(PyObject *module, int type, int mode); static PyObject * -msvcrt_CrtSetReportMode(PyObject *module, PyObject *args) +msvcrt_CrtSetReportMode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int type; int mode; long _return_value; - if (!PyArg_ParseTuple(args, "ii:CrtSetReportMode", + if (!_PyArg_ParseStack(args, nargs, "ii:CrtSetReportMode", &type, &mode)) { goto exit; } + + if (!_PyArg_NoStackKeywords("CrtSetReportMode", kwnames)) { + goto exit; + } _return_value = msvcrt_CrtSetReportMode_impl(module, type, mode); if ((_return_value == -1) && PyErr_Occurred()) { goto exit; @@ -569,4 +589,4 @@ exit: #ifndef MSVCRT_SET_ERROR_MODE_METHODDEF #define MSVCRT_SET_ERROR_MODE_METHODDEF #endif /* !defined(MSVCRT_SET_ERROR_MODE_METHODDEF) */ -/*[clinic end generated code: output=ae04e2b50eef8b63 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=36f1e78ca8bd3944 input=a9049054013a1b77]*/ diff --git a/PC/clinic/winreg.c.h b/PC/clinic/winreg.c.h index c7d5b9e452..2ca47344c4 100644 --- a/PC/clinic/winreg.c.h +++ b/PC/clinic/winreg.c.h @@ -93,7 +93,7 @@ winreg_HKEYType___exit__(PyHKEYObject *self, PyObject **args, Py_ssize_t nargs, PyObject *exc_value; PyObject *traceback; - if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, &exc_type, &exc_value, &traceback)) { goto exit; } @@ -134,24 +134,28 @@ PyDoc_STRVAR(winreg_ConnectRegistry__doc__, "If the function fails, an OSError exception is raised."); #define WINREG_CONNECTREGISTRY_METHODDEF \ - {"ConnectRegistry", (PyCFunction)winreg_ConnectRegistry, METH_VARARGS, winreg_ConnectRegistry__doc__}, + {"ConnectRegistry", (PyCFunction)winreg_ConnectRegistry, METH_FASTCALL, winreg_ConnectRegistry__doc__}, static HKEY winreg_ConnectRegistry_impl(PyObject *module, Py_UNICODE *computer_name, HKEY key); static PyObject * -winreg_ConnectRegistry(PyObject *module, PyObject *args) +winreg_ConnectRegistry(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_UNICODE *computer_name; HKEY key; HKEY _return_value; - if (!PyArg_ParseTuple(args, "ZO&:ConnectRegistry", + if (!_PyArg_ParseStack(args, nargs, "ZO&:ConnectRegistry", &computer_name, clinic_HKEY_converter, &key)) { goto exit; } + + if (!_PyArg_NoStackKeywords("ConnectRegistry", kwnames)) { + goto exit; + } _return_value = winreg_ConnectRegistry_impl(module, computer_name, key); if (_return_value == NULL) { goto exit; @@ -182,23 +186,27 @@ PyDoc_STRVAR(winreg_CreateKey__doc__, "If the function fails, an OSError exception is raised."); #define WINREG_CREATEKEY_METHODDEF \ - {"CreateKey", (PyCFunction)winreg_CreateKey, METH_VARARGS, winreg_CreateKey__doc__}, + {"CreateKey", (PyCFunction)winreg_CreateKey, METH_FASTCALL, winreg_CreateKey__doc__}, static HKEY winreg_CreateKey_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key); static PyObject * -winreg_CreateKey(PyObject *module, PyObject *args) +winreg_CreateKey(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; HKEY key; Py_UNICODE *sub_key; HKEY _return_value; - if (!PyArg_ParseTuple(args, "O&Z:CreateKey", + if (!_PyArg_ParseStack(args, nargs, "O&Z:CreateKey", clinic_HKEY_converter, &key, &sub_key)) { goto exit; } + + if (!_PyArg_NoStackKeywords("CreateKey", kwnames)) { + goto exit; + } _return_value = winreg_CreateKey_impl(module, key, sub_key); if (_return_value == NULL) { goto exit; @@ -253,7 +261,7 @@ winreg_CreateKeyEx(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject REGSAM access = KEY_WRITE; HKEY _return_value; - if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) { goto exit; } @@ -286,22 +294,26 @@ PyDoc_STRVAR(winreg_DeleteKey__doc__, "is removed. If the function fails, an OSError exception is raised."); #define WINREG_DELETEKEY_METHODDEF \ - {"DeleteKey", (PyCFunction)winreg_DeleteKey, METH_VARARGS, winreg_DeleteKey__doc__}, + {"DeleteKey", (PyCFunction)winreg_DeleteKey, METH_FASTCALL, winreg_DeleteKey__doc__}, static PyObject * winreg_DeleteKey_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key); static PyObject * -winreg_DeleteKey(PyObject *module, PyObject *args) +winreg_DeleteKey(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; HKEY key; Py_UNICODE *sub_key; - if (!PyArg_ParseTuple(args, "O&u:DeleteKey", + if (!_PyArg_ParseStack(args, nargs, "O&u:DeleteKey", clinic_HKEY_converter, &key, &sub_key)) { goto exit; } + + if (!_PyArg_NoStackKeywords("DeleteKey", kwnames)) { + goto exit; + } return_value = winreg_DeleteKey_impl(module, key, sub_key); exit: @@ -351,7 +363,7 @@ winreg_DeleteKeyEx(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject REGSAM access = KEY_WOW64_64KEY; int reserved = 0; - if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, clinic_HKEY_converter, &key, &sub_key, &access, &reserved)) { goto exit; } @@ -373,22 +385,26 @@ PyDoc_STRVAR(winreg_DeleteValue__doc__, " A string that identifies the value to remove."); #define WINREG_DELETEVALUE_METHODDEF \ - {"DeleteValue", (PyCFunction)winreg_DeleteValue, METH_VARARGS, winreg_DeleteValue__doc__}, + {"DeleteValue", (PyCFunction)winreg_DeleteValue, METH_FASTCALL, winreg_DeleteValue__doc__}, static PyObject * winreg_DeleteValue_impl(PyObject *module, HKEY key, Py_UNICODE *value); static PyObject * -winreg_DeleteValue(PyObject *module, PyObject *args) +winreg_DeleteValue(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; HKEY key; Py_UNICODE *value; - if (!PyArg_ParseTuple(args, "O&Z:DeleteValue", + if (!_PyArg_ParseStack(args, nargs, "O&Z:DeleteValue", clinic_HKEY_converter, &key, &value)) { goto exit; } + + if (!_PyArg_NoStackKeywords("DeleteValue", kwnames)) { + goto exit; + } return_value = winreg_DeleteValue_impl(module, key, value); exit: @@ -411,22 +427,26 @@ PyDoc_STRVAR(winreg_EnumKey__doc__, "raised, indicating no more values are available."); #define WINREG_ENUMKEY_METHODDEF \ - {"EnumKey", (PyCFunction)winreg_EnumKey, METH_VARARGS, winreg_EnumKey__doc__}, + {"EnumKey", (PyCFunction)winreg_EnumKey, METH_FASTCALL, winreg_EnumKey__doc__}, static PyObject * winreg_EnumKey_impl(PyObject *module, HKEY key, int index); static PyObject * -winreg_EnumKey(PyObject *module, PyObject *args) +winreg_EnumKey(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; HKEY key; int index; - if (!PyArg_ParseTuple(args, "O&i:EnumKey", + if (!_PyArg_ParseStack(args, nargs, "O&i:EnumKey", clinic_HKEY_converter, &key, &index)) { goto exit; } + + if (!_PyArg_NoStackKeywords("EnumKey", kwnames)) { + goto exit; + } return_value = winreg_EnumKey_impl(module, key, index); exit: @@ -458,22 +478,26 @@ PyDoc_STRVAR(winreg_EnumValue__doc__, " An integer that identifies the type of the value data."); #define WINREG_ENUMVALUE_METHODDEF \ - {"EnumValue", (PyCFunction)winreg_EnumValue, METH_VARARGS, winreg_EnumValue__doc__}, + {"EnumValue", (PyCFunction)winreg_EnumValue, METH_FASTCALL, winreg_EnumValue__doc__}, static PyObject * winreg_EnumValue_impl(PyObject *module, HKEY key, int index); static PyObject * -winreg_EnumValue(PyObject *module, PyObject *args) +winreg_EnumValue(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; HKEY key; int index; - if (!PyArg_ParseTuple(args, "O&i:EnumValue", + if (!_PyArg_ParseStack(args, nargs, "O&i:EnumValue", clinic_HKEY_converter, &key, &index)) { goto exit; } + + if (!_PyArg_NoStackKeywords("EnumValue", kwnames)) { + goto exit; + } return_value = winreg_EnumValue_impl(module, key, index); exit: @@ -576,24 +600,28 @@ PyDoc_STRVAR(winreg_LoadKey__doc__, "tree."); #define WINREG_LOADKEY_METHODDEF \ - {"LoadKey", (PyCFunction)winreg_LoadKey, METH_VARARGS, winreg_LoadKey__doc__}, + {"LoadKey", (PyCFunction)winreg_LoadKey, METH_FASTCALL, winreg_LoadKey__doc__}, static PyObject * winreg_LoadKey_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key, Py_UNICODE *file_name); static PyObject * -winreg_LoadKey(PyObject *module, PyObject *args) +winreg_LoadKey(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; HKEY key; Py_UNICODE *sub_key; Py_UNICODE *file_name; - if (!PyArg_ParseTuple(args, "O&uu:LoadKey", + if (!_PyArg_ParseStack(args, nargs, "O&uu:LoadKey", clinic_HKEY_converter, &key, &sub_key, &file_name)) { goto exit; } + + if (!_PyArg_NoStackKeywords("LoadKey", kwnames)) { + goto exit; + } return_value = winreg_LoadKey_impl(module, key, sub_key, file_name); exit: @@ -638,7 +666,7 @@ winreg_OpenKey(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kw REGSAM access = KEY_READ; HKEY _return_value; - if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) { goto exit; } @@ -690,7 +718,7 @@ winreg_OpenKeyEx(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject * REGSAM access = KEY_READ; HKEY _return_value; - if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) { goto exit; } @@ -761,22 +789,26 @@ PyDoc_STRVAR(winreg_QueryValue__doc__, "completeness."); #define WINREG_QUERYVALUE_METHODDEF \ - {"QueryValue", (PyCFunction)winreg_QueryValue, METH_VARARGS, winreg_QueryValue__doc__}, + {"QueryValue", (PyCFunction)winreg_QueryValue, METH_FASTCALL, winreg_QueryValue__doc__}, static PyObject * winreg_QueryValue_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key); static PyObject * -winreg_QueryValue(PyObject *module, PyObject *args) +winreg_QueryValue(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; HKEY key; Py_UNICODE *sub_key; - if (!PyArg_ParseTuple(args, "O&Z:QueryValue", + if (!_PyArg_ParseStack(args, nargs, "O&Z:QueryValue", clinic_HKEY_converter, &key, &sub_key)) { goto exit; } + + if (!_PyArg_NoStackKeywords("QueryValue", kwnames)) { + goto exit; + } return_value = winreg_QueryValue_impl(module, key, sub_key); exit: @@ -800,22 +832,26 @@ PyDoc_STRVAR(winreg_QueryValueEx__doc__, "The return value is a tuple of the value and the type_id."); #define WINREG_QUERYVALUEEX_METHODDEF \ - {"QueryValueEx", (PyCFunction)winreg_QueryValueEx, METH_VARARGS, winreg_QueryValueEx__doc__}, + {"QueryValueEx", (PyCFunction)winreg_QueryValueEx, METH_FASTCALL, winreg_QueryValueEx__doc__}, static PyObject * winreg_QueryValueEx_impl(PyObject *module, HKEY key, Py_UNICODE *name); static PyObject * -winreg_QueryValueEx(PyObject *module, PyObject *args) +winreg_QueryValueEx(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; HKEY key; Py_UNICODE *name; - if (!PyArg_ParseTuple(args, "O&Z:QueryValueEx", + if (!_PyArg_ParseStack(args, nargs, "O&Z:QueryValueEx", clinic_HKEY_converter, &key, &name)) { goto exit; } + + if (!_PyArg_NoStackKeywords("QueryValueEx", kwnames)) { + goto exit; + } return_value = winreg_QueryValueEx_impl(module, key, name); exit: @@ -844,22 +880,26 @@ PyDoc_STRVAR(winreg_SaveKey__doc__, "to the API."); #define WINREG_SAVEKEY_METHODDEF \ - {"SaveKey", (PyCFunction)winreg_SaveKey, METH_VARARGS, winreg_SaveKey__doc__}, + {"SaveKey", (PyCFunction)winreg_SaveKey, METH_FASTCALL, winreg_SaveKey__doc__}, static PyObject * winreg_SaveKey_impl(PyObject *module, HKEY key, Py_UNICODE *file_name); static PyObject * -winreg_SaveKey(PyObject *module, PyObject *args) +winreg_SaveKey(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; HKEY key; Py_UNICODE *file_name; - if (!PyArg_ParseTuple(args, "O&u:SaveKey", + if (!_PyArg_ParseStack(args, nargs, "O&u:SaveKey", clinic_HKEY_converter, &key, &file_name)) { goto exit; } + + if (!_PyArg_NoStackKeywords("SaveKey", kwnames)) { + goto exit; + } return_value = winreg_SaveKey_impl(module, key, file_name); exit: @@ -893,7 +933,7 @@ PyDoc_STRVAR(winreg_SetValue__doc__, "KEY_SET_VALUE access."); #define WINREG_SETVALUE_METHODDEF \ - {"SetValue", (PyCFunction)winreg_SetValue, METH_VARARGS, winreg_SetValue__doc__}, + {"SetValue", (PyCFunction)winreg_SetValue, METH_FASTCALL, winreg_SetValue__doc__}, static PyObject * winreg_SetValue_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key, @@ -901,7 +941,7 @@ winreg_SetValue_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key, Py_ssize_clean_t value_length); static PyObject * -winreg_SetValue(PyObject *module, PyObject *args) +winreg_SetValue(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; HKEY key; @@ -910,10 +950,14 @@ winreg_SetValue(PyObject *module, PyObject *args) Py_UNICODE *value; Py_ssize_clean_t value_length; - if (!PyArg_ParseTuple(args, "O&Zku#:SetValue", + if (!_PyArg_ParseStack(args, nargs, "O&Zku#:SetValue", clinic_HKEY_converter, &key, &sub_key, &type, &value, &value_length)) { goto exit; } + + if (!_PyArg_NoStackKeywords("SetValue", kwnames)) { + goto exit; + } return_value = winreg_SetValue_impl(module, key, sub_key, type, value, value_length); exit: @@ -964,14 +1008,14 @@ PyDoc_STRVAR(winreg_SetValueEx__doc__, "the configuration registry to help the registry perform efficiently."); #define WINREG_SETVALUEEX_METHODDEF \ - {"SetValueEx", (PyCFunction)winreg_SetValueEx, METH_VARARGS, winreg_SetValueEx__doc__}, + {"SetValueEx", (PyCFunction)winreg_SetValueEx, METH_FASTCALL, winreg_SetValueEx__doc__}, static PyObject * winreg_SetValueEx_impl(PyObject *module, HKEY key, Py_UNICODE *value_name, PyObject *reserved, DWORD type, PyObject *value); static PyObject * -winreg_SetValueEx(PyObject *module, PyObject *args) +winreg_SetValueEx(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; HKEY key; @@ -980,10 +1024,14 @@ winreg_SetValueEx(PyObject *module, PyObject *args) DWORD type; PyObject *value; - if (!PyArg_ParseTuple(args, "O&ZOkO:SetValueEx", + if (!_PyArg_ParseStack(args, nargs, "O&ZOkO:SetValueEx", clinic_HKEY_converter, &key, &value_name, &reserved, &type, &value)) { goto exit; } + + if (!_PyArg_NoStackKeywords("SetValueEx", kwnames)) { + goto exit; + } return_value = winreg_SetValueEx_impl(module, key, value_name, reserved, type, value); exit: @@ -1091,4 +1139,4 @@ winreg_QueryReflectionKey(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=16dd06be6e14b86e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ddc72b006143d33d input=a9049054013a1b77]*/ diff --git a/PC/clinic/winsound.c.h b/PC/clinic/winsound.c.h index 52d25b2434..8fa37134fc 100644 --- a/PC/clinic/winsound.c.h +++ b/PC/clinic/winsound.c.h @@ -28,7 +28,7 @@ winsound_PlaySound(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject PyObject *sound; int flags; - if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, &sound, &flags)) { goto exit; } @@ -65,7 +65,7 @@ winsound_Beep(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn int frequency; int duration; - if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, &frequency, &duration)) { goto exit; } @@ -97,7 +97,7 @@ winsound_MessageBeep(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObje static _PyArg_Parser _parser = {"|i:MessageBeep", _keywords, 0}; int type = MB_OK; - if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, &type)) { goto exit; } @@ -106,4 +106,4 @@ winsound_MessageBeep(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObje exit: return return_value; } -/*[clinic end generated code: output=bfe16b2b8b490cb1 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=102a556c665a277d input=a9049054013a1b77]*/ |