mirror of https://github.com/python/cpython
Issue #22570: Renamed Py_SETREF to Py_XSETREF.
This commit is contained in:
commit
ec39756960
|
@ -856,14 +856,14 @@ PyAPI_FUNC(void) _Py_Dealloc(PyObject *);
|
||||||
*
|
*
|
||||||
* The safe way is:
|
* The safe way is:
|
||||||
*
|
*
|
||||||
* Py_SETREF(op, op2);
|
* Py_XSETREF(op, op2);
|
||||||
*
|
*
|
||||||
* That arranges to set `op` to `op2` _before_ decref'ing, so that any code
|
* That arranges to set `op` to `op2` _before_ decref'ing, so that any code
|
||||||
* triggered as a side-effect of `op` getting torn down no longer believes
|
* triggered as a side-effect of `op` getting torn down no longer believes
|
||||||
* `op` points to a valid object.
|
* `op` points to a valid object.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define Py_SETREF(op, op2) \
|
#define Py_XSETREF(op, op2) \
|
||||||
do { \
|
do { \
|
||||||
PyObject *_py_tmp = (PyObject *)(op); \
|
PyObject *_py_tmp = (PyObject *)(op); \
|
||||||
(op) = (op2); \
|
(op) = (op2); \
|
||||||
|
|
|
@ -540,7 +540,7 @@ decompress(BZ2Decompressor *d, char *data, size_t len, Py_ssize_t max_length)
|
||||||
if (d->eof) {
|
if (d->eof) {
|
||||||
d->needs_input = 0;
|
d->needs_input = 0;
|
||||||
if (d->bzs_avail_in_real > 0) {
|
if (d->bzs_avail_in_real > 0) {
|
||||||
Py_SETREF(d->unused_data,
|
Py_XSETREF(d->unused_data,
|
||||||
PyBytes_FromStringAndSize(bzs->next_in, d->bzs_avail_in_real));
|
PyBytes_FromStringAndSize(bzs->next_in, d->bzs_avail_in_real));
|
||||||
if (d->unused_data == NULL)
|
if (d->unused_data == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
|
@ -277,7 +277,7 @@ _set_str(const char *name, PyObject **target, PyObject *src, const char *dflt)
|
||||||
if (PyUnicode_READY(src) == -1)
|
if (PyUnicode_READY(src) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
Py_INCREF(src);
|
Py_INCREF(src);
|
||||||
Py_SETREF(*target, src);
|
Py_XSETREF(*target, src);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -783,7 +783,7 @@ parse_process_char(ReaderObj *self, Py_UCS4 c)
|
||||||
static int
|
static int
|
||||||
parse_reset(ReaderObj *self)
|
parse_reset(ReaderObj *self)
|
||||||
{
|
{
|
||||||
Py_SETREF(self->fields, PyList_New(0));
|
Py_XSETREF(self->fields, PyList_New(0));
|
||||||
if (self->fields == NULL)
|
if (self->fields == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
self->field_len = 0;
|
self->field_len = 0;
|
||||||
|
|
|
@ -391,7 +391,7 @@ StructUnionType_new(PyTypeObject *type, PyObject *args, PyObject *kwds, int isSt
|
||||||
Py_DECREF((PyObject *)dict);
|
Py_DECREF((PyObject *)dict);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
Py_SETREF(result->tp_dict, (PyObject *)dict);
|
Py_XSETREF(result->tp_dict, (PyObject *)dict);
|
||||||
dict->format = _ctypes_alloc_format_string(NULL, "B");
|
dict->format = _ctypes_alloc_format_string(NULL, "B");
|
||||||
if (dict->format == NULL) {
|
if (dict->format == NULL) {
|
||||||
Py_DECREF(result);
|
Py_DECREF(result);
|
||||||
|
@ -870,7 +870,7 @@ PyCPointerType_SetProto(StgDictObject *stgdict, PyObject *proto)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_INCREF(proto);
|
Py_INCREF(proto);
|
||||||
Py_SETREF(stgdict->proto, proto);
|
Py_XSETREF(stgdict->proto, proto);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -960,7 +960,7 @@ PyCPointerType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||||
Py_DECREF((PyObject *)stgdict);
|
Py_DECREF((PyObject *)stgdict);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
Py_SETREF(result->tp_dict, (PyObject *)stgdict);
|
Py_XSETREF(result->tp_dict, (PyObject *)stgdict);
|
||||||
|
|
||||||
return (PyObject *)result;
|
return (PyObject *)result;
|
||||||
}
|
}
|
||||||
|
@ -1403,7 +1403,7 @@ PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||||
/* replace the class dict by our updated spam dict */
|
/* replace the class dict by our updated spam dict */
|
||||||
if (-1 == PyDict_Update((PyObject *)stgdict, result->tp_dict))
|
if (-1 == PyDict_Update((PyObject *)stgdict, result->tp_dict))
|
||||||
goto error;
|
goto error;
|
||||||
Py_SETREF(result->tp_dict, (PyObject *)stgdict); /* steal the reference */
|
Py_XSETREF(result->tp_dict, (PyObject *)stgdict); /* steal the reference */
|
||||||
stgdict = NULL;
|
stgdict = NULL;
|
||||||
|
|
||||||
/* Special case for character arrays.
|
/* Special case for character arrays.
|
||||||
|
@ -1816,7 +1816,7 @@ static PyObject *CreateSwappedType(PyTypeObject *type, PyObject *args, PyObject
|
||||||
Py_DECREF((PyObject *)stgdict);
|
Py_DECREF((PyObject *)stgdict);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
Py_SETREF(result->tp_dict, (PyObject *)stgdict);
|
Py_XSETREF(result->tp_dict, (PyObject *)stgdict);
|
||||||
|
|
||||||
return (PyObject *)result;
|
return (PyObject *)result;
|
||||||
}
|
}
|
||||||
|
@ -1944,7 +1944,7 @@ PyCSimpleType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||||
Py_DECREF((PyObject *)stgdict);
|
Py_DECREF((PyObject *)stgdict);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
Py_SETREF(result->tp_dict, (PyObject *)stgdict);
|
Py_XSETREF(result->tp_dict, (PyObject *)stgdict);
|
||||||
|
|
||||||
/* Install from_param class methods in ctypes base classes.
|
/* Install from_param class methods in ctypes base classes.
|
||||||
Overrides the PyCSimpleType_from_param generic method.
|
Overrides the PyCSimpleType_from_param generic method.
|
||||||
|
@ -2307,7 +2307,7 @@ PyCFuncPtrType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||||
Py_DECREF((PyObject *)stgdict);
|
Py_DECREF((PyObject *)stgdict);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
Py_SETREF(result->tp_dict, (PyObject *)stgdict);
|
Py_XSETREF(result->tp_dict, (PyObject *)stgdict);
|
||||||
|
|
||||||
if (-1 == make_funcptrtype_dict(stgdict)) {
|
if (-1 == make_funcptrtype_dict(stgdict)) {
|
||||||
Py_DECREF(result);
|
Py_DECREF(result);
|
||||||
|
@ -2451,7 +2451,7 @@ KeepRef(CDataObject *target, Py_ssize_t index, PyObject *keep)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (ob->b_objects == NULL || !PyDict_CheckExact(ob->b_objects)) {
|
if (ob->b_objects == NULL || !PyDict_CheckExact(ob->b_objects)) {
|
||||||
Py_SETREF(ob->b_objects, keep); /* refcount consumed */
|
Py_XSETREF(ob->b_objects, keep); /* refcount consumed */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
key = unique_key(target, index);
|
key = unique_key(target, index);
|
||||||
|
@ -2955,7 +2955,7 @@ PyCFuncPtr_set_errcheck(PyCFuncPtrObject *self, PyObject *ob)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_XINCREF(ob);
|
Py_XINCREF(ob);
|
||||||
Py_SETREF(self->errcheck, ob);
|
Py_XSETREF(self->errcheck, ob);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2984,8 +2984,8 @@ PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_INCREF(ob);
|
Py_INCREF(ob);
|
||||||
Py_SETREF(self->restype, ob);
|
Py_XSETREF(self->restype, ob);
|
||||||
Py_SETREF(self->checker, PyObject_GetAttrString(ob, "_check_retval_"));
|
Py_XSETREF(self->checker, PyObject_GetAttrString(ob, "_check_retval_"));
|
||||||
if (self->checker == NULL)
|
if (self->checker == NULL)
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -3022,9 +3022,9 @@ PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob)
|
||||||
converters = converters_from_argtypes(ob);
|
converters = converters_from_argtypes(ob);
|
||||||
if (!converters)
|
if (!converters)
|
||||||
return -1;
|
return -1;
|
||||||
Py_SETREF(self->converters, converters);
|
Py_XSETREF(self->converters, converters);
|
||||||
Py_INCREF(ob);
|
Py_INCREF(ob);
|
||||||
Py_SETREF(self->argtypes, ob);
|
Py_XSETREF(self->argtypes, ob);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -5150,7 +5150,7 @@ comerror_init(PyObject *self, PyObject *args, PyObject *kwds)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
Py_INCREF(args);
|
Py_INCREF(args);
|
||||||
Py_SETREF(((PyBaseExceptionObject *)self)->args, args);
|
Py_XSETREF(((PyBaseExceptionObject *)self)->args, args);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -313,7 +313,7 @@ PyCursesPanel_replace_panel(PyCursesPanelObject *self, PyObject *args)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
Py_INCREF(temp);
|
Py_INCREF(temp);
|
||||||
Py_SETREF(po->wo, temp);
|
Py_XSETREF(po->wo, temp);
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
return Py_None;
|
return Py_None;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1058,7 +1058,7 @@ format_utcoffset(char *buf, size_t buflen, const char *sep,
|
||||||
/* Offset is normalized, so it is negative if days < 0 */
|
/* Offset is normalized, so it is negative if days < 0 */
|
||||||
if (GET_TD_DAYS(offset) < 0) {
|
if (GET_TD_DAYS(offset) < 0) {
|
||||||
sign = '-';
|
sign = '-';
|
||||||
Py_SETREF(offset, delta_negative((PyDateTime_Delta *)offset));
|
Py_XSETREF(offset, delta_negative((PyDateTime_Delta *)offset));
|
||||||
if (offset == NULL)
|
if (offset == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -3045,7 +3045,7 @@ tzinfo_fromutc(PyDateTime_TZInfo *self, PyObject *dt)
|
||||||
if (dst == Py_None)
|
if (dst == Py_None)
|
||||||
goto Inconsistent;
|
goto Inconsistent;
|
||||||
if (delta_bool((PyDateTime_Delta *)dst) != 0) {
|
if (delta_bool((PyDateTime_Delta *)dst) != 0) {
|
||||||
Py_SETREF(result, add_datetime_timedelta((PyDateTime_DateTime *)result,
|
Py_XSETREF(result, add_datetime_timedelta((PyDateTime_DateTime *)result,
|
||||||
(PyDateTime_Delta *)dst, 1));
|
(PyDateTime_Delta *)dst, 1));
|
||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
@ -4445,7 +4445,7 @@ datetime_subtract(PyObject *left, PyObject *right)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (offdiff != NULL) {
|
if (offdiff != NULL) {
|
||||||
Py_SETREF(result, delta_subtract(result, offdiff));
|
Py_XSETREF(result, delta_subtract(result, offdiff));
|
||||||
Py_DECREF(offdiff);
|
Py_DECREF(offdiff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3439,14 +3439,14 @@ dec_as_integer_ratio(PyObject *self, PyObject *args UNUSED)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_SETREF(exponent, long_methods->nb_power(tmp, exponent, Py_None));
|
Py_XSETREF(exponent, long_methods->nb_power(tmp, exponent, Py_None));
|
||||||
Py_DECREF(tmp);
|
Py_DECREF(tmp);
|
||||||
if (exponent == NULL) {
|
if (exponent == NULL) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exp >= 0) {
|
if (exp >= 0) {
|
||||||
Py_SETREF(numerator, long_methods->nb_multiply(numerator, exponent));
|
Py_XSETREF(numerator, long_methods->nb_multiply(numerator, exponent));
|
||||||
if (numerator == NULL) {
|
if (numerator == NULL) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -3462,8 +3462,8 @@ dec_as_integer_ratio(PyObject *self, PyObject *args UNUSED)
|
||||||
if (tmp == NULL) {
|
if (tmp == NULL) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
Py_SETREF(numerator, long_methods->nb_floor_divide(numerator, tmp));
|
Py_XSETREF(numerator, long_methods->nb_floor_divide(numerator, tmp));
|
||||||
Py_SETREF(denominator, long_methods->nb_floor_divide(denominator, tmp));
|
Py_XSETREF(denominator, long_methods->nb_floor_divide(denominator, tmp));
|
||||||
Py_DECREF(tmp);
|
Py_DECREF(tmp);
|
||||||
if (numerator == NULL || denominator == NULL) {
|
if (numerator == NULL || denominator == NULL) {
|
||||||
goto error;
|
goto error;
|
||||||
|
|
|
@ -397,7 +397,7 @@ element_init(PyObject *self, PyObject *args, PyObject *kwds)
|
||||||
|
|
||||||
/* Replace the objects already pointed to by tag, text and tail. */
|
/* Replace the objects already pointed to by tag, text and tail. */
|
||||||
Py_INCREF(tag);
|
Py_INCREF(tag);
|
||||||
Py_SETREF(self_elem->tag, tag);
|
Py_XSETREF(self_elem->tag, tag);
|
||||||
|
|
||||||
tmp = self_elem->text;
|
tmp = self_elem->text;
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
|
@ -964,7 +964,7 @@ element_setstate_from_attributes(ElementObject *self,
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_INCREF(tag);
|
Py_INCREF(tag);
|
||||||
Py_SETREF(self->tag, tag);
|
Py_XSETREF(self->tag, tag);
|
||||||
|
|
||||||
_clear_joined_ptr(&self->text);
|
_clear_joined_ptr(&self->text);
|
||||||
self->text = text ? JOIN_SET(text, PyList_CheckExact(text)) : Py_None;
|
self->text = text ? JOIN_SET(text, PyList_CheckExact(text)) : Py_None;
|
||||||
|
@ -1008,7 +1008,7 @@ element_setstate_from_attributes(ElementObject *self,
|
||||||
/* Stash attrib. */
|
/* Stash attrib. */
|
||||||
if (attrib) {
|
if (attrib) {
|
||||||
Py_INCREF(attrib);
|
Py_INCREF(attrib);
|
||||||
Py_SETREF(self->extra->attrib, attrib);
|
Py_XSETREF(self->extra->attrib, attrib);
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
|
@ -1957,7 +1957,7 @@ element_tag_setter(ElementObject *self, PyObject *value, void *closure)
|
||||||
{
|
{
|
||||||
_VALIDATE_ATTR_VALUE(value);
|
_VALIDATE_ATTR_VALUE(value);
|
||||||
Py_INCREF(value);
|
Py_INCREF(value);
|
||||||
Py_SETREF(self->tag, value);
|
Py_XSETREF(self->tag, value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1990,7 +1990,7 @@ element_attrib_setter(ElementObject *self, PyObject *value, void *closure)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_INCREF(value);
|
Py_INCREF(value);
|
||||||
Py_SETREF(self->extra->attrib, value);
|
Py_XSETREF(self->extra->attrib, value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2338,7 +2338,7 @@ _elementtree_TreeBuilder___init___impl(TreeBuilderObject *self,
|
||||||
{
|
{
|
||||||
if (element_factory) {
|
if (element_factory) {
|
||||||
Py_INCREF(element_factory);
|
Py_INCREF(element_factory);
|
||||||
Py_SETREF(self->element_factory, element_factory);
|
Py_XSETREF(self->element_factory, element_factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2524,9 +2524,9 @@ treebuilder_handle_start(TreeBuilderObject* self, PyObject* tag,
|
||||||
self->index++;
|
self->index++;
|
||||||
|
|
||||||
Py_INCREF(node);
|
Py_INCREF(node);
|
||||||
Py_SETREF(self->this, node);
|
Py_XSETREF(self->this, node);
|
||||||
Py_INCREF(node);
|
Py_INCREF(node);
|
||||||
Py_SETREF(self->last, node);
|
Py_XSETREF(self->last, node);
|
||||||
|
|
||||||
if (treebuilder_append_event(self, self->start_event_obj, node) < 0)
|
if (treebuilder_append_event(self, self->start_event_obj, node) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -3583,7 +3583,7 @@ _elementtree_XMLParser__setevents_impl(XMLParserObject *self,
|
||||||
events_append = PyObject_GetAttrString(events_queue, "append");
|
events_append = PyObject_GetAttrString(events_queue, "append");
|
||||||
if (events_append == NULL)
|
if (events_append == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
Py_SETREF(target->events_append, events_append);
|
Py_XSETREF(target->events_append, events_append);
|
||||||
|
|
||||||
/* clear out existing events */
|
/* clear out existing events */
|
||||||
Py_CLEAR(target->start_event_obj);
|
Py_CLEAR(target->start_event_obj);
|
||||||
|
@ -3618,18 +3618,18 @@ _elementtree_XMLParser__setevents_impl(XMLParserObject *self,
|
||||||
|
|
||||||
Py_INCREF(event_name_obj);
|
Py_INCREF(event_name_obj);
|
||||||
if (strcmp(event_name, "start") == 0) {
|
if (strcmp(event_name, "start") == 0) {
|
||||||
Py_SETREF(target->start_event_obj, event_name_obj);
|
Py_XSETREF(target->start_event_obj, event_name_obj);
|
||||||
} else if (strcmp(event_name, "end") == 0) {
|
} else if (strcmp(event_name, "end") == 0) {
|
||||||
Py_SETREF(target->end_event_obj, event_name_obj);
|
Py_XSETREF(target->end_event_obj, event_name_obj);
|
||||||
} else if (strcmp(event_name, "start-ns") == 0) {
|
} else if (strcmp(event_name, "start-ns") == 0) {
|
||||||
Py_SETREF(target->start_ns_event_obj, event_name_obj);
|
Py_XSETREF(target->start_ns_event_obj, event_name_obj);
|
||||||
EXPAT(SetNamespaceDeclHandler)(
|
EXPAT(SetNamespaceDeclHandler)(
|
||||||
self->parser,
|
self->parser,
|
||||||
(XML_StartNamespaceDeclHandler) expat_start_ns_handler,
|
(XML_StartNamespaceDeclHandler) expat_start_ns_handler,
|
||||||
(XML_EndNamespaceDeclHandler) expat_end_ns_handler
|
(XML_EndNamespaceDeclHandler) expat_end_ns_handler
|
||||||
);
|
);
|
||||||
} else if (strcmp(event_name, "end-ns") == 0) {
|
} else if (strcmp(event_name, "end-ns") == 0) {
|
||||||
Py_SETREF(target->end_ns_event_obj, event_name_obj);
|
Py_XSETREF(target->end_ns_event_obj, event_name_obj);
|
||||||
EXPAT(SetNamespaceDeclHandler)(
|
EXPAT(SetNamespaceDeclHandler)(
|
||||||
self->parser,
|
self->parser,
|
||||||
(XML_StartNamespaceDeclHandler) expat_start_ns_handler,
|
(XML_StartNamespaceDeclHandler) expat_start_ns_handler,
|
||||||
|
|
|
@ -294,10 +294,10 @@ partial_setstate(partialobject *pto, PyObject *state)
|
||||||
else
|
else
|
||||||
Py_INCREF(dict);
|
Py_INCREF(dict);
|
||||||
|
|
||||||
Py_SETREF(pto->fn, fn);
|
Py_XSETREF(pto->fn, fn);
|
||||||
Py_SETREF(pto->args, fnargs);
|
Py_XSETREF(pto->args, fnargs);
|
||||||
Py_SETREF(pto->kw, kw);
|
Py_XSETREF(pto->kw, kw);
|
||||||
Py_SETREF(pto->dict, dict);
|
Py_XSETREF(pto->dict, dict);
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1196,7 +1196,7 @@ found:
|
||||||
Py_CLEAR(res);
|
Py_CLEAR(res);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
Py_SETREF(res, _PyBytes_Join(_PyIO_empty_bytes, chunks));
|
Py_XSETREF(res, _PyBytes_Join(_PyIO_empty_bytes, chunks));
|
||||||
|
|
||||||
end:
|
end:
|
||||||
LEAVE_BUFFERED(self)
|
LEAVE_BUFFERED(self)
|
||||||
|
@ -1452,7 +1452,7 @@ _io_BufferedReader___init___impl(buffered *self, PyObject *raw,
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
Py_INCREF(raw);
|
Py_INCREF(raw);
|
||||||
Py_SETREF(self->raw, raw);
|
Py_XSETREF(self->raw, raw);
|
||||||
self->buffer_size = buffer_size;
|
self->buffer_size = buffer_size;
|
||||||
self->readable = 1;
|
self->readable = 1;
|
||||||
self->writable = 0;
|
self->writable = 0;
|
||||||
|
@ -1804,7 +1804,7 @@ _io_BufferedWriter___init___impl(buffered *self, PyObject *raw,
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
Py_INCREF(raw);
|
Py_INCREF(raw);
|
||||||
Py_SETREF(self->raw, raw);
|
Py_XSETREF(self->raw, raw);
|
||||||
self->readable = 0;
|
self->readable = 0;
|
||||||
self->writable = 1;
|
self->writable = 1;
|
||||||
|
|
||||||
|
@ -2307,7 +2307,7 @@ _io_BufferedRandom___init___impl(buffered *self, PyObject *raw,
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
Py_INCREF(raw);
|
Py_INCREF(raw);
|
||||||
Py_SETREF(self->raw, raw);
|
Py_XSETREF(self->raw, raw);
|
||||||
self->buffer_size = buffer_size;
|
self->buffer_size = buffer_size;
|
||||||
self->readable = 1;
|
self->readable = 1;
|
||||||
self->writable = 1;
|
self->writable = 1;
|
||||||
|
|
|
@ -96,7 +96,7 @@ unshare_buffer(bytesio *self, size_t size)
|
||||||
return -1;
|
return -1;
|
||||||
memcpy(PyBytes_AS_STRING(new_buf), PyBytes_AS_STRING(self->buf),
|
memcpy(PyBytes_AS_STRING(new_buf), PyBytes_AS_STRING(self->buf),
|
||||||
self->string_size);
|
self->string_size);
|
||||||
Py_SETREF(self->buf, new_buf);
|
Py_XSETREF(self->buf, new_buf);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -967,7 +967,7 @@ _io_BytesIO___init___impl(bytesio *self, PyObject *initvalue)
|
||||||
if (initvalue && initvalue != Py_None) {
|
if (initvalue && initvalue != Py_None) {
|
||||||
if (PyBytes_CheckExact(initvalue)) {
|
if (PyBytes_CheckExact(initvalue)) {
|
||||||
Py_INCREF(initvalue);
|
Py_INCREF(initvalue);
|
||||||
Py_SETREF(self->buf, initvalue);
|
Py_XSETREF(self->buf, initvalue);
|
||||||
self->string_size = PyBytes_GET_SIZE(initvalue);
|
self->string_size = PyBytes_GET_SIZE(initvalue);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -995,7 +995,7 @@ _io_TextIOWrapper___init___impl(textio *self, PyObject *buffer,
|
||||||
"Oi", self->decoder, (int)self->readtranslate);
|
"Oi", self->decoder, (int)self->readtranslate);
|
||||||
if (incrementalDecoder == NULL)
|
if (incrementalDecoder == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
Py_SETREF(self->decoder, incrementalDecoder);
|
Py_XSETREF(self->decoder, incrementalDecoder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1373,7 +1373,7 @@ _io_TextIOWrapper_write_impl(textio *self, PyObject *text)
|
||||||
static void
|
static void
|
||||||
textiowrapper_set_decoded_chars(textio *self, PyObject *chars)
|
textiowrapper_set_decoded_chars(textio *self, PyObject *chars)
|
||||||
{
|
{
|
||||||
Py_SETREF(self->decoded_chars, chars);
|
Py_XSETREF(self->decoded_chars, chars);
|
||||||
self->decoded_chars_used = 0;
|
self->decoded_chars_used = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1521,7 +1521,7 @@ textiowrapper_read_chunk(textio *self, Py_ssize_t size_hint)
|
||||||
dec_buffer = NULL; /* Reference lost to PyBytes_Concat */
|
dec_buffer = NULL; /* Reference lost to PyBytes_Concat */
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
Py_SETREF(self->snapshot, Py_BuildValue("NN", dec_flags, next_input));
|
Py_XSETREF(self->snapshot, Py_BuildValue("NN", dec_flags, next_input));
|
||||||
}
|
}
|
||||||
Py_DECREF(input_chunk);
|
Py_DECREF(input_chunk);
|
||||||
|
|
||||||
|
@ -1627,7 +1627,7 @@ _io_TextIOWrapper_read_impl(textio *self, Py_ssize_t n)
|
||||||
if (chunks != NULL) {
|
if (chunks != NULL) {
|
||||||
if (result != NULL && PyList_Append(chunks, result) < 0)
|
if (result != NULL && PyList_Append(chunks, result) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
Py_SETREF(result, PyUnicode_Join(_PyIO_empty_str, chunks));
|
Py_XSETREF(result, PyUnicode_Join(_PyIO_empty_str, chunks));
|
||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
goto fail;
|
goto fail;
|
||||||
Py_CLEAR(chunks);
|
Py_CLEAR(chunks);
|
||||||
|
|
|
@ -778,7 +778,7 @@ profiler_init(ProfilerObject *pObj, PyObject *args, PyObject *kw)
|
||||||
return -1;
|
return -1;
|
||||||
pObj->externalTimerUnit = timeunit;
|
pObj->externalTimerUnit = timeunit;
|
||||||
Py_XINCREF(timer);
|
Py_XINCREF(timer);
|
||||||
Py_SETREF(pObj->externalTimer, timer);
|
Py_XSETREF(pObj->externalTimer, timer);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1011,7 +1011,7 @@ decompress(Decompressor *d, uint8_t *data, size_t len, Py_ssize_t max_length)
|
||||||
if (d->eof) {
|
if (d->eof) {
|
||||||
d->needs_input = 0;
|
d->needs_input = 0;
|
||||||
if (lzs->avail_in > 0) {
|
if (lzs->avail_in > 0) {
|
||||||
Py_SETREF(d->unused_data,
|
Py_XSETREF(d->unused_data,
|
||||||
PyBytes_FromStringAndSize((char *)lzs->next_in, lzs->avail_in));
|
PyBytes_FromStringAndSize((char *)lzs->next_in, lzs->avail_in));
|
||||||
if (d->unused_data == NULL)
|
if (d->unused_data == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
|
@ -869,7 +869,7 @@ PyMemoTable_Set(PyMemoTable *self, PyObject *key, Py_ssize_t value)
|
||||||
static int
|
static int
|
||||||
_Pickler_ClearBuffer(PicklerObject *self)
|
_Pickler_ClearBuffer(PicklerObject *self)
|
||||||
{
|
{
|
||||||
Py_SETREF(self->output_buffer,
|
Py_XSETREF(self->output_buffer,
|
||||||
PyBytes_FromStringAndSize(NULL, self->max_output_len));
|
PyBytes_FromStringAndSize(NULL, self->max_output_len));
|
||||||
if (self->output_buffer == NULL)
|
if (self->output_buffer == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -3116,7 +3116,7 @@ fix_imports(PyObject **module_name, PyObject **global_name)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_INCREF(item);
|
Py_INCREF(item);
|
||||||
Py_SETREF(*module_name, item);
|
Py_XSETREF(*module_name, item);
|
||||||
}
|
}
|
||||||
else if (PyErr_Occurred()) {
|
else if (PyErr_Occurred()) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -4506,7 +4506,7 @@ Pickler_set_persid(PicklerObject *self, PyObject *value)
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_INCREF(value);
|
Py_INCREF(value);
|
||||||
Py_SETREF(self->pers_func, value);
|
Py_XSETREF(self->pers_func, value);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -6955,7 +6955,7 @@ Unpickler_set_persload(UnpicklerObject *self, PyObject *value)
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_INCREF(value);
|
Py_INCREF(value);
|
||||||
Py_SETREF(self->pers_func, value);
|
Py_XSETREF(self->pers_func, value);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,7 +204,7 @@ void pysqlite_flush_statement_cache(pysqlite_Connection* self)
|
||||||
node = node->next;
|
node = node->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_SETREF(self->statement_cache,
|
Py_XSETREF(self->statement_cache,
|
||||||
(pysqlite_Cache *)PyObject_CallFunction((PyObject *)&pysqlite_CacheType, "O", self));
|
(pysqlite_Cache *)PyObject_CallFunction((PyObject *)&pysqlite_CacheType, "O", self));
|
||||||
Py_DECREF(self);
|
Py_DECREF(self);
|
||||||
self->statement_cache->decref_factory = 0;
|
self->statement_cache->decref_factory = 0;
|
||||||
|
@ -319,7 +319,7 @@ PyObject* pysqlite_connection_cursor(pysqlite_Connection* self, PyObject* args,
|
||||||
|
|
||||||
if (cursor && self->row_factory != Py_None) {
|
if (cursor && self->row_factory != Py_None) {
|
||||||
Py_INCREF(self->row_factory);
|
Py_INCREF(self->row_factory);
|
||||||
Py_SETREF(((pysqlite_Cursor *)cursor)->row_factory, self->row_factory);
|
Py_XSETREF(((pysqlite_Cursor *)cursor)->row_factory, self->row_factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
return cursor;
|
return cursor;
|
||||||
|
@ -794,7 +794,7 @@ static void _pysqlite_drop_unused_statement_references(pysqlite_Connection* self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_SETREF(self->statements, new_list);
|
Py_XSETREF(self->statements, new_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _pysqlite_drop_unused_cursor_references(pysqlite_Connection* self)
|
static void _pysqlite_drop_unused_cursor_references(pysqlite_Connection* self)
|
||||||
|
@ -825,7 +825,7 @@ static void _pysqlite_drop_unused_cursor_references(pysqlite_Connection* self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_SETREF(self->cursors, new_list);
|
Py_XSETREF(self->cursors, new_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject* pysqlite_connection_create_function(pysqlite_Connection* self, PyObject* args, PyObject* kwargs)
|
PyObject* pysqlite_connection_create_function(pysqlite_Connection* self, PyObject* args, PyObject* kwargs)
|
||||||
|
|
|
@ -170,7 +170,7 @@ int pysqlite_build_row_cast_map(pysqlite_Cursor* self)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_SETREF(self->row_cast_map, PyList_New(0));
|
Py_XSETREF(self->row_cast_map, PyList_New(0));
|
||||||
|
|
||||||
for (i = 0; i < sqlite3_column_count(self->statement->st); i++) {
|
for (i = 0; i < sqlite3_column_count(self->statement->st); i++) {
|
||||||
converter = NULL;
|
converter = NULL;
|
||||||
|
@ -510,7 +510,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
|
||||||
|
|
||||||
/* reset description and rowcount */
|
/* reset description and rowcount */
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
Py_SETREF(self->description, Py_None);
|
Py_XSETREF(self->description, Py_None);
|
||||||
self->rowcount = -1L;
|
self->rowcount = -1L;
|
||||||
|
|
||||||
func_args = PyTuple_New(1);
|
func_args = PyTuple_New(1);
|
||||||
|
@ -526,7 +526,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
|
||||||
(void)pysqlite_statement_reset(self->statement);
|
(void)pysqlite_statement_reset(self->statement);
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_SETREF(self->statement,
|
Py_XSETREF(self->statement,
|
||||||
(pysqlite_Statement *)pysqlite_cache_get(self->connection->statement_cache, func_args));
|
(pysqlite_Statement *)pysqlite_cache_get(self->connection->statement_cache, func_args));
|
||||||
Py_DECREF(func_args);
|
Py_DECREF(func_args);
|
||||||
|
|
||||||
|
@ -535,7 +535,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self->statement->in_use) {
|
if (self->statement->in_use) {
|
||||||
Py_SETREF(self->statement,
|
Py_XSETREF(self->statement,
|
||||||
PyObject_New(pysqlite_Statement, &pysqlite_StatementType));
|
PyObject_New(pysqlite_Statement, &pysqlite_StatementType));
|
||||||
if (!self->statement) {
|
if (!self->statement) {
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -652,7 +652,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
|
||||||
numcols = sqlite3_column_count(self->statement->st);
|
numcols = sqlite3_column_count(self->statement->st);
|
||||||
Py_END_ALLOW_THREADS
|
Py_END_ALLOW_THREADS
|
||||||
|
|
||||||
Py_SETREF(self->description, PyTuple_New(numcols));
|
Py_XSETREF(self->description, PyTuple_New(numcols));
|
||||||
if (!self->description) {
|
if (!self->description) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
|
@ -753,7 +753,7 @@ deepcopy(PyObject** object, PyObject* memo)
|
||||||
if (!copy)
|
if (!copy)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
Py_SETREF(*object, copy);
|
Py_XSETREF(*object, copy);
|
||||||
|
|
||||||
return 1; /* success */
|
return 1; /* success */
|
||||||
}
|
}
|
||||||
|
|
|
@ -1589,7 +1589,7 @@ static int PySSL_set_context(PySSLSocket *self, PyObject *value,
|
||||||
return -1;
|
return -1;
|
||||||
#else
|
#else
|
||||||
Py_INCREF(value);
|
Py_INCREF(value);
|
||||||
Py_SETREF(self->ctx, (PySSLContext *)value);
|
Py_XSETREF(self->ctx, (PySSLContext *)value);
|
||||||
SSL_set_SSL_CTX(self->ssl, self->ctx->ctx);
|
SSL_set_SSL_CTX(self->ssl, self->ctx->ctx);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
@ -1646,7 +1646,7 @@ PySSL_get_owner(PySSLSocket *self, void *c)
|
||||||
static int
|
static int
|
||||||
PySSL_set_owner(PySSLSocket *self, PyObject *value, void *c)
|
PySSL_set_owner(PySSLSocket *self, PyObject *value, void *c)
|
||||||
{
|
{
|
||||||
Py_SETREF(self->owner, PyWeakref_NewRef(value, NULL));
|
Py_XSETREF(self->owner, PyWeakref_NewRef(value, NULL));
|
||||||
if (self->owner == NULL)
|
if (self->owner == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1437,7 +1437,7 @@ s_init(PyObject *self, PyObject *args, PyObject *kwds)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_SETREF(soself->s_format, o_format);
|
Py_XSETREF(soself->s_format, o_format);
|
||||||
|
|
||||||
ret = prepare_s(soself);
|
ret = prepare_s(soself);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -793,7 +793,7 @@ encoder_encode_stateful(MultibyteStatefulEncoderContext *ctx,
|
||||||
ctx->errors, final ? MBENC_FLUSH | MBENC_RESET : 0);
|
ctx->errors, final ? MBENC_FLUSH | MBENC_RESET : 0);
|
||||||
if (r == NULL) {
|
if (r == NULL) {
|
||||||
/* recover the original pending buffer */
|
/* recover the original pending buffer */
|
||||||
Py_SETREF(ctx->pending, origpending);
|
Py_XSETREF(ctx->pending, origpending);
|
||||||
origpending = NULL;
|
origpending = NULL;
|
||||||
goto errorexit;
|
goto errorexit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -488,7 +488,7 @@ faulthandler_py_enable(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
Py_XINCREF(file);
|
Py_XINCREF(file);
|
||||||
Py_SETREF(fatal_error.file, file);
|
Py_XSETREF(fatal_error.file, file);
|
||||||
fatal_error.fd = fd;
|
fatal_error.fd = fd;
|
||||||
fatal_error.all_threads = all_threads;
|
fatal_error.all_threads = all_threads;
|
||||||
fatal_error.interp = tstate->interp;
|
fatal_error.interp = tstate->interp;
|
||||||
|
@ -668,7 +668,7 @@ faulthandler_dump_traceback_later(PyObject *self,
|
||||||
cancel_dump_traceback_later();
|
cancel_dump_traceback_later();
|
||||||
|
|
||||||
Py_XINCREF(file);
|
Py_XINCREF(file);
|
||||||
Py_SETREF(thread.file, file);
|
Py_XSETREF(thread.file, file);
|
||||||
thread.fd = fd;
|
thread.fd = fd;
|
||||||
thread.timeout_us = timeout_us;
|
thread.timeout_us = timeout_us;
|
||||||
thread.repeat = repeat;
|
thread.repeat = repeat;
|
||||||
|
@ -846,7 +846,7 @@ faulthandler_register_py(PyObject *self,
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_XINCREF(file);
|
Py_XINCREF(file);
|
||||||
Py_SETREF(user->file, file);
|
Py_XSETREF(user->file, file);
|
||||||
user->fd = fd;
|
user->fd = fd;
|
||||||
user->all_threads = all_threads;
|
user->all_threads = all_threads;
|
||||||
user->chain = chain;
|
user->chain = chain;
|
||||||
|
|
|
@ -108,12 +108,12 @@ groupby_next(groupbyobject *gbo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_SETREF(gbo->currkey, newkey);
|
Py_XSETREF(gbo->currkey, newkey);
|
||||||
Py_SETREF(gbo->currvalue, newvalue);
|
Py_XSETREF(gbo->currvalue, newvalue);
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_INCREF(gbo->currkey);
|
Py_INCREF(gbo->currkey);
|
||||||
Py_SETREF(gbo->tgtkey, gbo->currkey);
|
Py_XSETREF(gbo->tgtkey, gbo->currkey);
|
||||||
|
|
||||||
grouper = _grouper_create(gbo, gbo->tgtkey);
|
grouper = _grouper_create(gbo, gbo->tgtkey);
|
||||||
if (grouper == NULL)
|
if (grouper == NULL)
|
||||||
|
@ -150,11 +150,11 @@ groupby_setstate(groupbyobject *lz, PyObject *state)
|
||||||
if (!PyArg_ParseTuple(state, "OOO", &currkey, &currvalue, &tgtkey))
|
if (!PyArg_ParseTuple(state, "OOO", &currkey, &currvalue, &tgtkey))
|
||||||
return NULL;
|
return NULL;
|
||||||
Py_INCREF(currkey);
|
Py_INCREF(currkey);
|
||||||
Py_SETREF(lz->currkey, currkey);
|
Py_XSETREF(lz->currkey, currkey);
|
||||||
Py_INCREF(currvalue);
|
Py_INCREF(currvalue);
|
||||||
Py_SETREF(lz->currvalue, currvalue);
|
Py_XSETREF(lz->currvalue, currvalue);
|
||||||
Py_INCREF(tgtkey);
|
Py_INCREF(tgtkey);
|
||||||
Py_SETREF(lz->tgtkey, tgtkey);
|
Py_XSETREF(lz->tgtkey, tgtkey);
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -622,7 +622,7 @@ tee_next(teeobject *to)
|
||||||
link = teedataobject_jumplink(to->dataobj);
|
link = teedataobject_jumplink(to->dataobj);
|
||||||
if (link == NULL)
|
if (link == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
Py_SETREF(to->dataobj, (teedataobject *)link);
|
Py_XSETREF(to->dataobj, (teedataobject *)link);
|
||||||
to->index = 0;
|
to->index = 0;
|
||||||
}
|
}
|
||||||
value = teedataobject_getitem(to->dataobj, to->index);
|
value = teedataobject_getitem(to->dataobj, to->index);
|
||||||
|
@ -734,7 +734,7 @@ tee_setstate(teeobject *to, PyObject *state)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
Py_INCREF(tdo);
|
Py_INCREF(tdo);
|
||||||
Py_SETREF(to->dataobj, tdo);
|
Py_XSETREF(to->dataobj, tdo);
|
||||||
to->index = index;
|
to->index = index;
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
@ -975,7 +975,7 @@ cycle_setstate(cycleobject *lz, PyObject *state)
|
||||||
if (!PyArg_ParseTuple(state, "O!i", &PyList_Type, &saved, &firstpass))
|
if (!PyArg_ParseTuple(state, "O!i", &PyList_Type, &saved, &firstpass))
|
||||||
return NULL;
|
return NULL;
|
||||||
Py_INCREF(saved);
|
Py_INCREF(saved);
|
||||||
Py_SETREF(lz->saved, saved);
|
Py_XSETREF(lz->saved, saved);
|
||||||
lz->firstpass = firstpass != 0;
|
lz->firstpass = firstpass != 0;
|
||||||
lz->index = 0;
|
lz->index = 0;
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
|
@ -1907,9 +1907,9 @@ chain_setstate(chainobject *lz, PyObject *state)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
Py_INCREF(source);
|
Py_INCREF(source);
|
||||||
Py_SETREF(lz->source, source);
|
Py_XSETREF(lz->source, source);
|
||||||
Py_XINCREF(active);
|
Py_XINCREF(active);
|
||||||
Py_SETREF(lz->active, active);
|
Py_XSETREF(lz->active, active);
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2266,7 +2266,7 @@ product_setstate(productobject *lz, PyObject *state)
|
||||||
Py_INCREF(element);
|
Py_INCREF(element);
|
||||||
PyTuple_SET_ITEM(result, i, element);
|
PyTuple_SET_ITEM(result, i, element);
|
||||||
}
|
}
|
||||||
Py_SETREF(lz->result, result);
|
Py_XSETREF(lz->result, result);
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2587,7 +2587,7 @@ combinations_setstate(combinationsobject *lz, PyObject *state)
|
||||||
PyTuple_SET_ITEM(result, i, element);
|
PyTuple_SET_ITEM(result, i, element);
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_SETREF(lz->result, result);
|
Py_XSETREF(lz->result, result);
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2917,7 +2917,7 @@ cwr_setstate(cwrobject *lz, PyObject *state)
|
||||||
Py_INCREF(element);
|
Py_INCREF(element);
|
||||||
PyTuple_SET_ITEM(result, i, element);
|
PyTuple_SET_ITEM(result, i, element);
|
||||||
}
|
}
|
||||||
Py_SETREF(lz->result, result);
|
Py_XSETREF(lz->result, result);
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3305,7 +3305,7 @@ permutations_setstate(permutationsobject *po, PyObject *state)
|
||||||
Py_INCREF(element);
|
Py_INCREF(element);
|
||||||
PyTuple_SET_ITEM(result, i, element);
|
PyTuple_SET_ITEM(result, i, element);
|
||||||
}
|
}
|
||||||
Py_SETREF(po->result, result);
|
Py_XSETREF(po->result, result);
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3457,7 +3457,7 @@ accumulate_next(accumulateobject *lz)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
Py_INCREF(newtotal);
|
Py_INCREF(newtotal);
|
||||||
Py_SETREF(lz->total, newtotal);
|
Py_XSETREF(lz->total, newtotal);
|
||||||
return newtotal;
|
return newtotal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3490,7 +3490,7 @@ static PyObject *
|
||||||
accumulate_setstate(accumulateobject *lz, PyObject *state)
|
accumulate_setstate(accumulateobject *lz, PyObject *state)
|
||||||
{
|
{
|
||||||
Py_INCREF(state);
|
Py_INCREF(state);
|
||||||
Py_SETREF(lz->total, state);
|
Py_XSETREF(lz->total, state);
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4469,7 +4469,7 @@ static PyObject *
|
||||||
zip_longest_setstate(ziplongestobject *lz, PyObject *state)
|
zip_longest_setstate(ziplongestobject *lz, PyObject *state)
|
||||||
{
|
{
|
||||||
Py_INCREF(state);
|
Py_INCREF(state);
|
||||||
Py_SETREF(lz->fillvalue, state);
|
Py_XSETREF(lz->fillvalue, state);
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1362,7 +1362,7 @@ sethandler(xmlparseobject *self, PyObject *name, PyObject* v)
|
||||||
Py_INCREF(v);
|
Py_INCREF(v);
|
||||||
c_handler = handler_info[handlernum].handler;
|
c_handler = handler_info[handlernum].handler;
|
||||||
}
|
}
|
||||||
Py_SETREF(self->handlers[handlernum], v);
|
Py_XSETREF(self->handlers[handlernum], v);
|
||||||
handler_info[handlernum].setter(self->itself, c_handler);
|
handler_info[handlernum].setter(self->itself, c_handler);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -324,7 +324,7 @@ set_hook(const char *funcname, PyObject **hook_var, PyObject *args)
|
||||||
}
|
}
|
||||||
else if (PyCallable_Check(function)) {
|
else if (PyCallable_Check(function)) {
|
||||||
Py_INCREF(function);
|
Py_INCREF(function);
|
||||||
Py_SETREF(*hook_var, function);
|
Py_XSETREF(*hook_var, function);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PyErr_Format(PyExc_TypeError,
|
PyErr_Format(PyExc_TypeError,
|
||||||
|
|
|
@ -1266,7 +1266,7 @@ PyInit__signal(void)
|
||||||
if (Handlers[SIGINT].func == DefaultHandler) {
|
if (Handlers[SIGINT].func == DefaultHandler) {
|
||||||
/* Install default int handler */
|
/* Install default int handler */
|
||||||
Py_INCREF(IntHandler);
|
Py_INCREF(IntHandler);
|
||||||
Py_SETREF(Handlers[SIGINT].func, IntHandler);
|
Py_XSETREF(Handlers[SIGINT].func, IntHandler);
|
||||||
old_siginthandler = PyOS_setsig(SIGINT, signal_handler);
|
old_siginthandler = PyOS_setsig(SIGINT, signal_handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,7 @@ zipimporter_init(ZipImporter *self, PyObject *args, PyObject *kwds)
|
||||||
tmp = PyUnicode_FromFormat("%U%c", self->prefix, SEP);
|
tmp = PyUnicode_FromFormat("%U%c", self->prefix, SEP);
|
||||||
if (tmp == NULL)
|
if (tmp == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
Py_SETREF(self->prefix, tmp);
|
Py_XSETREF(self->prefix, tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -667,7 +667,7 @@ save_unconsumed_input(compobject *self, int err)
|
||||||
PyBytes_AS_STRING(self->unused_data), old_size);
|
PyBytes_AS_STRING(self->unused_data), old_size);
|
||||||
Py_MEMCPY(PyBytes_AS_STRING(new_data) + old_size,
|
Py_MEMCPY(PyBytes_AS_STRING(new_data) + old_size,
|
||||||
self->zst.next_in, self->zst.avail_in);
|
self->zst.next_in, self->zst.avail_in);
|
||||||
Py_SETREF(self->unused_data, new_data);
|
Py_XSETREF(self->unused_data, new_data);
|
||||||
self->zst.avail_in = 0;
|
self->zst.avail_in = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -679,7 +679,7 @@ save_unconsumed_input(compobject *self, int err)
|
||||||
(char *)self->zst.next_in, self->zst.avail_in);
|
(char *)self->zst.next_in, self->zst.avail_in);
|
||||||
if (new_data == NULL)
|
if (new_data == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
Py_SETREF(self->unconsumed_tail, new_data);
|
Py_XSETREF(self->unconsumed_tail, new_data);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -961,11 +961,11 @@ zlib_Compress_copy_impl(compobject *self)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
Py_INCREF(self->unused_data);
|
Py_INCREF(self->unused_data);
|
||||||
Py_SETREF(retval->unused_data, self->unused_data);
|
Py_XSETREF(retval->unused_data, self->unused_data);
|
||||||
Py_INCREF(self->unconsumed_tail);
|
Py_INCREF(self->unconsumed_tail);
|
||||||
Py_SETREF(retval->unconsumed_tail, self->unconsumed_tail);
|
Py_XSETREF(retval->unconsumed_tail, self->unconsumed_tail);
|
||||||
Py_XINCREF(self->zdict);
|
Py_XINCREF(self->zdict);
|
||||||
Py_SETREF(retval->zdict, self->zdict);
|
Py_XSETREF(retval->zdict, self->zdict);
|
||||||
retval->eof = self->eof;
|
retval->eof = self->eof;
|
||||||
|
|
||||||
/* Mark it as being initialized */
|
/* Mark it as being initialized */
|
||||||
|
@ -1017,11 +1017,11 @@ zlib_Decompress_copy_impl(compobject *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_INCREF(self->unused_data);
|
Py_INCREF(self->unused_data);
|
||||||
Py_SETREF(retval->unused_data, self->unused_data);
|
Py_XSETREF(retval->unused_data, self->unused_data);
|
||||||
Py_INCREF(self->unconsumed_tail);
|
Py_INCREF(self->unconsumed_tail);
|
||||||
Py_SETREF(retval->unconsumed_tail, self->unconsumed_tail);
|
Py_XSETREF(retval->unconsumed_tail, self->unconsumed_tail);
|
||||||
Py_XINCREF(self->zdict);
|
Py_XINCREF(self->zdict);
|
||||||
Py_SETREF(retval->zdict, self->zdict);
|
Py_XSETREF(retval->zdict, self->zdict);
|
||||||
retval->eof = self->eof;
|
retval->eof = self->eof;
|
||||||
|
|
||||||
/* Mark it as being initialized */
|
/* Mark it as being initialized */
|
||||||
|
|
|
@ -3698,7 +3698,7 @@ PyBytes_Concat(PyObject **pv, PyObject *w)
|
||||||
/* Multiple references, need to create new object */
|
/* Multiple references, need to create new object */
|
||||||
PyObject *v;
|
PyObject *v;
|
||||||
v = bytes_concat(*pv, w);
|
v = bytes_concat(*pv, w);
|
||||||
Py_SETREF(*pv, v);
|
Py_XSETREF(*pv, v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1509,7 +1509,7 @@ property_init(PyObject *self, PyObject *args, PyObject *kwds)
|
||||||
PyObject *get_doc = _PyObject_GetAttrId(get, &PyId___doc__);
|
PyObject *get_doc = _PyObject_GetAttrId(get, &PyId___doc__);
|
||||||
if (get_doc) {
|
if (get_doc) {
|
||||||
if (Py_TYPE(self) == &PyProperty_Type) {
|
if (Py_TYPE(self) == &PyProperty_Type) {
|
||||||
Py_SETREF(prop->prop_doc, get_doc);
|
Py_XSETREF(prop->prop_doc, get_doc);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* If this is a property subclass, put __doc__
|
/* If this is a property subclass, put __doc__
|
||||||
|
|
|
@ -63,7 +63,7 @@ BaseException_init(PyBaseExceptionObject *self, PyObject *args, PyObject *kwds)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
Py_INCREF(args);
|
Py_INCREF(args);
|
||||||
Py_SETREF(self->args, args);
|
Py_XSETREF(self->args, args);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,7 @@ BaseException_set_args(PyBaseExceptionObject *self, PyObject *val)
|
||||||
seq = PySequence_Tuple(val);
|
seq = PySequence_Tuple(val);
|
||||||
if (!seq)
|
if (!seq)
|
||||||
return -1;
|
return -1;
|
||||||
Py_SETREF(self->args, seq);
|
Py_XSETREF(self->args, seq);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,7 +231,7 @@ BaseException_set_tb(PyBaseExceptionObject *self, PyObject *tb)
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_XINCREF(tb);
|
Py_XINCREF(tb);
|
||||||
Py_SETREF(self->traceback, tb);
|
Py_XSETREF(self->traceback, tb);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ void
|
||||||
PyException_SetCause(PyObject *self, PyObject *cause)
|
PyException_SetCause(PyObject *self, PyObject *cause)
|
||||||
{
|
{
|
||||||
((PyBaseExceptionObject *)self)->suppress_context = 1;
|
((PyBaseExceptionObject *)self)->suppress_context = 1;
|
||||||
Py_SETREF(((PyBaseExceptionObject *)self)->cause, cause);
|
Py_XSETREF(((PyBaseExceptionObject *)self)->cause, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject *
|
PyObject *
|
||||||
|
@ -341,7 +341,7 @@ PyException_GetContext(PyObject *self) {
|
||||||
void
|
void
|
||||||
PyException_SetContext(PyObject *self, PyObject *context)
|
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;
|
return 0;
|
||||||
if (size == 1) {
|
if (size == 1) {
|
||||||
Py_INCREF(PyTuple_GET_ITEM(args, 0));
|
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 */
|
else { /* size > 1 */
|
||||||
Py_INCREF(args);
|
Py_INCREF(args);
|
||||||
Py_SETREF(self->code, args);
|
Py_XSETREF(self->code, args);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -622,7 +622,7 @@ ImportError_init(PyImportErrorObject *self, PyObject *args, PyObject *kwds)
|
||||||
kwd = PyDict_GetItemString(kwds, #kwd); \
|
kwd = PyDict_GetItemString(kwds, #kwd); \
|
||||||
if (kwd) { \
|
if (kwd) { \
|
||||||
Py_INCREF(kwd); \
|
Py_INCREF(kwd); \
|
||||||
Py_SETREF(self->kwd, kwd); \
|
Py_XSETREF(self->kwd, kwd); \
|
||||||
if (PyDict_DelItemString(kwds, #kwd)) \
|
if (PyDict_DelItemString(kwds, #kwd)) \
|
||||||
return -1; \
|
return -1; \
|
||||||
} \
|
} \
|
||||||
|
@ -641,7 +641,7 @@ ImportError_init(PyImportErrorObject *self, PyObject *args, PyObject *kwds)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
Py_INCREF(msg);
|
Py_INCREF(msg);
|
||||||
Py_SETREF(self->msg, msg);
|
Py_XSETREF(self->msg, msg);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -851,7 +851,7 @@ oserror_init(PyOSErrorObject *self, PyObject **p_args,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Steals the reference to args */
|
/* Steals the reference to args */
|
||||||
Py_SETREF(self->args, args);
|
Py_XSETREF(self->args, args);
|
||||||
*p_args = args = NULL;
|
*p_args = args = NULL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1271,7 +1271,7 @@ SyntaxError_init(PySyntaxErrorObject *self, PyObject *args, PyObject *kwds)
|
||||||
|
|
||||||
if (lenargs >= 1) {
|
if (lenargs >= 1) {
|
||||||
Py_INCREF(PyTuple_GET_ITEM(args, 0));
|
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) {
|
if (lenargs == 2) {
|
||||||
info = PyTuple_GET_ITEM(args, 1);
|
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_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_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_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_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);
|
Py_DECREF(info);
|
||||||
|
|
||||||
|
@ -1541,7 +1541,7 @@ set_unicodefromstring(PyObject **attr, const char *value)
|
||||||
PyObject *obj = PyUnicode_FromString(value);
|
PyObject *obj = PyUnicode_FromString(value);
|
||||||
if (!obj)
|
if (!obj)
|
||||||
return -1;
|
return -1;
|
||||||
Py_SETREF(*attr, obj);
|
Py_XSETREF(*attr, obj);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1947,7 +1947,7 @@ UnicodeDecodeError_init(PyObject *self, PyObject *args, PyObject *kwds)
|
||||||
Py_buffer view;
|
Py_buffer view;
|
||||||
if (PyObject_GetBuffer(ude->object, &view, PyBUF_SIMPLE) != 0)
|
if (PyObject_GetBuffer(ude->object, &view, PyBUF_SIMPLE) != 0)
|
||||||
goto error;
|
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);
|
PyBuffer_Release(&view);
|
||||||
if (!ude->object)
|
if (!ude->object)
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -2856,7 +2856,7 @@ _check_for_legacy_statements(PySyntaxErrorObject *self, Py_ssize_t start)
|
||||||
}
|
}
|
||||||
if (PyUnicode_Tailmatch(self->text, print_prefix,
|
if (PyUnicode_Tailmatch(self->text, print_prefix,
|
||||||
start, text_len, -1)) {
|
start, text_len, -1)) {
|
||||||
Py_SETREF(self->msg,
|
Py_XSETREF(self->msg,
|
||||||
PyUnicode_FromString("Missing parentheses in call to 'print'"));
|
PyUnicode_FromString("Missing parentheses in call to 'print'"));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -2870,7 +2870,7 @@ _check_for_legacy_statements(PySyntaxErrorObject *self, Py_ssize_t start)
|
||||||
}
|
}
|
||||||
if (PyUnicode_Tailmatch(self->text, exec_prefix,
|
if (PyUnicode_Tailmatch(self->text, exec_prefix,
|
||||||
start, text_len, -1)) {
|
start, text_len, -1)) {
|
||||||
Py_SETREF(self->msg,
|
Py_XSETREF(self->msg,
|
||||||
PyUnicode_FromString("Missing parentheses in call to 'exec'"));
|
PyUnicode_FromString("Missing parentheses in call to 'exec'"));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1494,13 +1494,13 @@ float_as_integer_ratio(PyObject *v, PyObject *unused)
|
||||||
|
|
||||||
/* fold in 2**exponent */
|
/* fold in 2**exponent */
|
||||||
if (exponent > 0) {
|
if (exponent > 0) {
|
||||||
Py_SETREF(numerator,
|
Py_XSETREF(numerator,
|
||||||
long_methods->nb_lshift(numerator, py_exponent));
|
long_methods->nb_lshift(numerator, py_exponent));
|
||||||
if (numerator == NULL)
|
if (numerator == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Py_SETREF(denominator,
|
Py_XSETREF(denominator,
|
||||||
long_methods->nb_lshift(denominator, py_exponent));
|
long_methods->nb_lshift(denominator, py_exponent));
|
||||||
if (denominator == NULL)
|
if (denominator == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
|
@ -353,7 +353,7 @@ frame_settrace(PyFrameObject *f, PyObject* v, void *closure)
|
||||||
f->f_lineno = PyFrame_GetLineNumber(f);
|
f->f_lineno = PyFrame_GetLineNumber(f);
|
||||||
|
|
||||||
Py_XINCREF(v);
|
Py_XINCREF(v);
|
||||||
Py_SETREF(f->f_trace, v);
|
Py_XSETREF(f->f_trace, v);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -853,7 +853,7 @@ dict_to_map(PyObject *map, Py_ssize_t nmap, PyObject *dict, PyObject **values,
|
||||||
}
|
}
|
||||||
} else if (values[j] != value) {
|
} else if (values[j] != value) {
|
||||||
Py_XINCREF(value);
|
Py_XINCREF(value);
|
||||||
Py_SETREF(values[j], value);
|
Py_XSETREF(values[j], value);
|
||||||
}
|
}
|
||||||
Py_XDECREF(value);
|
Py_XDECREF(value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,7 @@ PyFunction_SetDefaults(PyObject *op, PyObject *defaults)
|
||||||
PyErr_SetString(PyExc_SystemError, "non-tuple default args");
|
PyErr_SetString(PyExc_SystemError, "non-tuple default args");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_SETREF(((PyFunctionObject *)op)->func_defaults, defaults);
|
Py_XSETREF(((PyFunctionObject *)op)->func_defaults, defaults);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ PyFunction_SetKwDefaults(PyObject *op, PyObject *defaults)
|
||||||
"non-dict keyword only default args");
|
"non-dict keyword only default args");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_SETREF(((PyFunctionObject *)op)->func_kwdefaults, defaults);
|
Py_XSETREF(((PyFunctionObject *)op)->func_kwdefaults, defaults);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ PyFunction_SetClosure(PyObject *op, PyObject *closure)
|
||||||
closure->ob_type->tp_name);
|
closure->ob_type->tp_name);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_SETREF(((PyFunctionObject *)op)->func_closure, closure);
|
Py_XSETREF(((PyFunctionObject *)op)->func_closure, closure);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@ PyFunction_SetAnnotations(PyObject *op, PyObject *annotations)
|
||||||
"non-dict annotations");
|
"non-dict annotations");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_SETREF(((PyFunctionObject *)op)->func_annotations, annotations);
|
Py_XSETREF(((PyFunctionObject *)op)->func_annotations, annotations);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,7 +270,7 @@ func_set_code(PyFunctionObject *op, PyObject *value)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_INCREF(value);
|
Py_INCREF(value);
|
||||||
Py_SETREF(op->func_code, value);
|
Py_XSETREF(op->func_code, value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,7 +292,7 @@ func_set_name(PyFunctionObject *op, PyObject *value)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_INCREF(value);
|
Py_INCREF(value);
|
||||||
Py_SETREF(op->func_name, value);
|
Py_XSETREF(op->func_name, value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ func_set_qualname(PyFunctionObject *op, PyObject *value)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_INCREF(value);
|
Py_INCREF(value);
|
||||||
Py_SETREF(op->func_qualname, value);
|
Py_XSETREF(op->func_qualname, value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ func_set_defaults(PyFunctionObject *op, PyObject *value)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_XINCREF(value);
|
Py_XINCREF(value);
|
||||||
Py_SETREF(op->func_defaults, value);
|
Py_XSETREF(op->func_defaults, value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,7 +370,7 @@ func_set_kwdefaults(PyFunctionObject *op, PyObject *value)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_XINCREF(value);
|
Py_XINCREF(value);
|
||||||
Py_SETREF(op->func_kwdefaults, value);
|
Py_XSETREF(op->func_kwdefaults, value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ func_set_annotations(PyFunctionObject *op, PyObject *value)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_XINCREF(value);
|
Py_XINCREF(value);
|
||||||
Py_SETREF(op->func_annotations, value);
|
Py_XSETREF(op->func_annotations, value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -504,7 +504,7 @@ func_new(PyTypeObject* type, PyObject* args, PyObject* kw)
|
||||||
|
|
||||||
if (name != Py_None) {
|
if (name != Py_None) {
|
||||||
Py_INCREF(name);
|
Py_INCREF(name);
|
||||||
Py_SETREF(newfunc->func_name, name);
|
Py_XSETREF(newfunc->func_name, name);
|
||||||
}
|
}
|
||||||
if (defaults != Py_None) {
|
if (defaults != Py_None) {
|
||||||
Py_INCREF(defaults);
|
Py_INCREF(defaults);
|
||||||
|
|
|
@ -527,7 +527,7 @@ gen_set_name(PyGenObject *op, PyObject *value)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_INCREF(value);
|
Py_INCREF(value);
|
||||||
Py_SETREF(op->gi_name, value);
|
Py_XSETREF(op->gi_name, value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -549,7 +549,7 @@ gen_set_qualname(PyGenObject *op, PyObject *value)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_INCREF(value);
|
Py_INCREF(value);
|
||||||
Py_SETREF(op->gi_qualname, value);
|
Py_XSETREF(op->gi_qualname, value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -229,7 +229,7 @@ PyList_SetItem(PyObject *op, Py_ssize_t i,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
p = ((PyListObject *)op) -> ob_item + i;
|
p = ((PyListObject *)op) -> ob_item + i;
|
||||||
Py_SETREF(*p, newitem);
|
Py_XSETREF(*p, newitem);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -735,7 +735,7 @@ list_ass_item(PyListObject *a, Py_ssize_t i, PyObject *v)
|
||||||
if (v == NULL)
|
if (v == NULL)
|
||||||
return list_ass_slice(a, i, i+1, v);
|
return list_ass_slice(a, i, i+1, v);
|
||||||
Py_INCREF(v);
|
Py_INCREF(v);
|
||||||
Py_SETREF(a->ob_item[i], v);
|
Py_XSETREF(a->ob_item[i], v);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ module_init_dict(PyModuleObject *mod, PyObject *md_dict,
|
||||||
return -1;
|
return -1;
|
||||||
if (PyUnicode_CheckExact(name)) {
|
if (PyUnicode_CheckExact(name)) {
|
||||||
Py_INCREF(name);
|
Py_INCREF(name);
|
||||||
Py_SETREF(mod->md_name, name);
|
Py_XSETREF(mod->md_name, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1220,7 +1220,7 @@ PyObject_GenericSetDict(PyObject *obj, PyObject *value, void *context)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_INCREF(value);
|
Py_INCREF(value);
|
||||||
Py_SETREF(*dictptr, value);
|
Py_XSETREF(*dictptr, value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1001,7 +1001,7 @@ longrangeiter_setstate(longrangeiterobject *r, PyObject *state)
|
||||||
return NULL;
|
return NULL;
|
||||||
cmp = PyObject_RichCompareBool(state, zero, Py_LT);
|
cmp = PyObject_RichCompareBool(state, zero, Py_LT);
|
||||||
if (cmp > 0) {
|
if (cmp > 0) {
|
||||||
Py_SETREF(r->index, zero);
|
Py_XSETREF(r->index, zero);
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
Py_DECREF(zero);
|
Py_DECREF(zero);
|
||||||
|
@ -1015,7 +1015,7 @@ longrangeiter_setstate(longrangeiterobject *r, PyObject *state)
|
||||||
state = r->len;
|
state = r->len;
|
||||||
|
|
||||||
Py_INCREF(state);
|
Py_INCREF(state);
|
||||||
Py_SETREF(r->index, state);
|
Py_XSETREF(r->index, state);
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1064,7 +1064,7 @@ longrangeiter_next(longrangeiterobject *r)
|
||||||
result = PyNumber_Add(r->start, product);
|
result = PyNumber_Add(r->start, product);
|
||||||
Py_DECREF(product);
|
Py_DECREF(product);
|
||||||
if (result) {
|
if (result) {
|
||||||
Py_SETREF(r->index, new_index);
|
Py_XSETREF(r->index, new_index);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Py_DECREF(new_index);
|
Py_DECREF(new_index);
|
||||||
|
|
|
@ -162,7 +162,7 @@ PyTuple_SetItem(PyObject *op, Py_ssize_t i, PyObject *newitem)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
p = ((PyTupleObject *)op) -> ob_item + i;
|
p = ((PyTupleObject *)op) -> ob_item + i;
|
||||||
Py_SETREF(*p, newitem);
|
Py_XSETREF(*p, newitem);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -316,7 +316,7 @@ assign_version_tag(PyTypeObject *type)
|
||||||
for (i = 0; i < (1 << MCACHE_SIZE_EXP); i++) {
|
for (i = 0; i < (1 << MCACHE_SIZE_EXP); i++) {
|
||||||
method_cache[i].value = NULL;
|
method_cache[i].value = NULL;
|
||||||
Py_INCREF(Py_None);
|
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 */
|
/* mark all version tags as invalid */
|
||||||
PyType_Modified(&PyBaseObject_Type);
|
PyType_Modified(&PyBaseObject_Type);
|
||||||
|
@ -424,7 +424,7 @@ type_set_name(PyTypeObject *type, PyObject *value, void *context)
|
||||||
|
|
||||||
type->tp_name = tp_name;
|
type->tp_name = tp_name;
|
||||||
Py_INCREF(value);
|
Py_INCREF(value);
|
||||||
Py_SETREF(((PyHeapTypeObject*)type)->ht_name, value);
|
Py_XSETREF(((PyHeapTypeObject*)type)->ht_name, value);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -445,7 +445,7 @@ type_set_qualname(PyTypeObject *type, PyObject *value, void *context)
|
||||||
|
|
||||||
et = (PyHeapTypeObject*)type;
|
et = (PyHeapTypeObject*)type;
|
||||||
Py_INCREF(value);
|
Py_INCREF(value);
|
||||||
Py_SETREF(et->ht_qualname, value);
|
Py_XSETREF(et->ht_qualname, value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2124,7 +2124,7 @@ subtype_setdict(PyObject *obj, PyObject *value, void *context)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_XINCREF(value);
|
Py_XINCREF(value);
|
||||||
Py_SETREF(*dictptr, value);
|
Py_XSETREF(*dictptr, value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2903,7 +2903,7 @@ _PyType_Lookup(PyTypeObject *type, PyObject *name)
|
||||||
else
|
else
|
||||||
method_cache_misses++;
|
method_cache_misses++;
|
||||||
#endif
|
#endif
|
||||||
Py_SETREF(method_cache[h].name, name);
|
Py_XSETREF(method_cache[h].name, name);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1830,7 +1830,7 @@ unicode_resize(PyObject **p_unicode, Py_ssize_t length)
|
||||||
_Py_INCREF_UNICODE_EMPTY();
|
_Py_INCREF_UNICODE_EMPTY();
|
||||||
if (!unicode_empty)
|
if (!unicode_empty)
|
||||||
return -1;
|
return -1;
|
||||||
Py_SETREF(*p_unicode, unicode_empty);
|
Py_XSETREF(*p_unicode, unicode_empty);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1838,7 +1838,7 @@ unicode_resize(PyObject **p_unicode, Py_ssize_t length)
|
||||||
PyObject *copy = resize_copy(unicode, length);
|
PyObject *copy = resize_copy(unicode, length);
|
||||||
if (copy == NULL)
|
if (copy == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
Py_SETREF(*p_unicode, copy);
|
Py_XSETREF(*p_unicode, copy);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13547,7 +13547,7 @@ _PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer,
|
||||||
return -1;
|
return -1;
|
||||||
_PyUnicode_FastCopyCharacters(newbuffer, 0,
|
_PyUnicode_FastCopyCharacters(newbuffer, 0,
|
||||||
writer->buffer, 0, writer->pos);
|
writer->buffer, 0, writer->pos);
|
||||||
Py_SETREF(writer->buffer, newbuffer);
|
Py_XSETREF(writer->buffer, newbuffer);
|
||||||
}
|
}
|
||||||
_PyUnicodeWriter_Update(writer);
|
_PyUnicodeWriter_Update(writer);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -15264,7 +15264,7 @@ PyUnicode_InternInPlace(PyObject **p)
|
||||||
|
|
||||||
if (t) {
|
if (t) {
|
||||||
Py_INCREF(t);
|
Py_INCREF(t);
|
||||||
Py_SETREF(*p, t);
|
Py_XSETREF(*p, t);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -526,7 +526,7 @@ fp_setreadl(struct tok_state *tok, const char* enc)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
readline = _PyObject_GetAttrId(stream, &PyId_readline);
|
readline = _PyObject_GetAttrId(stream, &PyId_readline);
|
||||||
Py_SETREF(tok->decoding_readline, readline);
|
Py_XSETREF(tok->decoding_readline, readline);
|
||||||
if (pos > 0) {
|
if (pos > 0) {
|
||||||
if (PyObject_CallObject(readline, NULL) == NULL) {
|
if (PyObject_CallObject(readline, NULL) == NULL) {
|
||||||
readline = NULL;
|
readline = NULL;
|
||||||
|
|
|
@ -730,7 +730,7 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno,
|
||||||
goto handle_error;
|
goto handle_error;
|
||||||
}
|
}
|
||||||
else if (!is_true) {
|
else if (!is_true) {
|
||||||
Py_SETREF(*filename, PyUnicode_FromString("__main__"));
|
Py_XSETREF(*filename, PyUnicode_FromString("__main__"));
|
||||||
if (*filename == NULL)
|
if (*filename == NULL)
|
||||||
goto handle_error;
|
goto handle_error;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3236,7 +3236,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
|
||||||
Py_INCREF(self);
|
Py_INCREF(self);
|
||||||
func = PyMethod_GET_FUNCTION(func);
|
func = PyMethod_GET_FUNCTION(func);
|
||||||
Py_INCREF(func);
|
Py_INCREF(func);
|
||||||
Py_SETREF(*pfunc, self);
|
Py_XSETREF(*pfunc, self);
|
||||||
na++;
|
na++;
|
||||||
/* n++; */
|
/* n++; */
|
||||||
} else
|
} else
|
||||||
|
@ -4491,7 +4491,7 @@ _PyEval_SetCoroutineWrapper(PyObject *wrapper)
|
||||||
PyThreadState *tstate = PyThreadState_GET();
|
PyThreadState *tstate = PyThreadState_GET();
|
||||||
|
|
||||||
Py_XINCREF(wrapper);
|
Py_XINCREF(wrapper);
|
||||||
Py_SETREF(tstate->coroutine_wrapper, wrapper);
|
Py_XSETREF(tstate->coroutine_wrapper, wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject *
|
PyObject *
|
||||||
|
@ -4747,7 +4747,7 @@ call_function(PyObject ***pp_stack, int oparg
|
||||||
Py_INCREF(self);
|
Py_INCREF(self);
|
||||||
func = PyMethod_GET_FUNCTION(func);
|
func = PyMethod_GET_FUNCTION(func);
|
||||||
Py_INCREF(func);
|
Py_INCREF(func);
|
||||||
Py_SETREF(*pfunc, self);
|
Py_XSETREF(*pfunc, self);
|
||||||
na++;
|
na++;
|
||||||
n++;
|
n++;
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -1756,7 +1756,7 @@ compiler_class(struct compiler *c, stmt_ty s)
|
||||||
{
|
{
|
||||||
/* use the class name for name mangling */
|
/* use the class name for name mangling */
|
||||||
Py_INCREF(s->v.ClassDef.name);
|
Py_INCREF(s->v.ClassDef.name);
|
||||||
Py_SETREF(c->u->u_private, s->v.ClassDef.name);
|
Py_XSETREF(c->u->u_private, s->v.ClassDef.name);
|
||||||
/* load (global) __name__ ... */
|
/* load (global) __name__ ... */
|
||||||
str = PyUnicode_InternFromString("__name__");
|
str = PyUnicode_InternFromString("__name__");
|
||||||
if (!str || !compiler_nameop(c, str, Load)) {
|
if (!str || !compiler_nameop(c, str, Load)) {
|
||||||
|
|
|
@ -311,9 +311,9 @@ finally:
|
||||||
--tstate->recursion_depth;
|
--tstate->recursion_depth;
|
||||||
/* throw away the old exception and use the recursion error instead */
|
/* throw away the old exception and use the recursion error instead */
|
||||||
Py_INCREF(PyExc_RecursionError);
|
Py_INCREF(PyExc_RecursionError);
|
||||||
Py_SETREF(*exc, PyExc_RecursionError);
|
Py_XSETREF(*exc, PyExc_RecursionError);
|
||||||
Py_INCREF(PyExc_RecursionErrorInst);
|
Py_INCREF(PyExc_RecursionErrorInst);
|
||||||
Py_SETREF(*val, PyExc_RecursionErrorInst);
|
Py_XSETREF(*val, PyExc_RecursionErrorInst);
|
||||||
/* just keeping the old traceback */
|
/* just keeping the old traceback */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -884,7 +884,7 @@ update_code_filenames(PyCodeObject *co, PyObject *oldname, PyObject *newname)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Py_INCREF(newname);
|
Py_INCREF(newname);
|
||||||
Py_SETREF(co->co_filename, newname);
|
Py_XSETREF(co->co_filename, newname);
|
||||||
|
|
||||||
constants = co->co_consts;
|
constants = co->co_consts;
|
||||||
n = PyTuple_GET_SIZE(constants);
|
n = PyTuple_GET_SIZE(constants);
|
||||||
|
@ -1330,7 +1330,7 @@ remove_importlib_frames(void)
|
||||||
PyUnicode_CompareWithASCIIString(code->co_name,
|
PyUnicode_CompareWithASCIIString(code->co_name,
|
||||||
remove_frames) == 0)) {
|
remove_frames) == 0)) {
|
||||||
Py_XINCREF(next);
|
Py_XINCREF(next);
|
||||||
Py_SETREF(*outer_link, next);
|
Py_XSETREF(*outer_link, next);
|
||||||
prev_link = outer_link;
|
prev_link = outer_link;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -118,7 +118,7 @@ tuple_of_constants(unsigned char *codestr, Py_ssize_t n,
|
||||||
/* If it's a BUILD_SET, use the PyTuple we just built to create a
|
/* If it's a BUILD_SET, use the PyTuple we just built to create a
|
||||||
PyFrozenSet, and use that as the constant instead: */
|
PyFrozenSet, and use that as the constant instead: */
|
||||||
if (codestr[0] == BUILD_SET) {
|
if (codestr[0] == BUILD_SET) {
|
||||||
Py_SETREF(newconst, PyFrozenSet_New(newconst));
|
Py_XSETREF(newconst, PyFrozenSet_New(newconst));
|
||||||
if (newconst == NULL)
|
if (newconst == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -436,7 +436,7 @@ trace_trampoline(PyObject *self, PyFrameObject *frame,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (result != Py_None) {
|
if (result != Py_None) {
|
||||||
Py_SETREF(frame->f_trace, result);
|
Py_XSETREF(frame->f_trace, result);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Py_DECREF(result);
|
Py_DECREF(result);
|
||||||
|
|
Loading…
Reference in New Issue