summaryrefslogtreecommitdiffstats
path: root/PC/clinic
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-06-09 13:16:06 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-06-09 13:16:06 (GMT)
commit5dee6551e2b98792bc6336206f763623483e7883 (patch)
treee18dfc32e889ca62dc3a0d3f4cd1484353d7a6aa /PC/clinic
parent2561bf6ae0a16576321cfb8cb900869b109b2263 (diff)
downloadcpython-5dee6551e2b98792bc6336206f763623483e7883.zip
cpython-5dee6551e2b98792bc6336206f763623483e7883.tar.gz
cpython-5dee6551e2b98792bc6336206f763623483e7883.tar.bz2
Issue #26305: Argument Clinic now uses braces in C code as required by PEP 7.
Diffstat (limited to 'PC/clinic')
-rw-r--r--PC/clinic/msvcrtmodule.c.h59
-rw-r--r--PC/clinic/winreg.c.h86
-rw-r--r--PC/clinic/winsound.c.h11
3 files changed, 103 insertions, 53 deletions
diff --git a/PC/clinic/msvcrtmodule.c.h b/PC/clinic/msvcrtmodule.c.h
index c8e6ed8..24e18cd 100644
--- a/PC/clinic/msvcrtmodule.c.h
+++ b/PC/clinic/msvcrtmodule.c.h
@@ -51,8 +51,9 @@ msvcrt_locking(PyModuleDef *module, PyObject *args)
long nbytes;
if (!PyArg_ParseTuple(args, "iil:locking",
- &fd, &mode, &nbytes))
+ &fd, &mode, &nbytes)) {
goto exit;
+ }
return_value = msvcrt_locking_impl(module, fd, mode, nbytes);
exit:
@@ -85,11 +86,13 @@ msvcrt_setmode(PyModuleDef *module, PyObject *args)
long _return_value;
if (!PyArg_ParseTuple(args, "ii:setmode",
- &fd, &flags))
+ &fd, &flags)) {
goto exit;
+ }
_return_value = msvcrt_setmode_impl(module, fd, flags);
- if ((_return_value == -1) && PyErr_Occurred())
+ if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
+ }
return_value = PyLong_FromLong(_return_value);
exit:
@@ -122,11 +125,13 @@ msvcrt_open_osfhandle(PyModuleDef *module, PyObject *args)
long _return_value;
if (!PyArg_ParseTuple(args, ""_Py_PARSE_INTPTR"i:open_osfhandle",
- &handle, &flags))
+ &handle, &flags)) {
goto exit;
+ }
_return_value = msvcrt_open_osfhandle_impl(module, handle, flags);
- if ((_return_value == -1) && PyErr_Occurred())
+ if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
+ }
return_value = PyLong_FromLong(_return_value);
exit:
@@ -154,11 +159,13 @@ msvcrt_get_osfhandle(PyModuleDef *module, PyObject *arg)
int fd;
Py_intptr_t _return_value;
- if (!PyArg_Parse(arg, "i:get_osfhandle", &fd))
+ if (!PyArg_Parse(arg, "i:get_osfhandle", &fd)) {
goto exit;
+ }
_return_value = msvcrt_get_osfhandle_impl(module, fd);
- if ((_return_value == -1) && PyErr_Occurred())
+ if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
+ }
return_value = PyLong_FromVoidPtr((void *)_return_value);
exit:
@@ -184,8 +191,9 @@ msvcrt_kbhit(PyModuleDef *module, PyObject *Py_UNUSED(ignored))
long _return_value;
_return_value = msvcrt_kbhit_impl(module);
- if ((_return_value == -1) && PyErr_Occurred())
+ if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
+ }
return_value = PyLong_FromLong(_return_value);
exit:
@@ -312,8 +320,9 @@ msvcrt_putch(PyModuleDef *module, PyObject *arg)
PyObject *return_value = NULL;
char char_value;
- if (!PyArg_Parse(arg, "c:putch", &char_value))
+ if (!PyArg_Parse(arg, "c:putch", &char_value)) {
goto exit;
+ }
return_value = msvcrt_putch_impl(module, char_value);
exit:
@@ -338,8 +347,9 @@ msvcrt_putwch(PyModuleDef *module, PyObject *arg)
PyObject *return_value = NULL;
int unicode_char;
- if (!PyArg_Parse(arg, "C:putwch", &unicode_char))
+ if (!PyArg_Parse(arg, "C:putwch", &unicode_char)) {
goto exit;
+ }
return_value = msvcrt_putwch_impl(module, unicode_char);
exit:
@@ -368,8 +378,9 @@ msvcrt_ungetch(PyModuleDef *module, PyObject *arg)
PyObject *return_value = NULL;
char char_value;
- if (!PyArg_Parse(arg, "c:ungetch", &char_value))
+ if (!PyArg_Parse(arg, "c:ungetch", &char_value)) {
goto exit;
+ }
return_value = msvcrt_ungetch_impl(module, char_value);
exit:
@@ -394,8 +405,9 @@ msvcrt_ungetwch(PyModuleDef *module, PyObject *arg)
PyObject *return_value = NULL;
int unicode_char;
- if (!PyArg_Parse(arg, "C:ungetwch", &unicode_char))
+ if (!PyArg_Parse(arg, "C:ungetwch", &unicode_char)) {
goto exit;
+ }
return_value = msvcrt_ungetwch_impl(module, unicode_char);
exit:
@@ -427,11 +439,13 @@ msvcrt_CrtSetReportFile(PyModuleDef *module, PyObject *args)
long _return_value;
if (!PyArg_ParseTuple(args, "ii:CrtSetReportFile",
- &type, &file))
+ &type, &file)) {
goto exit;
+ }
_return_value = msvcrt_CrtSetReportFile_impl(module, type, file);
- if ((_return_value == -1) && PyErr_Occurred())
+ if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
+ }
return_value = PyLong_FromLong(_return_value);
exit:
@@ -465,11 +479,13 @@ msvcrt_CrtSetReportMode(PyModuleDef *module, PyObject *args)
long _return_value;
if (!PyArg_ParseTuple(args, "ii:CrtSetReportMode",
- &type, &mode))
+ &type, &mode)) {
goto exit;
+ }
_return_value = msvcrt_CrtSetReportMode_impl(module, type, mode);
- if ((_return_value == -1) && PyErr_Occurred())
+ if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
+ }
return_value = PyLong_FromLong(_return_value);
exit:
@@ -501,11 +517,13 @@ msvcrt_set_error_mode(PyModuleDef *module, PyObject *arg)
int mode;
long _return_value;
- if (!PyArg_Parse(arg, "i:set_error_mode", &mode))
+ if (!PyArg_Parse(arg, "i:set_error_mode", &mode)) {
goto exit;
+ }
_return_value = msvcrt_set_error_mode_impl(module, mode);
- if ((_return_value == -1) && PyErr_Occurred())
+ if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
+ }
return_value = PyLong_FromLong(_return_value);
exit:
@@ -532,8 +550,9 @@ msvcrt_SetErrorMode(PyModuleDef *module, PyObject *arg)
PyObject *return_value = NULL;
unsigned int mode;
- if (!PyArg_Parse(arg, "I:SetErrorMode", &mode))
+ if (!PyArg_Parse(arg, "I:SetErrorMode", &mode)) {
goto exit;
+ }
return_value = msvcrt_SetErrorMode_impl(module, mode);
exit:
@@ -551,4 +570,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=16613d3119a1fd44 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=636de3460aecbca7 input=a9049054013a1b77]*/
diff --git a/PC/clinic/winreg.c.h b/PC/clinic/winreg.c.h
index 5176130..f3a4cd1 100644
--- a/PC/clinic/winreg.c.h
+++ b/PC/clinic/winreg.c.h
@@ -93,8 +93,9 @@ winreg_HKEYType___exit__(PyHKEYObject *self, PyObject *args, PyObject *kwargs)
PyObject *traceback;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:__exit__", _keywords,
- &exc_type, &exc_value, &traceback))
+ &exc_type, &exc_value, &traceback)) {
goto exit;
+ }
return_value = winreg_HKEYType___exit___impl(self, exc_type, exc_value, traceback);
exit:
@@ -147,11 +148,13 @@ winreg_ConnectRegistry(PyModuleDef *module, PyObject *args)
HKEY _return_value;
if (!PyArg_ParseTuple(args, "ZO&:ConnectRegistry",
- &computer_name, clinic_HKEY_converter, &key))
+ &computer_name, clinic_HKEY_converter, &key)) {
goto exit;
+ }
_return_value = winreg_ConnectRegistry_impl(module, computer_name, key);
- if (_return_value == NULL)
+ if (_return_value == NULL) {
goto exit;
+ }
return_value = PyHKEY_FromHKEY(_return_value);
exit:
@@ -192,11 +195,13 @@ winreg_CreateKey(PyModuleDef *module, PyObject *args)
HKEY _return_value;
if (!PyArg_ParseTuple(args, "O&Z:CreateKey",
- clinic_HKEY_converter, &key, &sub_key))
+ clinic_HKEY_converter, &key, &sub_key)) {
goto exit;
+ }
_return_value = winreg_CreateKey_impl(module, key, sub_key);
- if (_return_value == NULL)
+ if (_return_value == NULL) {
goto exit;
+ }
return_value = PyHKEY_FromHKEY(_return_value);
exit:
@@ -247,11 +252,13 @@ winreg_CreateKeyEx(PyModuleDef *module, PyObject *args, PyObject *kwargs)
HKEY _return_value;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&Z|ii:CreateKeyEx", _keywords,
- clinic_HKEY_converter, &key, &sub_key, &reserved, &access))
+ clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) {
goto exit;
+ }
_return_value = winreg_CreateKeyEx_impl(module, key, sub_key, reserved, access);
- if (_return_value == NULL)
+ if (_return_value == NULL) {
goto exit;
+ }
return_value = PyHKEY_FromHKEY(_return_value);
exit:
@@ -290,8 +297,9 @@ winreg_DeleteKey(PyModuleDef *module, PyObject *args)
Py_UNICODE *sub_key;
if (!PyArg_ParseTuple(args, "O&u:DeleteKey",
- clinic_HKEY_converter, &key, &sub_key))
+ clinic_HKEY_converter, &key, &sub_key)) {
goto exit;
+ }
return_value = winreg_DeleteKey_impl(module, key, sub_key);
exit:
@@ -341,8 +349,9 @@ winreg_DeleteKeyEx(PyModuleDef *module, PyObject *args, PyObject *kwargs)
int reserved = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&u|ii:DeleteKeyEx", _keywords,
- clinic_HKEY_converter, &key, &sub_key, &access, &reserved))
+ clinic_HKEY_converter, &key, &sub_key, &access, &reserved)) {
goto exit;
+ }
return_value = winreg_DeleteKeyEx_impl(module, key, sub_key, access, reserved);
exit:
@@ -374,8 +383,9 @@ winreg_DeleteValue(PyModuleDef *module, PyObject *args)
Py_UNICODE *value;
if (!PyArg_ParseTuple(args, "O&Z:DeleteValue",
- clinic_HKEY_converter, &key, &value))
+ clinic_HKEY_converter, &key, &value)) {
goto exit;
+ }
return_value = winreg_DeleteValue_impl(module, key, value);
exit:
@@ -411,8 +421,9 @@ winreg_EnumKey(PyModuleDef *module, PyObject *args)
int index;
if (!PyArg_ParseTuple(args, "O&i:EnumKey",
- clinic_HKEY_converter, &key, &index))
+ clinic_HKEY_converter, &key, &index)) {
goto exit;
+ }
return_value = winreg_EnumKey_impl(module, key, index);
exit:
@@ -457,8 +468,9 @@ winreg_EnumValue(PyModuleDef *module, PyObject *args)
int index;
if (!PyArg_ParseTuple(args, "O&i:EnumValue",
- clinic_HKEY_converter, &key, &index))
+ clinic_HKEY_converter, &key, &index)) {
goto exit;
+ }
return_value = winreg_EnumValue_impl(module, key, index);
exit:
@@ -483,8 +495,9 @@ winreg_ExpandEnvironmentStrings(PyModuleDef *module, PyObject *arg)
PyObject *return_value = NULL;
Py_UNICODE *string;
- if (!PyArg_Parse(arg, "u:ExpandEnvironmentStrings", &string))
+ if (!PyArg_Parse(arg, "u:ExpandEnvironmentStrings", &string)) {
goto exit;
+ }
return_value = winreg_ExpandEnvironmentStrings_impl(module, string);
exit:
@@ -522,8 +535,9 @@ winreg_FlushKey(PyModuleDef *module, PyObject *arg)
PyObject *return_value = NULL;
HKEY key;
- if (!PyArg_Parse(arg, "O&:FlushKey", clinic_HKEY_converter, &key))
+ if (!PyArg_Parse(arg, "O&:FlushKey", clinic_HKEY_converter, &key)) {
goto exit;
+ }
return_value = winreg_FlushKey_impl(module, key);
exit:
@@ -574,8 +588,9 @@ winreg_LoadKey(PyModuleDef *module, PyObject *args)
Py_UNICODE *file_name;
if (!PyArg_ParseTuple(args, "O&uu:LoadKey",
- clinic_HKEY_converter, &key, &sub_key, &file_name))
+ clinic_HKEY_converter, &key, &sub_key, &file_name)) {
goto exit;
+ }
return_value = winreg_LoadKey_impl(module, key, sub_key, file_name);
exit:
@@ -620,11 +635,13 @@ winreg_OpenKey(PyModuleDef *module, PyObject *args, PyObject *kwargs)
HKEY _return_value;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&Z|ii:OpenKey", _keywords,
- clinic_HKEY_converter, &key, &sub_key, &reserved, &access))
+ clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) {
goto exit;
+ }
_return_value = winreg_OpenKey_impl(module, key, sub_key, reserved, access);
- if (_return_value == NULL)
+ if (_return_value == NULL) {
goto exit;
+ }
return_value = PyHKEY_FromHKEY(_return_value);
exit:
@@ -669,11 +686,13 @@ winreg_OpenKeyEx(PyModuleDef *module, PyObject *args, PyObject *kwargs)
HKEY _return_value;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&Z|ii:OpenKeyEx", _keywords,
- clinic_HKEY_converter, &key, &sub_key, &reserved, &access))
+ clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) {
goto exit;
+ }
_return_value = winreg_OpenKeyEx_impl(module, key, sub_key, reserved, access);
- if (_return_value == NULL)
+ if (_return_value == NULL) {
goto exit;
+ }
return_value = PyHKEY_FromHKEY(_return_value);
exit:
@@ -707,8 +726,9 @@ winreg_QueryInfoKey(PyModuleDef *module, PyObject *arg)
PyObject *return_value = NULL;
HKEY key;
- if (!PyArg_Parse(arg, "O&:QueryInfoKey", clinic_HKEY_converter, &key))
+ if (!PyArg_Parse(arg, "O&:QueryInfoKey", clinic_HKEY_converter, &key)) {
goto exit;
+ }
return_value = winreg_QueryInfoKey_impl(module, key);
exit:
@@ -749,8 +769,9 @@ winreg_QueryValue(PyModuleDef *module, PyObject *args)
Py_UNICODE *sub_key;
if (!PyArg_ParseTuple(args, "O&Z:QueryValue",
- clinic_HKEY_converter, &key, &sub_key))
+ clinic_HKEY_converter, &key, &sub_key)) {
goto exit;
+ }
return_value = winreg_QueryValue_impl(module, key, sub_key);
exit:
@@ -787,8 +808,9 @@ winreg_QueryValueEx(PyModuleDef *module, PyObject *args)
Py_UNICODE *name;
if (!PyArg_ParseTuple(args, "O&Z:QueryValueEx",
- clinic_HKEY_converter, &key, &name))
+ clinic_HKEY_converter, &key, &name)) {
goto exit;
+ }
return_value = winreg_QueryValueEx_impl(module, key, name);
exit:
@@ -830,8 +852,9 @@ winreg_SaveKey(PyModuleDef *module, PyObject *args)
Py_UNICODE *file_name;
if (!PyArg_ParseTuple(args, "O&u:SaveKey",
- clinic_HKEY_converter, &key, &file_name))
+ clinic_HKEY_converter, &key, &file_name)) {
goto exit;
+ }
return_value = winreg_SaveKey_impl(module, key, file_name);
exit:
@@ -883,8 +906,9 @@ winreg_SetValue(PyModuleDef *module, PyObject *args)
Py_ssize_clean_t value_length;
if (!PyArg_ParseTuple(args, "O&Zku#:SetValue",
- clinic_HKEY_converter, &key, &sub_key, &type, &value, &value_length))
+ clinic_HKEY_converter, &key, &sub_key, &type, &value, &value_length)) {
goto exit;
+ }
return_value = winreg_SetValue_impl(module, key, sub_key, type, value, value_length);
exit:
@@ -952,8 +976,9 @@ winreg_SetValueEx(PyModuleDef *module, PyObject *args)
PyObject *value;
if (!PyArg_ParseTuple(args, "O&ZOkO:SetValueEx",
- clinic_HKEY_converter, &key, &value_name, &reserved, &type, &value))
+ clinic_HKEY_converter, &key, &value_name, &reserved, &type, &value)) {
goto exit;
+ }
return_value = winreg_SetValueEx_impl(module, key, value_name, reserved, type, value);
exit:
@@ -987,8 +1012,9 @@ winreg_DisableReflectionKey(PyModuleDef *module, PyObject *arg)
PyObject *return_value = NULL;
HKEY key;
- if (!PyArg_Parse(arg, "O&:DisableReflectionKey", clinic_HKEY_converter, &key))
+ if (!PyArg_Parse(arg, "O&:DisableReflectionKey", clinic_HKEY_converter, &key)) {
goto exit;
+ }
return_value = winreg_DisableReflectionKey_impl(module, key);
exit:
@@ -1020,8 +1046,9 @@ winreg_EnableReflectionKey(PyModuleDef *module, PyObject *arg)
PyObject *return_value = NULL;
HKEY key;
- if (!PyArg_Parse(arg, "O&:EnableReflectionKey", clinic_HKEY_converter, &key))
+ if (!PyArg_Parse(arg, "O&:EnableReflectionKey", clinic_HKEY_converter, &key)) {
goto exit;
+ }
return_value = winreg_EnableReflectionKey_impl(module, key);
exit:
@@ -1051,11 +1078,12 @@ winreg_QueryReflectionKey(PyModuleDef *module, PyObject *arg)
PyObject *return_value = NULL;
HKEY key;
- if (!PyArg_Parse(arg, "O&:QueryReflectionKey", clinic_HKEY_converter, &key))
+ if (!PyArg_Parse(arg, "O&:QueryReflectionKey", clinic_HKEY_converter, &key)) {
goto exit;
+ }
return_value = winreg_QueryReflectionKey_impl(module, key);
exit:
return return_value;
}
-/*[clinic end generated code: output=0b71782e9b37b12a input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ca128bfa212d8d1f input=a9049054013a1b77]*/
diff --git a/PC/clinic/winsound.c.h b/PC/clinic/winsound.c.h
index dca5a42..e649363 100644
--- a/PC/clinic/winsound.c.h
+++ b/PC/clinic/winsound.c.h
@@ -27,8 +27,9 @@ winsound_PlaySound(PyModuleDef *module, PyObject *args)
int flags;
if (!PyArg_ParseTuple(args, "Zi:PlaySound",
- &sound, &flags))
+ &sound, &flags)) {
goto exit;
+ }
return_value = winsound_PlaySound_impl(module, sound, flags);
exit:
@@ -61,8 +62,9 @@ winsound_Beep(PyModuleDef *module, PyObject *args)
int duration;
if (!PyArg_ParseTuple(args, "ii:Beep",
- &frequency, &duration))
+ &frequency, &duration)) {
goto exit;
+ }
return_value = winsound_Beep_impl(module, frequency, duration);
exit:
@@ -90,11 +92,12 @@ winsound_MessageBeep(PyModuleDef *module, PyObject *args)
int x = MB_OK;
if (!PyArg_ParseTuple(args, "|i:MessageBeep",
- &x))
+ &x)) {
goto exit;
+ }
return_value = winsound_MessageBeep_impl(module, x);
exit:
return return_value;
}
-/*[clinic end generated code: output=c5b018ac9dc1f500 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a5f53e42d4396bb4 input=a9049054013a1b77]*/