Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use METH_NOARGS when no arguments are required #5488

Merged
merged 2 commits into from May 19, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
292 changes: 146 additions & 146 deletions src/_imaging.c

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions src/_imagingcms.c
Expand Up @@ -959,25 +959,25 @@ _is_intent_supported(CmsProfileObject *self, int clut) {

static PyMethodDef pyCMSdll_methods[] = {

{"profile_open", cms_profile_open, 1},
{"profile_frombytes", cms_profile_fromstring, 1},
{"profile_fromstring", cms_profile_fromstring, 1},
{"profile_tobytes", cms_profile_tobytes, 1},
{"profile_open", cms_profile_open, METH_VARARGS},
{"profile_frombytes", cms_profile_fromstring, METH_VARARGS},
{"profile_fromstring", cms_profile_fromstring, METH_VARARGS},
{"profile_tobytes", cms_profile_tobytes, METH_VARARGS},

/* profile and transform functions */
{"buildTransform", buildTransform, 1},
{"buildProofTransform", buildProofTransform, 1},
{"createProfile", createProfile, 1},
{"buildTransform", buildTransform, METH_VARARGS},
{"buildProofTransform", buildProofTransform, METH_VARARGS},
{"createProfile", createProfile, METH_VARARGS},

/* platform specific tools */
#ifdef _WIN32
{"get_display_profile_win32", cms_get_display_profile_win32, 1},
{"get_display_profile_win32", cms_get_display_profile_win32, METH_VARARGS},
#endif

{NULL, NULL}};

static struct PyMethodDef cms_profile_methods[] = {
{"is_intent_supported", (PyCFunction)cms_profile_is_intent_supported, 1},
{"is_intent_supported", (PyCFunction)cms_profile_is_intent_supported, METH_VARARGS},
{NULL, NULL} /* sentinel */
};

Expand Down
8 changes: 4 additions & 4 deletions src/decode.c
Expand Up @@ -239,10 +239,10 @@ _get_pulls_fd(ImagingDecoderObject *decoder) {
}

static struct PyMethodDef methods[] = {
{"decode", (PyCFunction)_decode, 1},
{"cleanup", (PyCFunction)_decode_cleanup, 1},
{"setimage", (PyCFunction)_setimage, 1},
{"setfd", (PyCFunction)_setfd, 1},
{"decode", (PyCFunction)_decode, METH_VARARGS},
{"cleanup", (PyCFunction)_decode_cleanup, METH_VARARGS},
{"setimage", (PyCFunction)_setimage, METH_VARARGS},
{"setfd", (PyCFunction)_setfd, METH_VARARGS},
{NULL, NULL} /* sentinel */
};

Expand Down
16 changes: 8 additions & 8 deletions src/display.c
Expand Up @@ -224,14 +224,14 @@ _tobytes(ImagingDisplayObject *display, PyObject *args) {
}

static struct PyMethodDef methods[] = {
{"draw", (PyCFunction)_draw, 1},
{"expose", (PyCFunction)_expose, 1},
{"paste", (PyCFunction)_paste, 1},
{"query_palette", (PyCFunction)_query_palette, 1},
{"getdc", (PyCFunction)_getdc, 1},
{"releasedc", (PyCFunction)_releasedc, 1},
{"frombytes", (PyCFunction)_frombytes, 1},
{"tobytes", (PyCFunction)_tobytes, 1},
{"draw", (PyCFunction)_draw, METH_VARARGS},
{"expose", (PyCFunction)_expose, METH_VARARGS},
{"paste", (PyCFunction)_paste, METH_VARARGS},
{"query_palette", (PyCFunction)_query_palette, METH_VARARGS},
{"getdc", (PyCFunction)_getdc, METH_VARARGS},
{"releasedc", (PyCFunction)_releasedc, METH_VARARGS},
{"frombytes", (PyCFunction)_frombytes, METH_VARARGS},
{"tobytes", (PyCFunction)_tobytes, METH_VARARGS},
{NULL, NULL} /* sentinel */
};

Expand Down
12 changes: 6 additions & 6 deletions src/encode.c
Expand Up @@ -304,12 +304,12 @@ _get_pushes_fd(ImagingEncoderObject *encoder) {
}

static struct PyMethodDef methods[] = {
{"encode", (PyCFunction)_encode, 1},
{"cleanup", (PyCFunction)_encode_cleanup, 1},
{"encode_to_file", (PyCFunction)_encode_to_file, 1},
{"encode_to_pyfd", (PyCFunction)_encode_to_pyfd, 1},
{"setimage", (PyCFunction)_setimage, 1},
{"setfd", (PyCFunction)_setfd, 1},
{"encode", (PyCFunction)_encode, METH_VARARGS},
{"cleanup", (PyCFunction)_encode_cleanup, METH_VARARGS},
{"encode_to_file", (PyCFunction)_encode_to_file, METH_VARARGS},
{"encode_to_pyfd", (PyCFunction)_encode_to_pyfd, METH_VARARGS},
{"setimage", (PyCFunction)_setimage, METH_VARARGS},
{"setfd", (PyCFunction)_setfd, METH_VARARGS},
{NULL, NULL} /* sentinel */
};

Expand Down
10 changes: 5 additions & 5 deletions src/outline.c
Expand Up @@ -145,11 +145,11 @@ _outline_transform(OutlineObject *self, PyObject *args) {
}

static struct PyMethodDef _outline_methods[] = {
{"line", (PyCFunction)_outline_line, 1},
{"curve", (PyCFunction)_outline_curve, 1},
{"move", (PyCFunction)_outline_move, 1},
{"close", (PyCFunction)_outline_close, 1},
{"transform", (PyCFunction)_outline_transform, 1},
{"line", (PyCFunction)_outline_line, METH_VARARGS},
{"curve", (PyCFunction)_outline_curve, METH_VARARGS},
{"move", (PyCFunction)_outline_move, METH_VARARGS},
{"close", (PyCFunction)_outline_close, METH_VARARGS},
{"transform", (PyCFunction)_outline_transform, METH_VARARGS},
{NULL, NULL} /* sentinel */
};

Expand Down
10 changes: 5 additions & 5 deletions src/path.c
Expand Up @@ -524,11 +524,11 @@ path_transform(PyPathObject *self, PyObject *args) {
}

static struct PyMethodDef methods[] = {
{"getbbox", (PyCFunction)path_getbbox, 1},
{"tolist", (PyCFunction)path_tolist, 1},
{"compact", (PyCFunction)path_compact, 1},
{"map", (PyCFunction)path_map, 1},
{"transform", (PyCFunction)path_transform, 1},
{"getbbox", (PyCFunction)path_getbbox, METH_VARARGS},
{"tolist", (PyCFunction)path_tolist, METH_VARARGS},
{"compact", (PyCFunction)path_compact, METH_VARARGS},
{"map", (PyCFunction)path_map, METH_VARARGS},
{"transform", (PyCFunction)path_transform, METH_VARARGS},
{NULL, NULL} /* sentinel */
};

Expand Down