Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-98724: Fix warnings on Py_SETREF() usage
Cast argument to the expected type.
  • Loading branch information
vstinner committed Nov 25, 2022
commit d19383c04d29bde4bd59ee6bcc56d3b437353503
2 changes: 1 addition & 1 deletion Modules/_curses_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ _curses_panel_panel_replace_impl(PyCursesPanelObject *self,
PyErr_SetString(state->PyCursesError, "replace_panel() returned ERR");
return NULL;
}
Py_SETREF(po->wo, Py_NewRef(win));
Py_SETREF(po->wo, (PyCursesWindowObject*)Py_NewRef(win));
Py_RETURN_NONE;
}

Expand Down
2 changes: 1 addition & 1 deletion Objects/longobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -4775,7 +4775,7 @@ long_pow(PyObject *v, PyObject *w, PyObject *x)
* because we're primarily trying to cut overhead for small powers.
*/
assert(bi); /* else there is no significant bit */
Py_SETREF(z, Py_NewRef(a));
Py_SETREF(z, (PyLongObject*)Py_NewRef(a));
for (bit = 2; ; bit <<= 1) {
if (bit > bi) { /* found the first bit */
assert((bi & bit) == 0);
Expand Down
2 changes: 1 addition & 1 deletion Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -9593,7 +9593,7 @@ super_init_impl(PyObject *self, PyTypeObject *type, PyObject *obj) {
return -1;
Py_INCREF(obj);
}
Py_XSETREF(su->type, Py_NewRef(type));
Py_XSETREF(su->type, (PyTypeObject*)Py_NewRef(type));
Py_XSETREF(su->obj, obj);
Py_XSETREF(su->obj_type, obj_type);
return 0;
Expand Down