summaryrefslogtreecommitdiffstats
path: root/Include/cpython/abstract.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-05-15 09:19:52 (GMT)
committerGitHub <noreply@github.com>2022-05-15 09:19:52 (GMT)
commit90e72300730189c4a48529baaad9b0005d40731c (patch)
tree9a4313d1b3fca0a17e4349bff1750497a89baec0 /Include/cpython/abstract.h
parentdb0b455ff482df68f331411bf22b3e5829398280 (diff)
downloadcpython-90e72300730189c4a48529baaad9b0005d40731c.zip
cpython-90e72300730189c4a48529baaad9b0005d40731c.tar.gz
cpython-90e72300730189c4a48529baaad9b0005d40731c.tar.bz2
gh-92781: Avoid mixing declarations and code in C API (#92783)
Avoid mixing declarations and code in the C API to fix the compiler warning: "ISO C90 forbids mixed declarations and code" [-Werror=declaration-after-statement].
Diffstat (limited to 'Include/cpython/abstract.h')
-rw-r--r--Include/cpython/abstract.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/Include/cpython/abstract.h b/Include/cpython/abstract.h
index 161e2cb..d276669 100644
--- a/Include/cpython/abstract.h
+++ b/Include/cpython/abstract.h
@@ -111,9 +111,8 @@ static inline PyObject *
PyObject_CallMethodOneArg(PyObject *self, PyObject *name, PyObject *arg)
{
PyObject *args[2] = {self, arg};
-
- assert(arg != NULL);
size_t nargsf = 2 | PY_VECTORCALL_ARGUMENTS_OFFSET;
+ assert(arg != NULL);
return PyObject_VectorcallMethod(name, args, nargsf, _Py_NULL);
}
@@ -160,9 +159,8 @@ static inline PyObject *
_PyObject_CallMethodIdOneArg(PyObject *self, _Py_Identifier *name, PyObject *arg)
{
PyObject *args[2] = {self, arg};
-
- assert(arg != NULL);
size_t nargsf = 2 | PY_VECTORCALL_ARGUMENTS_OFFSET;
+ assert(arg != NULL);
return _PyObject_VectorcallMethodId(name, args, nargsf, _Py_NULL);
}