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.
This commit is contained in:
Thomas Haller 2018-10-22 12:53:41 +02:00
parent 56ac630893
commit af48af4671
3 changed files with 10 additions and 4 deletions

View file

@ -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

View file

@ -2418,7 +2418,7 @@ nm_device_has_unmodified_applied_connection (NMDevice *self, NMSettingCompareFla
return nm_active_connection_has_unmodified_applied_connection ((NMActiveConnection *) priv->act_request.obj, compare_flags);
}
NMSetting *
gpointer
nm_device_get_applied_setting (NMDevice *self, GType setting_type)
{
NMConnection *connection;

View file

@ -543,7 +543,9 @@ NMConnection * nm_device_get_settings_connection_get_connection (NMDevice *self
NMConnection * nm_device_get_applied_connection (NMDevice *dev);
gboolean nm_device_has_unmodified_applied_connection (NMDevice *self,
NMSettingCompareFlags compare_flags);
NMSetting * nm_device_get_applied_setting (NMDevice *dev, GType setting_type);
gpointer /* (NMSetting *) */ nm_device_get_applied_setting (NMDevice *dev,
GType setting_type);
void nm_device_removed (NMDevice *self, gboolean unconfigure_ip_config);