summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-09-02 17:37:01 +0200
committerThomas Haller <thaller@redhat.com>2020-09-02 17:46:43 +0200
commitc7a724fd5311bb8d776c64d980d13e85a3fb82a5 (patch)
treeed6366b0065504a97f39aa540fca960f784798e1
parent426a4c9d50e1a5b7187dfdf82ee423768fe1c6da (diff)
downloadNetworkManager-c7a724fd5311bb8d776c64d980d13e85a3fb82a5.tar.gz
all: replace cleanup macro "gs_free_slist" by "nm_auto_free_slist"
-rw-r--r--shared/nm-glib-aux/nm-macros-internal.h9
-rw-r--r--src/nm-config.c6
-rw-r--r--src/tests/test-core.c6
3 files changed, 6 insertions, 15 deletions
diff --git a/shared/nm-glib-aux/nm-macros-internal.h b/shared/nm-glib-aux/nm-macros-internal.h
index c8017c69ce..bbab3a01b5 100644
--- a/shared/nm-glib-aux/nm-macros-internal.h
+++ b/shared/nm-glib-aux/nm-macros-internal.h
@@ -99,15 +99,6 @@ NM_AUTO_DEFINE_FCN0 (GPtrArray *, gs_local_ptrarray_unref, g_ptr_array_unref);
NM_AUTO_DEFINE_FCN0 (GHashTable *, gs_local_hashtable_unref, g_hash_table_unref);
/**
- * gs_free_slist:
- *
- * Call g_slist_free() on a variable location when it goes out
- * of scope.
- */
-#define gs_free_slist nm_auto(gs_local_free_slist)
-NM_AUTO_DEFINE_FCN0 (GSList *, gs_local_free_slist, g_slist_free);
-
-/**
* gs_unref_bytes:
*
* Call g_bytes_unref() on a variable location when it goes out
diff --git a/src/nm-config.c b/src/nm-config.c
index 06e36b71ae..66e8352eca 100644
--- a/src/nm-config.c
+++ b/src/nm-config.c
@@ -1020,8 +1020,8 @@ read_config (GKeyFile *keyfile,
} else {
gs_free char *old_sval = nm_config_keyfile_get_value (keyfile, group, base_key, NM_CONFIG_GET_VALUE_TYPE_SPEC);
gs_free char *new_sval = nm_config_keyfile_get_value (kf, group, key, NM_CONFIG_GET_VALUE_TYPE_SPEC);
- gs_free_slist GSList *old_specs = nm_match_spec_split (old_sval);
- gs_free_slist GSList *new_specs = nm_match_spec_split (new_sval);
+ nm_auto_free_slist GSList *old_specs = nm_match_spec_split (old_sval);
+ nm_auto_free_slist GSList *new_specs = nm_match_spec_split (new_sval);
/* the key is a device spec. This is a special kind of string-list, that
* we must split differently. */
@@ -1049,7 +1049,7 @@ read_config (GKeyFile *keyfile,
if (is_string_list)
nm_config_keyfile_set_string_list (keyfile, group, base_key, (const char *const*) new->pdata, new->len);
else {
- gs_free_slist GSList *specs = NULL;
+ nm_auto_free_slist GSList *specs = NULL;
gs_free char *specs_joined = NULL;
g_ptr_array_add (new, NULL);
diff --git a/src/tests/test-core.c b/src/tests/test-core.c
index 792a4a57ab..03fd679f94 100644
--- a/src/tests/test-core.c
+++ b/src/tests/test-core.c
@@ -801,7 +801,7 @@ test_connection_match_ip4_routes1 (void)
{
gs_unref_object NMConnection *orig = NULL, *copy = NULL;
NMConnection *matched;
- gs_free_slist GSList *connections = NULL;
+ nm_auto_free_slist GSList *connections = NULL;
NMSettingIPConfig *s_ip4;
orig = _match_connection_new ();
@@ -837,7 +837,7 @@ test_connection_match_ip4_routes2 (void)
{
gs_unref_object NMConnection *orig = NULL, *copy = NULL;
NMConnection *matched;
- gs_free_slist GSList *connections = NULL;
+ nm_auto_free_slist GSList *connections = NULL;
NMSettingIPConfig *s_ip4;
orig = _match_connection_new ();
@@ -876,7 +876,7 @@ test_connection_match_ip6_routes (void)
{
gs_unref_object NMConnection *orig = NULL, *copy = NULL;
NMConnection *matched;
- gs_free_slist GSList *connections = NULL;
+ nm_auto_free_slist GSList *connections = NULL;
NMSettingIPConfig *s_ip6;
orig = _match_connection_new ();