all: don't use "static inline" in source files

For static functions inside a module, the compiler determines on its own
whether to inline the function.

Also, "inline" was used at some places that don't immediatly look like
candidates for inlining. It was most likely a copy&paste error.
This commit is contained in:
Thomas Haller 2019-02-06 09:04:23 +01:00
parent bb341900dd
commit d25ed0820c
17 changed files with 23 additions and 23 deletions

View file

@ -461,7 +461,7 @@ again:
return FALSE; return FALSE;
} }
static inline gboolean static gboolean
check_permissions (struct stat *s, const char **out_error_msg) check_permissions (struct stat *s, const char **out_error_msg)
{ {
g_return_val_if_fail (s != NULL, FALSE); g_return_val_if_fail (s != NULL, FALSE);

View file

@ -201,7 +201,7 @@ nm_setting_bridge_get_multicast_snooping (NMSettingBridge *setting)
return NM_SETTING_BRIDGE_GET_PRIVATE (setting)->multicast_snooping; return NM_SETTING_BRIDGE_GET_PRIVATE (setting)->multicast_snooping;
} }
static inline gboolean static gboolean
check_range (guint32 val, check_range (guint32 val,
guint32 min, guint32 min,
guint32 max, guint32 max,

View file

@ -716,7 +716,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
G_STATIC_ASSERT (sizeof (guint) == sizeof (gboolean)); G_STATIC_ASSERT (sizeof (guint) == sizeof (gboolean));
static inline void static void
set_array_from_gvalue (const GValue *v, uint *a, size_t len) set_array_from_gvalue (const GValue *v, uint *a, size_t len)
{ {
GArray *src = g_value_get_boxed (v); GArray *src = g_value_get_boxed (v);
@ -731,7 +731,7 @@ set_array_from_gvalue (const GValue *v, uint *a, size_t len)
} }
#define SET_ARRAY_FROM_GVALUE(v, a) set_array_from_gvalue (v, a, G_N_ELEMENTS (a)) #define SET_ARRAY_FROM_GVALUE(v, a) set_array_from_gvalue (v, a, G_N_ELEMENTS (a))
static inline void static void
set_gvalue_from_array (GValue *v, uint *a, size_t len) set_gvalue_from_array (GValue *v, uint *a, size_t len)
{ {
GArray *src = g_array_sized_new (FALSE, TRUE, sizeof (guint), len); GArray *src = g_array_sized_new (FALSE, TRUE, sizeof (guint), len);

View file

@ -5356,7 +5356,7 @@ _json_find_object (json_t *json,
return json_element; return json_element;
} }
static inline void static void
_json_delete_object_on_int_match (json_t *json, _json_delete_object_on_int_match (json_t *json,
const char *key1, const char *key1,
const char *key2, const char *key2,
@ -5372,7 +5372,7 @@ _json_delete_object_on_int_match (json_t *json,
_json_del_object (json, key1, key2, key3); _json_del_object (json, key1, key2, key3);
} }
static inline void static void
_json_delete_object_on_bool_match (json_t *json, _json_delete_object_on_bool_match (json_t *json,
const char *key1, const char *key1,
const char *key2, const char *key2,
@ -5388,7 +5388,7 @@ _json_delete_object_on_bool_match (json_t *json,
_json_del_object (json, key1, key2, key3); _json_del_object (json, key1, key2, key3);
} }
static inline void static void
_json_delete_object_on_string_match (json_t *json, _json_delete_object_on_string_match (json_t *json,
const char *key1, const char *key1,
const char *key2, const char *key2,

View file

@ -254,7 +254,7 @@ nm_setting_bridge_get_ageing_time (NMSettingBridge *setting)
#define BR_MIN_AGEING_TIME 0 #define BR_MIN_AGEING_TIME 0
#define BR_MAX_AGEING_TIME 1000000 #define BR_MAX_AGEING_TIME 1000000
static inline gboolean static gboolean
check_range (guint32 val, check_range (guint32 val,
guint32 min, guint32 min,
guint32 max, guint32 max,

View file

@ -802,7 +802,7 @@ nm_setting_dcb_init (NMSettingDcb *setting)
{ {
} }
static inline void static void
set_uint_array (const GValue *v, uint *a, size_t len) set_uint_array (const GValue *v, uint *a, size_t len)
{ {
GArray *src = g_value_get_boxed (v); GArray *src = g_value_get_boxed (v);

View file

@ -650,7 +650,7 @@ nm_setting_compare (NMSetting *a,
return same; return same;
} }
static inline gboolean static gboolean
should_compare_prop (NMSetting *setting, should_compare_prop (NMSetting *setting,
const char *prop_name, const char *prop_name,
NMSettingCompareFlags comp_flags, NMSettingCompareFlags comp_flags,

View file

@ -107,7 +107,7 @@ get_secrets_info_free (GetSecretsInfo *info)
g_slice_free (GetSecretsInfo, info); g_slice_free (GetSecretsInfo, info);
} }
static inline gboolean static gboolean
should_auto_register (NMSecretAgentOld *self) should_auto_register (NMSecretAgentOld *self)
{ {
NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self); NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);

View file

@ -9517,7 +9517,7 @@ restore_ip6_properties (NMDevice *self)
} }
} }
static inline void static void
set_disable_ipv6 (NMDevice *self, const char *value) set_disable_ipv6 (NMDevice *self, const char *value)
{ {
/* We only touch disable_ipv6 when NM is not managing the IPv6LL address */ /* We only touch disable_ipv6 when NM is not managing the IPv6LL address */
@ -9525,7 +9525,7 @@ set_disable_ipv6 (NMDevice *self, const char *value)
nm_device_sysctl_ip_conf_set (self, AF_INET6, "disable_ipv6", value); nm_device_sysctl_ip_conf_set (self, AF_INET6, "disable_ipv6", value);
} }
static inline void static void
set_nm_ipv6ll (NMDevice *self, gboolean enable) set_nm_ipv6ll (NMDevice *self, gboolean enable)
{ {
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);

View file

@ -495,7 +495,7 @@ nm_dhcp_dhclient_escape_duid (GBytes *duid)
return escaped; return escaped;
} }
static inline gboolean static gboolean
isoctal (const guint8 *p) isoctal (const guint8 *p)
{ {
return ( p[0] >= '0' && p[0] <= '3' return ( p[0] >= '0' && p[0] <= '3'

View file

@ -536,7 +536,7 @@ start (NMNDisc *ndisc)
/*****************************************************************************/ /*****************************************************************************/
static inline int static int
ipv6_sysctl_get (NMPlatform *platform, const char *ifname, const char *property, int min, int max, int defval) ipv6_sysctl_get (NMPlatform *platform, const char *ifname, const char *property, int min, int max, int defval)
{ {
return nm_platform_sysctl_ip_conf_get_int_checked (platform, return nm_platform_sysctl_ip_conf_get_int_checked (platform,

View file

@ -709,7 +709,7 @@ nm_utils_kill_child_async (pid_t pid, int sig, NMLogDomain log_domain,
g_child_watch_add (pid, _kc_cb_watch_child, data); g_child_watch_add (pid, _kc_cb_watch_child, data);
} }
static inline gulong static gulong
_sleep_duration_convert_ms_to_us (guint32 sleep_duration_msec) _sleep_duration_convert_ms_to_us (guint32 sleep_duration_msec)
{ {
if (sleep_duration_msec > 0) { if (sleep_duration_msec > 0) {

View file

@ -2901,7 +2901,7 @@ nm_ip4_config_nmpobj_remove (NMIP4Config *self,
/*****************************************************************************/ /*****************************************************************************/
static inline void static void
hash_u32 (GChecksum *sum, guint32 n) hash_u32 (GChecksum *sum, guint32 n)
{ {
g_checksum_update (sum, (const guint8 *) &n, sizeof (n)); g_checksum_update (sum, (const guint8 *) &n, sizeof (n));

View file

@ -2353,13 +2353,13 @@ nm_ip6_config_nmpobj_remove (NMIP6Config *self,
/*****************************************************************************/ /*****************************************************************************/
static inline void static void
hash_u32 (GChecksum *sum, guint32 n) hash_u32 (GChecksum *sum, guint32 n)
{ {
g_checksum_update (sum, (const guint8 *) &n, sizeof (n)); g_checksum_update (sum, (const guint8 *) &n, sizeof (n));
} }
static inline void static void
hash_in6addr (GChecksum *sum, const struct in6_addr *a) hash_in6addr (GChecksum *sum, const struct in6_addr *a)
{ {
if (a) if (a)

View file

@ -894,7 +894,7 @@ nmp_utils_ethtool_get_link_settings (int ifindex,
| ADVERTISED_1000baseT_Full \ | ADVERTISED_1000baseT_Full \
| ADVERTISED_10000baseT_Full ) | ADVERTISED_10000baseT_Full )
static inline guint32 static guint32
get_baset_mode (guint32 speed, NMPlatformLinkDuplexType duplex) get_baset_mode (guint32 speed, NMPlatformLinkDuplexType duplex)
{ {
if (duplex == NM_PLATFORM_LINK_DUPLEX_UNKNOWN) if (duplex == NM_PLATFORM_LINK_DUPLEX_UNKNOWN)

View file

@ -1545,13 +1545,13 @@ _vt_cmd_plobj_id_hash_update (tfilter, NMPlatformTfilter, {
obj->handle); obj->handle);
}) })
static inline void static void
_vt_cmd_plobj_hash_update_ip4_route (const NMPlatformObject *obj, NMHashState *h) _vt_cmd_plobj_hash_update_ip4_route (const NMPlatformObject *obj, NMHashState *h)
{ {
return nm_platform_ip4_route_hash_update ((const NMPlatformIP4Route *) obj, NM_PLATFORM_IP_ROUTE_CMP_TYPE_FULL, h); return nm_platform_ip4_route_hash_update ((const NMPlatformIP4Route *) obj, NM_PLATFORM_IP_ROUTE_CMP_TYPE_FULL, h);
} }
static inline void static void
_vt_cmd_plobj_hash_update_ip6_route (const NMPlatformObject *obj, NMHashState *h) _vt_cmd_plobj_hash_update_ip6_route (const NMPlatformObject *obj, NMHashState *h)
{ {
return nm_platform_ip6_route_hash_update ((const NMPlatformIP6Route *) obj, NM_PLATFORM_IP_ROUTE_CMP_TYPE_FULL, h); return nm_platform_ip6_route_hash_update ((const NMPlatformIP6Route *) obj, NM_PLATFORM_IP_ROUTE_CMP_TYPE_FULL, h);

View file

@ -71,7 +71,7 @@ NM_CACHED_QUARK_FCN ("nm-supplicant-error-quark", nm_supplicant_error_quark)
/*****************************************************************************/ /*****************************************************************************/
static inline gboolean static gboolean
die_count_exceeded (guint32 count) die_count_exceeded (guint32 count)
{ {
return count > 2; return count > 2;