all: g_type_init() has been deprecated in GLib 2.35.0
authorJiří Klimeš <jklimes@redhat.com>
Tue, 27 May 2014 14:47:15 +0000 (16:47 +0200)
committerJiří Klimeš <jklimes@redhat.com>
Tue, 27 May 2014 14:58:21 +0000 (16:58 +0200)
g_type_init() deprecation:
https://bugzilla.gnome.org/show_bug.cgi?id=686161

49 files changed:
callouts/nm-avahi-autoipd-action.c
callouts/nm-dispatcher-action.c
callouts/tests/test-dispatcher-envp.c
cli/src/nmcli.c
examples/C/glib/add-connection-dbus-glib.c
examples/C/glib/add-connection-libnm-glib.c
examples/C/glib/get-active-connections-dbus-glib.c
examples/C/glib/get-ap-info-libnm-glib.c
examples/C/glib/list-connections-dbus-glib.c
examples/C/glib/list-connections-libnm-glib.c
examples/C/glib/monitor-nm-running-GDBus.c
examples/C/glib/monitor-nm-running-dbus-glib.c
examples/C/glib/monitor-nm-state-GDBus.c
libnm-glib/libnm-glib-test.c
libnm-glib/libnm_glib.c
libnm-glib/tests/test-nm-client.c
libnm-glib/tests/test-remote-settings-client.c
libnm-util/nm-param-spec-specialized.c
libnm-util/nm-setting.c
libnm-util/tests/test-general.c
libnm-util/tests/test-secrets.c
libnm-util/tests/test-setting-8021x.c
libnm-util/tests/test-setting-dcb.c
libnm-util/tests/test-settings-defaults.c
src/config/tests/test-config.c
src/devices/wifi/tests/test-wifi-ap-utils.c
src/dhcp-manager/tests/test-dhcp-dhclient.c
src/dnsmasq-manager/tests/test-dnsmasq-utils.c
src/main.c
src/platform/tests/dump.c
src/platform/tests/monitor.c
src/platform/tests/platform.c
src/platform/tests/test-common.c
src/ppp-manager/nm-pppd-plugin.c
src/rdisc/tests/rdisc.c
src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
src/settings/plugins/ifnet/tests/test_all.c
src/settings/plugins/ifupdown/tests/test-ifupdown.c
src/settings/plugins/keyfile/tests/test-keyfile.c
src/settings/tests/test-wired-defname.c
src/supplicant-manager/tests/test-supplicant-config.c
src/tests/test-dcb.c
src/tests/test-dhcp-options.c
src/tests/test-general.c
src/tests/test-ip4-config.c
src/tests/test-resolvconf-capture.c
test/nm-dhcp-opt-test.c
test/nm-online.c
tools/generate-settings-spec.c

index 440efad..f84eed7 100644 (file)
@@ -90,7 +90,9 @@ main (int argc, char *argv[])
        dbus_bool_t result;
        char *event, *iface, *address;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        if (argc != 4) {
                fprintf (stderr, "Error: expected 3 arguments (event, interface, address).\n");
index 23ae110..337a5c6 100644 (file)
@@ -689,7 +689,10 @@ main (int argc, char **argv)
 
        g_option_context_free (opt_ctx);
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
+
        g_unix_signal_add (SIGTERM, signal_handler, GINT_TO_POINTER (SIGTERM));
        g_unix_signal_add (SIGINT, signal_handler, GINT_TO_POINTER (SIGINT));
 
index 3ac0c9b..8dd1843 100644 (file)
@@ -642,7 +642,10 @@ main (int argc, char **argv)
        g_assert (argc > 1);
 
        g_test_init (&argc, &argv, NULL);
+
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        g_test_add_data_func ("/dispatcher/old_up", argv[1], (GTestDataFunc) test_old_up);
        g_test_add_data_func ("/dispatcher/old_down", argv[1], (GTestDataFunc) test_old_down);
index 5579ff4..1e44748 100644 (file)
@@ -426,7 +426,9 @@ main (int argc, char *argv[])
        textdomain (GETTEXT_PACKAGE);
 #endif
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        nmc_init (&nm_cli);
        g_idle_add (start, &args_info);
index c7c1a3f..354dcb7 100644 (file)
@@ -102,8 +102,10 @@ int main (int argc, char *argv[])
        DBusGConnection *bus;
        DBusGProxy *proxy;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        /* Initialize GType system */
        g_type_init ();
+#endif
 
        /* Get system bus */
        bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL);
index 510e06e..28eadf8 100644 (file)
@@ -110,8 +110,10 @@ int main (int argc, char *argv[])
        NMRemoteSettings *settings;
        GMainLoop *loop;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        /* Initialize GType system */
        g_type_init ();
+#endif
 
        loop = g_main_loop_new (NULL, FALSE);
 
index d6bd15c..86adbde 100644 (file)
@@ -223,8 +223,10 @@ int main (int argc, char *argv[])
        DBusGConnection *bus;
        DBusGProxy *props_proxy;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        /* Initialize GType system */
        g_type_init ();
+#endif
 
        /* Get system bus */
        bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL);
index c144be2..f38ca91 100644 (file)
@@ -200,8 +200,10 @@ int main (int argc, char *argv[])
        const GPtrArray *devices;
        int i;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        /* Initialize GType system */
        g_type_init ();
+#endif
 
        /* Get system bus */
        bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL);
index 3fd3fe7..e17b8dc 100644 (file)
@@ -67,8 +67,10 @@ int main (int argc, char *argv[])
        DBusGConnection *bus;
        DBusGProxy *proxy;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        /* Initialize GType system */
        g_type_init ();
+#endif
 
        /* Get system bus */
        bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL);
index 921dd68..29f105c 100644 (file)
@@ -153,8 +153,10 @@ int main (int argc, char *argv[])
 {
        DBusGConnection *bus;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        /* Initialize GType system */
        g_type_init ();
+#endif
 
        /* Get system bus */
        bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL);
index 5cc7232..9e38d4c 100644 (file)
@@ -57,8 +57,10 @@ main (int argc, char *argv[])
        GMainLoop *loop;
        GBusNameWatcherFlags flags;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        /* Initialize GType system */
        g_type_init ();
+#endif
 
        g_print ("Monitor 'org.freedesktop.NetworkManager' D-Bus name\n");
        g_print ("===================================================\n");
index 3290fb1..0b01a57 100644 (file)
@@ -71,8 +71,10 @@ main (int argc, char *argv[])
        GError *err = NULL;
        gboolean nm_running;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        /* Initialize GType system */
        g_type_init ();
+#endif
 
        g_print ("Monitor 'org.freedesktop.NetworkManager' D-Bus name\n");
        g_print ("===================================================\n");
index a3c5d8e..f401972 100644 (file)
@@ -91,8 +91,10 @@ main (int argc, char *argv[])
        GDBusProxyFlags flags;
        GDBusProxy *proxy;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        /* Initialize GType system */
        g_type_init ();
+#endif
 
        /* Monitor 'StateChanged' signal on 'org.freedesktop.NetworkManager' interface */
        g_print ("Monitor NetworkManager's state\n");
index 48a8ff1..36520f5 100644 (file)
@@ -390,7 +390,9 @@ main (int argc, char *argv[])
 {
        NMClient *client;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        client = nm_client_new ();
        if (!client) {
index 2abd6ab..a2a6d26 100644 (file)
@@ -493,7 +493,10 @@ libnm_glib_init (void)
 {
        libnm_glib_ctx  *ctx = NULL;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
+
        if (!g_thread_supported ())
                g_thread_init (NULL);
        dbus_g_thread_init ();
index 5bbb1cd..b181c8f 100644 (file)
@@ -931,7 +931,9 @@ main (int argc, char **argv)
 {
        g_assert (argc == 3);
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        g_test_init (&argc, &argv, NULL);
 
index 1299ce8..e3ef7f2 100644 (file)
@@ -352,7 +352,9 @@ main (int argc, char **argv)
 
        g_assert (argc == 3);
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
        
        g_test_init (&argc, &argv, NULL);
 
index beb19ae..27e498b 100644 (file)
@@ -954,7 +954,10 @@ main (int argc, char *argv[])
 {
        DBusGConnection *bus;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
+
        bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);
 
        compare_ints ();
index 9407c63..0adb805 100644 (file)
@@ -103,7 +103,9 @@ static void __attribute__((constructor))
 _ensure_registered (void)
 {
        if (G_UNLIKELY (registered_settings == NULL)) {
+#if !GLIB_CHECK_VERSION (2, 35, 0)
                g_type_init ();
+#endif
                _nm_value_transforms_register ();
                registered_settings = g_hash_table_new (g_str_hash, g_str_equal);
                registered_settings_by_type = g_hash_table_new (_nm_gtype_hash, _nm_gtype_equal);
index b6fc2c8..c65bd6c 100644 (file)
@@ -2489,7 +2489,9 @@ int main (int argc, char **argv)
        GError *error = NULL;
        char *base;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        if (!nm_utils_init (&error))
                FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message);
index 5a18beb..19c4194 100644 (file)
@@ -723,7 +723,9 @@ int main (int argc, char **argv)
        GError *error = NULL;
        char *base;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        if (!nm_utils_init (&error))
                FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message);
index bdfc8e0..a536a20 100644 (file)
@@ -411,7 +411,9 @@ int main (int argc, char **argv)
        if (argc < 3)
                FAIL ("init", "need at least two arguments: <path> <password>");
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        if (!nm_utils_init (&error))
                FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message);
index b0dad43..de07f2c 100644 (file)
@@ -304,7 +304,10 @@ int main (int argc, char **argv)
        gboolean success;
 
        g_test_init (&argc, &argv, NULL);
+
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        success = nm_utils_init (&error);
        g_assert_no_error (error);
index 98c7332..93468bc 100644 (file)
@@ -104,7 +104,9 @@ int main (int argc, char **argv)
        GError *error = NULL;
        char *base;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        if (!nm_utils_init (&error))
                FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message);
index caf93ff..fb6baac 100644 (file)
@@ -281,7 +281,10 @@ test_config_confdir_parse_error (void)
 int
 main (int argc, char **argv)
 {
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
+
        g_test_init (&argc, &argv, NULL);
 
        g_test_add_func ("/config/simple", test_config_simple);
index b828aa5..36d58f2 100644 (file)
@@ -1335,7 +1335,10 @@ main (int argc, char **argv)
 {
        gsize i;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
+
        g_test_init (&argc, &argv, NULL);
 
        g_test_add_func ("/wifi/lock_bssid",
index c1711f0..1ab182a 100644 (file)
@@ -577,7 +577,9 @@ main (int argc, char **argv)
 {
        g_test_init (&argc, &argv, NULL);
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        g_test_add_func ("/dhcp/dhclient/orig_missing", test_orig_missing);
        g_test_add_func ("/dhcp/dhclient/override_client_id", test_override_client_id);
index 5854309..07dbc0f 100644 (file)
@@ -104,7 +104,9 @@ main (int argc, char **argv)
 {
        g_test_init (&argc, &argv, NULL);
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        g_test_add_func ("/dnsmasq-manager/address-ranges", test_address_ranges);
 
index f54b989..4bd2b43 100644 (file)
@@ -562,7 +562,10 @@ main (int argc, char *argv[])
 
        nm_logging_syslog_openlog (debug);
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
+
        dbus_threads_init_default ();
 
        /* Ensure that non-exported properties don't leak out, and that the
index 6399585..9276d18 100644 (file)
@@ -123,7 +123,9 @@ dump_all (void)
 int
 main (int argc, char **argv)
 {
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        g_assert (argc <= 2);
        if (argc > 1 && !g_strcmp0 (argv[1], "--fake"))
index 21a4812..d56cc2b 100644 (file)
@@ -10,7 +10,10 @@ main (int argc, char **argv)
 {
        GMainLoop *loop;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
+
        loop = g_main_loop_new (NULL, FALSE);
        nm_logging_setup ("debug", NULL, NULL, NULL);
        openlog (G_LOG_DOMAIN, LOG_CONS | LOG_PERROR, LOG_DAEMON);
index baa7cd5..cd42c56 100644 (file)
@@ -850,7 +850,9 @@ main (int argc, char **argv)
        gboolean status = TRUE;
        int error;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        if (*argv && !g_strcmp0 (argv[1], "--fake")) {
                nm_fake_platform_setup ();
index fc5bfaf..911bec9 100644 (file)
@@ -136,7 +136,11 @@ main (int argc, char **argv)
        int result;
 
        openlog (G_LOG_DOMAIN, LOG_CONS | LOG_PERROR, LOG_DAEMON);
+
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
+
        g_test_init (&argc, &argv, NULL);
        /* Enable debug messages if called with --debug */
        for (; *argv; argv++) {
index 3f68894..e6ee86f 100644 (file)
@@ -325,7 +325,9 @@ plugin_init (void)
        DBusGConnection *bus;
        GError *err = NULL;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        g_message ("nm-ppp-plugin: (%s): initializing", __func__);
 
index 13a5f82..1fdf5b6 100644 (file)
@@ -39,7 +39,10 @@ main (int argc, char **argv)
        const char *ifname;
        char mac[6] = { 0x02, 0xaa, 0xbb, 0xcc, 0xdd, 0xee };
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
+
        loop = g_main_loop_new (NULL, FALSE);
        nm_logging_setup ("debug", "ip6", NULL, NULL);
        openlog (G_LOG_DOMAIN, LOG_CONS | LOG_PERROR, LOG_DAEMON);
index cd5abd0..bd85c03 100644 (file)
@@ -14378,7 +14378,9 @@ int main (int argc, char **argv)
        g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL);
 #endif
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        success = nm_utils_init (&error);
        g_assert_no_error (error);
index 8847efc..e2b1576 100644 (file)
@@ -455,7 +455,10 @@ main (int argc, char **argv)
 {
        char *f;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
+
        nm_linux_platform_setup ();
        nm_logging_setup ("WARN", "DEFAULT", NULL, NULL);
 
index 905962a..652e4af 100644 (file)
@@ -932,7 +932,9 @@ main (int argc, char **argv)
 {
        GError *error = NULL;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        if (!nm_utils_init (&error))
                FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message);
index 8f9df94..f7d4122 100644 (file)
@@ -3342,7 +3342,10 @@ int main (int argc, char **argv)
        GError *error = NULL;
        char *base;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
+
        g_log_set_always_fatal (G_LOG_LEVEL_MASK);
 
        if (!nm_utils_init (&error))
index 97d61a1..2d88dd7 100644 (file)
@@ -123,7 +123,10 @@ test_defname_multiple_conflicts (void)
 int
 main (int argc, char **argv)
 {
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
+
        g_test_init (&argc, &argv, NULL);
 
        g_test_add_func ("/defname/no_connections", test_defname_no_connections);
index 181a11f..d1d0562 100644 (file)
@@ -500,7 +500,9 @@ int main (int argc, char **argv)
        GError *error = NULL;
        char *base;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        if (!nm_utils_init (&error))
                FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message);
index aead8f1..c28f05b 100644 (file)
@@ -338,7 +338,9 @@ main (int argc, char **argv)
 {
        g_test_init (&argc, &argv, NULL);
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        g_test_add_func ("/dcb/fcoe", test_dcb_fcoe);
        g_test_add_func ("/dcb/iscsi", test_dcb_iscsi);
index 6b32451..c9748cf 100644 (file)
@@ -848,7 +848,9 @@ int main (int argc, char **argv)
        g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL);
 #endif
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        if (!nm_utils_init (&error))
                FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message);
index 207191f..d103c2b 100644 (file)
@@ -558,7 +558,9 @@ main (int argc, char **argv)
 {
        g_test_init (&argc, &argv, NULL);
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        g_test_add_func ("/general/nm_utils_ascii_str_to_int64", test_nm_utils_ascii_str_to_int64);
        g_test_add_func ("/general/nm_utils_ip6_address_clear_host_address", test_nm_utils_ip6_address_clear_host_address);
index f08ed24..3eee5f1 100644 (file)
@@ -340,7 +340,9 @@ main (int argc, char **argv)
 {
        g_test_init (&argc, &argv, NULL);
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        g_test_add_func ("/ip4-config/subtract", test_subtract);
        g_test_add_func ("/ip4-config/compare-with-source", test_compare_with_source);
index a04cbae..cde4bbe 100644 (file)
@@ -208,7 +208,7 @@ main (int argc, char **argv)
 {
        g_test_init (&argc, &argv, NULL);
 
-#if !GLIB_CHECK_VERSION (2,36,0)
+#if !GLIB_CHECK_VERSION (2,35,0)
        g_type_init ();
 #endif
 
index bc87175..9fe2e69 100644 (file)
@@ -260,7 +260,9 @@ int main (int argc, char **argv)
        DBusConnection *connection;
        DBusError                error;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        dbus_error_init (&error);
        connection = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
index 581a99e..8119287 100644 (file)
@@ -159,7 +159,9 @@ main (int argc, char *argv[])
                return 2;
        }
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        client = nm_client_new ();
        if (!client) {
index 3ba370f..f53fdba 100644 (file)
@@ -408,7 +408,9 @@ main (int argc, char *argv[])
                        usage (argv[0]);
        }
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
+#endif
 
        if (!nm_utils_init (&error)) {
                fprintf (stderr, "ERR: failed to initialize libnm-util: %s", error->message);