summaryrefslogtreecommitdiff
path: root/dbus_bindings/conn-methods.c
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2019-07-23 11:14:14 +0100
committerSimon McVittie <smcv@collabora.com>2019-07-23 11:14:14 +0100
commitb24fd92dcaac567568641df0490acac334dd94c9 (patch)
treecc4752787f25e0055c98c041a69d228fd2f6f0cf /dbus_bindings/conn-methods.c
parentd59f67d69256fdb88421934297ae20ff49356fb6 (diff)
Silence -Wcast-function-type with gcc 8
Casting via void (*)(void) is the documented way to suppress this warning. This is required because the CPython API treats function pointers as generic, with flags to indicate different calling conventions. Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'dbus_bindings/conn-methods.c')
-rw-r--r--dbus_bindings/conn-methods.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/dbus_bindings/conn-methods.c b/dbus_bindings/conn-methods.c
index 8ae053a..62bdf86 100644
--- a/dbus_bindings/conn-methods.c
+++ b/dbus_bindings/conn-methods.c
@@ -1035,7 +1035,10 @@ PyDoc_STRVAR(set_unique_name__doc__,
"already been set.\n");
struct PyMethodDef DBusPyConnection_tp_methods[] = {
-#define ENTRY(name, flags) {#name, (PyCFunction)Connection_##name, flags, Connection_##name##__doc__}
+#define ENTRY(name, flags) {\
+ #name, (PyCFunction) (void (*)(void)) Connection_##name, \
+ flags, Connection_##name##__doc__ \
+}
ENTRY(_require_main_loop, METH_NOARGS),
ENTRY(close, METH_NOARGS),
ENTRY(flush, METH_NOARGS),
@@ -1053,13 +1056,13 @@ struct PyMethodDef DBusPyConnection_tp_methods[] = {
ENTRY(send_message_with_reply_and_block, METH_VARARGS),
ENTRY(_unregister_object_path, METH_VARARGS|METH_KEYWORDS),
ENTRY(list_exported_child_objects, METH_VARARGS|METH_KEYWORDS),
- {"_new_for_bus", (PyCFunction)DBusPyConnection_NewForBus,
+ {"_new_for_bus", (PyCFunction) (void (*)(void)) DBusPyConnection_NewForBus,
METH_CLASS|METH_VARARGS|METH_KEYWORDS,
new_for_bus__doc__},
- {"get_unique_name", (PyCFunction)DBusPyConnection_GetUniqueName,
+ {"get_unique_name", (PyCFunction) (void (*)(void)) DBusPyConnection_GetUniqueName,
METH_NOARGS,
get_unique_name__doc__},
- {"set_unique_name", (PyCFunction)DBusPyConnection_SetUniqueName,
+ {"set_unique_name", (PyCFunction) (void (*)(void)) DBusPyConnection_SetUniqueName,
METH_VARARGS,
set_unique_name__doc__},
ENTRY(set_allow_anonymous, METH_VARARGS),