diff --git a/libnm-core/nm-keyfile-writer.c b/libnm-core/nm-keyfile-writer.c index f62e97c3e6..e0e6ba4bf8 100644 --- a/libnm-core/nm-keyfile-writer.c +++ b/libnm-core/nm-keyfile-writer.c @@ -233,12 +233,6 @@ route_writer (KeyfileWriterInfo *info, write_ip_values (info->keyfile, setting_name, array, NULL, TRUE); } -static int -sort_hash_keys (gconstpointer a, gconstpointer b, gpointer user_data) -{ - return g_strcmp0 (*((const char **) a), *((const char **) b)); -} - static void write_hash_of_string (GKeyFile *file, NMSetting *setting, @@ -262,7 +256,7 @@ write_hash_of_string (GKeyFile *file, if (!keys) return; - g_qsort_with_data (keys, l, sizeof (const char *), sort_hash_keys, NULL); + g_qsort_with_data (keys, l, sizeof (const char *), nm_strcmp_p_with_data, NULL); for (i = 0; keys[i]; i++) { const char *property, *data; diff --git a/src/nm-config.c b/src/nm-config.c index 67c0497810..4d0ebc1f8f 100644 --- a/src/nm-config.c +++ b/src/nm-config.c @@ -880,15 +880,6 @@ read_base_config (GKeyFile *keyfile, return TRUE; } -static int -sort_asciibetically (gconstpointer a, gconstpointer b) -{ - const char *s1 = *(const char **)a; - const char *s2 = *(const char **)b; - - return strcmp (s1, s2); -} - static GPtrArray * _get_config_dir_files (const char *config_dir) { @@ -917,7 +908,7 @@ _get_config_dir_files (const char *config_dir) } g_object_unref (dir); - g_ptr_array_sort (confs, sort_asciibetically); + g_ptr_array_sort (confs, nm_strcmp_p); return confs; }