summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-02-13 14:55:26 +0100
committerThomas Haller <thaller@redhat.com>2020-02-13 17:17:07 +0100
commitcd314370248b2bb199d8643fee09aa05d15a1859 (patch)
tree677326b4b14cd5ddd64b56bfc7aee3252426849d
parent17d9b852c80ceefa37478eea03e844d0d057c4de (diff)
shared: drop _STATIC variant of macros that define functions
Several macros are used to define function. They had a "_STATIC" variant, to define the function as static. I think those macros should not try to abstract entirely what they do. They should not accept the function scope as argument (or have two variants per scope). This also because it might make sense to add additional __attribute__(()) to the function. That only works, if the macro does not pretend to *not* define a plain function. Instead, embrace what the function does and let the users place the function scope as they see fit. This also follows what is already done with static NM_CACHED_QUARK_FCN ("autoconnect-root", autoconnect_root_quark)
-rw-r--r--clients/cli/connections.c6
-rw-r--r--clients/cli/general.c9
-rw-r--r--libnm/nm-client.c3
-rw-r--r--shared/nm-glib-aux/nm-errno.c3
-rw-r--r--shared/nm-glib-aux/nm-macros-internal.h8
-rw-r--r--shared/nm-glib-aux/nm-shared-utils.h35
-rw-r--r--shared/nm-glib-aux/tests/test-shared-general.c3
-rw-r--r--src/devices/nm-device-macsec.c3
-rw-r--r--src/devices/nm-device-wireguard.c3
-rw-r--r--src/devices/nm-device.c15
-rw-r--r--src/devices/nm-lldp-listener.c6
-rw-r--r--src/dns/nm-dns-manager.c6
-rw-r--r--src/nm-active-connection.c6
-rw-r--r--src/nm-config.c3
-rw-r--r--src/nm-connectivity.c3
-rw-r--r--src/nm-manager.c3
-rw-r--r--src/nm-policy.c3
-rw-r--r--src/platform/nm-linux-platform.c6
-rw-r--r--src/platform/nm-platform-utils.c3
-rw-r--r--src/platform/nm-platform.c12
-rw-r--r--src/platform/nmp-netns.c3
-rw-r--r--src/ppp/nm-ppp-manager.c6
-rw-r--r--src/settings/nm-secret-agent.c3
-rw-r--r--src/settings/nm-settings-connection.c6
-rw-r--r--src/settings/nm-settings.c3
-rw-r--r--src/supplicant/nm-supplicant-interface.c3
-rw-r--r--src/vpn/nm-vpn-connection.c9
27 files changed, 100 insertions, 72 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index 7c7e184ff..22e4307a9 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -62,7 +62,8 @@ typedef struct _OptionInfo {
/*****************************************************************************/
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (active_connection_state_to_string, NMActiveConnectionState,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (active_connection_state_to_string, NMActiveConnectionState,
NM_UTILS_LOOKUP_DEFAULT (N_("unknown")),
NM_UTILS_LOOKUP_ITEM (NM_ACTIVE_CONNECTION_STATE_ACTIVATING, N_("activating")),
NM_UTILS_LOOKUP_ITEM (NM_ACTIVE_CONNECTION_STATE_ACTIVATED, N_("activated")),
@@ -71,7 +72,8 @@ NM_UTILS_LOOKUP_STR_DEFINE_STATIC (active_connection_state_to_string, NMActiveCo
NM_UTILS_LOOKUP_ITEM_IGNORE (NM_ACTIVE_CONNECTION_STATE_UNKNOWN),
)
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (vpn_connection_state_to_string, NMVpnConnectionState,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (vpn_connection_state_to_string, NMVpnConnectionState,
NM_UTILS_LOOKUP_DEFAULT (N_("unknown")),
NM_UTILS_LOOKUP_ITEM (NM_VPN_CONNECTION_STATE_PREPARE, N_("VPN connecting (prepare)")),
NM_UTILS_LOOKUP_ITEM (NM_VPN_CONNECTION_STATE_NEED_AUTH, N_("VPN connecting (need authentication)")),
diff --git a/clients/cli/general.c b/clients/cli/general.c
index d806d0489..53b5e6d40 100644
--- a/clients/cli/general.c
+++ b/clients/cli/general.c
@@ -28,7 +28,8 @@ static void permission_changed (GObject *gobject,
/*****************************************************************************/
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (nm_state_to_string, NMState,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (nm_state_to_string, NMState,
NM_UTILS_LOOKUP_DEFAULT (N_("unknown")),
NM_UTILS_LOOKUP_ITEM (NM_STATE_ASLEEP, N_("asleep")),
NM_UTILS_LOOKUP_ITEM (NM_STATE_CONNECTING, N_("connecting")),
@@ -87,7 +88,8 @@ permission_to_string (NMClientPermission perm)
?: _("unknown");
}
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (permission_result_to_string, NMClientPermissionResult,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (permission_result_to_string, NMClientPermissionResult,
NM_UTILS_LOOKUP_DEFAULT (N_("unknown")),
NM_UTILS_LOOKUP_ITEM (NM_CLIENT_PERMISSION_RESULT_YES, N_("yes")),
NM_UTILS_LOOKUP_ITEM (NM_CLIENT_PERMISSION_RESULT_NO, N_("no")),
@@ -95,7 +97,8 @@ NM_UTILS_LOOKUP_STR_DEFINE_STATIC (permission_result_to_string, NMClientPermissi
NM_UTILS_LOOKUP_ITEM_IGNORE (NM_CLIENT_PERMISSION_RESULT_UNKNOWN),
);
-_NM_UTILS_LOOKUP_DEFINE (static, permission_result_to_color, NMClientPermissionResult, NMMetaColor,
+static
+NM_UTILS_LOOKUP_DEFINE (permission_result_to_color, NMClientPermissionResult, NMMetaColor,
NM_UTILS_LOOKUP_DEFAULT (NM_META_COLOR_PERMISSION_UNKNOWN),
NM_UTILS_LOOKUP_ITEM (NM_CLIENT_PERMISSION_RESULT_YES, NM_META_COLOR_PERMISSION_YES),
NM_UTILS_LOOKUP_ITEM (NM_CLIENT_PERMISSION_RESULT_NO, NM_META_COLOR_PERMISSION_NO),
diff --git a/libnm/nm-client.c b/libnm/nm-client.c
index 86160b066..76479359c 100644
--- a/libnm/nm-client.c
+++ b/libnm/nm-client.c
@@ -382,7 +382,8 @@ static NMRefString *_dbus_path_dns_manager = NULL;
/*****************************************************************************/
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (nml_dbus_obj_state_to_string, NMLDBusObjState,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (nml_dbus_obj_state_to_string, NMLDBusObjState,
NM_UTILS_LOOKUP_DEFAULT_WARN ("???"),
NM_UTILS_LOOKUP_ITEM (NML_DBUS_OBJ_STATE_UNLINKED, "unlinked"),
NM_UTILS_LOOKUP_ITEM (NML_DBUS_OBJ_STATE_WATCHED_ONLY, "watched-only"),
diff --git a/shared/nm-glib-aux/nm-errno.c b/shared/nm-glib-aux/nm-errno.c
index 9133d87d9..e709f9e69 100644
--- a/shared/nm-glib-aux/nm-errno.c
+++ b/shared/nm-glib-aux/nm-errno.c
@@ -11,7 +11,8 @@
/*****************************************************************************/
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_geterror,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (_geterror,
#if 0
enum _NMErrno,
#else
diff --git a/shared/nm-glib-aux/nm-macros-internal.h b/shared/nm-glib-aux/nm-macros-internal.h
index bce080579..52591040e 100644
--- a/shared/nm-glib-aux/nm-macros-internal.h
+++ b/shared/nm-glib-aux/nm-macros-internal.h
@@ -1362,8 +1362,8 @@ nm_g_variant_take_ref (GVariant *v)
#define NM_UTILS_LOOKUP_ITEM_IGNORE(v) (void) 0; case v: break; (void) 0
#define NM_UTILS_LOOKUP_ITEM_IGNORE_OTHER() (void) 0; default: break; (void) 0
-#define _NM_UTILS_LOOKUP_DEFINE(scope, fcn_name, lookup_type, result_type, unknown_val, ...) \
-scope result_type \
+#define NM_UTILS_LOOKUP_DEFINE(fcn_name, lookup_type, result_type, unknown_val, ...) \
+result_type \
fcn_name (lookup_type val) \
{ \
switch (val) { \
@@ -1375,9 +1375,7 @@ fcn_name (lookup_type val) \
}
#define NM_UTILS_LOOKUP_STR_DEFINE(fcn_name, lookup_type, unknown_val, ...) \
- _NM_UTILS_LOOKUP_DEFINE (, fcn_name, lookup_type, const char *, unknown_val, __VA_ARGS__)
-#define NM_UTILS_LOOKUP_STR_DEFINE_STATIC(fcn_name, lookup_type, unknown_val, ...) \
- _NM_UTILS_LOOKUP_DEFINE (static, fcn_name, lookup_type, const char *, unknown_val, __VA_ARGS__)
+ NM_UTILS_LOOKUP_DEFINE (fcn_name, lookup_type, const char *, unknown_val, __VA_ARGS__)
/* Call the string-lookup-table function @fcn_name. If the function returns
* %NULL, the numeric index is converted to string using a alloca() buffer.
diff --git a/shared/nm-glib-aux/nm-shared-utils.h b/shared/nm-glib-aux/nm-shared-utils.h
index c1984e1a1..d80559789 100644
--- a/shared/nm-glib-aux/nm-shared-utils.h
+++ b/shared/nm-glib-aux/nm-shared-utils.h
@@ -679,8 +679,8 @@ typedef struct {
#define NM_UTILS_FLAGS2STR(f, n) { .flag = f, .name = ""n, }
-#define _NM_UTILS_FLAGS2STR_DEFINE(scope, fcn_name, flags_type, ...) \
-scope const char * \
+#define NM_UTILS_FLAGS2STR_DEFINE(fcn_name, flags_type, ...) \
+const char * \
fcn_name (flags_type flags, char *buf, gsize len) \
{ \
static const NMUtilsFlags2StrDesc descs[] = { \
@@ -690,11 +690,6 @@ fcn_name (flags_type flags, char *buf, gsize len) \
return nm_utils_flags2str (descs, G_N_ELEMENTS (descs), flags, buf, len); \
};
-#define NM_UTILS_FLAGS2STR_DEFINE(fcn_name, flags_type, ...) \
- _NM_UTILS_FLAGS2STR_DEFINE (, fcn_name, flags_type, __VA_ARGS__)
-#define NM_UTILS_FLAGS2STR_DEFINE_STATIC(fcn_name, flags_type, ...) \
- _NM_UTILS_FLAGS2STR_DEFINE (static, fcn_name, flags_type, __VA_ARGS__)
-
const char *nm_utils_flags2str (const NMUtilsFlags2StrDesc *descs,
gsize n_descs,
unsigned flags,
@@ -706,8 +701,8 @@ const char *nm_utils_flags2str (const NMUtilsFlags2StrDesc *descs,
#define NM_UTILS_ENUM2STR(v, n) (void) 0; case v: s = ""n""; break; (void) 0
#define NM_UTILS_ENUM2STR_IGNORE(v) (void) 0; case v: break; (void) 0
-#define _NM_UTILS_ENUM2STR_DEFINE(scope, fcn_name, lookup_type, int_fmt, ...) \
-scope const char * \
+#define NM_UTILS_ENUM2STR_DEFINE_FULL(fcn_name, lookup_type, int_fmt, ...) \
+const char * \
fcn_name (lookup_type val, char *buf, gsize len) \
{ \
nm_utils_to_string_buffer_init (&buf, &len); \
@@ -727,9 +722,7 @@ fcn_name (lookup_type val, char *buf, gsize len) \
}
#define NM_UTILS_ENUM2STR_DEFINE(fcn_name, lookup_type, ...) \
- _NM_UTILS_ENUM2STR_DEFINE (, fcn_name, lookup_type, "d", __VA_ARGS__)
-#define NM_UTILS_ENUM2STR_DEFINE_STATIC(fcn_name, lookup_type, ...) \
- _NM_UTILS_ENUM2STR_DEFINE (static, fcn_name, lookup_type, "d", __VA_ARGS__)
+ NM_UTILS_ENUM2STR_DEFINE_FULL (fcn_name, lookup_type, "d", __VA_ARGS__)
/*****************************************************************************/
@@ -1543,13 +1536,12 @@ guint8 *nm_utils_hexstr2bin_alloc (const char *hexstr,
/*****************************************************************************/
-#define _NM_UTILS_STRING_TABLE_LOOKUP_DEFINE(scope, \
- fcn_name, \
- result_type, \
- entry_cmd, \
- unknown_val_cmd, \
- ...) \
-scope result_type \
+#define NM_UTILS_STRING_TABLE_LOOKUP_DEFINE(fcn_name, \
+ result_type, \
+ entry_cmd, \
+ unknown_val_cmd, \
+ ...) \
+result_type \
fcn_name (const char *name) \
{ \
static const struct { \
@@ -1605,11 +1597,6 @@ fcn_name (const char *name) \
{ unknown_val_cmd; } \
}
-#define NM_UTILS_STRING_TABLE_LOOKUP_DEFINE(fcn_name, lookup_type, entry_cmd, unknown_val_cmd, ...) \
- _NM_UTILS_STRING_TABLE_LOOKUP_DEFINE (, fcn_name, lookup_type, entry_cmd, unknown_val_cmd, __VA_ARGS__)
-#define NM_UTILS_STRING_TABLE_LOOKUP_DEFINE_STATIC(fcn_name, lookup_type, entry_cmd, unknown_val_cmd, ...) \
- _NM_UTILS_STRING_TABLE_LOOKUP_DEFINE (static, fcn_name, lookup_type, entry_cmd, unknown_val_cmd, __VA_ARGS__)
-
/*****************************************************************************/
static inline GTask *
diff --git a/shared/nm-glib-aux/tests/test-shared-general.c b/shared/nm-glib-aux/tests/test-shared-general.c
index 92e4330a2..28aff95c0 100644
--- a/shared/nm-glib-aux/tests/test-shared-general.c
+++ b/shared/nm-glib-aux/tests/test-shared-general.c
@@ -554,7 +554,8 @@ test_nm_ref_string (void)
/*****************************************************************************/
-NM_UTILS_STRING_TABLE_LOOKUP_DEFINE_STATIC (
+static
+NM_UTILS_STRING_TABLE_LOOKUP_DEFINE (
_do_string_table_lookup,
int,
{ ; },
diff --git a/src/devices/nm-device-macsec.c b/src/devices/nm-device-macsec.c
index c65bfd156..dbb4ac8ef 100644
--- a/src/devices/nm-device-macsec.c
+++ b/src/devices/nm-device-macsec.c
@@ -77,7 +77,8 @@ static void macsec_secrets_cancel (NMDeviceMacsec *self);
/******************************************************************/
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (validation_mode_to_string, guint8,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (validation_mode_to_string, guint8,
NM_UTILS_LOOKUP_DEFAULT_WARN ("<unknown>"),
NM_UTILS_LOOKUP_STR_ITEM (0, "disable"),
NM_UTILS_LOOKUP_STR_ITEM (1, "check"),
diff --git a/src/devices/nm-device-wireguard.c b/src/devices/nm-device-wireguard.c
index 063ffc395..f91bf22af 100644
--- a/src/devices/nm-device-wireguard.c
+++ b/src/devices/nm-device-wireguard.c
@@ -168,7 +168,8 @@ static gboolean link_config_delayed_ratelimit_cb (gpointer user_data);
/*****************************************************************************/
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_link_config_mode_to_string, LinkConfigMode,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (_link_config_mode_to_string, LinkConfigMode,
NM_UTILS_LOOKUP_DEFAULT_NM_ASSERT (NULL),
NM_UTILS_LOOKUP_ITEM (LINK_CONFIG_MODE_FULL, "full"),
NM_UTILS_LOOKUP_ITEM (LINK_CONFIG_MODE_REAPPLY, "reapply"),
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index ec9a6c3e2..e10e18695 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -684,7 +684,8 @@ static void (*const activate_stage5_ip_config_result_x[2]) (NMDevice *self) = {
/*****************************************************************************/
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (queued_state_to_string, NMDeviceState,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (queued_state_to_string, NMDeviceState,
NM_UTILS_LOOKUP_DEFAULT ( NM_PENDING_ACTIONPREFIX_QUEUED_STATE_CHANGE "???"),
NM_UTILS_LOOKUP_STR_ITEM (NM_DEVICE_STATE_UNKNOWN, NM_PENDING_ACTIONPREFIX_QUEUED_STATE_CHANGE "unknown"),
NM_UTILS_LOOKUP_STR_ITEM (NM_DEVICE_STATE_UNMANAGED, NM_PENDING_ACTIONPREFIX_QUEUED_STATE_CHANGE "unmanaged"),
@@ -781,7 +782,8 @@ NM_UTILS_LOOKUP_STR_DEFINE (nm_device_state_reason_to_str, NMDeviceStateReason,
#define reason_to_string_a(reason) NM_UTILS_LOOKUP_STR_A (nm_device_state_reason_to_str, reason)
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (mtu_source_to_str, NMDeviceMtuSource,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (mtu_source_to_str, NMDeviceMtuSource,
NM_UTILS_LOOKUP_DEFAULT_NM_ASSERT ("unknown"),
NM_UTILS_LOOKUP_STR_ITEM (NM_DEVICE_MTU_SOURCE_NONE, "none"),
NM_UTILS_LOOKUP_STR_ITEM (NM_DEVICE_MTU_SOURCE_PARENT, "parent"),
@@ -1042,7 +1044,8 @@ applied_config_reset_nameservers (AppliedConfig *config)
/*****************************************************************************/
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_sys_iface_state_to_str, NMDeviceSysIfaceState,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (_sys_iface_state_to_str, NMDeviceSysIfaceState,
NM_UTILS_LOOKUP_DEFAULT_NM_ASSERT ("unknown"),
NM_UTILS_LOOKUP_STR_ITEM (NM_DEVICE_SYS_IFACE_STATE_EXTERNAL, "external"),
NM_UTILS_LOOKUP_STR_ITEM (NM_DEVICE_SYS_IFACE_STATE_ASSUME, "assume"),
@@ -1380,7 +1383,8 @@ _get_stable_id (NMDevice *self,
/*****************************************************************************/
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_ip_state_to_string, NMDeviceIPState,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (_ip_state_to_string, NMDeviceIPState,
NM_UTILS_LOOKUP_DEFAULT_WARN ("unknown"),
NM_UTILS_LOOKUP_STR_ITEM (NM_DEVICE_IP_STATE_NONE, "none"),
NM_UTILS_LOOKUP_STR_ITEM (NM_DEVICE_IP_STATE_WAIT, "wait"),
@@ -5481,7 +5485,8 @@ nm_device_set_enabled (NMDevice *self, gboolean enabled)
NM_DEVICE_GET_CLASS (self)->set_enabled (self, enabled);
}
-NM_UTILS_FLAGS2STR_DEFINE_STATIC (_autoconnect_blocked_flags_to_string, NMDeviceAutoconnectBlockedFlags,
+static
+NM_UTILS_FLAGS2STR_DEFINE (_autoconnect_blocked_flags_to_string, NMDeviceAutoconnectBlockedFlags,
NM_UTILS_FLAGS2STR (NM_DEVICE_AUTOCONNECT_BLOCKED_NONE, "none"),
NM_UTILS_FLAGS2STR (NM_DEVICE_AUTOCONNECT_BLOCKED_USER, "user"),
NM_UTILS_FLAGS2STR (NM_DEVICE_AUTOCONNECT_BLOCKED_WRONG_PIN, "wrong-pin"),
diff --git a/src/devices/nm-lldp-listener.c b/src/devices/nm-lldp-listener.c
index 9201660f5..65399ba8b 100644
--- a/src/devices/nm-lldp-listener.c
+++ b/src/devices/nm-lldp-listener.c
@@ -154,7 +154,8 @@ ether_addr_equal (const struct ether_addr *a1, const struct ether_addr *a2)
/*****************************************************************************/
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_lldp_attr_id_to_name, LldpAttrId,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (_lldp_attr_id_to_name, LldpAttrId,
NM_UTILS_LOOKUP_DEFAULT_WARN (NULL),
NM_UTILS_LOOKUP_STR_ITEM (LLDP_ATTR_ID_PORT_DESCRIPTION, NM_LLDP_ATTR_PORT_DESCRIPTION),
NM_UTILS_LOOKUP_STR_ITEM (LLDP_ATTR_ID_SYSTEM_NAME, NM_LLDP_ATTR_SYSTEM_NAME),
@@ -174,7 +175,8 @@ NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_lldp_attr_id_to_name, LldpAttrId,
NM_UTILS_LOOKUP_ITEM_IGNORE (_LLDP_ATTR_ID_COUNT),
);
-_NM_UTILS_LOOKUP_DEFINE (static, _lldp_attr_id_to_type, LldpAttrId, LldpAttrType,
+static
+NM_UTILS_LOOKUP_DEFINE (_lldp_attr_id_to_type, LldpAttrId, LldpAttrType,
NM_UTILS_LOOKUP_DEFAULT_WARN (LLDP_ATTR_TYPE_NONE),
NM_UTILS_LOOKUP_ITEM (LLDP_ATTR_ID_PORT_DESCRIPTION, LLDP_ATTR_TYPE_STRING),
NM_UTILS_LOOKUP_ITEM (LLDP_ATTR_ID_SYSTEM_NAME, LLDP_ATTR_TYPE_STRING),
diff --git a/src/dns/nm-dns-manager.c b/src/dns/nm-dns-manager.c
index 58dad0257..6fc6c829f 100644
--- a/src/dns/nm-dns-manager.c
+++ b/src/dns/nm-dns-manager.c
@@ -178,7 +178,8 @@ domain_is_routing (const char *domain)
/*****************************************************************************/
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_rc_manager_to_string, NMDnsManagerResolvConfManager,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (_rc_manager_to_string, NMDnsManagerResolvConfManager,
NM_UTILS_LOOKUP_DEFAULT_WARN (NULL),
NM_UTILS_LOOKUP_STR_ITEM (NM_DNS_MANAGER_RESOLV_CONF_MAN_UNKNOWN, "unknown"),
NM_UTILS_LOOKUP_STR_ITEM (NM_DNS_MANAGER_RESOLV_CONF_MAN_UNMANAGED, "unmanaged"),
@@ -189,7 +190,8 @@ NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_rc_manager_to_string, NMDnsManagerResolvConf
NM_UTILS_LOOKUP_STR_ITEM (NM_DNS_MANAGER_RESOLV_CONF_MAN_NETCONFIG, "netconfig"),
);
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_config_type_to_string, NMDnsIPConfigType,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (_config_type_to_string, NMDnsIPConfigType,
NM_UTILS_LOOKUP_DEFAULT_WARN ("<unknown>"),
NM_UTILS_LOOKUP_STR_ITEM (NM_DNS_IP_CONFIG_TYPE_REMOVED, "removed"),
NM_UTILS_LOOKUP_STR_ITEM (NM_DNS_IP_CONFIG_TYPE_DEFAULT, "default"),
diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c
index 3b120d784..149385ef3 100644
--- a/src/nm-active-connection.c
+++ b/src/nm-active-connection.c
@@ -138,7 +138,8 @@ static void auth_complete (NMActiveConnection *self, gboolean result, const char
/*****************************************************************************/
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_state_to_string, NMActiveConnectionState,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (_state_to_string, NMActiveConnectionState,
NM_UTILS_LOOKUP_DEFAULT (NULL),
NM_UTILS_LOOKUP_STR_ITEM (NM_ACTIVE_CONNECTION_STATE_UNKNOWN, "unknown"),
NM_UTILS_LOOKUP_STR_ITEM (NM_ACTIVE_CONNECTION_STATE_ACTIVATING, "activating"),
@@ -152,7 +153,8 @@ NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_state_to_string, NMActiveConnectionState,
/* the maximum required buffer size for _state_flags_to_string(). */
#define _NM_ACTIVATION_STATE_FLAG_TO_STRING_BUFSIZE (255)
-NM_UTILS_FLAGS2STR_DEFINE_STATIC (_state_flags_to_string, NMActivationStateFlags,
+static
+NM_UTILS_FLAGS2STR_DEFINE (_state_flags_to_string, NMActivationStateFlags,
NM_UTILS_FLAGS2STR (NM_ACTIVATION_STATE_FLAG_NONE, "none"),
NM_UTILS_FLAGS2STR (NM_ACTIVATION_STATE_FLAG_IS_MASTER, "is-master"),
NM_UTILS_FLAGS2STR (NM_ACTIVATION_STATE_FLAG_IS_SLAVE, "is-slave"),
diff --git a/src/nm-config.c b/src/nm-config.c
index ab60082b7..aa1d831ab 100644
--- a/src/nm-config.c
+++ b/src/nm-config.c
@@ -2193,7 +2193,8 @@ _nm_config_state_set (NMConfig *self,
#define DEVICE_RUN_STATE_KEYFILE_KEY_DEVICE_ROOT_PATH "root-path"
#define DEVICE_RUN_STATE_KEYFILE_KEY_DEVICE_NEXT_SERVER "next-server"
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_device_state_managed_type_to_str, NMConfigDeviceStateManagedType,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (_device_state_managed_type_to_str, NMConfigDeviceStateManagedType,
NM_UTILS_LOOKUP_DEFAULT_NM_ASSERT ("unknown"),
NM_UTILS_LOOKUP_STR_ITEM (NM_CONFIG_DEVICE_STATE_MANAGED_TYPE_UNKNOWN, "unknown"),
NM_UTILS_LOOKUP_STR_ITEM (NM_CONFIG_DEVICE_STATE_MANAGED_TYPE_UNMANAGED, "unmanaged"),
diff --git a/src/nm-connectivity.c b/src/nm-connectivity.c
index a7a827797..2d80fd902 100644
--- a/src/nm-connectivity.c
+++ b/src/nm-connectivity.c
@@ -26,7 +26,8 @@
/*****************************************************************************/
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_state_to_string, int /*NMConnectivityState*/,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (_state_to_string, int /*NMConnectivityState*/,
NM_UTILS_LOOKUP_DEFAULT_WARN ("???"),
NM_UTILS_LOOKUP_STR_ITEM (NM_CONNECTIVITY_UNKNOWN, "UNKNOWN"),
NM_UTILS_LOOKUP_STR_ITEM (NM_CONNECTIVITY_NONE, "NONE"),
diff --git a/src/nm-manager.c b/src/nm-manager.c
index e6dec4cdf..9d7a08728 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -382,7 +382,8 @@ static void _activation_auth_done (NMManager *self,
/*****************************************************************************/
-static NM_CACHED_QUARK_FCN ("autoconnect-root", autoconnect_root_quark)
+static
+NM_CACHED_QUARK_FCN ("autoconnect-root", autoconnect_root_quark)
/*****************************************************************************/
diff --git a/src/nm-policy.c b/src/nm-policy.c
index 34d2e1d07..7a5ed42b6 100644
--- a/src/nm-policy.c
+++ b/src/nm-policy.c
@@ -2500,7 +2500,8 @@ nm_policy_get_activating_ip6_ac (NMPolicy *self)
/*****************************************************************************/
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_hostname_mode_to_string, NMPolicyHostnameMode,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (_hostname_mode_to_string, NMPolicyHostnameMode,
NM_UTILS_LOOKUP_DEFAULT_NM_ASSERT ("unknown"),
NM_UTILS_LOOKUP_STR_ITEM (NM_POLICY_HOSTNAME_MODE_NONE, "none"),
NM_UTILS_LOOKUP_STR_ITEM (NM_POLICY_HOSTNAME_MODE_DHCP, "dhcp"),
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index b71576d5d..0d4181f8f 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -5193,7 +5193,8 @@ refresh_all_type_get_info (RefreshAllType refresh_all_type)
return &infos[refresh_all_type];
}
-_NM_UTILS_LOOKUP_DEFINE (static, delayed_action_type_to_refresh_all_type, DelayedActionType, RefreshAllType,
+static
+NM_UTILS_LOOKUP_DEFINE (delayed_action_type_to_refresh_all_type, DelayedActionType, RefreshAllType,
NM_UTILS_LOOKUP_DEFAULT_NM_ASSERT (0),
NM_UTILS_LOOKUP_ITEM (DELAYED_ACTION_TYPE_REFRESH_ALL_LINKS, REFRESH_ALL_TYPE_LINKS),
NM_UTILS_LOOKUP_ITEM (DELAYED_ACTION_TYPE_REFRESH_ALL_IP4_ADDRESSES, REFRESH_ALL_TYPE_IP4_ADDRESSES),
@@ -5276,7 +5277,8 @@ delayed_action_refresh_from_needle_object (const NMPObject *obj_needle)
return delayed_action_type_from_refresh_all_type (refresh_all_type_from_needle_object (obj_needle));
}
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (delayed_action_to_string, DelayedActionType,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (delayed_action_to_string, DelayedActionType,
NM_UTILS_LOOKUP_DEFAULT_NM_ASSERT ("unknown"),
NM_UTILS_LOOKUP_STR_ITEM (DELAYED_ACTION_TYPE_REFRESH_ALL_LINKS, "refresh-all-links"),
NM_UTILS_LOOKUP_STR_ITEM (DELAYED_ACTION_TYPE_REFRESH_ALL_IP4_ADDRESSES, "refresh-all-ip4-addresses"),
diff --git a/src/platform/nm-platform-utils.c b/src/platform/nm-platform-utils.c
index 9529b9c5f..af95d4d3a 100644
--- a/src/platform/nm-platform-utils.c
+++ b/src/platform/nm-platform-utils.c
@@ -262,7 +262,8 @@ out:
* ethtool
*****************************************************************************/
-NM_UTILS_ENUM2STR_DEFINE_STATIC (_ethtool_cmd_to_string, guint32,
+static
+NM_UTILS_ENUM2STR_DEFINE (_ethtool_cmd_to_string, guint32,
NM_UTILS_ENUM2STR (ETHTOOL_GDRVINFO, "ETHTOOL_GDRVINFO"),
NM_UTILS_ENUM2STR (ETHTOOL_GFEATURES, "ETHTOOL_GFEATURES"),
NM_UTILS_ENUM2STR (ETHTOOL_GLINK, "ETHTOOL_GLINK"),
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c
index 7535958c7..4fb2a7c06 100644
--- a/src/platform/nm-platform.c
+++ b/src/platform/nm-platform.c
@@ -298,7 +298,8 @@ nm_platform_get_multi_idx (NMPlatform *self)
/*****************************************************************************/
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_nmp_nlm_flag_to_string_lookup, NMPNlmFlags,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (_nmp_nlm_flag_to_string_lookup, NMPNlmFlags,
NM_UTILS_LOOKUP_DEFAULT (NULL),
NM_UTILS_LOOKUP_ITEM (NMP_NLM_FLAG_ADD, "add"),
NM_UTILS_LOOKUP_ITEM (NMP_NLM_FLAG_CHANGE, "change"),
@@ -2276,7 +2277,8 @@ nm_platform_link_get_lnk_wireguard (NMPlatform *self, int ifindex, const NMPlatf
/*****************************************************************************/
-NM_UTILS_FLAGS2STR_DEFINE_STATIC (_wireguard_change_flags_to_string, NMPlatformWireGuardChangeFlags,
+static
+NM_UTILS_FLAGS2STR_DEFINE (_wireguard_change_flags_to_string, NMPlatformWireGuardChangeFlags,
NM_UTILS_FLAGS2STR (NM_PLATFORM_WIREGUARD_CHANGE_FLAG_NONE, "none"),
NM_UTILS_FLAGS2STR (NM_PLATFORM_WIREGUARD_CHANGE_FLAG_REPLACE_PEERS, "replace-peers"),
NM_UTILS_FLAGS2STR (NM_PLATFORM_WIREGUARD_CHANGE_FLAG_HAS_PRIVATE_KEY, "has-private-key"),
@@ -2284,7 +2286,8 @@ NM_UTILS_FLAGS2STR_DEFINE_STATIC (_wireguard_change_flags_to_string, NMPlatformW
NM_UTILS_FLAGS2STR (NM_PLATFORM_WIREGUARD_CHANGE_FLAG_HAS_FWMARK, "has-fwmark"),
);
-NM_UTILS_FLAGS2STR_DEFINE_STATIC (_wireguard_change_peer_flags_to_string, NMPlatformWireGuardChangePeerFlags,
+static
+NM_UTILS_FLAGS2STR_DEFINE (_wireguard_change_peer_flags_to_string, NMPlatformWireGuardChangePeerFlags,
NM_UTILS_FLAGS2STR (NM_PLATFORM_WIREGUARD_CHANGE_PEER_FLAG_NONE, "none"),
NM_UTILS_FLAGS2STR (NM_PLATFORM_WIREGUARD_CHANGE_PEER_FLAG_REMOVE_ME, "remove"),
NM_UTILS_FLAGS2STR (NM_PLATFORM_WIREGUARD_CHANGE_PEER_FLAG_HAS_PRESHARED_KEY, "psk"),
@@ -5887,7 +5890,8 @@ nm_platform_ip6_address_to_string (const NMPlatformIP6Address *address, char *bu
return buf;
}
-NM_UTILS_FLAGS2STR_DEFINE_STATIC (_rtm_flags_to_string, unsigned,
+static
+NM_UTILS_FLAGS2STR_DEFINE (_rtm_flags_to_string, unsigned,
NM_UTILS_FLAGS2STR (RTNH_F_DEAD, "dead"),
NM_UTILS_FLAGS2STR (RTNH_F_PERVASIVE, "pervasive"),
NM_UTILS_FLAGS2STR (RTNH_F_ONLINK, "onlink"),
diff --git a/src/platform/nmp-netns.c b/src/platform/nmp-netns.c
index 78f76cc7b..bc91d7a86 100644
--- a/src/platform/nmp-netns.c
+++ b/src/platform/nmp-netns.c
@@ -31,7 +31,8 @@
#define _CLONE_NS_ALL ((int) (CLONE_NEWNS | CLONE_NEWNET))
#define _CLONE_NS_ALL_V CLONE_NEWNS , CLONE_NEWNET
-NM_UTILS_FLAGS2STR_DEFINE_STATIC (_clone_ns_to_str, int,
+static
+NM_UTILS_FLAGS2STR_DEFINE (_clone_ns_to_str, int,
NM_UTILS_FLAGS2STR (CLONE_NEWNS, "mnt"),
NM_UTILS_FLAGS2STR (CLONE_NEWNET, "net"),
);
diff --git a/src/ppp/nm-ppp-manager.c b/src/ppp/nm-ppp-manager.c
index f649e0cbb..67c3b0f86 100644
--- a/src/ppp/nm-ppp-manager.c
+++ b/src/ppp/nm-ppp-manager.c
@@ -41,7 +41,8 @@
#define NM_PPPD_PLUGIN PPPD_PLUGIN_DIR "/nm-pppd-plugin.so"
-static NM_CACHED_QUARK_FCN ("ppp-manager-secret-tries", ppp_manager_secret_tries_quark)
+static
+NM_CACHED_QUARK_FCN ("ppp-manager-secret-tries", ppp_manager_secret_tries_quark)
/*****************************************************************************/
@@ -664,7 +665,8 @@ out:
/*****************************************************************************/
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (pppd_exit_code_to_str, int,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (pppd_exit_code_to_str, int,
NM_UTILS_LOOKUP_DEFAULT ("Unknown error"),
NM_UTILS_LOOKUP_STR_ITEM ( 1, "Fatal pppd error");
NM_UTILS_LOOKUP_STR_ITEM ( 2, "pppd options error"),
diff --git a/src/settings/nm-secret-agent.c b/src/settings/nm-secret-agent.c
index 6159943a1..d7172c639 100644
--- a/src/settings/nm-secret-agent.c
+++ b/src/settings/nm-secret-agent.c
@@ -107,7 +107,8 @@ G_DEFINE_TYPE (NMSecretAgent, nm_secret_agent, G_TYPE_OBJECT)
/*****************************************************************************/
-NM_UTILS_FLAGS2STR_DEFINE_STATIC (_capabilities_to_string, NMSecretAgentCapabilities,
+static
+NM_UTILS_FLAGS2STR_DEFINE (_capabilities_to_string, NMSecretAgentCapabilities,
NM_UTILS_FLAGS2STR (NM_SECRET_AGENT_CAPABILITY_NONE, "none"),
NM_UTILS_FLAGS2STR (NM_SECRET_AGENT_CAPABILITY_VPN_HINTS, "vpn-hints"),
);
diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c
index fd701ecde..95d71b097 100644
--- a/src/settings/nm-settings-connection.c
+++ b/src/settings/nm-settings-connection.c
@@ -1968,7 +1968,8 @@ _nm_settings_connection_emit_signal_updated_internal (NMSettingsConnection *self
/*****************************************************************************/
-NM_UTILS_FLAGS2STR_DEFINE_STATIC (_settings_connection_flags_to_string, NMSettingsConnectionIntFlags,
+static
+NM_UTILS_FLAGS2STR_DEFINE (_settings_connection_flags_to_string, NMSettingsConnectionIntFlags,
NM_UTILS_FLAGS2STR (NM_SETTINGS_CONNECTION_INT_FLAGS_NONE, "none"),
NM_UTILS_FLAGS2STR (NM_SETTINGS_CONNECTION_INT_FLAGS_UNSAVED, "unsaved"),
NM_UTILS_FLAGS2STR (NM_SETTINGS_CONNECTION_INT_FLAGS_NM_GENERATED, "nm-generated"),
@@ -2413,7 +2414,8 @@ nm_settings_connection_autoconnect_retries_blocked_until (NMSettingsConnection *
return NM_SETTINGS_CONNECTION_GET_PRIVATE (self)->autoconnect_retries_blocked_until;
}
-NM_UTILS_FLAGS2STR_DEFINE_STATIC (_autoconnect_blocked_reason_to_string, NMSettingsAutoconnectBlockedReason,
+static
+NM_UTILS_FLAGS2STR_DEFINE (_autoconnect_blocked_reason_to_string, NMSettingsAutoconnectBlockedReason,
NM_UTILS_FLAGS2STR (NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_NONE, "none"),
NM_UTILS_FLAGS2STR (NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_USER_REQUEST, "user-request"),
NM_UTILS_FLAGS2STR (NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_FAILED, "failed"),
diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c
index a0b61e18c..78361804d 100644
--- a/src/settings/nm-settings.c
+++ b/src/settings/nm-settings.c
@@ -67,7 +67,8 @@
/*****************************************************************************/
-static NM_CACHED_QUARK_FCN ("default-wired-connection", _default_wired_connection_quark)
+static
+NM_CACHED_QUARK_FCN ("default-wired-connection", _default_wired_connection_quark)
/*****************************************************************************/
diff --git a/src/supplicant/nm-supplicant-interface.c b/src/supplicant/nm-supplicant-interface.c
index ba162e237..4b6b4f6e1 100644
--- a/src/supplicant/nm-supplicant-interface.c
+++ b/src/supplicant/nm-supplicant-interface.c
@@ -186,7 +186,8 @@ NM_UTILS_LOOKUP_STR_DEFINE (nm_supplicant_interface_state_to_string, NMSupplican
NM_UTILS_LOOKUP_STR_ITEM (NM_SUPPLICANT_INTERFACE_STATE_DOWN, "down"),
);
-NM_UTILS_STRING_TABLE_LOOKUP_DEFINE_STATIC (
+static
+NM_UTILS_STRING_TABLE_LOOKUP_DEFINE (
wpas_state_string_to_enum,
NMSupplicantInterfaceState,
{ nm_assert (name); },
diff --git a/src/vpn/nm-vpn-connection.c b/src/vpn/nm-vpn-connection.c
index 21368b01d..e1b17e725 100644
--- a/src/vpn/nm-vpn-connection.c
+++ b/src/vpn/nm-vpn-connection.c
@@ -872,7 +872,8 @@ nm_vpn_connection_get_service (NMVpnConnection *self)
return nm_setting_vpn_get_service_type (s_vpn);
}
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_vpn_plugin_failure_to_string, NMVpnPluginFailure,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (_vpn_plugin_failure_to_string, NMVpnPluginFailure,
NM_UTILS_LOOKUP_DEFAULT (NULL),
NM_UTILS_LOOKUP_STR_ITEM (NM_VPN_PLUGIN_FAILURE_LOGIN_FAILED, "login-failed"),
NM_UTILS_LOOKUP_STR_ITEM (NM_VPN_PLUGIN_FAILURE_CONNECT_FAILED, "connect-failed"),
@@ -901,7 +902,8 @@ plugin_failed (NMVpnConnection *self, guint reason)
}
}
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_vpn_service_state_to_string, NMVpnServiceState,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (_vpn_service_state_to_string, NMVpnServiceState,
NM_UTILS_LOOKUP_DEFAULT (NULL),
NM_UTILS_LOOKUP_STR_ITEM (NM_VPN_SERVICE_STATE_UNKNOWN, "unknown"),
NM_UTILS_LOOKUP_STR_ITEM (NM_VPN_SERVICE_STATE_INIT, "init"),
@@ -914,7 +916,8 @@ NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_vpn_service_state_to_string, NMVpnServiceSta
#define vpn_service_state_to_string_a(state) NM_UTILS_LOOKUP_STR_A (_vpn_service_state_to_string, state)
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_vpn_state_to_string, VpnState,
+static
+NM_UTILS_LOOKUP_STR_DEFINE (_vpn_state_to_string, VpnState,
NM_UTILS_LOOKUP_DEFAULT (NULL),
NM_UTILS_LOOKUP_STR_ITEM (STATE_UNKNOWN, "unknown"),
NM_UTILS_LOOKUP_STR_ITEM (STATE_WAITING, "waiting"),