diff options
author | Thomas Haller <thaller@redhat.com> | 2018-10-22 12:53:41 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-10-23 10:47:01 +0200 |
commit | af48af4671031d3f6ff3e019c854d24402ef0d04 (patch) | |
tree | 8e6e66263cdc8b0fee0d263facd57be32e1e214e /libnm-core | |
parent | 56ac6308939ee826b55bcef346fdb911d6eebf47 (diff) |
device: return void pointer from nm_device_get_applied_setting()
Literally ever use of nm_device_get_applied_setting() requires a
cast. Just don't.
Diffstat (limited to 'libnm-core')
-rw-r--r-- | libnm-core/nm-connection.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libnm-core/nm-connection.c b/libnm-core/nm-connection.c index 5f406cc64..a19a09dcd 100644 --- a/libnm-core/nm-connection.c +++ b/libnm-core/nm-connection.c @@ -169,11 +169,15 @@ nm_connection_remove_setting (NMConnection *connection, GType setting_type) static gpointer _connection_get_setting (NMConnection *connection, GType setting_type) { + NMSetting *setting; + nm_assert (NM_IS_CONNECTION (connection)); nm_assert (g_type_is_a (setting_type, NM_TYPE_SETTING)); - return g_hash_table_lookup (NM_CONNECTION_GET_PRIVATE (connection)->settings, - g_type_name (setting_type)); + setting = g_hash_table_lookup (NM_CONNECTION_GET_PRIVATE (connection)->settings, + g_type_name (setting_type)); + nm_assert (!setting || G_TYPE_CHECK_INSTANCE_TYPE (setting, setting_type)); + return setting; } static gpointer |