summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-09-30 14:08:50 +0200
committerThomas Haller <thaller@redhat.com>2015-09-30 14:12:25 +0200
commita9b1869d63d3c114bf63b9f11901e6c45a0d4a27 (patch)
tree43464ad49335ccf4e05e9a6af0da6b89c80f11ef
parent261dff429e109996a2d3ce4b1ae3acf701e80738 (diff)
downloadNetworkManager-a9b1869d63d3c114bf63b9f11901e6c45a0d4a27.tar.gz
all: use glib compatibility functions for g_hash_table_add() and g_hash_table_insert()
-rw-r--r--src/nm-bus-manager.c6
-rw-r--r--src/nm-firewall-manager.c6
-rw-r--r--src/settings/nm-agent-manager.c18
3 files changed, 5 insertions, 25 deletions
diff --git a/src/nm-bus-manager.c b/src/nm-bus-manager.c
index 3b8f672aef..7b12b42313 100644
--- a/src/nm-bus-manager.c
+++ b/src/nm-bus-manager.c
@@ -873,12 +873,8 @@ nm_bus_manager_register_object (NMBusManager *self,
* stable -- because the path is the identifier for the object in this
* situation. */
-#if GLIB_CHECK_VERSION(2, 40, 0)
- if (!g_hash_table_insert (priv->exported, (gpointer) path, object))
+ if (!nm_g_hash_table_insert (priv->exported, (gpointer) path, object))
g_return_if_reached ();
-#else
- g_hash_table_insert (priv->exported, (gpointer) path, object);
-#endif
nm_assert_exported (self, path, object);
diff --git a/src/nm-firewall-manager.c b/src/nm-firewall-manager.c
index ab8598a0a8..db7ca0cadc 100644
--- a/src/nm-firewall-manager.c
+++ b/src/nm-firewall-manager.c
@@ -163,12 +163,8 @@ _cb_info_create (NMFirewallManager *self,
} else
info->mode = CB_INFO_MODE_IDLE;
-#if GLIB_CHECK_VERSION(2, 40, 0)
- if (!g_hash_table_add (priv->pending_calls, info))
+ if (!nm_g_hash_table_add (priv->pending_calls, info))
g_return_val_if_reached (NULL);
-#else
- g_hash_table_add (priv->pending_calls, info);
-#endif
return info;
}
diff --git a/src/settings/nm-agent-manager.c b/src/settings/nm-agent-manager.c
index aa05354e06..21635a939e 100644
--- a/src/settings/nm-agent-manager.c
+++ b/src/settings/nm-agent-manager.c
@@ -1216,12 +1216,8 @@ nm_agent_manager_get_secrets (NMAgentManager *self,
req->con.get.callback = callback;
req->con.get.callback_data = callback_data;
-#if GLIB_CHECK_VERSION(2, 40, 0)
- if (!g_hash_table_add (priv->requests, req))
+ if (!nm_g_hash_table_add (priv->requests, req))
g_assert_not_reached ();
-#else
- g_hash_table_add (priv->requests, req);
-#endif
/* Kick off the request */
if (!(req->con.get.flags & NM_SECRET_AGENT_GET_SECRETS_FLAG_ONLY_SYSTEM))
@@ -1326,12 +1322,8 @@ nm_agent_manager_save_secrets (NMAgentManager *self,
subject);
req->con.path = g_strdup (path);
req->con.connection = g_object_ref (connection);
-#if GLIB_CHECK_VERSION(2, 40, 0)
- if (!g_hash_table_add (priv->requests, req))
+ if (!nm_g_hash_table_add (priv->requests, req))
g_assert_not_reached ();
-#else
- g_hash_table_add (priv->requests, req);
-#endif
/* Kick off the request */
request_add_agents (self, req);
@@ -1418,12 +1410,8 @@ nm_agent_manager_delete_secrets (NMAgentManager *self,
req->con.path = g_strdup (path);
req->con.connection = g_object_ref (connection);
g_object_unref (subject);
-#if GLIB_CHECK_VERSION(2, 40, 0)
- if (!g_hash_table_add (priv->requests, req))
+ if (!nm_g_hash_table_add (priv->requests, req))
g_assert_not_reached ();
-#else
- g_hash_table_add (priv->requests, req);
-#endif
/* Kick off the request */
request_add_agents (self, req);