bpo-45490: Rename static inline functions (GH-31217)

When a static inline function is wrapped by a macro which casts its
arguments to the expected type, there is no need that the function
has a different name than the macro. Use the same name for the macro
and the function to avoid confusion.

Rename _PyUnicode_get_wstr_length() to PyUnicode_WSTR_LENGTH().

Don't rename static inline _Py_NewRef() and _Py_XNewRef() functions,
since the C API exports Py_NewRef() and Py_XNewRef() functions as
regular functions. The name cannot be reused in this case.
This commit is contained in:
Victor Stinner 2022-02-11 17:01:10 +01:00 committed by GitHub
parent 4f9386661d
commit e0bcfd0e4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 32 deletions

View file

@ -1939,7 +1939,7 @@ int
if (PyAsyncGen_CheckExact(iter)) {
return SPEC_FAIL_FOR_ITER_ASYNC_GENERATOR;
}
PyTypeObject *t = _Py_TYPE(iter);
PyTypeObject *t = Py_TYPE(iter);
if (t == &PyListIter_Type) {
return SPEC_FAIL_FOR_ITER_LIST;
}