[glib: 3/4] gmain: Remove some redundant casts
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 3/4] gmain: Remove some redundant casts
- Date: Fri, 18 Oct 2019 14:00:59 +0000 (UTC)
commit d9b30d47a622d368360a4097a8af63434f383791
Author: Philip Withnall <withnall endlessm com>
Date: Mon Oct 7 16:29:26 2019 +0100
gmain: Remove some redundant casts
These were introducing strict aliasing warnings. Remove them (in line
with other uses of `g_once_init_leave()`).
Signed-off-by: Philip Withnall <withnall endlessm com>
glib/gmain.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/glib/gmain.c b/glib/gmain.c
index 27a30f202..d6c88818d 100644
--- a/glib/gmain.c
+++ b/glib/gmain.c
@@ -675,7 +675,7 @@ g_main_context_new (void)
GMainContext *
g_main_context_default (void)
{
- static GMainContext *default_main_context;
+ static GMainContext *default_main_context = NULL;
if (g_once_init_enter (&default_main_context))
{
@@ -690,8 +690,7 @@ g_main_context_default (void)
g_print ("default context=%p\n", context);
#endif
- g_once_init_leave ((gsize *) &default_main_context, (gsize) context);
-
+ g_once_init_leave (&default_main_context, context);
}
return default_main_context;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]