Fixing various warnings in glib/gmain.c

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));
                                                                    ^
This commit is contained in:
Emmanuel Fleury 2019-02-04 09:30:38 +01:00
parent 9eb4fcdede
commit 81a4698c45

View File

@ -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;