From 7933b0e55234fca86809dad1dee53f0d8e2b96ec Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 29 Aug 2013 11:10:15 +0200 Subject: [PATCH] trivial: Stop calling deprecated g_type_init() When building with a recent enough glib (>= 2.36), don't call g_type_init() any more. This is deprecated and causes ugly compile warnings. --- src/linux/hidpp-test.c | 2 ++ src/up-main.c | 2 ++ src/up-self-test.c | 2 ++ tools/up-tool.c | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/linux/hidpp-test.c b/src/linux/hidpp-test.c index 5ae85ce..d23582e 100644 --- a/src/linux/hidpp-test.c +++ b/src/linux/hidpp-test.c @@ -39,7 +39,9 @@ main (int argc, char **argv) gboolean ret; GError *error = NULL; +#if !defined(GLIB_VERSION_2_36) g_type_init (); +#endif g_test_init (&argc, &argv, NULL); d = hidpp_device_new (); diff --git a/src/up-main.c b/src/up-main.c index 6201a44..a7e6eb6 100644 --- a/src/up-main.c +++ b/src/up-main.c @@ -204,7 +204,9 @@ main (gint argc, gchar **argv) { NULL} }; +#if !defined(GLIB_VERSION_2_36) g_type_init (); +#endif context = g_option_context_new ("upower daemon"); g_option_context_add_main_entries (context, options, NULL); diff --git a/src/up-self-test.c b/src/up-self-test.c index edcae99..1a0595d 100644 --- a/src/up-self-test.c +++ b/src/up-self-test.c @@ -333,7 +333,9 @@ up_test_wakeups_func (void) int main (int argc, char **argv) { +#if !defined(GLIB_VERSION_2_36) g_type_init (); +#endif g_test_init (&argc, &argv, NULL); /* make check, vs. make distcheck */ diff --git a/tools/up-tool.c b/tools/up-tool.c index 87051e3..c82dae4 100644 --- a/tools/up-tool.c +++ b/tools/up-tool.c @@ -278,7 +278,9 @@ main (int argc, char **argv) { NULL } }; +#if !defined(GLIB_VERSION_2_36) g_type_init (); +#endif context = g_option_context_new ("UPower tool"); g_option_context_add_main_entries (context, entries, NULL);