Skip to content

Commit b3dc340

Browse files
committed
Make struct private
1 parent b8baca5 commit b3dc340

File tree

10 files changed

+19
-19
lines changed

10 files changed

+19
-19
lines changed

Include/object.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ typedef PyObject *(*iternextfunc) (PyObject *);
309309
typedef struct _py_object_index_pair {
310310
PyObject *object;
311311
Py_ssize_t index;
312-
} PyObjectIndexPair;
313-
typedef PyObjectIndexPair (*iteritemfunc) (PyObject *, Py_ssize_t index);
312+
} _PyObjectIndexPair;
313+
typedef _PyObjectIndexPair (*iteritemfunc) (PyObject *, Py_ssize_t index);
314314
typedef PyObject *(*descrgetfunc) (PyObject *, PyObject *, PyObject *);
315315
typedef int (*descrsetfunc) (PyObject *, PyObject *, PyObject *);
316316
typedef int (*initproc)(PyObject *, PyObject *, PyObject *);

Modules/_testinternalcapi/test_cases.c.h

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

Objects/bytesobject.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3206,15 +3206,15 @@ Construct an immutable array of bytes from:\n\
32063206
static PyObject *bytes_iter(PyObject *seq);
32073207

32083208

3209-
static PyObjectIndexPair
3209+
static _PyObjectIndexPair
32103210
bytes_iteritem(PyObject *obj, Py_ssize_t index)
32113211
{
32123212
PyBytesObject *a = _PyBytes_CAST(obj);
32133213
if (index >= Py_SIZE(a)) {
3214-
return (PyObjectIndexPair) { .object = NULL, .index = index };
3214+
return (_PyObjectIndexPair) { .object = NULL, .index = index };
32153215
}
32163216
PyObject *l = _PyLong_FromUnsignedChar((unsigned char)a->ob_sval[index]);
3217-
return (PyObjectIndexPair) { .object = l, .index = index + 1 };
3217+
return (_PyObjectIndexPair) { .object = l, .index = index + 1 };
32183218
}
32193219

32203220
PyTypeObject PyBytes_Type = {

Objects/listobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3913,11 +3913,11 @@ list_ass_subscript(PyObject *self, PyObject *item, PyObject *value)
39133913
return res;
39143914
}
39153915

3916-
static PyObjectIndexPair
3916+
static _PyObjectIndexPair
39173917
list_iteritem(PyObject *obj, Py_ssize_t index)
39183918
{
39193919
PyObject *result = list_get_item_ref((PyListObject *)obj, index);
3920-
return (PyObjectIndexPair) { .object = result, .index = index + 1 };
3920+
return (_PyObjectIndexPair) { .object = result, .index = index + 1 };
39213921
}
39223922

39233923
static PyMappingMethods list_as_mapping = {

Objects/tupleobject.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -873,15 +873,15 @@ static PySequenceMethods tuple_as_sequence = {
873873
tuple_contains, /* sq_contains */
874874
};
875875

876-
static PyObjectIndexPair
876+
static _PyObjectIndexPair
877877
tuple_iteritem(PyObject *obj, Py_ssize_t index)
878878
{
879879
if (index >= PyTuple_GET_SIZE(obj)) {
880-
return (PyObjectIndexPair) { .object = NULL, .index = index };
880+
return (_PyObjectIndexPair) { .object = NULL, .index = index };
881881
}
882882
PyObject *result = PyTuple_GET_ITEM(obj, index);
883883
Py_INCREF(result);
884-
return (PyObjectIndexPair) { .object = result, .index = index + 1 };
884+
return (_PyObjectIndexPair) { .object = result, .index = index + 1 };
885885
}
886886

887887
static PyObject*

Objects/unicodeobject.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13982,18 +13982,18 @@ unicode_subtype_new(PyTypeObject *type, PyObject *unicode)
1398213982
return NULL;
1398313983
}
1398413984

13985-
static PyObjectIndexPair
13985+
static _PyObjectIndexPair
1398613986
unicode_iteritem(PyObject *obj, Py_ssize_t index)
1398713987
{
1398813988
if (index >= PyUnicode_GET_LENGTH(obj)) {
13989-
return (PyObjectIndexPair) { .object = NULL, .index = index };
13989+
return (_PyObjectIndexPair) { .object = NULL, .index = index };
1399013990
}
1399113991
const void *data = PyUnicode_DATA(obj);
1399213992
int kind = PyUnicode_KIND(obj);
1399313993
Py_UCS4 ch = PyUnicode_READ(kind, data, index);
1399413994
PyObject *result = unicode_char(ch);
1399513995
index = (result == NULL) ? -1 : index + 1;
13996-
return (PyObjectIndexPair) { .object = result, .index = index };
13996+
return (_PyObjectIndexPair) { .object = result, .index = index };
1399713997
}
1399813998

1399913999
void

Python/bytecodes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3718,7 +3718,7 @@ dummy_func(
37183718
replaced op(_FOR_ITER_VIRTUAL, (iter, null_or_index -- iter, null_or_index, next)) {
37193719
PyObject *iter_o = PyStackRef_AsPyObjectBorrow(iter);
37203720
Py_ssize_t index = PyStackRef_UntagInt(null_or_index);
3721-
PyObjectIndexPair next_index = Py_TYPE(iter_o)->tp_iteritem(iter_o, index);
3721+
_PyObjectIndexPair next_index = Py_TYPE(iter_o)->tp_iteritem(iter_o, index);
37223722
PyObject *next_o = next_index.object;
37233723
index = next_index.index;
37243724
if (next_o == NULL) {
@@ -3741,7 +3741,7 @@ dummy_func(
37413741
op(_FOR_ITER_VIRTUAL_TIER_TWO, (iter, null_or_index -- iter, null_or_index, next)) {
37423742
PyObject *iter_o = PyStackRef_AsPyObjectBorrow(iter);
37433743
Py_ssize_t index = PyStackRef_UntagInt(null_or_index);
3744-
PyObjectIndexPair next_index = Py_TYPE(iter_o)->tp_iteritem(iter_o, index);
3744+
_PyObjectIndexPair next_index = Py_TYPE(iter_o)->tp_iteritem(iter_o, index);
37453745
PyObject *next_o = next_index.object;
37463746
index = next_index.index;
37473747
if (next_o == NULL) {

Python/ceval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3704,7 +3704,7 @@ _PyStackRef _PyForIter_VirtualIteratorNext(PyThreadState* tstate, _PyInterpreter
37043704
if (PyStackRef_IsTaggedInt(index)) {
37053705
intptr_t i = PyStackRef_UntagInt(index);
37063706
assert(i >= 0);
3707-
PyObjectIndexPair next_index = Py_TYPE(iter_o)->tp_iteritem(iter_o, i);
3707+
_PyObjectIndexPair next_index = Py_TYPE(iter_o)->tp_iteritem(iter_o, i);
37083708
i = next_index.index;
37093709
PyObject *next = next_index.object;
37103710
if (next == NULL) {

Python/executor_cases.c.h

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

Python/generated_cases.c.h

Lines changed: 1 addition & 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)