summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-04-06 06:50:03 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-04-06 06:50:03 (GMT)
commitec39756960def5fdd8cb0ae191429f2f8e229f55 (patch)
treeadb8bb87ed393db602face59929660b968f452e5 /Objects
parent72783056983f216104087b6c49d85ea273bf67c4 (diff)
parent48842714b948fa239392ddd7e207151d5fcb8bc7 (diff)
downloadcpython-ec39756960def5fdd8cb0ae191429f2f8e229f55.zip
cpython-ec39756960def5fdd8cb0ae191429f2f8e229f55.tar.gz
cpython-ec39756960def5fdd8cb0ae191429f2f8e229f55.tar.bz2
Issue #22570: Renamed Py_SETREF to Py_XSETREF.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/bytesobject.c2
-rw-r--r--Objects/descrobject.c2
-rw-r--r--Objects/exceptions.c38
-rw-r--r--Objects/floatobject.c4
-rw-r--r--Objects/frameobject.c4
-rw-r--r--Objects/funcobject.c22
-rw-r--r--Objects/genobject.c4
-rw-r--r--Objects/listobject.c4
-rw-r--r--Objects/moduleobject.c2
-rw-r--r--Objects/object.c2
-rw-r--r--Objects/rangeobject.c6
-rw-r--r--Objects/tupleobject.c2
-rw-r--r--Objects/typeobject.c10
-rw-r--r--Objects/unicodeobject.c8
14 files changed, 55 insertions, 55 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 5bbbcde..639ee71 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -3698,7 +3698,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 2002d21..80fc662 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 7374368..2c7688c 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -63,7 +63,7 @@ BaseException_init(PyBaseExceptionObject *self, PyObject *args, PyObject *kwds)
return -1;
Py_INCREF(args);
- Py_SETREF(self->args, args);
+ Py_XSETREF(self->args, args);
return 0;
}
@@ -202,7 +202,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;
}
@@ -231,7 +231,7 @@ BaseException_set_tb(PyBaseExceptionObject *self, PyObject *tb)
}
Py_XINCREF(tb);
- Py_SETREF(self->traceback, tb);
+ Py_XSETREF(self->traceback, tb);
return 0;
}
@@ -327,7 +327,7 @@ void
PyException_SetCause(PyObject *self, PyObject *cause)
{
((PyBaseExceptionObject *)self)->suppress_context = 1;
- Py_SETREF(((PyBaseExceptionObject *)self)->cause, cause);
+ Py_XSETREF(((PyBaseExceptionObject *)self)->cause, cause);
}
PyObject *
@@ -341,7 +341,7 @@ PyException_GetContext(PyObject *self) {
void
PyException_SetContext(PyObject *self, PyObject *context)
{
- Py_SETREF(((PyBaseExceptionObject *)self)->context, context);
+ Py_XSETREF(((PyBaseExceptionObject *)self)->context, context);
}
@@ -557,11 +557,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;
}
@@ -622,7 +622,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; \
} \
@@ -641,7 +641,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;
}
@@ -851,7 +851,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;
@@ -1271,7 +1271,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);
@@ -1287,16 +1287,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);
@@ -1541,7 +1541,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;
}
@@ -1947,7 +1947,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;
@@ -2856,7 +2856,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;
}
@@ -2870,7 +2870,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/floatobject.c b/Objects/floatobject.c
index eb60659..32a0de1 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -1494,13 +1494,13 @@ float_as_integer_ratio(PyObject *v, PyObject *unused)
/* fold in 2**exponent */
if (exponent > 0) {
- Py_SETREF(numerator,
+ Py_XSETREF(numerator,
long_methods->nb_lshift(numerator, py_exponent));
if (numerator == NULL)
goto error;
}
else {
- Py_SETREF(denominator,
+ Py_XSETREF(denominator,
long_methods->nb_lshift(denominator, py_exponent));
if (denominator == NULL)
goto error;
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index da2d2ed..a4a862a 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -353,7 +353,7 @@ frame_settrace(PyFrameObject *f, PyObject* v, void *closure)
f->f_lineno = PyFrame_GetLineNumber(f);
Py_XINCREF(v);
- Py_SETREF(f->f_trace, v);
+ Py_XSETREF(f->f_trace, v);
return 0;
}
@@ -853,7 +853,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 2967634..c5f1a0a 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;
}
@@ -270,7 +270,7 @@ func_set_code(PyFunctionObject *op, PyObject *value)
return -1;
}
Py_INCREF(value);
- Py_SETREF(op->func_code, value);
+ Py_XSETREF(op->func_code, value);
return 0;
}
@@ -292,7 +292,7 @@ func_set_name(PyFunctionObject *op, PyObject *value)
return -1;
}
Py_INCREF(value);
- Py_SETREF(op->func_name, value);
+ Py_XSETREF(op->func_name, value);
return 0;
}
@@ -314,7 +314,7 @@ func_set_qualname(PyFunctionObject *op, PyObject *value)
return -1;
}
Py_INCREF(value);
- Py_SETREF(op->func_qualname, value);
+ Py_XSETREF(op->func_qualname, value);
return 0;
}
@@ -342,7 +342,7 @@ func_set_defaults(PyFunctionObject *op, PyObject *value)
return -1;
}
Py_XINCREF(value);
- Py_SETREF(op->func_defaults, value);
+ Py_XSETREF(op->func_defaults, value);
return 0;
}
@@ -370,7 +370,7 @@ func_set_kwdefaults(PyFunctionObject *op, PyObject *value)
return -1;
}
Py_XINCREF(value);
- Py_SETREF(op->func_kwdefaults, value);
+ Py_XSETREF(op->func_kwdefaults, value);
return 0;
}
@@ -400,7 +400,7 @@ func_set_annotations(PyFunctionObject *op, PyObject *value)
return -1;
}
Py_XINCREF(value);
- Py_SETREF(op->func_annotations, value);
+ Py_XSETREF(op->func_annotations, value);
return 0;
}
@@ -504,7 +504,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/genobject.c b/Objects/genobject.c
index fdb3c03..c94a6ed 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -527,7 +527,7 @@ gen_set_name(PyGenObject *op, PyObject *value)
return -1;
}
Py_INCREF(value);
- Py_SETREF(op->gi_name, value);
+ Py_XSETREF(op->gi_name, value);
return 0;
}
@@ -549,7 +549,7 @@ gen_set_qualname(PyGenObject *op, PyObject *value)
return -1;
}
Py_INCREF(value);
- Py_SETREF(op->gi_qualname, value);
+ Py_XSETREF(op->gi_qualname, value);
return 0;
}
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 81b40ae..7c02be7 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -229,7 +229,7 @@ PyList_SetItem(PyObject *op, Py_ssize_t i,
return -1;
}
p = ((PyListObject *)op) -> ob_item + i;
- Py_SETREF(*p, newitem);
+ Py_XSETREF(*p, newitem);
return 0;
}
@@ -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_SETREF(a->ob_item[i], v);
+ Py_XSETREF(a->ob_item[i], v);
return 0;
}
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/object.c b/Objects/object.c
index 8072dbc..0817311 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1220,7 +1220,7 @@ PyObject_GenericSetDict(PyObject *obj, PyObject *value, void *context)
return -1;
}
Py_INCREF(value);
- Py_SETREF(*dictptr, value);
+ Py_XSETREF(*dictptr, value);
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/tupleobject.c b/Objects/tupleobject.c
index 5020aff..a7774e2 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -162,7 +162,7 @@ PyTuple_SetItem(PyObject *op, Py_ssize_t i, PyObject *newitem)
return -1;
}
p = ((PyTupleObject *)op) -> ob_item + i;
- Py_SETREF(*p, newitem);
+ Py_XSETREF(*p, newitem);
return 0;
}
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 46fb27e..a01862d 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;
}
@@ -2124,7 +2124,7 @@ subtype_setdict(PyObject *obj, PyObject *value, void *context)
return -1;
}
Py_XINCREF(value);
- Py_SETREF(*dictptr, value);
+ Py_XSETREF(*dictptr, value);
return 0;
}
@@ -2903,7 +2903,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 8dc2a38..2499a36 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_SETREF(*p_unicode, unicode_empty);
+ Py_XSETREF(*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_SETREF(*p_unicode, copy);
+ Py_XSETREF(*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_SETREF(writer->buffer, newbuffer);
+ Py_XSETREF(writer->buffer, newbuffer);
}
_PyUnicodeWriter_Update(writer);
return 0;
@@ -15264,7 +15264,7 @@ PyUnicode_InternInPlace(PyObject **p)
if (t) {
Py_INCREF(t);
- Py_SETREF(*p, t);
+ Py_XSETREF(*p, t);
return;
}