diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-04-06 06:45:48 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-04-06 06:45:48 (GMT) |
commit | 48842714b948fa239392ddd7e207151d5fcb8bc7 (patch) | |
tree | 7fd1573b10b193f735a2685bb832900608513e7d /Objects | |
parent | 0e0563ca2c6d67126f33ea077ddea19af71f14eb (diff) | |
download | cpython-48842714b948fa239392ddd7e207151d5fcb8bc7.zip cpython-48842714b948fa239392ddd7e207151d5fcb8bc7.tar.gz cpython-48842714b948fa239392ddd7e207151d5fcb8bc7.tar.bz2 |
Issue #22570: Renamed Py_SETREF to Py_XSETREF.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/bytesobject.c | 2 | ||||
-rw-r--r-- | Objects/descrobject.c | 2 | ||||
-rw-r--r-- | Objects/exceptions.c | 32 | ||||
-rw-r--r-- | Objects/frameobject.c | 2 | ||||
-rw-r--r-- | Objects/funcobject.c | 10 | ||||
-rw-r--r-- | Objects/moduleobject.c | 2 | ||||
-rw-r--r-- | Objects/rangeobject.c | 6 | ||||
-rw-r--r-- | Objects/typeobject.c | 8 | ||||
-rw-r--r-- | Objects/unicodeobject.c | 8 |
9 files changed, 36 insertions, 36 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 495c3eb..11a4408 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_SETREF(*pv, v); + Py_XSETREF(*pv, v); } } diff --git a/Objects/descrobject.c b/Objects/descrobject.c index da11f6b..ac2752e 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -1509,7 +1509,7 @@ property_init(PyObject *self, PyObject *args, PyObject *kwds) PyObject *get_doc = _PyObject_GetAttrId(get, &PyId___doc__); if (get_doc) { if (Py_TYPE(self) == &PyProperty_Type) { - Py_SETREF(prop->prop_doc, get_doc); + Py_XSETREF(prop->prop_doc, get_doc); } else { /* If this is a property subclass, put __doc__ diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 85f9472..d03aada 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -206,7 +206,7 @@ BaseException_set_args(PyBaseExceptionObject *self, PyObject *val) seq = PySequence_Tuple(val); if (!seq) return -1; - Py_SETREF(self->args, seq); + Py_XSETREF(self->args, seq); return 0; } @@ -235,7 +235,7 @@ BaseException_set_tb(PyBaseExceptionObject *self, PyObject *tb) } Py_XINCREF(tb); - Py_SETREF(self->traceback, tb); + Py_XSETREF(self->traceback, tb); return 0; } @@ -563,11 +563,11 @@ SystemExit_init(PySystemExitObject *self, PyObject *args, PyObject *kwds) return 0; if (size == 1) { Py_INCREF(PyTuple_GET_ITEM(args, 0)); - Py_SETREF(self->code, PyTuple_GET_ITEM(args, 0)); + Py_XSETREF(self->code, PyTuple_GET_ITEM(args, 0)); } else { /* size > 1 */ Py_INCREF(args); - Py_SETREF(self->code, args); + Py_XSETREF(self->code, args); } return 0; } @@ -628,7 +628,7 @@ ImportError_init(PyImportErrorObject *self, PyObject *args, PyObject *kwds) kwd = PyDict_GetItemString(kwds, #kwd); \ if (kwd) { \ Py_INCREF(kwd); \ - Py_SETREF(self->kwd, kwd); \ + Py_XSETREF(self->kwd, kwd); \ if (PyDict_DelItemString(kwds, #kwd)) \ return -1; \ } \ @@ -647,7 +647,7 @@ ImportError_init(PyImportErrorObject *self, PyObject *args, PyObject *kwds) return -1; Py_INCREF(msg); - Py_SETREF(self->msg, msg); + Py_XSETREF(self->msg, msg); return 0; } @@ -857,7 +857,7 @@ oserror_init(PyOSErrorObject *self, PyObject **p_args, #endif /* Steals the reference to args */ - Py_SETREF(self->args, args); + Py_XSETREF(self->args, args); *p_args = args = NULL; return 0; @@ -1277,7 +1277,7 @@ SyntaxError_init(PySyntaxErrorObject *self, PyObject *args, PyObject *kwds) if (lenargs >= 1) { Py_INCREF(PyTuple_GET_ITEM(args, 0)); - Py_SETREF(self->msg, PyTuple_GET_ITEM(args, 0)); + Py_XSETREF(self->msg, PyTuple_GET_ITEM(args, 0)); } if (lenargs == 2) { info = PyTuple_GET_ITEM(args, 1); @@ -1293,16 +1293,16 @@ SyntaxError_init(PySyntaxErrorObject *self, PyObject *args, PyObject *kwds) } Py_INCREF(PyTuple_GET_ITEM(info, 0)); - Py_SETREF(self->filename, PyTuple_GET_ITEM(info, 0)); + Py_XSETREF(self->filename, PyTuple_GET_ITEM(info, 0)); Py_INCREF(PyTuple_GET_ITEM(info, 1)); - Py_SETREF(self->lineno, PyTuple_GET_ITEM(info, 1)); + Py_XSETREF(self->lineno, PyTuple_GET_ITEM(info, 1)); Py_INCREF(PyTuple_GET_ITEM(info, 2)); - Py_SETREF(self->offset, PyTuple_GET_ITEM(info, 2)); + Py_XSETREF(self->offset, PyTuple_GET_ITEM(info, 2)); Py_INCREF(PyTuple_GET_ITEM(info, 3)); - Py_SETREF(self->text, PyTuple_GET_ITEM(info, 3)); + Py_XSETREF(self->text, PyTuple_GET_ITEM(info, 3)); Py_DECREF(info); @@ -1547,7 +1547,7 @@ set_unicodefromstring(PyObject **attr, const char *value) PyObject *obj = PyUnicode_FromString(value); if (!obj) return -1; - Py_SETREF(*attr, obj); + Py_XSETREF(*attr, obj); return 0; } @@ -1953,7 +1953,7 @@ UnicodeDecodeError_init(PyObject *self, PyObject *args, PyObject *kwds) Py_buffer view; if (PyObject_GetBuffer(ude->object, &view, PyBUF_SIMPLE) != 0) goto error; - Py_SETREF(ude->object, PyBytes_FromStringAndSize(view.buf, view.len)); + Py_XSETREF(ude->object, PyBytes_FromStringAndSize(view.buf, view.len)); PyBuffer_Release(&view); if (!ude->object) goto error; @@ -2862,7 +2862,7 @@ _check_for_legacy_statements(PySyntaxErrorObject *self, Py_ssize_t start) } if (PyUnicode_Tailmatch(self->text, print_prefix, start, text_len, -1)) { - Py_SETREF(self->msg, + Py_XSETREF(self->msg, PyUnicode_FromString("Missing parentheses in call to 'print'")); return 1; } @@ -2876,7 +2876,7 @@ _check_for_legacy_statements(PySyntaxErrorObject *self, Py_ssize_t start) } if (PyUnicode_Tailmatch(self->text, exec_prefix, start, text_len, -1)) { - Py_SETREF(self->msg, + Py_XSETREF(self->msg, PyUnicode_FromString("Missing parentheses in call to 'exec'")); return 1; } diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 37e626d..bdf06db 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -857,7 +857,7 @@ dict_to_map(PyObject *map, Py_ssize_t nmap, PyObject *dict, PyObject **values, } } else if (values[j] != value) { Py_XINCREF(value); - Py_SETREF(values[j], value); + Py_XSETREF(values[j], value); } Py_XDECREF(value); } diff --git a/Objects/funcobject.c b/Objects/funcobject.c index 13daaba..4252e93 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -127,7 +127,7 @@ PyFunction_SetDefaults(PyObject *op, PyObject *defaults) PyErr_SetString(PyExc_SystemError, "non-tuple default args"); return -1; } - Py_SETREF(((PyFunctionObject *)op)->func_defaults, defaults); + Py_XSETREF(((PyFunctionObject *)op)->func_defaults, defaults); return 0; } @@ -158,7 +158,7 @@ PyFunction_SetKwDefaults(PyObject *op, PyObject *defaults) "non-dict keyword only default args"); return -1; } - Py_SETREF(((PyFunctionObject *)op)->func_kwdefaults, defaults); + Py_XSETREF(((PyFunctionObject *)op)->func_kwdefaults, defaults); return 0; } @@ -190,7 +190,7 @@ PyFunction_SetClosure(PyObject *op, PyObject *closure) closure->ob_type->tp_name); return -1; } - Py_SETREF(((PyFunctionObject *)op)->func_closure, closure); + Py_XSETREF(((PyFunctionObject *)op)->func_closure, closure); return 0; } @@ -221,7 +221,7 @@ PyFunction_SetAnnotations(PyObject *op, PyObject *annotations) "non-dict annotations"); return -1; } - Py_SETREF(((PyFunctionObject *)op)->func_annotations, annotations); + Py_XSETREF(((PyFunctionObject *)op)->func_annotations, annotations); return 0; } @@ -527,7 +527,7 @@ func_new(PyTypeObject* type, PyObject* args, PyObject* kw) if (name != Py_None) { Py_INCREF(name); - Py_SETREF(newfunc->func_name, name); + Py_XSETREF(newfunc->func_name, name); } if (defaults != Py_None) { Py_INCREF(defaults); diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index 24c5f4c..a4cdc20 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -69,7 +69,7 @@ module_init_dict(PyModuleObject *mod, PyObject *md_dict, return -1; if (PyUnicode_CheckExact(name)) { Py_INCREF(name); - Py_SETREF(mod->md_name, name); + Py_XSETREF(mod->md_name, name); } return 0; diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index 45656d2..7a114e0 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -1001,7 +1001,7 @@ longrangeiter_setstate(longrangeiterobject *r, PyObject *state) return NULL; cmp = PyObject_RichCompareBool(state, zero, Py_LT); if (cmp > 0) { - Py_SETREF(r->index, zero); + Py_XSETREF(r->index, zero); Py_RETURN_NONE; } Py_DECREF(zero); @@ -1015,7 +1015,7 @@ longrangeiter_setstate(longrangeiterobject *r, PyObject *state) state = r->len; Py_INCREF(state); - Py_SETREF(r->index, state); + Py_XSETREF(r->index, state); Py_RETURN_NONE; } @@ -1064,7 +1064,7 @@ longrangeiter_next(longrangeiterobject *r) result = PyNumber_Add(r->start, product); Py_DECREF(product); if (result) { - Py_SETREF(r->index, new_index); + Py_XSETREF(r->index, new_index); } else { Py_DECREF(new_index); diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 810afd3..7628ce7 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -316,7 +316,7 @@ assign_version_tag(PyTypeObject *type) for (i = 0; i < (1 << MCACHE_SIZE_EXP); i++) { method_cache[i].value = NULL; Py_INCREF(Py_None); - Py_SETREF(method_cache[i].name, Py_None); + Py_XSETREF(method_cache[i].name, Py_None); } /* mark all version tags as invalid */ PyType_Modified(&PyBaseObject_Type); @@ -424,7 +424,7 @@ type_set_name(PyTypeObject *type, PyObject *value, void *context) type->tp_name = tp_name; Py_INCREF(value); - Py_SETREF(((PyHeapTypeObject*)type)->ht_name, value); + Py_XSETREF(((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_SETREF(et->ht_qualname, value); + Py_XSETREF(et->ht_qualname, value); return 0; } @@ -2897,7 +2897,7 @@ _PyType_Lookup(PyTypeObject *type, PyObject *name) else method_cache_misses++; #endif - Py_SETREF(method_cache[h].name, name); + Py_XSETREF(method_cache[h].name, name); } return res; } diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 230125b..e2813fd 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_SETREF(*p_unicode, unicode_empty); + Py_XSETREF(*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_SETREF(*p_unicode, copy); + Py_XSETREF(*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_SETREF(writer->buffer, newbuffer); + Py_XSETREF(writer->buffer, newbuffer); } _PyUnicodeWriter_Update(writer); return 0; @@ -15012,7 +15012,7 @@ PyUnicode_InternInPlace(PyObject **p) if (t) { Py_INCREF(t); - Py_SETREF(*p, t); + Py_XSETREF(*p, t); return; } |