Skip to content

Commit f641773

Browse files
committed
remove un-necessary casts to setter
1 parent d356465 commit f641773

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

Modules/_functoolsmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1636,7 +1636,7 @@ _functools__lru_cache_wrapper_cache_clear_impl(PyObject *self)
16361636
}
16371637

16381638
static PyObject *
1639-
lru_cache_reduce(PyObject *self, PyObject *Py_UNUSED(ignored))
1639+
lru_cache_reduce(PyObject *self, PyObject *Py_UNUSED(dummy))
16401640
{
16411641
return PyObject_GetAttrString(self, "__qualname__");
16421642
}

Modules/_testcapi/watchers.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ _testcapi_unwatch_dict_impl(PyObject *module, int watcher_id, PyObject *dict)
162162
}
163163

164164
static PyObject *
165-
get_dict_watcher_events(PyObject *self, PyObject *Py_UNUSED(ignored))
165+
get_dict_watcher_events(PyObject *self, PyObject *Py_UNUSED(args))
166166
{
167167
if (!g_dict_watch_events) {
168168
PyErr_SetString(PyExc_RuntimeError, "no watchers active");
@@ -255,7 +255,7 @@ clear_type_watcher(PyObject *self, PyObject *watcher_id)
255255
}
256256

257257
static PyObject *
258-
get_type_modified_events(PyObject *self, PyObject *Py_UNUSED(ignored))
258+
get_type_modified_events(PyObject *self, PyObject *Py_UNUSED(args))
259259
{
260260
if (!g_type_modified_events) {
261261
PyErr_SetString(PyExc_RuntimeError, "no watchers active");
@@ -413,7 +413,7 @@ get_code_watcher_num_destroyed_events(PyObject *self, PyObject *watcher_id)
413413
}
414414

415415
static PyObject *
416-
allocate_too_many_code_watchers(PyObject *self, PyObject *Py_UNUSED(ignored))
416+
allocate_too_many_code_watchers(PyObject *self, PyObject *Py_UNUSED(args))
417417
{
418418
int watcher_ids[CODE_MAX_WATCHERS + 1];
419419
int num_watchers = 0;
@@ -742,7 +742,7 @@ get_context_switches(PyObject *Py_UNUSED(self), PyObject *watcher_id)
742742
}
743743

744744
static PyObject *
745-
allocate_too_many_context_watchers(PyObject *self, PyObject *Py_UNUSED(ignored))
745+
allocate_too_many_context_watchers(PyObject *self, PyObject *Py_UNUSED(args))
746746
{
747747
int watcher_ids[CONTEXT_MAX_WATCHERS + 1];
748748
int num_watchers = 0;

Modules/atexitmodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ Run all registered exit functions.\n\
217217
If a callback raises an exception, it is logged with sys.unraisablehook.");
218218

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

233233
static PyObject *
234-
atexit_clear(PyObject *module, PyObject *Py_UNUSED(ignored))
234+
atexit_clear(PyObject *module, PyObject *Py_UNUSED(dummy))
235235
{
236236
atexit_cleanup(get_atexit_state());
237237
Py_RETURN_NONE;
@@ -244,7 +244,7 @@ PyDoc_STRVAR(atexit_ncallbacks__doc__,
244244
Return the number of registered exit functions.");
245245

246246
static PyObject *
247-
atexit_ncallbacks(PyObject *module, PyObject *Py_UNUSED(ignored))
247+
atexit_ncallbacks(PyObject *module, PyObject *Py_UNUSED(dummy))
248248
{
249249
struct atexit_state *state = get_atexit_state();
250250
assert(state->callbacks != NULL);

Modules/faulthandler.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,8 +1124,8 @@ faulthandler_fatal_error_c_thread(PyObject *self, PyObject *args)
11241124
Py_RETURN_NONE;
11251125
}
11261126

1127-
static PyObject* _Py_NO_SANITIZE_UNDEFINED
1128-
faulthandler_sigfpe(PyObject *self, PyObject *Py_UNUSED(ignored))
1127+
static PyObject * _Py_NO_SANITIZE_UNDEFINED
1128+
faulthandler_sigfpe(PyObject *self, PyObject *Py_UNUSED(dummy))
11291129
{
11301130
faulthandler_suppress_crash_report();
11311131

Objects/dictobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5922,7 +5922,7 @@ dictview_mapping(PyObject *view, void *Py_UNUSED(ignored)) {
59225922
}
59235923

59245924
static PyGetSetDef dictview_getset[] = {
5925-
{"mapping", dictview_mapping, (setter)NULL,
5925+
{"mapping", dictview_mapping, NULL,
59265926
PyDoc_STR("dictionary that this view refers to"), NULL},
59275927
{0}
59285928
};

Objects/genericaliasobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,8 +824,8 @@ ga_unpacked_tuple_args(PyObject *self, void *unused)
824824
}
825825

826826
static PyGetSetDef ga_properties[] = {
827-
{"__parameters__", ga_parameters, (setter)NULL, PyDoc_STR("Type variables in the GenericAlias."), NULL},
828-
{"__typing_unpacked_tuple_args__", ga_unpacked_tuple_args, (setter)NULL, NULL},
827+
{"__parameters__", ga_parameters, NULL, PyDoc_STR("Type variables in the GenericAlias."), NULL},
828+
{"__typing_unpacked_tuple_args__", ga_unpacked_tuple_args, NULL, NULL},
829829
{0}
830830
};
831831

Objects/longobject.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6540,19 +6540,19 @@ static PyMethodDef long_methods[] = {
65406540

65416541
static PyGetSetDef long_getset[] = {
65426542
{"real",
6543-
long_long_getter, (setter)NULL,
6543+
long_long_getter, NULL,
65446544
"the real part of a complex number",
65456545
NULL},
65466546
{"imag",
6547-
long_get0, (setter)NULL,
6547+
long_get0, NULL,
65486548
"the imaginary part of a complex number",
65496549
NULL},
65506550
{"numerator",
6551-
long_long_getter, (setter)NULL,
6551+
long_long_getter, NULL,
65526552
"the numerator of a rational number in lowest terms",
65536553
NULL},
65546554
{"denominator",
6555-
long_get1, (setter)NULL,
6555+
long_get1, NULL,
65566556
"the denominator of a rational number in lowest terms",
65576557
NULL},
65586558
{NULL} /* Sentinel */

Objects/unionobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ static PyGetSetDef union_properties[] = {
380380
PyDoc_STR("Qualified name of the type"), NULL},
381381
{"__origin__", union_origin, NULL,
382382
PyDoc_STR("Always returns the type"), NULL},
383-
{"__parameters__", union_parameters, (setter)NULL,
383+
{"__parameters__", union_parameters, NULL,
384384
PyDoc_STR("Type variables in the types.UnionType."), NULL},
385385
{0}
386386
};

0 commit comments

Comments
 (0)