Break the fields of each PyMethodDef structure initializer to separate lines.
While at it, drop the superfluous (char*) cast from the "PyMethodDef.ml_name" field initializer <https://docs.python.org/3/c-api/structures.html#c.PyMethodDef>. (According to commit bf0eee111fc3, "Add Python 3 bindings.", 2019-05-11, we don't target Python 2.) Effect shown on the currently longest line in "python/libnbdmod.c": > - { (char *) "aio_connect_systemd_socket_activation", > nbd_internal_py_aio_connect_systemd_socket_activation, METH_VARARGS, NULL }, > + { > + "aio_connect_systemd_socket_activation", > + nbd_internal_py_aio_connect_systemd_socket_activation, > + METH_VARARGS, > + NULL > + }, Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172516 Signed-off-by: Laszlo Ersek <ler...@redhat.com> --- generator/Python.ml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/generator/Python.ml b/generator/Python.ml index 87444c54bdf0..c146f04f0b49 100644 --- a/generator/Python.ml +++ b/generator/Python.ml @@ -100,8 +100,12 @@ let pr "static PyMethodDef methods[] = {\n"; List.iter ( fun name -> - pr " { (char *) \"%s\", nbd_internal_py_%s, METH_VARARGS, NULL },\n" - name name; + pr " {\n"; + pr " \"%s\",\n" name; + pr " nbd_internal_py_%s,\n" name; + pr " METH_VARARGS,\n"; + pr " NULL\n"; + pr " },\n" ) ([ "create"; "close"; "display_version"; "alloc_aio_buffer"; _______________________________________________ Libguestfs mailing list Libguestfs@redhat.com https://listman.redhat.com/mailman/listinfo/libguestfs