Commit 98ae6e06 authored by Jiří Klimeš's avatar Jiří Klimeš

all: g_type_init() has been deprecated in GLib 2.35.0

g_type_init() deprecation:
https://bugzilla.gnome.org/show_bug.cgi?id=686161
parent aba55670
......@@ -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");
......
......@@ -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));
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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");
......
......@@ -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");
......
......@@ -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");
......
......@@ -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) {
......
......@@ -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 ();
......
......@@ -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);
......
......@@ -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);
......
......@@ -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 ();
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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",
......
......@@ -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);
......
......@@ -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);
......
......@@ -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
......
......@@ -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"))
......
......@@ -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);
......
......@@ -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 ();
......
......@@ -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++) {
......
......@@ -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__);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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))
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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
......
......@@ -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);
......
......@@ -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) {
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment