Skip to content

Commit 5556d3e

Browse files
authored
gh-98724: Fix warnings on Py_SETREF() usage (#99781)
Cast argument to the expected type.
1 parent ae234fb commit 5556d3e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Modules/_curses_panel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ _curses_panel_panel_replace_impl(PyCursesPanelObject *self,
424424
PyErr_SetString(state->PyCursesError, "replace_panel() returned ERR");
425425
return NULL;
426426
}
427-
Py_SETREF(po->wo, Py_NewRef(win));
427+
Py_SETREF(po->wo, (PyCursesWindowObject*)Py_NewRef(win));
428428
Py_RETURN_NONE;
429429
}
430430

Objects/longobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4775,7 +4775,7 @@ long_pow(PyObject *v, PyObject *w, PyObject *x)
47754775
* because we're primarily trying to cut overhead for small powers.
47764776
*/
47774777
assert(bi); /* else there is no significant bit */
4778-
Py_SETREF(z, Py_NewRef(a));
4778+
Py_SETREF(z, (PyLongObject*)Py_NewRef(a));
47794779
for (bit = 2; ; bit <<= 1) {
47804780
if (bit > bi) { /* found the first bit */
47814781
assert((bi & bit) == 0);

Objects/typeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9593,7 +9593,7 @@ super_init_impl(PyObject *self, PyTypeObject *type, PyObject *obj) {
95939593
return -1;
95949594
Py_INCREF(obj);
95959595
}
9596-
Py_XSETREF(su->type, Py_NewRef(type));
9596+
Py_XSETREF(su->type, (PyTypeObject*)Py_NewRef(type));
95979597
Py_XSETREF(su->obj, obj);
95989598
Py_XSETREF(su->obj_type, obj_type);
95999599
return 0;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy