Commit 8a46b25c authored by Lubomir Rintel's avatar Lubomir Rintel 🥕

all: require glib 2.40

RHEL 7.1 and Ubuntu 14.04 LTS both have this.

https://bugzilla.gnome.org/show_bug.cgi?id=792323
parent 1443bf77
......@@ -626,8 +626,6 @@ main (int argc, char *argv[])
textdomain (GETTEXT_PACKAGE);
#endif
nm_g_type_init ();
/* Save terminal settings */
tcgetattr (STDIN_FILENO, &termios_orig);
......
......@@ -86,7 +86,7 @@ test_client_meta_check (void)
g_assert (pi->setting_info == info);
g_assert (pi->property_name);
g_assert (nm_g_hash_table_add (property_names, (gpointer) pi->property_name));
g_assert (g_hash_table_add (property_names, (gpointer) pi->property_name));
g_assert_cmpstr (pi->property_name, ==, pi->meta_type->get_name ((const NMMetaAbstractInfo *) pi, FALSE));
g_assert_cmpstr (pi->property_name, ==, pi->meta_type->get_name ((const NMMetaAbstractInfo *) pi, TRUE));
......@@ -107,7 +107,7 @@ test_client_meta_check (void)
for (i = 0; info->valid_parts[i]; i++) {
g_assert (info->valid_parts[i]->setting_info);
g_assert (nm_g_hash_table_add (dup, (gpointer) info->valid_parts[i]->setting_info));
g_assert (g_hash_table_add (dup, (gpointer) info->valid_parts[i]->setting_info));
if (i == 0) {
g_assert (info->valid_parts[i]->setting_info == &nm_meta_setting_infos_editor[NM_META_SETTING_TYPE_CONNECTION]);
......
......@@ -244,8 +244,6 @@ main (int argc, char *argv[])
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
nm_g_type_init ();
data.start_timestamp_ms = _now_ms ();
opt_ctx = g_option_context_new (NULL);
......
......@@ -359,21 +359,11 @@ nmt_newt_edit_string (const char *data)
goto done;
}
#if GLIB_CHECK_VERSION (2, 34, 0)
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (!g_spawn_check_exit_status (status, &error)) {
nmt_newt_message_dialog (_("Editor failed: %s"), error->message);
g_error_free (error);
goto done;
}
G_GNUC_END_IGNORE_DEPRECATIONS
#else
if (WIFEXITED (status)) {
if (WEXITSTATUS (status) != 0)
nmt_newt_message_dialog (_("Editor failed with status %d"), WEXITSTATUS (status));
} else if (WIFSIGNALED (status))
nmt_newt_message_dialog (_("Editor failed with signal %d"), WTERMSIG (status));
#endif
if (!g_file_get_contents (filename, &new_data, NULL, &error)) {
nmt_newt_message_dialog (_("Could not re-read file: %s"), error->message);
......
......@@ -234,14 +234,14 @@ AC_SUBST([DL_LIBS], "$ac_cv_search_dlopen")
PKG_CHECK_MODULES(GLIB, [gio-unix-2.0 >= 2.37.6 gmodule-2.0],
[AC_SUBST(LOG_DRIVER, '$(top_srcdir)/build-aux/tap-driver.sh')
AC_SUBST(AM_TESTS_FD_REDIRECT, '--tap')],
[PKG_CHECK_MODULES(GLIB, gio-unix-2.0 >= 2.32 gmodule-2.0)
[PKG_CHECK_MODULES(GLIB, gio-unix-2.0 >= 2.40 gmodule-2.0)
AC_SUBST(LOG_DRIVER, '$(top_srcdir)/build-aux/test-driver')])
dnl GLIB_VERSION_MIN_REQUIRED should match the version above.
dnl GLIB_VERSION_MAX_ALLOWED should be set to the same version;
dnl nm-glib.h will cause it to be overridden for the functions
dnl we have compat versions of.
GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32"
GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40"
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
......
......@@ -916,8 +916,6 @@ main (int argc, char **argv)
g_option_context_free (opt_ctx);
nm_g_type_init ();
g_unix_signal_add (SIGTERM, signal_handler, GINT_TO_POINTER (SIGTERM));
g_unix_signal_add (SIGINT, signal_handler, GINT_TO_POINTER (SIGINT));
......
......@@ -15,9 +15,6 @@ DOC_SOURCE_DIR=$(top_srcdir)/libnm-glib
# Extra options to supply to gtkdoc-scan.
SCAN_OPTIONS=
# Extra options to supply to gtkdoc-scangobj.
SCANGOBJ_OPTIONS=--type-init-func 'g_type_init();'
# Extra options to supply to gtkdoc-mkdb.
MKDB_OPTIONS=--sgml-mode --output-format=xml
......
......@@ -17,9 +17,6 @@ DOC_SOURCE_DIR= \
# Extra options to supply to gtkdoc-scan.
SCAN_OPTIONS=--rebuild-types --rebuild-sections
# Extra options to supply to gtkdoc-scangobj.
SCANGOBJ_OPTIONS=--type-init-func 'g_type_init();'
# Extra options to supply to gtkdoc-mkdb.
MKDB_OPTIONS=--sgml-mode --output-format=xml
......
......@@ -19,9 +19,6 @@ DOC_SOURCE_DIR= \
# Extra options to supply to gtkdoc-scan.
SCAN_OPTIONS=--rebuild-types --rebuild-sections
# Extra options to supply to gtkdoc-scangobj.
SCANGOBJ_OPTIONS=--type-init-func 'g_type_init();'
# Extra options to supply to gtkdoc-mkdb.
MKDB_OPTIONS=--sgml-mode --output-format=xml
......
......@@ -124,11 +124,6 @@ main (int argc, char *argv[])
GDBusProxy *proxy;
GError *error = NULL;
#if !GLIB_CHECK_VERSION (2, 35, 0)
/* Initialize GType system */
g_type_init ();
#endif
/* Create a D-Bus proxy; NM_DBUS_* defined in nm-dbus-interface.h */
proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,
......
......@@ -105,11 +105,6 @@ main (int argc, char *argv[])
GMainLoop *loop;
GError *error = NULL;
#if !GLIB_CHECK_VERSION (2, 35, 0)
/* Initialize GType system */
g_type_init ();
#endif
loop = g_main_loop_new (NULL, FALSE);
/* Connect to NetworkManager */
......
......@@ -251,11 +251,6 @@ main (int argc, char *argv[])
{
GDBusProxy *props_proxy;
#if !GLIB_CHECK_VERSION (2, 35, 0)
/* Initialize GType system */
g_type_init ();
#endif
/* Create a D-Bus proxy to get the object properties from the NM Manager
* object. NM_DBUS_* defines are from nm-dbus-interface.h.
*/
......
......@@ -202,11 +202,6 @@ main (int argc, char *argv[])
int i;
GError *error = NULL;
#if !GLIB_CHECK_VERSION (2, 35, 0)
/* Initialize GType system */
g_type_init ();
#endif
/* Get NMClient object */
client = nm_client_new (NULL, &error);
if (!client) {
......
......@@ -65,11 +65,6 @@ main (int argc, char *argv[])
{
GDBusProxy *proxy;
#if !GLIB_CHECK_VERSION (2, 35, 0)
/* Initialize GType system */
g_type_init ();
#endif
/* Create a D-Bus proxy; NM_DBUS_* defined in nm-dbus-interface.h */
proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,
......
......@@ -69,11 +69,6 @@ main (int argc, char *argv[])
const GPtrArray *connections;
int i;
#if !GLIB_CHECK_VERSION (2, 35, 0)
/* Initialize GType system */
g_type_init ();
#endif
if (!(client = nm_client_new (NULL, &error))) {
g_message ("Error: Could not connect to NetworkManager: %s.", error->message);
g_error_free (error);
......
......@@ -56,11 +56,6 @@ 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");
......
......@@ -90,11 +90,6 @@ 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");
g_print ("==============================\n");
......
......@@ -89,7 +89,7 @@ gboolean _nm_setting_clear_secrets_with_flags (NMSetting *setting,
/* Ensure the setting's GType is registered at library load time */
#define NM_SETTING_REGISTER_TYPE(x) \
static void __attribute__((constructor)) register_setting (void) \
{ nm_g_type_init (); g_type_ensure (x); }
{ g_type_ensure (x); }
GVariant *_nm_setting_get_deprecated_virtual_interface_name (NMSetting *setting,
NMConnection *connection,
......
......@@ -94,7 +94,6 @@ static void
_ensure_registered (void)
{
if (G_UNLIKELY (registered_settings == NULL)) {
nm_g_type_init ();
registered_settings = g_hash_table_new (nm_str_hash, g_str_equal);
registered_settings_by_type = g_hash_table_new (_nm_gtype_hash, _nm_gtype_equal);
}
......@@ -816,7 +815,7 @@ _nm_setting_new_from_dbus (GType setting_type,
g_variant_unref (entry_key);
g_variant_unref (entry);
if (!nm_g_hash_table_add (keys, key)) {
if (!g_hash_table_add (keys, key)) {
g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING,
_("duplicate property"));
g_prefix_error (error, "%s.%s: ", nm_setting_get_name (setting), key);
......
......@@ -253,8 +253,6 @@ _nm_utils_init (void)
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
nm_g_type_init ();
_nm_dbus_errors_init ();
}
......
......@@ -6093,66 +6093,6 @@ again:
/*****************************************************************************/
static void
test_g_ptr_array_insert (void)
{
/* this test only makes sense on a recent glib, where we compare our compat
* with the original implementation. */
#if GLIB_CHECK_VERSION(2, 40, 0)
gs_unref_ptrarray GPtrArray *arr1 = g_ptr_array_new ();
gs_unref_ptrarray GPtrArray *arr2 = g_ptr_array_new ();
GRand *rand = nmtst_get_rand ();
guint i;
for (i = 0; i < 560; i++) {
gint32 idx = g_rand_int_range (rand, -1, arr1->len + 1);
g_ptr_array_insert (arr1, idx, GINT_TO_POINTER (i));
_nm_g_ptr_array_insert (arr2, idx, GINT_TO_POINTER (i));
g_assert_cmpint (arr1->len, ==, arr2->len);
g_assert (memcmp (arr1->pdata, arr2->pdata, arr1->len * sizeof (gpointer)) == 0);
}
#endif
}
/*****************************************************************************/
static void
test_g_hash_table_get_keys_as_array (void)
{
GHashTable *table = g_hash_table_new (nm_str_hash, g_str_equal);
guint length = 0;
char **keys;
g_hash_table_insert (table, "one", "1");
g_hash_table_insert (table, "two", "2");
g_hash_table_insert (table, "three", "3");
keys = (char **) _nm_g_hash_table_get_keys_as_array (table, &length);
g_assert (keys);
g_assert_cmpuint (length, ==, 3);
g_assert ( !strcmp (keys[0], "one")
|| !strcmp (keys[1], "one")
|| !strcmp (keys[2], "one"));
g_assert ( !strcmp (keys[0], "two")
|| !strcmp (keys[1], "two")
|| !strcmp (keys[2], "two"));
g_assert ( !strcmp (keys[0], "three")
|| !strcmp (keys[1], "three")
|| !strcmp (keys[2], "three"));
g_assert (!keys[3]);
g_free (keys);
g_hash_table_unref (table);
}
/*****************************************************************************/
static int
_test_find_binary_search_cmp (gconstpointer a, gconstpointer b, gpointer dummy)
{
......@@ -7074,8 +7014,6 @@ int main (int argc, char **argv)
g_test_add_func ("/core/general/_nm_utils_ascii_str_to_int64", test_nm_utils_ascii_str_to_int64);
g_test_add_func ("/core/general/nm_utils_is_power_of_two", test_nm_utils_is_power_of_two);
g_test_add_func ("/core/general/_glib_compat_g_ptr_array_insert", test_g_ptr_array_insert);
g_test_add_func ("/core/general/_glib_compat_g_hash_table_get_keys_as_array", test_g_hash_table_get_keys_as_array);
g_test_add_func ("/core/general/_nm_utils_ptrarray_find_binary_search", test_nm_utils_ptrarray_find_binary_search);
g_test_add_func ("/core/general/_nm_utils_ptrarray_find_binary_search_with_duplicates", test_nm_utils_ptrarray_find_binary_search_with_duplicates);
g_test_add_func ("/core/general/_nm_utils_strstrdictkey", test_nm_utils_strstrdictkey);
......
......@@ -400,8 +400,6 @@ main (int argc, char *argv[])
{
NMClient *client;
nm_g_type_init ();
client = nm_client_new ();
if (!client) {
exit (1);
......
......@@ -495,8 +495,6 @@ libnm_glib_init (void)
{
libnm_glib_ctx *ctx = NULL;
nm_g_type_init ();
if (!g_thread_supported ())
g_thread_init (NULL);
dbus_g_thread_init ();
......
......@@ -956,8 +956,6 @@ main (int argc, char *argv[])
{
DBusGConnection *bus;
nm_g_type_init ();
bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);
compare_ints ();
......
......@@ -105,7 +105,7 @@ gboolean _nm_setting_clear_secrets_with_flags (NMSetting *setting,
/* Ensure the setting's GType is registered at library load time */
#define NM_SETTING_REGISTER_TYPE(x) \
static void __attribute__((constructor)) register_setting (void) \
{ nm_g_type_init (); g_type_ensure (x); }
{ g_type_ensure (x); }
NMSetting *nm_setting_find_in_list (GSList *settings_list, const char *setting_name);
......
......@@ -102,7 +102,6 @@ static void
_ensure_registered (void)
{
if (G_UNLIKELY (registered_settings == NULL)) {
nm_g_type_init ();
_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);
......
......@@ -386,10 +386,10 @@ _add (NMDedupMultiIndex *self,
head_entry->len++;
if ( add_head_entry
&& !nm_g_hash_table_add (self->idx_entries, head_entry))
&& !g_hash_table_add (self->idx_entries, head_entry))
nm_assert_not_reached ();
if (!nm_g_hash_table_add (self->idx_entries, entry))
if (!g_hash_table_add (self->idx_entries, entry))
nm_assert_not_reached ();
NM_SET_OUT (out_entry, entry);
......@@ -870,7 +870,7 @@ nm_dedup_multi_index_obj_intern (NMDedupMultiIndex *self,
nm_assert (obj_new);
nm_assert (!obj_new->_multi_idx);
if (!nm_g_hash_table_add (self->idx_objs, (gpointer) obj_new))
if (!g_hash_table_add (self->idx_objs, (gpointer) obj_new))
nm_assert_not_reached ();
((NMDedupMultiObj *) obj_new)->_multi_idx = self;
......
This diff is collapsed.
......@@ -332,8 +332,6 @@ __nmtst_init (int *argc, char ***argv, gboolean assert_logging, const char *log_
__nmtst_internal.assert_logging = !!assert_logging;
nm_g_type_init ();
is_debug = g_test_verbose ();
nmtst_debug = g_getenv ("NMTST_DEBUG");
......@@ -540,13 +538,10 @@ __nmtst_init (int *argc, char ***argv, gboolean assert_logging, const char *log_
*out_set_logging = TRUE;
#endif
g_assert (success);
#if GLIB_CHECK_VERSION(2,34,0)
if (__nmtst_internal.no_expect_message)
g_log_set_always_fatal (G_LOG_FATAL_MASK);
#else
/* g_test_expect_message() is a NOP, so allow any messages */
g_log_set_always_fatal (G_LOG_FATAL_MASK);
#endif
} else if (__nmtst_internal.no_expect_message) {
/* We have a test that would be assert_logging, but the user specified no_expect_message.
* This transforms g_test_expect_message() into a NOP, but we also have to relax
......@@ -566,14 +561,9 @@ __nmtst_init (int *argc, char ***argv, gboolean assert_logging, const char *log_
}
#endif
} else {
#if GLIB_CHECK_VERSION(2,34,0)
/* We were called not to set logging levels. This means, that the user
* expects to assert against (all) messages. Any uncought message is fatal. */
g_log_set_always_fatal (G_LOG_LEVEL_MASK);
#else
/* g_test_expect_message() is a NOP, so allow any messages */
g_log_set_always_fatal (G_LOG_FATAL_MASK);
#endif
}
if ((!__nmtst_internal.assert_logging || (__nmtst_internal.assert_logging && __nmtst_internal.no_expect_message)) &&
......@@ -640,7 +630,6 @@ nmtst_test_quick (void)
return __nmtst_internal.test_quick;
}
#if GLIB_CHECK_VERSION(2,34,0)
#undef g_test_expect_message
#define g_test_expect_message(...) \
G_STMT_START { \
......@@ -664,11 +653,8 @@ nmtst_test_quick (void)
if (__nmtst_internal.assert_logging && __nmtst_internal.no_expect_message) \
g_debug ("nmtst: assert-logging: g_test_assert_expected_messages(%s, %s:%d, %s)", _domain?:"", _file?:"", _line, _func?:""); \
\
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
g_test_assert_expected_messages_internal (_domain, _file, _line, _func); \
G_GNUC_END_IGNORE_DEPRECATIONS \
} G_STMT_END
#endif
#define NMTST_EXPECT(domain, level, msg) g_test_expect_message (domain, level, msg)
......@@ -1739,7 +1725,7 @@ _nmtst_assert_connection_has_settings (NMConnection *connection, gboolean has_at
va_start (ap, has_at_most);
while ((name = va_arg (ap, const char *))) {
if (!nm_g_hash_table_add (names, (gpointer) name))
if (!g_hash_table_add (names, (gpointer) name))
g_assert_not_reached ();
g_ptr_array_add (names_arr, (gpointer) name);
}
......
......@@ -9331,7 +9331,7 @@ _nm_device_hash_check_invalid_keys (GHashTable *hash, const char *setting_name,
gs_unref_hashtable GHashTable *check_dups = g_hash_table_new_full (nm_str_hash, g_str_equal, NULL, NULL);
for (i = 0; argv[i]; i++) {
if (!nm_g_hash_table_add (check_dups, (char *) argv[i]))
if (!g_hash_table_add (check_dups, (char *) argv[i]))
nm_assert (FALSE);
}
nm_assert (g_hash_table_size (check_dups) > 0);
......@@ -12344,7 +12344,7 @@ available_connections_del_all (NMDevice *self)
static gboolean
available_connections_add (NMDevice *self, NMConnection *connection)
{
return nm_g_hash_table_add (self->_priv->available_connections, g_object_ref (connection));
return g_hash_table_add (self->_priv->available_connections, g_object_ref (connection));
}
static gboolean
......
......@@ -134,8 +134,6 @@ main (int argc, char *argv[])
guint try_count = 0;
gint64 time_end;
nm_g_type_init ();
/* FIXME: g_dbus_connection_new_for_address_sync() tries to connect to the socket in
* non-blocking mode, which can easily fail with EAGAIN, causing the creation of the
* socket to fail with "Could not connect: Resource temporarily unavailable".
......
......@@ -232,8 +232,6 @@ main (int argc, char *argv[])
NMConfigCmdLineOptions *config_cli;
guint sd_id = 0;
nm_g_type_init ();
/* Known to cause a possible deadlock upon GDBus initialization:
* https://bugzilla.gnome.org/show_bug.cgi?id=674885 */
g_type_ensure (G_TYPE_SOCKET);
......
......@@ -835,10 +835,8 @@ nm_bus_manager_register_object (NMBusManager *self,
priv = NM_BUS_MANAGER_GET_PRIVATE (self);
#if NM_MORE_ASSERTS >= 1
#if GLIB_CHECK_VERSION(2,34,0)
if (g_dbus_object_manager_server_is_exported (priv->obj_manager, object))
g_return_if_reached ();
#endif
#endif
g_dbus_object_manager_server_export (priv->obj_manager, object);
......@@ -866,10 +864,8 @@ nm_bus_manager_unregister_object (NMBusManager *self,
priv = NM_BUS_MANAGER_GET_PRIVATE (self);
#if NM_MORE_ASSERTS >= 1
#if GLIB_CHECK_VERSION(2,34,0)
if (!g_dbus_object_manager_server_is_exported (priv->obj_manager, object))
g_return_if_reached ();
#endif
#endif
g_object_get (G_OBJECT (object), "g-object-path", &path, NULL);
......
......@@ -237,9 +237,7 @@ nm_checkpoint_manager_create (NMCheckpointManager *self,
item->checkpoint = checkpoint;
c_list_link_tail (&self->list, &item->list);
if (!nm_g_hash_table_insert (self->checkpoints,
(gpointer) checkpoint_path,
item))
if (!g_hash_table_insert (self->checkpoints, (gpointer) checkpoint_path, item))
g_return_val_if_reached (NULL);
notify_checkpoints (self);
......
......@@ -2113,7 +2113,7 @@ nm_config_device_state_load_all (void)
if (!state)
continue;
if (!nm_g_hash_table_insert (states, GINT_TO_POINTER (ifindex), state))
if (!g_hash_table_insert (states, GINT_TO_POINTER (ifindex), state))
nm_assert_not_reached ();
}
g_dir_close (dir);
......
......@@ -347,8 +347,6 @@ main (int argc, char *argv[])
guint sd_id;
char sysctl_path_buf[NM_UTILS_SYSCTL_IP_CONF_PATH_BUFSIZE];
nm_g_type_init ();
setpgid (getpid (), getpid ());
if (!do_early_setup (&argc, &argv))
......
......@@ -435,10 +435,10 @@ _device_route_metric_get (NMManager *self,
* hence we skip it. */
continue;
}
if (!nm_g_hash_table_add (priv->device_route_metrics,
_device_route_metric_data_new (device_state->ifindex,
device_state->route_metric_default_aspired,
device_state->route_metric_default_effective)))
if (!g_hash_table_add (priv->device_route_metrics,
_device_route_metric_data_new (device_state->ifindex,
device_state->route_metric_default_aspired,
device_state->route_metric_default_effective)))
nm_assert_not_reached ();
}
}
......@@ -531,7 +531,7 @@ again:
_LOGT (LOGD_DEVICE, "default-route-metric: ifindex %d reserves metric %u (aspired %u)",
data->ifindex, data->effective_metric, data->aspired_metric);
if (!nm_g_hash_table_add (priv->device_route_metrics, data))
if (!g_hash_table_add (priv->device_route_metrics, data))
nm_assert_not_reached ();
out:
......
......@@ -1268,7 +1268,7 @@ auto_activate_device (NMPolicy *self,
* activation fails in early stages without changing device
* state.
*/
if (nm_g_hash_table_add (priv->pending_active_connections, ac)) {
if (g_hash_table_add (priv->pending_active_connections, ac)) {
g_signal_connect (ac, NM_ACTIVE_CONNECTION_STATE_CHANGED,
G_CALLBACK (pending_ac_state_changed), g_object_ref (self));
g_object_weak_ref (G_OBJECT (ac), (GWeakNotify) pending_ac_gone, self);
......@@ -2000,7 +2000,7 @@ device_added (NMManager *manager, NMDevice *device, gpointer user_data)
priv = NM_POLICY_GET_PRIVATE (self);
if (!nm_g_hash_table_add (priv->devices, device))
if (!g_hash_table_add (priv->devices, device))
g_return_if_reached ();
devices_list_register (self, device);
......
......@@ -601,7 +601,7 @@ nm_platform_link_get_all (NMPlatform *self, gboolean sort_by_name)
for (i = 0; i < links->len; i++) {
item = NMP_OBJECT_CAST_LINK (links->pdata[i]);
nm_assert (item->ifindex > 0);
if (!nm_g_hash_table_insert (unseen, GINT_TO_POINTER (item->ifindex), NULL))
if (!g_hash_table_insert (unseen, GINT_TO_POINTER (item->ifindex), NULL))
nm_assert_not_reached ();
}
......@@ -3338,7 +3338,7 @@ nm_platform_ip4_address_sync (NMPlatform *self,
known_addresses_idx = g_hash_table_new ((GHashFunc) nmp_object_id_hash,
(GEqualFunc) nmp_object_id_equal);
}
if (!nm_g_hash_table_insert (known_addresses_idx, (gpointer) o, (gpointer) o)) {
if (!g_hash_table_insert (known_addresses_idx, (gpointer) o, (gpointer) o)) {
/* duplicate? Keep only the first instance. */
goto delete_and_next;
}
......@@ -3750,7 +3750,7 @@ nm_platform_ip_route_sync (NMPlatform *self,
routes_idx = g_hash_table_new ((GHashFunc) nmp_object_id_hash,
(GEqualFunc) nmp_object_id_equal);
}
if (!nm_g_hash_table_insert (routes_idx, (gpointer) conf_o, (gpointer) conf_o)) {
if (!g_hash_table_insert (routes_idx, (gpointer) conf_o, (gpointer) conf_o)) {
_LOGD ("route-sync: skip adding duplicate route %s",
nmp_object_to_string (conf_o, NMP_OBJECT_TO_STRING_PUBLIC, sbuf1, sizeof (sbuf1)));
continue;
......
......@@ -402,8 +402,6 @@ plugin_init (void)
GDBusConnection *bus;
GError *err = NULL;
nm_g_type_init ();
g_message ("nm-ppp-plugin: (%s): initializing", __func__);
bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &err);
......
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