summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/bytesobject.c12
-rw-r--r--Objects/setobject.c8
-rw-r--r--Objects/stringobject.c2
-rw-r--r--Objects/unicodeobject.c8
4 files changed, 15 insertions, 15 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 31db95f..25f7763 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -102,7 +102,7 @@ PyBytes_FromStringAndSize(const char *bytes, Py_ssize_t size)
memcpy(new->ob_bytes, bytes, size);
new->ob_bytes[size] = '\0'; /* Trailing null byte */
}
- new->ob_size = size;
+ Py_Size(new) = size;
new->ob_alloc = alloc;
return (PyObject *)new;
@@ -232,7 +232,7 @@ bytes_iconcat(PyBytesObject *self, PyObject *other)
return PyErr_NoMemory();
if (size < self->ob_alloc) {
Py_Size(self) = size;
- self->ob_bytes[self->ob_size] = '\0'; /* Trailing null byte */
+ self->ob_bytes[Py_Size(self)] = '\0'; /* Trailing null byte */
}
else if (PyBytes_Resize((PyObject *)self, size) < 0)
return NULL;
@@ -281,7 +281,7 @@ bytes_irepeat(PyBytesObject *self, Py_ssize_t count)
return PyErr_NoMemory();
if (size < self->ob_alloc) {
Py_Size(self) = size;
- self->ob_bytes[self->ob_size] = '\0'; /* Trailing null byte */
+ self->ob_bytes[Py_Size(self)] = '\0'; /* Trailing null byte */
}
else if (PyBytes_Resize((PyObject *)self, size) < 0)
return NULL;
@@ -816,7 +816,7 @@ static PyObject *
bytes_repr(PyBytesObject *self)
{
static const char *hexdigits = "0123456789abcdef";
- size_t newsize = 3 + 4 * self->ob_size;
+ size_t newsize = 3 + 4 * Py_Size(self);
PyObject *v;
if (newsize > PY_SSIZE_T_MAX || newsize / 4 != Py_Size(self)) {
PyErr_SetString(PyExc_OverflowError,
@@ -2594,7 +2594,7 @@ static PyObject *
bytes_join(PyBytesObject *self, PyObject *it)
{
PyObject *seq;
- Py_ssize_t mysize = self->ob_size;
+ Py_ssize_t mysize = Py_Size(self);
Py_ssize_t i;
Py_ssize_t n;
PyObject **items;
@@ -2727,7 +2727,7 @@ bytes_reduce(PyBytesObject *self)
return Py_BuildValue("(O(s#s))",
Py_Type(self),
self->ob_bytes == NULL ? "" : self->ob_bytes,
- self->ob_size,
+ Py_Size(self),
"latin-1");
}
diff --git a/Objects/setobject.c b/Objects/setobject.c
index cc60488..a5366c8 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -619,21 +619,21 @@ set_repr(PySetObject *so)
if (status != 0) {
if (status < 0)
return NULL;
- return PyUnicode_FromFormat("%s(...)", so->ob_type->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()", so->ob_type->tp_name);
+ return PyUnicode_FromFormat("%s()", Py_Type(so)->tp_name);
}
keys = PySequence_List((PyObject *)so);
if (keys == NULL)
goto done;
- if (so->ob_type != &PySet_Type) {
- result = PyUnicode_FromFormat("%s(%R)", so->ob_type->tp_name, keys);
+ if (Py_Type(so) != &PySet_Type) {
+ result = PyUnicode_FromFormat("%s(%R)", Py_Type(so)->tp_name, keys);
Py_DECREF(keys);
}
else {
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 6156b2f..68dfd35 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -835,7 +835,7 @@ PyString_Repr(PyObject *obj, int smartquotes)
static const char *hexdigits = "0123456789abcdef";
register PyStringObject* op = (PyStringObject*) obj;
Py_ssize_t length = PyString_GET_SIZE(op);
- size_t newsize = 3 + 4 * op->ob_size;
+ size_t newsize = 3 + 4 * Py_Size(op);
PyObject *v;
if (newsize > PY_SSIZE_T_MAX || newsize / 4 != Py_Size(op)) {
PyErr_SetString(PyExc_OverflowError,
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index bf031bb..6944eab 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -305,7 +305,7 @@ void unicode_dealloc(register PyUnicodeObject *unicode)
case SSTATE_INTERNED_MORTAL:
/* revive dead object temporarily for DelItem */
- unicode->ob_refcnt = 3;
+ Py_Refcnt(unicode) = 3;
if (PyDict_DelItem(interned, (PyObject *)unicode) != 0)
Py_FatalError(
"deletion of interned unicode string failed");
@@ -8758,7 +8758,7 @@ PyUnicode_InternInPlace(PyObject **p)
PyThreadState_GET()->recursion_critical = 0;
/* The two references in interned are not counted by refcnt.
The deallocator will take care of this */
- s->ob_refcnt -= 2;
+ Py_Refcnt(s) -= 2;
PyUnicode_CHECK_INTERNED(s) = SSTATE_INTERNED_MORTAL;
}
@@ -8812,11 +8812,11 @@ void _Py_ReleaseInternedUnicodeStrings(void)
/* XXX Shouldn't happen */
break;
case SSTATE_INTERNED_IMMORTAL:
- s->ob_refcnt += 1;
+ Py_Refcnt(s) += 1;
immortal_size += s->length;
break;
case SSTATE_INTERNED_MORTAL:
- s->ob_refcnt += 2;
+ Py_Refcnt(s) += 2;
mortal_size += s->length;
break;
default: