8000 Remove PyUnstable_ prefix · python/cpython@b67b73a · GitHub
[go: up one dir, main page]

Skip to content

Commit b67b73a

Browse files
committed
Remove PyUnstable_ prefix
1 parent a309f39 commit b67b73a

File tree

4 files changed

+32
-32
lines changed

4 files changed

+32
-32
lines changed

Doc/c-api/long.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -552,17 +552,17 @@ Import/Export API
552552
A single unsigned digit.
553553
554554
It is usually used in an *array of digits*, such as the
555-
:c:member:`PyUnstable_Long_DigitArray.digits` array.
555+
:c:member:`PyLong_DigitArray.digits` array.
556556
557557
Its size depend on the :c:macro:`!PYLONG_BITS_IN_DIGIT` macro:
558558
see the ``configure`` :option:`--enable-big-digits` option.
559559
560-
See :c:member:`PyUnstable_Long_LAYOUT.bits_per_digit` for the number of bits per
561-
digit and :c:member:`PyUnstable_Long_LAYOUT.digit_size` for the size of a digit (in
560+
See :c:member:`PyLong_LAYOUT.bits_per_digit` for the number of bits per
561+
digit and :c:member:`PyLong_LAYOUT.digit_size` for the size of a digit (in
562562
bytes).
563563
564564
565-
.. c:struct:: PyUnstable_Long_LAYOUT
565+
.. c:struct:: PyLong_LAYOUT
566566
567567
Internal layout of a Python :class:`int` object.
568568
@@ -591,7 +591,7 @@ Import/Export API
591591
- ``-1`` for least significant first (little endian)
592592
593593
594-
.. c:function:: PyObject* PyUnstable_Long_Import(int negative, size_t ndigits, Py_digit *digits)
594+
.. c:function:: PyObject* PyLong_Import(int negative, size_t ndigits, Py_digit *digits)
595595
596596
Create a Python :class:`int` object from an array of digits.
597597
@@ -604,14 +604,14 @@ Import/Export API
604604
605605
*digits* is an array of unsigned digits.
606606
607-
See :c:struct:`PyUnstable_Long_LAYOUT` for the internal layout of an integer.
607+
See :c:struct:`PyLong_LAYOUT` for the internal layout of an integer.
608608
609609
610-
.. c:struct:: PyUnstable_Long_DigitArray
610+
.. c:struct:: PyLong_DigitArray
611611
612612
A Python :class:`int` object exported as an array of digits.
613613
614 8000 -
See :c:struct:`PyUnstable_Long_LAYOUT` for the internal layout of an
614+
See :c:struct:`PyLong_LAYOUT` for the internal layout of an
615615
integer.
616616
617617
.. c:member:: PyLongObject *obj
@@ -631,7 +631,7 @@ Import/Export API
631631
Array of unsigned digits.
632632
633633
634-
.. c:function:: int PyUnstable_Long_Export(PyObject *obj, PyUnstable_Long_DigitArray *array)
634+
.. c:function:: int PyLong_Export(PyObject *obj, PyLong_DigitArray *array)
635635
636636
Export a Python :class:`int` object as an array of digits.
637637
@@ -641,10 +641,10 @@ Import/Export API
641641
This function always succeeds if *obj* is a Python :class:`int` object or a
642642
subclass.
643643
644-
:c:func:`PyUnstable_Long_ReleaseExport` must be called once done with using
644+
:c:func:`PyLong_ReleaseExport` must be called once done with using
645645
*export*.
646646
647647
648-
.. c:function:: void PyUnstable_Long_ReleaseExport(PyUnstable_Long_DigitArray *array)
648+
.. c:function:: void PyLong_ReleaseExport(PyLong_DigitArray *array)
649649
650-
Release the export *array* created by :c:func:`PyUnstable_Long_Export`.
650+
Release the export *array* created by :c:func:`PyLong_Export`.

Include/cpython/longintrepr.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ _PyLong_CompactValue(PyLongObject *op)
143143

144144
/* --- Import/Export API -------------------------------------------------- */
145145

146-
typedef struct PyUnstable_LongLayout {
146+
typedef struct PyLongLayout {
147147
// Bits per digit
148148
uint8_t bits_per_digit;
149149

@@ -159,27 +159,27 @@ typedef struct PyUnstable_LongLayout {
159159
// - 1 for most significant byte first (big endian)
160160
// - -1 for least significant first (little endian)
161161
int8_t array_endian;
162-
} PyUnstable_LongLayout;
162+
} PyLongLayout;
163163

164-
PyAPI_DATA(const PyUnstable_LongLayout) PyUnstable_Long_LAYOUT;
164+
PyAPI_DATA(const PyLongLayout) PyLong_LAYOUT;
165165

166-
PyAPI_FUNC(PyObject*) PyUnstable_Long_Import(
166+
PyAPI_FUNC(PyObject*) PyLong_Import(
167167
int negative,
168168
size_t ndigits,
169169
Py_digit *digits);
170170

171-
typedef struct PyUnstable_Long_DigitArray {
171+
typedef struct PyLong_DigitArray {
172172
PyLongObject *obj;
173173
int negative;
174174
size_t ndigits;
175175
Py_digit *digits;
176-
} PyUnstable_Long_DigitArray;
176+
} PyLong_DigitArray;
177177

178-
PyAPI_FUNC(int) PyUnstable_Long_Export(
178+
PyAPI_FUNC(int) PyLong_Export(
179179
PyObject *obj,
180-
PyUnstable_Long_DigitArray *array);
181-
PyAPI_FUNC(void) PyUnstable_Long_ReleaseExport(
182-
PyUnstable_Long_DigitArray *array);
180+
PyLong_DigitArray *array);
181+
PyAPI_FUNC(void) PyLong_ReleaseExport(
182+
PyLong_DigitArray *array);
183183

184184

185185
/* --- PyLongWriter API --------------------------------------------------- */

Modules/_testcapi/long.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ pylong_import(PyObject *module, PyObject *args)
149149
digits[i] = digit;
150150
}
151151

152-
PyObject *res = PyUnstable_Long_Import(negative, ndigits, digits);
152+
PyObject *res = PyLong_Import(negative, ndigits, digits);
153153
PyMem_Free(digits);
154154

155155
return res;
@@ -163,8 +163,8 @@ pylong_import(PyObject *module, PyObject *args)
163163
static PyObject *
164164
pylong_export(PyObject *module, PyObject *obj)
165165
{
166-
PyUnstable_Long_DigitArray array;
167-
if (PyUnstable_Long_Export(obj, &array) < 0) {
166+
PyLong_DigitArray array;
167+
if (PyLong_Export(obj, &array) < 0) {
168168
return NULL;
169169
}
170170

@@ -185,19 +185,19 @@ pylong_export(PyObject *module, PyObject *obj)
185185
}
186186

187187
PyObject *res = Py_BuildValue("(iN)", array.negative, digits);
188-
PyUnstable_Long_ReleaseExport(&array);
188+
PyLong_ReleaseExport(&array);
189189
return res;
190190

191191
error:
192-
PyUnstable_Long_ReleaseExport(&array);
192+
PyLong_ReleaseExport(&array);
193193
return NULL;
194194
}
195195

196196

197197
static PyObject *
198198
get_pylong_layout(PyObject *module, PyObject *Py_UNUSED(args))
199199
{
200-
PyUnstable_LongLayout layout = PyUnstable_Long_LAYOUT;
200+
PyLongLayout layout = PyLong_LAYOUT;
201201

202202
PyObject *dict = PyDict_New();
203203
if (dict == NULL) {

Objects/longobject.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6694,7 +6694,7 @@ PyUnstable_Long_CompactValue(const PyLongObject* op) {
66946694
return _PyLong_CompactValue((PyLongObject*)op);
66956695
}
66966696

6697-
const PyUnstable_LongLayout PyUnstable_Long_LAYOUT = {
6697+
const PyLongLayout PyLong_LAYOUT = {
66986698
.bits_per_digit = PyLong_SHIFT,
66996699
.word_endian = PY_LITTLE_ENDIAN ? -1 : 1,
67006700
.array_endian = -1, // least significant first
@@ -6703,14 +6703,14 @@ const PyUnstable_LongLayout PyUnstable_Long_LAYOUT = {
67036703

67046704

67056705
PyObject*
6706-
PyUnstable_Long_Import(int negative, size_t ndigits, Py_digit *digits)
6706+
PyLong_Import(int negative, size_t ndigits, Py_digit *digits)
67076707
{
67086708
return (PyObject*)_PyLong_FromDigits(negative, ndigits, digits);
67096709
}
67106710

67116711

67126712
int
6713-
PyUnstable_Long_Export(PyObject *obj, PyUnstable_Long_DigitArray *array)
6713+
PyLong_Export(PyObject *obj, PyLong_DigitArray *array)
67146714
{
67156715
if (!PyLong_Check(obj)) {
67166716
PyErr_Format(PyExc_TypeError, "expect int, got %T", obj);
@@ -6730,7 +6730,7 @@ PyUnstable_Long_Export(PyObject *obj, PyUnstable_Long_DigitArray *array)
67306730

67316731

67326732
void
6733-
PyUnstable_Long_ReleaseExport(PyUnstable_Long_DigitArray *array)
6733+
PyLong_ReleaseExport(PyLong_DigitArray *array)
67346734
{
67356735
Py_CLEAR(array->obj);
67366736
array->negative = 0;

0 commit comments

Comments
 (0)
0