core: change NM_IS_IP_CONFIG() to have no additional argument
NM_IS_IP_CONFIG() is a standard name for GObject related macros. Next, we will add NMIPConfig object, so this macro (and name) will have a use. Rename, and adjust the existing macro to avoid the name conflict.
This commit is contained in:
@@ -1247,7 +1247,7 @@ applied_config_init (AppliedConfig *config, gpointer ip_config)
|
||||
|| (!config->orig && !config->current)
|
||||
|| nm_ip_config_get_addr_family (ip_config) == nm_ip_config_get_addr_family (config->orig ?: config->current));
|
||||
nm_assert ( !ip_config
|
||||
|| NM_IS_IP_CONFIG (ip_config, AF_UNSPEC));
|
||||
|| NM_IS_IP_CONFIG (ip_config));
|
||||
|
||||
nm_g_object_ref (ip_config);
|
||||
applied_config_clear (config);
|
||||
|
@@ -428,7 +428,7 @@ nm_dhcp_client_set_state (NMDhcpClient *self,
|
||||
gs_free char *event_id = NULL;
|
||||
|
||||
if (NM_IN_SET (new_state, NM_DHCP_STATE_BOUND, NM_DHCP_STATE_EXTENDED)) {
|
||||
g_return_if_fail (NM_IS_IP_CONFIG (ip_config, priv->addr_family));
|
||||
g_return_if_fail (NM_IS_IP_CONFIG_ADDR_FAMILY (ip_config, priv->addr_family));
|
||||
g_return_if_fail (options);
|
||||
} else {
|
||||
g_return_if_fail (!ip_config);
|
||||
|
@@ -215,7 +215,7 @@ _ASSERT_ip_config_data (const NMDnsIPConfigData *ip_data)
|
||||
{
|
||||
nm_assert (ip_data);
|
||||
_ASSERT_config_data (ip_data->data);
|
||||
nm_assert (NM_IS_IP_CONFIG (ip_data->ip_config, AF_UNSPEC));
|
||||
nm_assert (NM_IS_IP_CONFIG (ip_data->ip_config));
|
||||
nm_assert (c_list_contains (&ip_data->data->data_lst_head, &ip_data->data_lst));
|
||||
nm_assert (ip_data->data->ifindex == nm_ip_config_get_ifindex (ip_data->ip_config));
|
||||
}
|
||||
@@ -228,7 +228,7 @@ _ip_config_data_new (NMDnsConfigData *data,
|
||||
NMDnsIPConfigData *ip_data;
|
||||
|
||||
_ASSERT_config_data (data);
|
||||
nm_assert (NM_IS_IP_CONFIG (ip_config, AF_UNSPEC));
|
||||
nm_assert (NM_IS_IP_CONFIG (ip_config));
|
||||
nm_assert (ip_config_type != NM_DNS_IP_CONFIG_TYPE_REMOVED);
|
||||
|
||||
ip_data = g_slice_new0 (NMDnsIPConfigData);
|
||||
@@ -1644,7 +1644,7 @@ nm_dns_manager_set_ip_config (NMDnsManager *self,
|
||||
NMDnsIPConfigData **p_best;
|
||||
|
||||
g_return_val_if_fail (NM_IS_DNS_MANAGER (self), FALSE);
|
||||
g_return_val_if_fail (NM_IS_IP_CONFIG (ip_config, AF_UNSPEC), FALSE);
|
||||
g_return_val_if_fail (NM_IS_IP_CONFIG (ip_config), FALSE);
|
||||
|
||||
ifindex = nm_ip_config_get_ifindex (ip_config);
|
||||
g_return_val_if_fail (ifindex > 0, FALSE);
|
||||
|
@@ -262,7 +262,7 @@ void nm_ip_config_dump (const NMIPConfig *self,
|
||||
#include "nm-ip6-config.h"
|
||||
|
||||
static inline gboolean
|
||||
NM_IS_IP_CONFIG (gconstpointer config, int addr_family)
|
||||
NM_IS_IP_CONFIG_ADDR_FAMILY (gconstpointer config, int addr_family)
|
||||
{
|
||||
if (addr_family == AF_UNSPEC)
|
||||
return NM_IS_IP4_CONFIG (config) || NM_IS_IP6_CONFIG (config);
|
||||
@@ -273,6 +273,8 @@ NM_IS_IP_CONFIG (gconstpointer config, int addr_family)
|
||||
g_return_val_if_reached (FALSE);
|
||||
}
|
||||
|
||||
#define NM_IS_IP_CONFIG(config) NM_IS_IP_CONFIG_ADDR_FAMILY ((config), AF_UNSPEC)
|
||||
|
||||
#if _NM_CC_SUPPORT_GENERIC
|
||||
/* _NM_IS_IP_CONFIG() is a bit unusual. If _Generic() is supported,
|
||||
* it checks whether @config is either NM_IS_IP4_CONFIG() or NM_IS_IP6_CONFIG(),
|
||||
@@ -307,7 +309,7 @@ NM_IS_IP_CONFIG (gconstpointer config, int addr_family)
|
||||
NMIP6Config * : (NM_IS_IP6_CONFIG (_config))); \
|
||||
})
|
||||
#else
|
||||
#define _NM_IS_IP_CONFIG(typeexpr, config) NM_IS_IP_CONFIG(config, AF_UNSPEC)
|
||||
#define _NM_IS_IP_CONFIG(typeexpr, config) NM_IS_IP_CONFIG(config)
|
||||
#endif
|
||||
|
||||
#define NM_IP_CONFIG_CAST(config) \
|
||||
|
@@ -1975,8 +1975,8 @@ device_ip_config_changed (NMDevice *device,
|
||||
int addr_family;
|
||||
|
||||
nm_assert (new_config || old_config);
|
||||
nm_assert (!new_config || NM_IS_IP_CONFIG (new_config, AF_UNSPEC));
|
||||
nm_assert (!old_config || NM_IS_IP_CONFIG (old_config, AF_UNSPEC));
|
||||
nm_assert (!new_config || NM_IS_IP_CONFIG (new_config));
|
||||
nm_assert (!old_config || NM_IS_IP_CONFIG (old_config));
|
||||
|
||||
if (new_config) {
|
||||
addr_family = nm_ip_config_get_addr_family (new_config);
|
||||
|
Reference in New Issue
Block a user