Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
70861ec
remove un-necessary casts to PyCFunction
picnixz Feb 6, 2025
d356465
remove un-necessary casts to `getter`
picnixz Feb 6, 2025
f641773
remove un-necessary casts to `setter`
picnixz Feb 6, 2025
a197210
remove un-necessary casts for `initproc`
picnixz Mar 20, 2025
5a39cb7
add TODO note to remove casts to `destructor`
picnixz Mar 20, 2025
222b662
un-necessary cast for module free functions
picnixz Mar 20, 2025
ad434c0
fixup: None and NoneType
picnixz Mar 20, 2025
2fea60f
fixup: _PyDictViewObject
picnixz Mar 20, 2025
47bc0ee
fixup: bool_invert
picnixz Mar 20, 2025
a894c4c
fixup: PyUnicodeObject methods
picnixz Mar 20, 2025
1c17bfc
fixup: rangeobject
picnixz Mar 20, 2025
e415739
fixup: zoneinfo_init_subclass
picnixz Mar 20, 2025
86bc47c
fixup: ga_iter
picnixz Mar 24, 2025
5d98a84
fixup: hamt_baseiter_tp_iternext
picnixz Mar 24, 2025
1053101
remove dead code
picnixz Mar 24, 2025
5e68e29
Merge branch 'main' into fix/ubsan/casts-111178
picnixz Mar 24, 2025
937aa63
Merge branch 'main' into fix/ubsan/casts-111178
picnixz Mar 24, 2025
9c780ad
Update Include/cpython/object.h
picnixz Mar 24, 2025
3124512
Merge remote-tracking branch 'upstream/main' into fix/ubsan/casts-111178
picnixz Mar 30, 2025
92d648e
fixup comments
picnixz Mar 30, 2025
25c2a3f
Merge branch 'main' into fix/ubsan/casts-111178
picnixz Mar 31, 2025
4bf2a1e
Update Modules/faulthandler.c
picnixz Apr 1, 2025
db5dae1
Update Include/cpython/object.h
picnixz Apr 1, 2025
6cfed6c
Update Python/ceval.c
picnixz Apr 1, 2025
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
Prev Previous commit
Next Next commit
remove un-necessary casts to setter
  • Loading branch information
picnixz committed Mar 24, 2025
commit f641773ae89b2afec622ec2ea483a024088e879d
2 changes: 1 addition & 1 deletion Modules/_functoolsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,7 @@ _functools__lru_cache_wrapper_cache_clear_impl(PyObject *self)
}

static PyObject *
lru_cache_reduce(PyObject *self, PyObject *Py_UNUSED(ignored))
lru_cache_reduce(PyObject *self, PyObject *Py_UNUSED(dummy))
{
return PyObject_GetAttrString(self, "__qualname__");
}
Expand Down
8 changes: 4 additions & 4 deletions Modules/_testcapi/watchers.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ _testcapi_unwatch_dict_impl(PyObject *module, int watcher_id, PyObject *dict)
}

static PyObject *
get_dict_watcher_events(PyObject *self, PyObject *Py_UNUSED(ignored))
get_dict_watcher_events(PyObject *self, PyObject *Py_UNUSED(args))
{
if (!g_dict_watch_events) {
PyErr_SetString(PyExc_RuntimeError, "no watchers active");
Expand Down Expand Up @@ -255,7 +255,7 @@ clear_type_watcher(PyObject *self, PyObject *watcher_id)
}

static PyObject *
get_type_modified_events(PyObject *self, PyObject *Py_UNUSED(ignored))
get_type_modified_events(PyObject *self, PyObject *Py_UNUSED(args))
{
if (!g_type_modified_events) {
PyErr_SetString(PyExc_RuntimeError, "no watchers active");
Expand Down Expand Up @@ -413,7 +413,7 @@ get_code_watcher_num_destroyed_events(PyObject *self, PyObject *watcher_id)
}

static PyObject *
allocate_too_many_code_watchers(PyObject *self, PyObject *Py_UNUSED(ignored))
allocate_too_many_code_watchers(PyObject *self, PyObject *Py_UNUSED(args))
{
int watcher_ids[CODE_MAX_WATCHERS + 1];
int num_watchers = 0;
Expand Down Expand Up @@ -742,7 +742,7 @@ get_context_switches(PyObject *Py_UNUSED(self), PyObject *watcher_id)
}

static PyObject *
allocate_too_many_context_watchers(PyObject *self, PyObject *Py_UNUSED(ignored))
allocate_too_many_context_watchers(PyObject *self, PyObject *Py_UNUSED(args))
{
int watcher_ids[CONTEXT_MAX_WATCHERS + 1];
int num_watchers = 0;
Expand Down
6 changes: 3 additions & 3 deletions Modules/atexitmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Run all registered exit functions.\n\
If a callback raises an exception, it is logged with sys.unraisablehook.");

static PyObject *
atexit_run_exitfuncs(PyObject *module, PyObject *Py_UNUSED(ignored))
atexit_run_exitfuncs(PyObject *module, PyObject *Py_UNUSED(dummy))
{
struct atexit_state *state = get_atexit_state();
atexit_callfuncs(state);
Expand All @@ -231,7 +231,7 @@ PyDoc_STRVAR(atexit_clear__doc__,
Clear the list of previously registered exit functions.");

static PyObject *
atexit_clear(PyObject *module, PyObject *Py_UNUSED(ignored))
atexit_clear(PyObject *module, PyObject *Py_UNUSED(dummy))
{
atexit_cleanup(get_atexit_state());
Py_RETURN_NONE;
Expand All @@ -244,7 +244,7 @@ PyDoc_STRVAR(atexit_ncallbacks__doc__,
Return the number of registered exit functions.");

static PyObject *
atexit_ncallbacks(PyObject *module, PyObject *Py_UNUSED(ignored))
atexit_ncallbacks(PyObject *module, PyObject *Py_UNUSED(dummy))
{
struct atexit_state *state = get_atexit_state();
assert(state->callbacks != NULL);
Expand Down
4 changes: 2 additions & 2 deletions Modules/faulthandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1124,8 +1124,8 @@ faulthandler_fatal_error_c_thread(PyObject *self, PyObject *args)
Py_RETURN_NONE;
}

static PyObject* _Py_NO_SANITIZE_UNDEFINED
faulthandler_sigfpe(PyObject *self, PyObject *Py_UNUSED(ignored))
static PyObject * _Py_NO_SANITIZE_UNDEFINED
Comment thread
picnixz marked this conversation as resolved.
Outdated
faulthandler_sigfpe(PyObject *self, PyObject *Py_UNUSED(dummy))
{
faulthandler_suppress_crash_report();

Expand Down
2 changes: 1 addition & 1 deletion Objects/dictobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -5922,7 +5922,7 @@ dictview_mapping(PyObject *view, void *Py_UNUSED(ignored)) {
}

static PyGetSetDef dictview_getset[] = {
{"mapping", dictview_mapping, (setter)NULL,
{"mapping", dictview_mapping, NULL,
PyDoc_STR("dictionary that this view refers to"), NULL},
{0}
};
Expand Down
4 changes: 2 additions & 2 deletions Objects/genericaliasobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,8 +824,8 @@ ga_unpacked_tuple_args(PyObject *self, void *unused)
}

static PyGetSetDef ga_properties[] = {
{"__parameters__", ga_parameters, (setter)NULL, PyDoc_STR("Type variables in the GenericAlias."), NULL},
{"__typing_unpacked_tuple_args__", ga_unpacked_tuple_args, (setter)NULL, NULL},
{"__parameters__", ga_parameters, NULL, PyDoc_STR("Type variables in the GenericAlias."), NULL},
{"__typing_unpacked_tuple_args__", ga_unpacked_tuple_args, NULL, NULL},
{0}
};

Expand Down
8 changes: 4 additions & 4 deletions Objects/longobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -6540,19 +6540,19 @@ static PyMethodDef long_methods[] = {

static PyGetSetDef long_getset[] = {
{"real",
long_long_getter, (setter)NULL,
long_long_getter, NULL,
"the real part of a complex number",
NULL},
{"imag",
long_get0, (setter)NULL,
long_get0, NULL,
"the imaginary part of a complex number",
NULL},
{"numerator",
long_long_getter, (setter)NULL,
long_long_getter, NULL,
"the numerator of a rational number in lowest terms",
NULL},
{"denominator",
long_get1, (setter)NULL,
long_get1, NULL,
"the denominator of a rational number in lowest terms",
NULL},
{NULL} /* Sentinel */
Expand Down
2 changes: 1 addition & 1 deletion Objects/unionobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ static PyGetSetDef union_properties[] = {
PyDoc_STR("Qualified name of the type"), NULL},
{"__origin__", union_origin, NULL,
PyDoc_STR("Always returns the type"), NULL},
{"__parameters__", union_parameters, (setter)NULL,
{"__parameters__", union_parameters, NULL,
PyDoc_STR("Type variables in the types.UnionType."), NULL},
{0}
};
Expand Down