From 81a4698c45c94bbecd02062a9f32c8d79a9be0dd Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Mon, 4 Feb 2019 09:30:38 +0100 Subject: [PATCH] Fixing various warnings in glib/gmain.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit glib/gmain.c:480:1: error: missing initializer for field ‘closure_callback’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’} [-Werror=missing-field-initializers] }; ^ In file included from glib/giochannel.h:33, from glib/glib.h:54, from glib/glib-unix.h:33, from glib/gmain.c:50: glib/gmain.h:262:19: note: ‘closure_callback’ declared here GSourceFunc closure_callback; ^~~~~~~~~~~~~~~~ glib/gmain.c:491:1: error: missing initializer for field ‘closure_callback’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’} [-Werror=missing-field-initializers] }; ^ In file included from glib/giochannel.h:33, from glib/glib.h:54, from glib/glib-unix.h:33, from glib/gmain.c:50: glib/gmain.h:262:19: note: ‘closure_callback’ declared here GSourceFunc closure_callback; ^~~~~~~~~~~~~~~~ glib/gmain.c:499:1: error: missing initializer for field ‘closure_callback’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’} [-Werror=missing-field-initializers] }; ^ In file included from glib/giochannel.h:33, from glib/glib.h:54, from glib/glib-unix.h:33, from glib/gmain.c:50: glib/gmain.h:262:19: note: ‘closure_callback’ declared here GSourceFunc closure_callback; ^~~~~~~~~~~~~~~~ glib/gmain.c:507:1: error: missing initializer for field ‘closure_callback’ of ‘GSourceFuncs’ {aka ‘struct _GSourceFuncs’} [-Werror=missing-field-initializers] }; ^ In file included from glib/giochannel.h:33, from glib/glib.h:54, from glib/glib-unix.h:33, from glib/gmain.c:50: glib/gmain.h:262:19: note: ‘closure_callback’ declared here GSourceFunc closure_callback; ^~~~~~~~~~~~~~~~ glib/gmain.c: In function ‘g_source_set_callback_indirect’: glib/gmain.c:1615:68: error: suggest braces around empty body in an ‘if’ statement [-Werror=empty-body] callback_funcs->get)); ^ --- glib/gmain.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/glib/gmain.c b/glib/gmain.c index 860c39dd1..6b98f8c0c 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -476,7 +476,8 @@ GSourceFuncs g_unix_signal_funcs = g_unix_signal_watch_prepare, g_unix_signal_watch_check, g_unix_signal_watch_dispatch, - g_unix_signal_watch_finalize + g_unix_signal_watch_finalize, + NULL, NULL }; #endif /* !G_OS_WIN32 */ G_LOCK_DEFINE_STATIC (main_context_list); @@ -487,7 +488,7 @@ GSourceFuncs g_timeout_funcs = NULL, /* prepare */ NULL, /* check */ g_timeout_dispatch, - NULL + NULL, NULL, NULL }; GSourceFuncs g_child_watch_funcs = @@ -495,7 +496,8 @@ GSourceFuncs g_child_watch_funcs = g_child_watch_prepare, g_child_watch_check, g_child_watch_dispatch, - g_child_watch_finalize + g_child_watch_finalize, + NULL, NULL }; GSourceFuncs g_idle_funcs = @@ -503,7 +505,7 @@ GSourceFuncs g_idle_funcs = g_idle_prepare, g_idle_check, g_idle_dispatch, - NULL + NULL, NULL, NULL }; /** @@ -1609,10 +1611,12 @@ g_source_set_callback_indirect (GSource *source, LOCK_CONTEXT (context); if (callback_funcs != &g_source_callback_funcs) - TRACE (GLIB_SOURCE_SET_CALLBACK_INDIRECT (source, callback_data, - callback_funcs->ref, - callback_funcs->unref, - callback_funcs->get)); + { + TRACE (GLIB_SOURCE_SET_CALLBACK_INDIRECT (source, callback_data, + callback_funcs->ref, + callback_funcs->unref, + callback_funcs->get)); + } old_cb_data = source->callback_data; old_cb_funcs = source->callback_funcs;