summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-04-10 15:05:40 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-04-10 15:05:40 (GMT)
commit57a01d3a0ee20ee9eea69b658c6bac0f39541625 (patch)
treecdeb89c231bbf902b59832b1b1f6dbe9a775292e /Objects
parente0805cf10ea84b44a13ad5649267edba7cb83ee9 (diff)
downloadcpython-57a01d3a0ee20ee9eea69b658c6bac0f39541625.zip
cpython-57a01d3a0ee20ee9eea69b658c6bac0f39541625.tar.gz
cpython-57a01d3a0ee20ee9eea69b658c6bac0f39541625.tar.bz2
Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREF
in places where Py_DECREF was used.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/bytesobject.c2
-rw-r--r--Objects/funcobject.c2
-rw-r--r--Objects/rangeobject.c2
-rw-r--r--Objects/typeobject.c6
-rw-r--r--Objects/unicodeobject.c8
5 files changed, 10 insertions, 10 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 11a4408..495c3eb 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -3520,7 +3520,7 @@ PyBytes_Concat(PyObject **pv, PyObject *w)
/* Multiple references, need to create new object */
PyObject *v;
v = bytes_concat(*pv, w);
- Py_XSETREF(*pv, v);
+ Py_SETREF(*pv, v);
}
}
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index 4252e93..e6c327d 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -527,7 +527,7 @@ func_new(PyTypeObject* type, PyObject* args, PyObject* kw)
if (name != Py_None) {
Py_INCREF(name);
- Py_XSETREF(newfunc->func_name, name);
+ Py_SETREF(newfunc->func_name, name);
}
if (defaults != Py_None) {
Py_INCREF(defaults);
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c
index 7a114e0..2be32e0 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -1064,7 +1064,7 @@ longrangeiter_next(longrangeiterobject *r)
result = PyNumber_Add(r->start, product);
Py_DECREF(product);
if (result) {
- Py_XSETREF(r->index, new_index);
+ Py_SETREF(r->index, new_index);
}
else {
Py_DECREF(new_index);
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 7628ce7..f88a5fb 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -424,7 +424,7 @@ type_set_name(PyTypeObject *type, PyObject *value, void *context)
type->tp_name = tp_name;
Py_INCREF(value);
- Py_XSETREF(((PyHeapTypeObject*)type)->ht_name, value);
+ Py_SETREF(((PyHeapTypeObject*)type)->ht_name, value);
return 0;
}
@@ -445,7 +445,7 @@ type_set_qualname(PyTypeObject *type, PyObject *value, void *context)
et = (PyHeapTypeObject*)type;
Py_INCREF(value);
- Py_XSETREF(et->ht_qualname, value);
+ Py_SETREF(et->ht_qualname, value);
return 0;
}
@@ -2897,7 +2897,7 @@ _PyType_Lookup(PyTypeObject *type, PyObject *name)
else
method_cache_misses++;
#endif
- Py_XSETREF(method_cache[h].name, name);
+ Py_SETREF(method_cache[h].name, name);
}
return res;
}
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index e2813fd..230125b 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1667,7 +1667,7 @@ unicode_resize(PyObject **p_unicode, Py_ssize_t length)
_Py_INCREF_UNICODE_EMPTY();
if (!unicode_empty)
return -1;
- Py_XSETREF(*p_unicode, unicode_empty);
+ Py_SETREF(*p_unicode, unicode_empty);
return 0;
}
@@ -1675,7 +1675,7 @@ unicode_resize(PyObject **p_unicode, Py_ssize_t length)
PyObject *copy = resize_copy(unicode, length);
if (copy == NULL)
return -1;
- Py_XSETREF(*p_unicode, copy);
+ Py_SETREF(*p_unicode, copy);
return 0;
}
@@ -13326,7 +13326,7 @@ _PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer,
return -1;
_PyUnicode_FastCopyCharacters(newbuffer, 0,
writer->buffer, 0, writer->pos);
- Py_XSETREF(writer->buffer, newbuffer);
+ Py_SETREF(writer->buffer, newbuffer);
}
_PyUnicodeWriter_Update(writer);
return 0;
@@ -15012,7 +15012,7 @@ PyUnicode_InternInPlace(PyObject **p)
if (t) {
Py_INCREF(t);
- Py_XSETREF(*p, t);
+ Py_SETREF(*p, t);
return;
}