diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-04-10 15:12:01 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-04-10 15:12:01 (GMT) |
commit | f01e408c1688a207eba18444da8c151c872fba59 (patch) | |
tree | 3330812d856579add4526f10d5284164a15b6037 /Objects | |
parent | 47c5474aa0cbe8dc3cf2c370b19769edd3f2e8d8 (diff) | |
parent | 57a01d3a0ee20ee9eea69b658c6bac0f39541625 (diff) | |
download | cpython-f01e408c1688a207eba18444da8c151c872fba59.zip cpython-f01e408c1688a207eba18444da8c151c872fba59.tar.gz cpython-f01e408c1688a207eba18444da8c151c872fba59.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.c | 2 | ||||
-rw-r--r-- | Objects/funcobject.c | 2 | ||||
-rw-r--r-- | Objects/listobject.c | 2 | ||||
-rw-r--r-- | Objects/rangeobject.c | 2 | ||||
-rw-r--r-- | Objects/typeobject.c | 6 | ||||
-rw-r--r-- | Objects/unicodeobject.c | 8 |
6 files changed, 11 insertions, 11 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index cbf8166..b935375 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -3697,7 +3697,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 c5f1a0a..261c16d 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -504,7 +504,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/listobject.c b/Objects/listobject.c index 7c02be7..6e2d026 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -735,7 +735,7 @@ list_ass_item(PyListObject *a, Py_ssize_t i, PyObject *v) if (v == NULL) return list_ass_slice(a, i, i+1, v); Py_INCREF(v); - Py_XSETREF(a->ob_item[i], v); + Py_SETREF(a->ob_item[i], v); return 0; } 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 a01862d..865c6eb 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; } @@ -2903,7 +2903,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 2499a36..8dc2a38 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -1830,7 +1830,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; } @@ -1838,7 +1838,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; } @@ -13547,7 +13547,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; @@ -15264,7 +15264,7 @@ PyUnicode_InternInPlace(PyObject **p) if (t) { Py_INCREF(t); - Py_XSETREF(*p, t); + Py_SETREF(*p, t); return; } |