Use (void) for empty function parameters by Yay295 · Pull Request #8002 · python-pillow/Pillow
Casting is already used for this reason quite a lot elsewhere already. By "other places" I meant "other places in Pillow"; I wasn't talking about other projects.
| static struct PyMethodDef _anim_decoder_methods[] = { | |
| {"get_info", (PyCFunction)_anim_decoder_get_info, METH_NOARGS, "get_info"}, | |
| {"get_chunk", (PyCFunction)_anim_decoder_get_chunk, METH_VARARGS, "get_chunk"}, | |
| {"get_next", (PyCFunction)_anim_decoder_get_next, METH_NOARGS, "get_next"}, | |
| {"reset", (PyCFunction)_anim_decoder_reset, METH_NOARGS, "reset"}, | |
| {NULL, NULL} /* sentinel */ | |
| }; |
https://github.com/search?q=repo%3Apython-pillow%2FPillow+%28PyCFunction%29&type=code