#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
diff --git a/Objects/setobject.c b/Objects/setobject.c
index cd63968..c7fb633 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -564,7 +564,7 @@
if (num_free_sets < MAXFREESETS && PyAnySet_CheckExact(so))
free_sets[num_free_sets++] = so;
else
- Py_Type(so)->tp_free(so);
+ Py_TYPE(so)->tp_free(so);
Py_TRASHCAN_SAFE_END(so)
}
@@ -580,13 +580,13 @@
if (status != 0) {
if (status < 0)
return NULL;
- return PyUnicode_FromFormat("%s(...)", Py_Type(so)->tp_name);
+ return PyUnicode_FromFormat("%s(...)", Py_TYPE(so)->tp_name);
}
/* shortcut for the empty set */
if (!so->used) {
Py_ReprLeave((PyObject*)so);
- return PyUnicode_FromFormat("%s()", Py_Type(so)->tp_name);
+ return PyUnicode_FromFormat("%s()", Py_TYPE(so)->tp_name);
}
keys = PySequence_List((PyObject *)so);
@@ -611,9 +611,9 @@
*u++ = '}';
}
Py_DECREF(listrepr);
- if (Py_Type(so) != &PySet_Type) {
+ if (Py_TYPE(so) != &PySet_Type) {
PyObject *tmp = PyUnicode_FromFormat("%s(%U)",
- Py_Type(so)->tp_name,
+ Py_TYPE(so)->tp_name,
result);
Py_DECREF(result);
result = tmp;
@@ -979,7 +979,7 @@
(type == &PySet_Type || type == &PyFrozenSet_Type)) {
so = free_sets[--num_free_sets];
assert (so != NULL && PyAnySet_CheckExact(so));
- Py_Type(so) = type;
+ Py_TYPE(so) = type;
_Py_NewReference((PyObject *)so);
EMPTY_TO_MINSIZE(so);
PyObject_GC_Track(so);
@@ -1105,8 +1105,8 @@
memcpy(b->smalltable, tab, sizeof(tab));
}
- if (PyType_IsSubtype(Py_Type(a), &PyFrozenSet_Type) &&
- PyType_IsSubtype(Py_Type(b), &PyFrozenSet_Type)) {
+ if (PyType_IsSubtype(Py_TYPE(a), &PyFrozenSet_Type) &&
+ PyType_IsSubtype(Py_TYPE(b), &PyFrozenSet_Type)) {
h = a->hash; a->hash = b->hash; b->hash = h;
} else {
a->hash = -1;
@@ -1117,7 +1117,7 @@
static PyObject *
set_copy(PySetObject *so)
{
- return make_new_set(Py_Type(so), (PyObject *)so);
+ return make_new_set(Py_TYPE(so), (PyObject *)so);
}
static PyObject *
@@ -1195,7 +1195,7 @@
if ((PyObject *)so == other)
return set_copy(so);
- result = (PySetObject *)make_new_set(Py_Type(so), NULL);
+ result = (PySetObject *)make_new_set(Py_TYPE(so), NULL);
if (result == NULL)
return NULL;
@@ -1449,7 +1449,7 @@
return NULL;
}
- result = make_new_set(Py_Type(so), NULL);
+ result = make_new_set(Py_TYPE(so), NULL);
if (result == NULL)
return NULL;
@@ -1550,7 +1550,7 @@
Py_INCREF(other);
otherset = (PySetObject *)other;
} else {
- otherset = (PySetObject *)make_new_set(Py_Type(so), other);
+ otherset = (PySetObject *)make_new_set(Py_TYPE(so), other);
if (otherset == NULL)
return NULL;
}
@@ -1581,7 +1581,7 @@
PyObject *rv;
PySetObject *otherset;
- otherset = (PySetObject *)make_new_set(Py_Type(so), other);
+ otherset = (PySetObject *)make_new_set(Py_TYPE(so), other);
if (otherset == NULL)
return NULL;
rv = set_symmetric_difference_update(otherset, (PyObject *)so);
@@ -1844,7 +1844,7 @@
dict = Py_None;
Py_INCREF(dict);
}
- result = PyTuple_Pack(3, Py_Type(so), args, dict);
+ result = PyTuple_Pack(3, Py_TYPE(so), args, dict);
done:
Py_XDECREF(args);
Py_XDECREF(keys);
@@ -1861,7 +1861,7 @@
if (!PyAnySet_Check(self))
return -1;
- if (!PyArg_UnpackTuple(args, Py_Type(self)->tp_name, 0, 1, &iterable))
+ if (!PyArg_UnpackTuple(args, Py_TYPE(self)->tp_name, 0, 1, &iterable))
return -1;
set_clear_internal(self);
self->hash = -1;
@@ -2153,7 +2153,7 @@
int
PySet_Clear(PyObject *set)
{
- if (!PyType_IsSubtype(Py_Type(set), &PySet_Type)) {
+ if (!PyType_IsSubtype(Py_TYPE(set), &PySet_Type)) {
PyErr_BadInternalCall();
return -1;
}
@@ -2173,7 +2173,7 @@
int
PySet_Discard(PyObject *set, PyObject *key)
{
- if (!PyType_IsSubtype(Py_Type(set), &PySet_Type)) {
+ if (!PyType_IsSubtype(Py_TYPE(set), &PySet_Type)) {
PyErr_BadInternalCall();
return -1;
}
@@ -2183,7 +2183,7 @@
int
PySet_Add(PyObject *set, PyObject *key)
{
- if (!PyType_IsSubtype(Py_Type(set), &PySet_Type)) {
+ if (!PyType_IsSubtype(Py_TYPE(set), &PySet_Type)) {
PyErr_BadInternalCall();
return -1;
}
@@ -2224,7 +2224,7 @@
PyObject *
PySet_Pop(PyObject *set)
{
- if (!PyType_IsSubtype(Py_Type(set), &PySet_Type)) {
+ if (!PyType_IsSubtype(Py_TYPE(set), &PySet_Type)) {
PyErr_BadInternalCall();
return NULL;
}
@@ -2234,7 +2234,7 @@
int
_PySet_Update(PyObject *set, PyObject *iterable)
{
- if (!PyType_IsSubtype(Py_Type(set), &PySet_Type)) {
+ if (!PyType_IsSubtype(Py_TYPE(set), &PySet_Type)) {
PyErr_BadInternalCall();
return -1;
}