Skip to content

Commit 713afb8

Browse files
authored
gh-106320: Remove private _PyLong converter functions (#108499)
Move these private functions to the internal C API (pycore_long.h): * _PyLong_UnsignedInt_Converter() * _PyLong_UnsignedLongLong_Converter() * _PyLong_UnsignedLong_Converter() * _PyLong_UnsignedShort_Converter() Argument Clinic now emits #include "pycore_long.h" when these functions are used.
1 parent 86bc9e3 commit 713afb8

File tree

14 files changed

+46
-14
lines changed

14 files changed

+46
-14
lines changed

Include/cpython/longobject.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
# error "this header file must not be included directly"
33
#endif
44

5-
PyAPI_FUNC(int) _PyLong_UnsignedShort_Converter(PyObject *, void *);
6-
PyAPI_FUNC(int) _PyLong_UnsignedInt_Converter(PyObject *, void *);
7-
PyAPI_FUNC(int) _PyLong_UnsignedLong_Converter(PyObject *, void *);
8-
PyAPI_FUNC(int) _PyLong_UnsignedLongLong_Converter(PyObject *, void *);
95
PyAPI_FUNC(int) _PyLong_Size_t_Converter(PyObject *, void *);
106

117
PyAPI_FUNC(PyObject*) PyLong_FromUnicodeObject(PyObject *u, int base);

Include/internal/pycore_long.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ extern char* _PyLong_FormatBytesWriter(
186186
int base,
187187
int alternate);
188188

189+
// Argument converters used by Argument Clinic
190+
PyAPI_FUNC(int) _PyLong_UnsignedShort_Converter(PyObject *, void *);
191+
PyAPI_FUNC(int) _PyLong_UnsignedInt_Converter(PyObject *, void *);
192+
PyAPI_FUNC(int) _PyLong_UnsignedLong_Converter(PyObject *, void *);
193+
PyAPI_FUNC(int) _PyLong_UnsignedLongLong_Converter(PyObject *, void *);
194+
195+
189196
/* Long value tag bits:
190197
* 0-1: Sign bits value = (1-sign), ie. negative=2, positive=0, zero=1.
191198
* 2: Reserved for immortality bit

Modules/_blake2/clinic/blake2b_impl.c.h

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/_blake2/clinic/blake2s_impl.c.h

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/clinic/_testclinic.c.h

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/clinic/_testclinic_depr.c.h

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/clinic/overlapped.c.h

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/clinic/posixmodule.c.h

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/clinic/selectmodule.c.h

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/clinic/sha3module.c.h

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)