@@ -424,7 +424,7 @@ StructUnionType_new(PyTypeObject *type, PyObject *args, PyObject *kwds, int isSt
424424 Py_DECREF ((PyObject * )dict );
425425 return NULL ;
426426 }
427- Py_SETREF (result -> tp_dict , (PyObject * )dict );
427+ Py_XSETREF (result -> tp_dict , (PyObject * )dict );
428428 dict -> format = _ctypes_alloc_format_string (NULL , "B" );
429429 if (dict -> format == NULL ) {
430430 Py_DECREF (result );
@@ -902,7 +902,7 @@ PyCPointerType_SetProto(StgDictObject *stgdict, PyObject *proto)
902902 return -1 ;
903903 }
904904 Py_INCREF (proto );
905- Py_SETREF (stgdict -> proto , proto );
905+ Py_XSETREF (stgdict -> proto , proto );
906906 return 0 ;
907907}
908908
@@ -992,7 +992,7 @@ PyCPointerType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
992992 Py_DECREF ((PyObject * )stgdict );
993993 return NULL ;
994994 }
995- Py_SETREF (result -> tp_dict , (PyObject * )stgdict );
995+ Py_XSETREF (result -> tp_dict , (PyObject * )stgdict );
996996
997997 return (PyObject * )result ;
998998}
@@ -1457,7 +1457,7 @@ PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
14571457 Py_DECREF ((PyObject * )stgdict );
14581458 return NULL ;
14591459 }
1460- Py_SETREF (result -> tp_dict , (PyObject * )stgdict );
1460+ Py_XSETREF (result -> tp_dict , (PyObject * )stgdict );
14611461
14621462 /* Special case for character arrays.
14631463 A permanent annoyance: char arrays are also strings!
@@ -1880,7 +1880,7 @@ static PyObject *CreateSwappedType(PyTypeObject *type, PyObject *args, PyObject
18801880 Py_DECREF ((PyObject * )stgdict );
18811881 return NULL ;
18821882 }
1883- Py_SETREF (result -> tp_dict , (PyObject * )stgdict );
1883+ Py_XSETREF (result -> tp_dict , (PyObject * )stgdict );
18841884
18851885 return (PyObject * )result ;
18861886}
@@ -2388,7 +2388,7 @@ PyCFuncPtrType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
23882388 Py_DECREF ((PyObject * )stgdict );
23892389 return NULL ;
23902390 }
2391- Py_SETREF (result -> tp_dict , (PyObject * )stgdict );
2391+ Py_XSETREF (result -> tp_dict , (PyObject * )stgdict );
23922392
23932393 if (-1 == make_funcptrtype_dict (stgdict )) {
23942394 Py_DECREF (result );
@@ -2530,7 +2530,7 @@ KeepRef(CDataObject *target, Py_ssize_t index, PyObject *keep)
25302530 }
25312531 ob = PyCData_GetContainer (target );
25322532 if (ob -> b_objects == NULL || !PyDict_CheckExact (ob -> b_objects )) {
2533- Py_SETREF (ob -> b_objects , keep ); /* refcount consumed */
2533+ Py_XSETREF (ob -> b_objects , keep ); /* refcount consumed */
25342534 return 0 ;
25352535 }
25362536 key = unique_key (target , index );
@@ -3053,7 +3053,7 @@ PyCFuncPtr_set_errcheck(PyCFuncPtrObject *self, PyObject *ob)
30533053 return -1 ;
30543054 }
30553055 Py_XINCREF (ob );
3056- Py_SETREF (self -> errcheck , ob );
3056+ Py_XSETREF (self -> errcheck , ob );
30573057 return 0 ;
30583058}
30593059
@@ -3082,8 +3082,8 @@ PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob)
30823082 return -1 ;
30833083 }
30843084 Py_INCREF (ob );
3085- Py_SETREF (self -> restype , ob );
3086- Py_SETREF (self -> checker , PyObject_GetAttrString (ob , "_check_retval_" ));
3085+ Py_XSETREF (self -> restype , ob );
3086+ Py_XSETREF (self -> checker , PyObject_GetAttrString (ob , "_check_retval_" ));
30873087 if (self -> checker == NULL )
30883088 PyErr_Clear ();
30893089 return 0 ;
@@ -3120,9 +3120,9 @@ PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob)
31203120 converters = converters_from_argtypes (ob );
31213121 if (!converters )
31223122 return -1 ;
3123- Py_SETREF (self -> converters , converters );
3123+ Py_XSETREF (self -> converters , converters );
31243124 Py_INCREF (ob );
3125- Py_SETREF (self -> argtypes , ob );
3125+ Py_XSETREF (self -> argtypes , ob );
31263126 }
31273127 return 0 ;
31283128}
0 commit comments