From dba19ebd7df9d5e4c65e0fbb2d9f33a28c884523 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 12 Aug 2018 16:53:18 +0200 Subject: [PATCH] all: avoid useless cast of g_free() to GDestroyNotify --- libnm-core/nm-utils.c | 2 +- libnm-core/tests/test-setting.c | 4 ++-- libnm-util/nm-setting.c | 2 +- libnm-util/nm-utils.c | 2 +- src/supplicant/nm-supplicant-config.c | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c index 0acb96b28..606624e0e 100644 --- a/libnm-core/nm-utils.c +++ b/libnm-core/nm-utils.c @@ -5654,7 +5654,7 @@ _nm_utils_team_config_get (const char *conf, g_ptr_array_free (data, TRUE); } else if (json_is_array (json_element)) { - GPtrArray *data = g_ptr_array_new_with_free_func ((GDestroyNotify) g_free); + GPtrArray *data = g_ptr_array_new_with_free_func (g_free); json_t *str_element; int index; diff --git a/libnm-core/tests/test-setting.c b/libnm-core/tests/test-setting.c index 5526ad8a7..18dadd886 100644 --- a/libnm-core/tests/test-setting.c +++ b/libnm-core/tests/test-setting.c @@ -1002,7 +1002,7 @@ test_runner_loadbalance_sync_from_config (void) { gs_unref_ptrarray GPtrArray *tx_hash = NULL; - tx_hash = g_ptr_array_new_with_free_func ((GDestroyNotify) g_free); + tx_hash = g_ptr_array_new_with_free_func (g_free); g_ptr_array_add (tx_hash, g_strdup ("eth")); g_ptr_array_add (tx_hash, g_strdup ("ipv4")); g_ptr_array_add (tx_hash, g_strdup ("ipv6")); @@ -1039,7 +1039,7 @@ test_runner_lacp_sync_from_config (void) { gs_unref_ptrarray GPtrArray *tx_hash = NULL; - tx_hash = g_ptr_array_new_with_free_func ((GDestroyNotify) g_free); + tx_hash = g_ptr_array_new_with_free_func (g_free); g_ptr_array_add (tx_hash, g_strdup ("eth")); g_ptr_array_add (tx_hash, g_strdup ("ipv4")); g_ptr_array_add (tx_hash, g_strdup ("ipv6")); diff --git a/libnm-util/nm-setting.c b/libnm-util/nm-setting.c index 36d6dab1a..9147dfe15 100644 --- a/libnm-util/nm-setting.c +++ b/libnm-util/nm-setting.c @@ -321,7 +321,7 @@ nm_setting_to_hash (NMSetting *setting, NMSettingHashFlags flags) property_specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (setting), &n_property_specs); hash = g_hash_table_new_full (g_str_hash, g_str_equal, - (GDestroyNotify) g_free, destroy_gvalue); + g_free, destroy_gvalue); for (i = 0; i < n_property_specs; i++) { GParamSpec *prop_spec = property_specs[i]; diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index 26f5533a2..054d69f4c 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -491,7 +491,7 @@ nm_utils_gvalue_hash_dup (GHashTable *hash) g_return_val_if_fail (hash != NULL, NULL); table = g_hash_table_new_full (g_str_hash, g_str_equal, - (GDestroyNotify) g_free, + g_free, value_destroy); g_hash_table_foreach (hash, value_dup, table); diff --git a/src/supplicant/nm-supplicant-config.c b/src/supplicant/nm-supplicant-config.c index d090ffacb..a0628d74a 100644 --- a/src/supplicant/nm-supplicant-config.c +++ b/src/supplicant/nm-supplicant-config.c @@ -94,11 +94,11 @@ nm_supplicant_config_init (NMSupplicantConfig * self) NMSupplicantConfigPrivate *priv = NM_SUPPLICANT_CONFIG_GET_PRIVATE (self); priv->config = g_hash_table_new_full (nm_str_hash, g_str_equal, - (GDestroyNotify) g_free, + g_free, (GDestroyNotify) config_option_free); priv->blobs = g_hash_table_new_full (nm_str_hash, g_str_equal, - (GDestroyNotify) g_free, + g_free, (GDestroyNotify) g_bytes_unref); priv->ap_scan = 1;