From 4e109bacabde005eefa613055049adc27010fa5b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 9 Jul 2021 08:48:48 +0200 Subject: [PATCH] clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" Subjectively, I think this looks better. --- .clang-format | 2 +- src/contrib/nm-compat.h | 38 +- src/core/devices/bluetooth/nm-bluez-manager.c | 4 +- src/core/devices/nm-device-logging.h | 12 +- src/core/devices/ovs/nm-ovsdb.c | 2 +- src/core/devices/wifi/nm-wifi-common.c | 2 +- src/core/devices/wwan/nm-modem-manager.c | 6 +- src/core/dhcp/nm-dhcp-dhclient.c | 49 +- src/core/dhcp/nm-dhcp-dhcpcanon.c | 37 +- src/core/dhcp/nm-dhcp-dhcpcd.c | 39 +- src/core/dhcp/nm-dhcp-helper.c | 4 +- src/core/dns/nm-dns-manager.c | 14 +- src/core/main.c | 2 +- src/core/nm-audit-manager.c | 2 +- src/core/nm-connectivity.c | 2 +- src/core/nm-core-utils.c | 4 +- src/core/nm-core-utils.h | 2 +- src/core/nm-hostname-manager.c | 14 +- src/core/nm-iface-helper.c | 2 +- src/core/nm-ip4-config.h | 14 +- src/core/nm-session-monitor.c | 10 +- src/core/nm-sleep-monitor.c | 40 +- src/core/nm-test-utils-core.h | 12 +- src/core/nm-types.h | 2 +- src/core/ppp/nm-ppp-manager.c | 4 +- src/core/settings/nm-settings.c | 2 +- src/core/supplicant/nm-supplicant-types.h | 4 +- src/libnm-client-impl/nm-dbus-helpers.h | 2 +- src/libnm-client-impl/nm-dhcp4-config.h | 2 +- src/libnm-client-impl/nm-dhcp6-config.h | 2 +- src/libnm-client-impl/nm-dns-manager.h | 2 +- src/libnm-client-impl/nm-ip4-config.h | 2 +- src/libnm-client-impl/nm-ip6-config.h | 2 +- src/libnm-client-impl/nm-object-private.h | 2 +- .../nm-remote-connection-private.h | 2 +- src/libnm-client-impl/tests/test-libnm.c | 2 +- src/libnm-client-public/NetworkManager.h | 10 +- src/libnm-client-public/nm-access-point.h | 2 +- .../nm-active-connection.h | 2 +- src/libnm-client-public/nm-checkpoint.h | 2 +- src/libnm-client-public/nm-client.h | 2 +- src/libnm-client-public/nm-device-6lowpan.h | 2 +- src/libnm-client-public/nm-device-adsl.h | 2 +- src/libnm-client-public/nm-device-bond.h | 2 +- src/libnm-client-public/nm-device-bridge.h | 2 +- src/libnm-client-public/nm-device-bt.h | 2 +- src/libnm-client-public/nm-device-dummy.h | 2 +- src/libnm-client-public/nm-device-ethernet.h | 2 +- src/libnm-client-public/nm-device-generic.h | 2 +- .../nm-device-infiniband.h | 2 +- src/libnm-client-public/nm-device-ip-tunnel.h | 2 +- src/libnm-client-public/nm-device-macsec.h | 2 +- src/libnm-client-public/nm-device-macvlan.h | 2 +- src/libnm-client-public/nm-device-modem.h | 2 +- src/libnm-client-public/nm-device-olpc-mesh.h | 2 +- .../nm-device-ovs-bridge.h | 2 +- .../nm-device-ovs-interface.h | 2 +- src/libnm-client-public/nm-device-ovs-port.h | 2 +- src/libnm-client-public/nm-device-ppp.h | 2 +- src/libnm-client-public/nm-device-team.h | 2 +- src/libnm-client-public/nm-device-tun.h | 2 +- src/libnm-client-public/nm-device-veth.h | 2 +- src/libnm-client-public/nm-device-vlan.h | 2 +- src/libnm-client-public/nm-device-vrf.h | 2 +- src/libnm-client-public/nm-device-vxlan.h | 2 +- src/libnm-client-public/nm-device-wifi-p2p.h | 2 +- src/libnm-client-public/nm-device-wifi.h | 2 +- src/libnm-client-public/nm-device-wimax.h | 2 +- src/libnm-client-public/nm-device-wireguard.h | 2 +- src/libnm-client-public/nm-device-wpan.h | 2 +- src/libnm-client-public/nm-device.h | 2 +- src/libnm-client-public/nm-dhcp-config.h | 2 +- src/libnm-client-public/nm-ip-config.h | 2 +- src/libnm-client-public/nm-object.h | 2 +- .../nm-remote-connection.h | 2 +- src/libnm-client-public/nm-vpn-connection.h | 2 +- src/libnm-client-public/nm-vpn-editor.h | 2 +- .../nm-vpn-service-plugin.h | 2 +- src/libnm-client-public/nm-wifi-p2p-peer.h | 2 +- src/libnm-client-public/nm-wimax-nsp.h | 2 +- src/libnm-core-impl/nm-connection-private.h | 2 +- .../nm-meta-setting-base-impl.c | 4 +- src/libnm-core-impl/nm-property-compare.h | 2 +- src/libnm-core-impl/nm-setting-private.h | 2 +- src/libnm-core-impl/nm-setting-wpan.c | 6 +- src/libnm-core-impl/nm-team-utils.h | 2 +- src/libnm-core-impl/nm-utils-private.h | 2 +- src/libnm-core-impl/tests/test-setting.c | 2 +- src/libnm-core-intern/nm-core-internal.h | 2 +- src/libnm-core-intern/nm-keyfile-internal.h | 2 +- src/libnm-core-intern/nm-keyfile-utils.h | 2 +- .../nm-meta-setting-base-impl.h | 4 +- src/libnm-core-public/nm-connection.h | 2 +- src/libnm-core-public/nm-dbus-interface.h | 8 +- src/libnm-core-public/nm-keyfile.h | 2 +- src/libnm-core-public/nm-setting-6lowpan.h | 2 +- src/libnm-core-public/nm-setting-8021x.h | 2 +- src/libnm-core-public/nm-setting-adsl.h | 2 +- src/libnm-core-public/nm-setting-bluetooth.h | 2 +- src/libnm-core-public/nm-setting-bond.h | 2 +- .../nm-setting-bridge-port.h | 2 +- src/libnm-core-public/nm-setting-bridge.h | 2 +- src/libnm-core-public/nm-setting-cdma.h | 2 +- src/libnm-core-public/nm-setting-connection.h | 2 +- src/libnm-core-public/nm-setting-dcb.h | 2 +- src/libnm-core-public/nm-setting-dummy.h | 2 +- src/libnm-core-public/nm-setting-ethtool.h | 2 +- src/libnm-core-public/nm-setting-generic.h | 2 +- src/libnm-core-public/nm-setting-gsm.h | 2 +- src/libnm-core-public/nm-setting-hostname.h | 2 +- src/libnm-core-public/nm-setting-infiniband.h | 2 +- src/libnm-core-public/nm-setting-ip-config.h | 2 +- src/libnm-core-public/nm-setting-ip-tunnel.h | 2 +- src/libnm-core-public/nm-setting-ip4-config.h | 2 +- src/libnm-core-public/nm-setting-ip6-config.h | 2 +- src/libnm-core-public/nm-setting-macsec.h | 2 +- src/libnm-core-public/nm-setting-macvlan.h | 2 +- src/libnm-core-public/nm-setting-match.h | 2 +- src/libnm-core-public/nm-setting-olpc-mesh.h | 2 +- src/libnm-core-public/nm-setting-ovs-bridge.h | 2 +- src/libnm-core-public/nm-setting-ovs-dpdk.h | 2 +- .../nm-setting-ovs-external-ids.h | 2 +- .../nm-setting-ovs-interface.h | 2 +- src/libnm-core-public/nm-setting-ovs-patch.h | 2 +- src/libnm-core-public/nm-setting-ovs-port.h | 2 +- src/libnm-core-public/nm-setting-ppp.h | 2 +- src/libnm-core-public/nm-setting-pppoe.h | 2 +- src/libnm-core-public/nm-setting-proxy.h | 2 +- src/libnm-core-public/nm-setting-serial.h | 2 +- src/libnm-core-public/nm-setting-sriov.h | 2 +- src/libnm-core-public/nm-setting-tc-config.h | 2 +- src/libnm-core-public/nm-setting-team-port.h | 2 +- src/libnm-core-public/nm-setting-team.h | 2 +- src/libnm-core-public/nm-setting-tun.h | 2 +- src/libnm-core-public/nm-setting-user.h | 2 +- src/libnm-core-public/nm-setting-veth.h | 2 +- src/libnm-core-public/nm-setting-vlan.h | 2 +- src/libnm-core-public/nm-setting-vpn.h | 2 +- src/libnm-core-public/nm-setting-vrf.h | 2 +- src/libnm-core-public/nm-setting-vxlan.h | 2 +- src/libnm-core-public/nm-setting-wifi-p2p.h | 2 +- src/libnm-core-public/nm-setting-wimax.h | 2 +- src/libnm-core-public/nm-setting-wired.h | 2 +- src/libnm-core-public/nm-setting-wireguard.h | 2 +- .../nm-setting-wireless-security.h | 2 +- src/libnm-core-public/nm-setting-wireless.h | 2 +- src/libnm-core-public/nm-setting-wpan.h | 2 +- src/libnm-core-public/nm-setting.h | 2 +- src/libnm-core-public/nm-simple-connection.h | 2 +- src/libnm-core-public/nm-utils.h | 2 +- src/libnm-core-public/nm-version.h | 242 ++++---- src/libnm-core-public/nm-vpn-dbus-interface.h | 4 +- src/libnm-core-public/nm-vpn-editor-plugin.h | 2 +- src/libnm-glib-aux/nm-default-glib.h | 24 +- src/libnm-glib-aux/nm-gassert-patch.h | 68 +-- src/libnm-glib-aux/nm-glib.h | 314 +++++------ src/libnm-glib-aux/nm-hash-utils.h | 12 +- src/libnm-glib-aux/nm-jansson.h | 22 +- src/libnm-glib-aux/nm-json-aux.c | 4 +- src/libnm-glib-aux/nm-logging-fwd.h | 126 ++--- src/libnm-glib-aux/nm-macros-internal.h | 213 ++++--- src/libnm-glib-aux/nm-random-utils.c | 4 +- src/libnm-glib-aux/nm-shared-utils.h | 80 +-- src/libnm-glib-aux/nm-test-utils.h | 523 +++++++++--------- src/libnm-glib-aux/nm-value-type.h | 42 +- src/libnm-log-core/nm-logging.c | 60 +- src/libnm-log-core/nm-logging.h | 2 +- src/libnm-platform/nm-linux-platform.c | 12 +- src/libnm-platform/nm-netlink.c | 4 +- src/libnm-platform/nm-netlink.h | 2 +- src/libnm-platform/nm-platform-utils.c | 14 +- src/libnm-platform/nm-platform.h | 4 +- src/libnm-platform/wifi/nm-wifi-utils-wext.c | 2 +- src/libnm-platform/wifi/nm-wifi-utils.c | 2 +- src/libnm-std-aux/nm-default-std.h | 18 +- src/libnm-std-aux/nm-std-aux.h | 100 ++-- .../sd-adapt-core/nm-sd-adapt-core.h | 82 +-- .../sd-adapt-shared/nm-sd-adapt-shared.h | 98 ++-- src/libnmc-base/qrcodegen.c | 4 +- .../nm-meta-setting-base-impl.c | 4 +- .../nm-meta-setting-base-impl.h | 4 +- src/libnmc-setting/nm-meta-setting-desc.c | 2 +- src/linux-headers/nl802154.h | 4 +- src/nm-cloud-setup/nm-cloud-setup-utils.h | 2 +- src/nm-daemon-helper/nm-daemon-helper.c | 2 +- src/nmcli/nmcli.c | 4 +- src/nmtui/nm-editor-utils.c | 2 +- 187 files changed, 1346 insertions(+), 1355 deletions(-) diff --git a/.clang-format b/.clang-format index 8538f3dfe8..ebb662e482 100644 --- a/.clang-format +++ b/.clang-format @@ -44,7 +44,7 @@ BreakStringLiterals: true IncludeBlocks: Preserve IndentCaseLabels: false IndentGotoLabels: false -IndentPPDirectives: BeforeHash +IndentPPDirectives: None IndentWrappedFunctionNames: false KeepEmptyLinesAtTheStartOfBlocks: false MaxEmptyLinesToKeep: 1 diff --git a/src/contrib/nm-compat.h b/src/contrib/nm-compat.h index 33eaec1253..7614194fc2 100644 --- a/src/contrib/nm-compat.h +++ b/src/contrib/nm-compat.h @@ -15,23 +15,23 @@ const char **_nm_setting_vpn_get_data_keys(NMSettingVpn *setting, guint *out_len const char **_nm_setting_vpn_get_secret_keys(NMSettingVpn *setting, guint *out_length); #if NM_CHECK_VERSION(1, 11, 0) - #define nm_setting_vpn_get_data_keys(setting, out_length) \ - ({ \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - nm_setting_vpn_get_data_keys(setting, out_length); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - }) - #define nm_setting_vpn_get_secret_keys(setting, out_length) \ - ({ \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - nm_setting_vpn_get_secret_keys(setting, out_length); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - }) +#define nm_setting_vpn_get_data_keys(setting, out_length) \ + ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + nm_setting_vpn_get_data_keys(setting, out_length); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) +#define nm_setting_vpn_get_secret_keys(setting, out_length) \ + ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + nm_setting_vpn_get_secret_keys(setting, out_length); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) #else - #define nm_setting_vpn_get_data_keys(setting, out_length) \ - _nm_setting_vpn_get_data_keys(setting, out_length) - #define nm_setting_vpn_get_secret_keys(setting, out_length) \ - _nm_setting_vpn_get_secret_keys(setting, out_length) +#define nm_setting_vpn_get_data_keys(setting, out_length) \ + _nm_setting_vpn_get_data_keys(setting, out_length) +#define nm_setting_vpn_get_secret_keys(setting, out_length) \ + _nm_setting_vpn_get_secret_keys(setting, out_length) #endif /*****************************************************************************/ @@ -39,15 +39,15 @@ const char **_nm_setting_vpn_get_secret_keys(NMSettingVpn *setting, guint *out_l /* possibly missing defines from newer libnm API. */ #ifndef NM_VPN_PLUGIN_CONFIG_PROXY_PAC - #define NM_VPN_PLUGIN_CONFIG_PROXY_PAC "pac" +#define NM_VPN_PLUGIN_CONFIG_PROXY_PAC "pac" #endif #ifndef NM_VPN_PLUGIN_IP4_CONFIG_PRESERVE_ROUTES - #define NM_VPN_PLUGIN_IP4_CONFIG_PRESERVE_ROUTES "preserve-routes" +#define NM_VPN_PLUGIN_IP4_CONFIG_PRESERVE_ROUTES "preserve-routes" #endif #ifndef NM_VPN_PLUGIN_IP6_CONFIG_PRESERVE_ROUTES - #define NM_VPN_PLUGIN_IP6_CONFIG_PRESERVE_ROUTES "preserve-routes" +#define NM_VPN_PLUGIN_IP6_CONFIG_PRESERVE_ROUTES "preserve-routes" #endif /*****************************************************************************/ diff --git a/src/core/devices/bluetooth/nm-bluez-manager.c b/src/core/devices/bluetooth/nm-bluez-manager.c index fc081580f4..94875e40b5 100644 --- a/src/core/devices/bluetooth/nm-bluez-manager.c +++ b/src/core/devices/bluetooth/nm-bluez-manager.c @@ -31,9 +31,9 @@ /*****************************************************************************/ #if WITH_BLUEZ5_DUN - #define _NM_BT_CAPABILITY_SUPPORTED_DUN NM_BT_CAPABILITY_DUN +#define _NM_BT_CAPABILITY_SUPPORTED_DUN NM_BT_CAPABILITY_DUN #else - #define _NM_BT_CAPABILITY_SUPPORTED_DUN NM_BT_CAPABILITY_NONE +#define _NM_BT_CAPABILITY_SUPPORTED_DUN NM_BT_CAPABILITY_NONE #endif #define _NM_BT_CAPABILITY_SUPPORTED (NM_BT_CAPABILITY_NAP | _NM_BT_CAPABILITY_SUPPORTED_DUN) diff --git a/src/core/devices/nm-device-logging.h b/src/core/devices/nm-device-logging.h index 844e994940..c2602189f3 100644 --- a/src/core/devices/nm-device-logging.h +++ b/src/core/devices/nm-device-logging.h @@ -9,15 +9,13 @@ #include "nm-device.h" #if !_NM_CC_SUPPORT_GENERIC - #define _NM_DEVICE_CAST(self) ((NMDevice *) (self)) +#define _NM_DEVICE_CAST(self) ((NMDevice *) (self)) #elif !defined(_NMLOG_DEVICE_TYPE) - #define _NM_DEVICE_CAST(self) \ - _Generic((self), NMDevice * \ - : ((NMDevice *) (self)), NMDevice *const \ - : ((NMDevice *) (self))) +#define _NM_DEVICE_CAST(self) \ + _Generic((self), NMDevice * : ((NMDevice *) (self)), NMDevice *const : ((NMDevice *) (self))) #else - #define _NM_DEVICE_CAST(self) \ - _Generic((self), \ +#define _NM_DEVICE_CAST(self) \ + _Generic((self), \ _NMLOG_DEVICE_TYPE * : ((NMDevice *) (self)), \ _NMLOG_DEVICE_TYPE * const: ((NMDevice *) (self)), \ NMDevice * : ((NMDevice *) (self)), \ diff --git a/src/core/devices/ovs/nm-ovsdb.c b/src/core/devices/ovs/nm-ovsdb.c index b8d5311a7a..4f72e9fa9d 100644 --- a/src/core/devices/ovs/nm-ovsdb.c +++ b/src/core/devices/ovs/nm-ovsdb.c @@ -25,7 +25,7 @@ /*****************************************************************************/ #if JANSSON_VERSION_HEX < 0x020400 - #warning "requires at least libjansson 2.4" +#warning "requires at least libjansson 2.4" #endif typedef struct { diff --git a/src/core/devices/wifi/nm-wifi-common.c b/src/core/devices/wifi/nm-wifi-common.c index b98ef2227e..d029ce7f2a 100644 --- a/src/core/devices/wifi/nm-wifi-common.c +++ b/src/core/devices/wifi/nm-wifi-common.c @@ -13,7 +13,7 @@ #include "nm-dbus-manager.h" #if WITH_IWD - #include "nm-device-iwd.h" +#include "nm-device-iwd.h" #endif /*****************************************************************************/ diff --git a/src/core/devices/wwan/nm-modem-manager.c b/src/core/devices/wwan/nm-modem-manager.c index 4fb9a37895..8d087d1331 100644 --- a/src/core/devices/wwan/nm-modem-manager.c +++ b/src/core/devices/wwan/nm-modem-manager.c @@ -12,9 +12,9 @@ #include #if HAVE_LIBSYSTEMD - #include +#include #else - #define sd_booted() FALSE +#define sd_booted() FALSE #endif #include "libnm-std-aux/nm-dbus-compat.h" @@ -22,7 +22,7 @@ #include "nm-modem-broadband.h" #if WITH_OFONO - #include "nm-modem-ofono.h" +#include "nm-modem-ofono.h" #endif #define MODEM_POKE_INTERVAL 120 diff --git a/src/core/dhcp/nm-dhcp-dhclient.c b/src/core/dhcp/nm-dhcp-dhclient.c index 5077407f0e..970a51f5dd 100644 --- a/src/core/dhcp/nm-dhcp-dhclient.c +++ b/src/core/dhcp/nm-dhcp-dhclient.c @@ -14,21 +14,21 @@ #if WITH_DHCLIENT - #include - #include - #include - #include - #include - #include +#include +#include +#include +#include +#include +#include - #include "libnm-glib-aux/nm-dedup-multi.h" +#include "libnm-glib-aux/nm-dedup-multi.h" - #include "nm-utils.h" - #include "nm-dhcp-dhclient-utils.h" - #include "nm-dhcp-manager.h" - #include "NetworkManagerUtils.h" - #include "nm-dhcp-listener.h" - #include "nm-dhcp-client-logging.h" +#include "nm-utils.h" +#include "nm-dhcp-dhclient-utils.h" +#include "nm-dhcp-manager.h" +#include "NetworkManagerUtils.h" +#include "nm-dhcp-listener.h" +#include "nm-dhcp-client-logging.h" /*****************************************************************************/ @@ -41,16 +41,15 @@ _addr_family_to_path_part(int addr_family) /*****************************************************************************/ - #define NM_TYPE_DHCP_DHCLIENT (nm_dhcp_dhclient_get_type()) - #define NM_DHCP_DHCLIENT(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_DHCP_DHCLIENT, NMDhcpDhclient)) - #define NM_DHCP_DHCLIENT_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_DHCP_DHCLIENT, NMDhcpDhclientClass)) - #define NM_IS_DHCP_DHCLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_DHCP_DHCLIENT)) - #define NM_IS_DHCP_DHCLIENT_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_DHCP_DHCLIENT)) - #define NM_DHCP_DHCLIENT_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_DHCP_DHCLIENT, NMDhcpDhclientClass)) +#define NM_TYPE_DHCP_DHCLIENT (nm_dhcp_dhclient_get_type()) +#define NM_DHCP_DHCLIENT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_DHCP_DHCLIENT, NMDhcpDhclient)) +#define NM_DHCP_DHCLIENT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_DHCP_DHCLIENT, NMDhcpDhclientClass)) +#define NM_IS_DHCP_DHCLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_DHCP_DHCLIENT)) +#define NM_IS_DHCP_DHCLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_DHCP_DHCLIENT)) +#define NM_DHCP_DHCLIENT_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_DHCP_DHCLIENT, NMDhcpDhclientClass)) typedef struct _NMDhcpDhclient NMDhcpDhclient; typedef struct _NMDhcpDhclientClass NMDhcpDhclientClass; @@ -78,8 +77,8 @@ struct _NMDhcpDhclientClass { G_DEFINE_TYPE(NMDhcpDhclient, nm_dhcp_dhclient, NM_TYPE_DHCP_CLIENT) - #define NM_DHCP_DHCLIENT_GET_PRIVATE(self) \ - _NM_GET_PRIVATE(self, NMDhcpDhclient, NM_IS_DHCP_DHCLIENT) +#define NM_DHCP_DHCLIENT_GET_PRIVATE(self) \ + _NM_GET_PRIVATE(self, NMDhcpDhclient, NM_IS_DHCP_DHCLIENT) /*****************************************************************************/ diff --git a/src/core/dhcp/nm-dhcp-dhcpcanon.c b/src/core/dhcp/nm-dhcp-dhcpcanon.c index 2be64c09f2..f993ffb940 100644 --- a/src/core/dhcp/nm-dhcp-dhcpcanon.c +++ b/src/core/dhcp/nm-dhcp-dhcpcanon.c @@ -7,25 +7,24 @@ #if WITH_DHCPCANON - #include - #include +#include +#include - #include "nm-utils.h" - #include "nm-dhcp-manager.h" - #include "NetworkManagerUtils.h" - #include "nm-dhcp-listener.h" - #include "nm-dhcp-client-logging.h" +#include "nm-utils.h" +#include "nm-dhcp-manager.h" +#include "NetworkManagerUtils.h" +#include "nm-dhcp-listener.h" +#include "nm-dhcp-client-logging.h" - #define NM_TYPE_DHCP_DHCPCANON (nm_dhcp_dhcpcanon_get_type()) - #define NM_DHCP_DHCPCANON(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_DHCP_DHCPCANON, NMDhcpDhcpcanon)) - #define NM_DHCP_DHCPCANON_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_DHCP_DHCPCANON, NMDhcpDhcpcanonClass)) - #define NM_IS_DHCP_DHCPCANON(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_DHCP_DHCPCANON)) - #define NM_IS_DHCP_DHCPCANON_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_DHCP_DHCPCANON)) - #define NM_DHCP_DHCPCANON_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_DHCP_DHCPCANON, NMDhcpDhcpcanonClass)) +#define NM_TYPE_DHCP_DHCPCANON (nm_dhcp_dhcpcanon_get_type()) +#define NM_DHCP_DHCPCANON(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_DHCP_DHCPCANON, NMDhcpDhcpcanon)) +#define NM_DHCP_DHCPCANON_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_DHCP_DHCPCANON, NMDhcpDhcpcanonClass)) +#define NM_IS_DHCP_DHCPCANON(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_DHCP_DHCPCANON)) +#define NM_IS_DHCP_DHCPCANON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_DHCP_DHCPCANON)) +#define NM_DHCP_DHCPCANON_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_DHCP_DHCPCANON, NMDhcpDhcpcanonClass)) typedef struct _NMDhcpDhcpcanon NMDhcpDhcpcanon; typedef struct _NMDhcpDhcpcanonClass NMDhcpDhcpcanonClass; @@ -53,8 +52,8 @@ struct _NMDhcpDhcpcanonClass { G_DEFINE_TYPE(NMDhcpDhcpcanon, nm_dhcp_dhcpcanon, NM_TYPE_DHCP_CLIENT) - #define NM_DHCP_DHCPCANON_GET_PRIVATE(self) \ - _NM_GET_PRIVATE(self, NMDhcpDhcpcanon, NM_IS_DHCP_DHCPCANON) +#define NM_DHCP_DHCPCANON_GET_PRIVATE(self) \ + _NM_GET_PRIVATE(self, NMDhcpDhcpcanon, NM_IS_DHCP_DHCPCANON) /*****************************************************************************/ diff --git a/src/core/dhcp/nm-dhcp-dhcpcd.c b/src/core/dhcp/nm-dhcp-dhcpcd.c index 86269f9306..7522156bef 100644 --- a/src/core/dhcp/nm-dhcp-dhcpcd.c +++ b/src/core/dhcp/nm-dhcp-dhcpcd.c @@ -8,29 +8,28 @@ #if WITH_DHCPCD - #include - #include - #include - #include - #include +#include +#include +#include +#include +#include - #include "nm-dhcp-manager.h" - #include "nm-utils.h" - #include "NetworkManagerUtils.h" - #include "nm-dhcp-listener.h" - #include "nm-dhcp-client-logging.h" +#include "nm-dhcp-manager.h" +#include "nm-utils.h" +#include "NetworkManagerUtils.h" +#include "nm-dhcp-listener.h" +#include "nm-dhcp-client-logging.h" /*****************************************************************************/ - #define NM_TYPE_DHCP_DHCPCD (nm_dhcp_dhcpcd_get_type()) - #define NM_DHCP_DHCPCD(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_DHCP_DHCPCD, NMDhcpDhcpcd)) - #define NM_DHCP_DHCPCD_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_DHCP_DHCPCD, NMDhcpDhcpcdClass)) - #define NM_IS_DHCP_DHCPCD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_DHCP_DHCPCD)) - #define NM_IS_DHCP_DHCPCD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_DHCP_DHCPCD)) - #define NM_DHCP_DHCPCD_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_DHCP_DHCPCD, NMDhcpDhcpcdClass)) +#define NM_TYPE_DHCP_DHCPCD (nm_dhcp_dhcpcd_get_type()) +#define NM_DHCP_DHCPCD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_DHCP_DHCPCD, NMDhcpDhcpcd)) +#define NM_DHCP_DHCPCD_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_DHCP_DHCPCD, NMDhcpDhcpcdClass)) +#define NM_IS_DHCP_DHCPCD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_DHCP_DHCPCD)) +#define NM_IS_DHCP_DHCPCD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_DHCP_DHCPCD)) +#define NM_DHCP_DHCPCD_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_DHCP_DHCPCD, NMDhcpDhcpcdClass)) typedef struct _NMDhcpDhcpcd NMDhcpDhcpcd; typedef struct _NMDhcpDhcpcdClass NMDhcpDhcpcdClass; @@ -54,7 +53,7 @@ struct _NMDhcpDhcpcdClass { G_DEFINE_TYPE(NMDhcpDhcpcd, nm_dhcp_dhcpcd, NM_TYPE_DHCP_CLIENT) - #define NM_DHCP_DHCPCD_GET_PRIVATE(self) _NM_GET_PRIVATE(self, NMDhcpDhcpcd, NM_IS_DHCP_DHCPCD) +#define NM_DHCP_DHCPCD_GET_PRIVATE(self) _NM_GET_PRIVATE(self, NMDhcpDhcpcd, NM_IS_DHCP_DHCPCD) /*****************************************************************************/ diff --git a/src/core/dhcp/nm-dhcp-helper.c b/src/core/dhcp/nm-dhcp-helper.c index 56d2010158..fd66667651 100644 --- a/src/core/dhcp/nm-dhcp-helper.c +++ b/src/core/dhcp/nm-dhcp-helper.c @@ -16,9 +16,9 @@ /*****************************************************************************/ #if NM_MORE_LOGGING - #define _NMLOG_ENABLED(level) TRUE +#define _NMLOG_ENABLED(level) TRUE #else - #define _NMLOG_ENABLED(level) ((level) <= LOG_ERR) +#define _NMLOG_ENABLED(level) ((level) <= LOG_ERR) #endif #define _NMLOG(always_enabled, level, ...) \ diff --git a/src/core/dns/nm-dns-manager.c b/src/core/dns/nm-dns-manager.c index 4c498c8248..4fec0afdd3 100644 --- a/src/core/dns/nm-dns-manager.c +++ b/src/core/dns/nm-dns-manager.c @@ -19,7 +19,7 @@ #include #if WITH_LIBPSL - #include +#include #endif #include "libnm-glib-aux/nm-str-buf.h" @@ -42,17 +42,17 @@ #define HASH_LEN NM_UTILS_CHECKSUM_LENGTH_SHA1 #ifndef RESOLVCONF_PATH - #define RESOLVCONF_PATH "/sbin/resolvconf" - #define HAS_RESOLVCONF 0 +#define RESOLVCONF_PATH "/sbin/resolvconf" +#define HAS_RESOLVCONF 0 #else - #define HAS_RESOLVCONF 1 +#define HAS_RESOLVCONF 1 #endif #ifndef NETCONFIG_PATH - #define NETCONFIG_PATH "/sbin/netconfig" - #define HAS_NETCONFIG 0 +#define NETCONFIG_PATH "/sbin/netconfig" +#define HAS_NETCONFIG 0 #else - #define HAS_NETCONFIG 1 +#define HAS_NETCONFIG 1 #endif /*****************************************************************************/ diff --git a/src/core/main.c b/src/core/main.c index 3cb5c07f7f..01dc94feed 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -38,7 +38,7 @@ #include "nm-netns.h" #if !defined(NM_DIST_VERSION) - #define NM_DIST_VERSION VERSION +#define NM_DIST_VERSION VERSION #endif #define NM_DEFAULT_PID_FILE NMRUNDIR "/NetworkManager.pid" diff --git a/src/core/nm-audit-manager.c b/src/core/nm-audit-manager.c index 2ef5d86097..477e17983a 100644 --- a/src/core/nm-audit-manager.c +++ b/src/core/nm-audit-manager.c @@ -8,7 +8,7 @@ #include "nm-audit-manager.h" #if HAVE_LIBAUDIT - #include +#include #endif #define NM_VALUE_TYPE_DEFINE_FUNCTIONS diff --git a/src/core/nm-connectivity.c b/src/core/nm-connectivity.c index 2c412341b7..13fb026514 100644 --- a/src/core/nm-connectivity.c +++ b/src/core/nm-connectivity.c @@ -10,7 +10,7 @@ #include "nm-connectivity.h" #if WITH_CONCHECK - #include +#include #endif #include diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c index 364625159e..972d40b081 100644 --- a/src/core/nm-core-utils.c +++ b/src/core/nm-core-utils.c @@ -39,8 +39,8 @@ #include "nm-setting-wireless-security.h" #ifdef __NM_SD_UTILS_H__ - #error \ - "nm-core-utils.c should stay independent of systemd utils. Are you looking for NetworkMangerUtils.c? " +#error \ + "nm-core-utils.c should stay independent of systemd utils. Are you looking for NetworkMangerUtils.c? " #endif G_STATIC_ASSERT(sizeof(NMUtilsTestFlags) <= sizeof(int)); diff --git a/src/core/nm-core-utils.h b/src/core/nm-core-utils.h index bcb182b849..920330bc43 100644 --- a/src/core/nm-core-utils.h +++ b/src/core/nm-core-utils.h @@ -40,7 +40,7 @@ void _nm_singleton_instance_register_destruction(GObject *instance); /* By default, the getter will assert that the singleton will be created only once. You can * change this by redefining NM_DEFINE_SINGLETON_ALLOW_MULTIPLE. */ #ifndef NM_DEFINE_SINGLETON_ALLOW_MULTIPLE - #define NM_DEFINE_SINGLETON_ALLOW_MULTIPLE FALSE +#define NM_DEFINE_SINGLETON_ALLOW_MULTIPLE FALSE #endif #define NM_DEFINE_SINGLETON_GETTER(TYPE, GETTER, GTYPE, ...) \ diff --git a/src/core/nm-hostname-manager.c b/src/core/nm-hostname-manager.c index 6092ed782b..32dc2db994 100644 --- a/src/core/nm-hostname-manager.c +++ b/src/core/nm-hostname-manager.c @@ -10,8 +10,8 @@ #include #if HAVE_SELINUX - #include - #include +#include +#include #endif #include "libnm-core-aux-intern/nm-common-macros.h" @@ -37,17 +37,17 @@ #if (defined(HOSTNAME_PERSIST_SUSE) + defined(HOSTNAME_PERSIST_SLACKWARE) \ + defined(HOSTNAME_PERSIST_GENTOO)) \ > 1 - #error "Can only define one of HOSTNAME_PERSIST_*" +#error "Can only define one of HOSTNAME_PERSIST_*" #endif #if defined(HOSTNAME_PERSIST_SUSE) - #define HOSTNAME_FILE HOSTNAME_FILE_UCASE_HOSTNAME +#define HOSTNAME_FILE HOSTNAME_FILE_UCASE_HOSTNAME #elif defined(HOSTNAME_PERSIST_SLACKWARE) - #define HOSTNAME_FILE HOSTNAME_FILE_UCASE_HOSTNAME +#define HOSTNAME_FILE HOSTNAME_FILE_UCASE_HOSTNAME #elif defined(HOSTNAME_PERSIST_GENTOO) - #define HOSTNAME_FILE HOSTNAME_FILE_GENTOO +#define HOSTNAME_FILE HOSTNAME_FILE_GENTOO #else - #define HOSTNAME_FILE HOSTNAME_FILE_DEFAULT +#define HOSTNAME_FILE HOSTNAME_FILE_DEFAULT #endif /*****************************************************************************/ diff --git a/src/core/nm-iface-helper.c b/src/core/nm-iface-helper.c index fedb480e3d..66338e8e1f 100644 --- a/src/core/nm-iface-helper.c +++ b/src/core/nm-iface-helper.c @@ -30,7 +30,7 @@ #include "libnm-systemd-core/nm-sd.h" #if !defined(NM_DIST_VERSION) - #define NM_DIST_VERSION VERSION +#define NM_DIST_VERSION VERSION #endif #define NMIH_PID_FILE_FMT NMRUNDIR "/nm-iface-helper-%d.pid" diff --git a/src/core/nm-ip4-config.h b/src/core/nm-ip4-config.h index fdaa6d4673..326b884def 100644 --- a/src/core/nm-ip4-config.h +++ b/src/core/nm-ip4-config.h @@ -275,7 +275,7 @@ NM_IS_IP_CONFIG_ADDR_FAMILY(gconstpointer config, int addr_family) } #if _NM_CC_SUPPORT_GENERIC - /* _NM_IS_IP_CONFIG() is a bit unusual. If _Generic() is supported, +/* _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(), * depending on the pointer type of @config. * @@ -286,10 +286,10 @@ NM_IS_IP_CONFIG_ADDR_FAMILY(gconstpointer config, int addr_family) * NMIP4Config *ptr = nm_ip4_config_new(...); * g_assert (_NM_IS_IP_CONFIG (ptr, ptr)); */ - #define _NM_IS_IP_CONFIG(typeexpr, config) \ - ({ \ - const void *const _config = (config); \ - _Generic ((typeexpr), \ +#define _NM_IS_IP_CONFIG(typeexpr, config) \ + ({ \ + const void *const _config = (config); \ + _Generic ((typeexpr), \ const void *const: (NM_IS_IP4_CONFIG (_config) || NM_IS_IP6_CONFIG (_config)), \ const void * : (NM_IS_IP4_CONFIG (_config) || NM_IS_IP6_CONFIG (_config)), \ void *const: (NM_IS_IP4_CONFIG (_config) || NM_IS_IP6_CONFIG (_config)), \ @@ -306,9 +306,9 @@ NM_IS_IP_CONFIG_ADDR_FAMILY(gconstpointer config, int addr_family) const NMIP6Config * : (NM_IS_IP6_CONFIG (_config)), \ NMIP6Config *const: (NM_IS_IP6_CONFIG (_config)), \ NMIP6Config * : (NM_IS_IP6_CONFIG (_config))); \ - }) + }) #else - #define _NM_IS_IP_CONFIG(typeexpr, config) NM_IS_IP_CONFIG(config) +#define _NM_IS_IP_CONFIG(typeexpr, config) NM_IS_IP_CONFIG(config) #endif #define NM_IP_CONFIG_CAST(config) \ diff --git a/src/core/nm-session-monitor.c b/src/core/nm-session-monitor.c index 88de1a0069..2cc99ab3b9 100644 --- a/src/core/nm-session-monitor.c +++ b/src/core/nm-session-monitor.c @@ -14,17 +14,17 @@ #include #if SESSION_TRACKING_SYSTEMD && SESSION_TRACKING_ELOGIND - #error Cannot build both systemd-logind and elogind support +#error Cannot build both systemd-logind and elogind support #endif #if SESSION_TRACKING_SYSTEMD - #include - #define LOGIND_NAME "systemd-logind" +#include +#define LOGIND_NAME "systemd-logind" #endif #if SESSION_TRACKING_ELOGIND - #include - #define LOGIND_NAME "elogind" +#include +#define LOGIND_NAME "elogind" #endif #include "NetworkManagerUtils.h" diff --git a/src/core/nm-sleep-monitor.c b/src/core/nm-sleep-monitor.c index 306453e768..76f132033e 100644 --- a/src/core/nm-sleep-monitor.c +++ b/src/core/nm-sleep-monitor.c @@ -16,23 +16,23 @@ #if defined(SUSPEND_RESUME_UPOWER) - #define SUSPEND_DBUS_NAME "org.freedesktop.UPower" - #define SUSPEND_DBUS_PATH "/org/freedesktop/UPower" - #define SUSPEND_DBUS_INTERFACE "org.freedesktop.UPower" - #define USE_UPOWER 1 - #define _NMLOG_PREFIX_NAME "sleep-monitor-up" +#define SUSPEND_DBUS_NAME "org.freedesktop.UPower" +#define SUSPEND_DBUS_PATH "/org/freedesktop/UPower" +#define SUSPEND_DBUS_INTERFACE "org.freedesktop.UPower" +#define USE_UPOWER 1 +#define _NMLOG_PREFIX_NAME "sleep-monitor-up" #elif defined(SUSPEND_RESUME_SYSTEMD) || defined(SUSPEND_RESUME_ELOGIND) - #define SUSPEND_DBUS_NAME "org.freedesktop.login1" - #define SUSPEND_DBUS_PATH "/org/freedesktop/login1" - #define SUSPEND_DBUS_INTERFACE "org.freedesktop.login1.Manager" - #define USE_UPOWER 0 - #if defined(SUSPEND_RESUME_SYSTEMD) - #define _NMLOG_PREFIX_NAME "sleep-monitor-sd" - #else - #define _NMLOG_PREFIX_NAME "sleep-monitor-el" - #endif +#define SUSPEND_DBUS_NAME "org.freedesktop.login1" +#define SUSPEND_DBUS_PATH "/org/freedesktop/login1" +#define SUSPEND_DBUS_INTERFACE "org.freedesktop.login1.Manager" +#define USE_UPOWER 0 +#if defined(SUSPEND_RESUME_SYSTEMD) +#define _NMLOG_PREFIX_NAME "sleep-monitor-sd" +#else +#define _NMLOG_PREFIX_NAME "sleep-monitor-el" +#endif #elif defined(SUSPEND_RESUME_CONSOLEKIT) @@ -40,15 +40,15 @@ * uses. http://consolekit2.github.io/ConsoleKit2/#Manager.Inhibit */ - #define SUSPEND_DBUS_NAME "org.freedesktop.ConsoleKit" - #define SUSPEND_DBUS_PATH "/org/freedesktop/ConsoleKit/Manager" - #define SUSPEND_DBUS_INTERFACE "org.freedesktop.ConsoleKit.Manager" - #define USE_UPOWER 0 - #define _NMLOG_PREFIX_NAME "sleep-monitor-ck" +#define SUSPEND_DBUS_NAME "org.freedesktop.ConsoleKit" +#define SUSPEND_DBUS_PATH "/org/freedesktop/ConsoleKit/Manager" +#define SUSPEND_DBUS_INTERFACE "org.freedesktop.ConsoleKit.Manager" +#define USE_UPOWER 0 +#define _NMLOG_PREFIX_NAME "sleep-monitor-ck" #else - #error define one of SUSPEND_RESUME_SYSTEMD, SUSPEND_RESUME_ELOGIND, SUSPEND_RESUME_CONSOLEKIT, or SUSPEND_RESUME_UPOWER +#error define one of SUSPEND_RESUME_SYSTEMD, SUSPEND_RESUME_ELOGIND, SUSPEND_RESUME_CONSOLEKIT, or SUSPEND_RESUME_UPOWER #endif diff --git a/src/core/nm-test-utils-core.h b/src/core/nm-test-utils-core.h index 99d12ba997..e037ba9229 100644 --- a/src/core/nm-test-utils-core.h +++ b/src/core/nm-test-utils-core.h @@ -222,7 +222,7 @@ nmtst_platform_ip4_routes_equal(const NMPlatformIP4Route *a, } } - #ifdef __NMP_OBJECT_H__ +#ifdef __NMP_OBJECT_H__ static inline void nmtst_platform_ip4_routes_equal_aptr(const NMPObject *const * a, @@ -242,7 +242,7 @@ nmtst_platform_ip4_routes_equal_aptr(const NMPObject *const * a, nmtst_platform_ip4_routes_equal(c_a, b, len, ignore_order); } - #endif +#endif static inline int _nmtst_platform_ip6_routes_equal_sort(gconstpointer a, gconstpointer b, gpointer user_data) @@ -291,7 +291,7 @@ nmtst_platform_ip6_routes_equal(const NMPlatformIP6Route *a, } } - #ifdef __NMP_OBJECT_H__ +#ifdef __NMP_OBJECT_H__ static inline void nmtst_platform_ip6_routes_equal_aptr(const NMPObject *const * a, @@ -311,13 +311,13 @@ nmtst_platform_ip6_routes_equal_aptr(const NMPObject *const * a, nmtst_platform_ip6_routes_equal(c_a, b, len, ignore_order); } - #endif +#endif #endif #ifdef __NETWORKMANAGER_IP4_CONFIG_H__ - #include "libnm-glib-aux/nm-dedup-multi.h" +#include "libnm-glib-aux/nm-dedup-multi.h" static inline NMIP4Config * nmtst_ip4_config_new(int ifindex) @@ -331,7 +331,7 @@ nmtst_ip4_config_new(int ifindex) #ifdef __NETWORKMANAGER_IP6_CONFIG_H__ - #include "libnm-glib-aux/nm-dedup-multi.h" +#include "libnm-glib-aux/nm-dedup-multi.h" static inline NMIP6Config * nmtst_ip6_config_new(int ifindex) diff --git a/src/core/nm-types.h b/src/core/nm-types.h index 7ad5aee15a..294cf40936 100644 --- a/src/core/nm-types.h +++ b/src/core/nm-types.h @@ -7,7 +7,7 @@ #define __NETWORKMANAGER_TYPES_H__ #if !((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_DAEMON) - #error Cannot use this header. +#error Cannot use this header. #endif /* core */ diff --git a/src/core/ppp/nm-ppp-manager.c b/src/core/ppp/nm-ppp-manager.c index fefc5d613d..e6790f2260 100644 --- a/src/core/ppp/nm-ppp-manager.c +++ b/src/core/ppp/nm-ppp-manager.c @@ -21,7 +21,7 @@ #include #ifndef aligned_u64 - #define aligned_u64 unsigned long long __attribute__((aligned(8))) +#define aligned_u64 unsigned long long __attribute__((aligned(8))) #endif #include #include @@ -761,7 +761,7 @@ create_pppd_cmd_line(NMPPPManager * self, g_return_val_if_fail(setting != NULL, NULL); #ifndef PPPD_PATH - #define PPPD_PATH NULL +#define PPPD_PATH NULL #endif pppd_binary = nm_utils_find_helper("pppd", PPPD_PATH, err); diff --git a/src/core/settings/nm-settings.c b/src/core/settings/nm-settings.c index 9da96616c6..843d073e2c 100644 --- a/src/core/settings/nm-settings.c +++ b/src/core/settings/nm-settings.c @@ -17,7 +17,7 @@ #include #if HAVE_SELINUX - #include +#include #endif #include "libnm-core-aux-intern/nm-common-macros.h" diff --git a/src/core/supplicant/nm-supplicant-types.h b/src/core/supplicant/nm-supplicant-types.h index c9b72de164..743ef8f028 100644 --- a/src/core/supplicant/nm-supplicant-types.h +++ b/src/core/supplicant/nm-supplicant-types.h @@ -14,9 +14,9 @@ #define NM_WPAS_DBUS_INTERFACE "fi.w1.wpa_supplicant1" #if HAVE_WEXT - #define NM_WPAS_DEFAULT_WIFI_DRIVER "nl80211,wext" +#define NM_WPAS_DEFAULT_WIFI_DRIVER "nl80211,wext" #else - #define NM_WPAS_DEFAULT_WIFI_DRIVER "nl80211" +#define NM_WPAS_DEFAULT_WIFI_DRIVER "nl80211" #endif #define NM_WPAS_DBUS_IFACE_INTERFACE NM_WPAS_DBUS_INTERFACE ".Interface" diff --git a/src/libnm-client-impl/nm-dbus-helpers.h b/src/libnm-client-impl/nm-dbus-helpers.h index e519f7330b..5a6b2d6293 100644 --- a/src/libnm-client-impl/nm-dbus-helpers.h +++ b/src/libnm-client-impl/nm-dbus-helpers.h @@ -7,7 +7,7 @@ #define __NM_DBUS_HELPERS_PRIVATE_H__ #if !((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE) - #error Cannot use this header. +#error Cannot use this header. #endif #include "libnm-std-aux/nm-dbus-compat.h" diff --git a/src/libnm-client-impl/nm-dhcp4-config.h b/src/libnm-client-impl/nm-dhcp4-config.h index d0ea2b4604..135720f05e 100644 --- a/src/libnm-client-impl/nm-dhcp4-config.h +++ b/src/libnm-client-impl/nm-dhcp4-config.h @@ -7,7 +7,7 @@ #define __NM_DHCP4_CONFIG_H__ #if !((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE) - #error Cannot use this header. +#error Cannot use this header. #endif #include "nm-dhcp-config.h" diff --git a/src/libnm-client-impl/nm-dhcp6-config.h b/src/libnm-client-impl/nm-dhcp6-config.h index 253594e654..adaa50509b 100644 --- a/src/libnm-client-impl/nm-dhcp6-config.h +++ b/src/libnm-client-impl/nm-dhcp6-config.h @@ -7,7 +7,7 @@ #define __NM_DHCP6_CONFIG_H__ #if !((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE) - #error Cannot use this header. +#error Cannot use this header. #endif #include "nm-dhcp-config.h" diff --git a/src/libnm-client-impl/nm-dns-manager.h b/src/libnm-client-impl/nm-dns-manager.h index 8053b243d4..e6159e617f 100644 --- a/src/libnm-client-impl/nm-dns-manager.h +++ b/src/libnm-client-impl/nm-dns-manager.h @@ -7,7 +7,7 @@ #define __NM_DNS_MANAGER_H__ #if !((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE) - #error Cannot use this header. +#error Cannot use this header. #endif #include "nm-client.h" diff --git a/src/libnm-client-impl/nm-ip4-config.h b/src/libnm-client-impl/nm-ip4-config.h index b9297dc08b..db82a0a523 100644 --- a/src/libnm-client-impl/nm-ip4-config.h +++ b/src/libnm-client-impl/nm-ip4-config.h @@ -8,7 +8,7 @@ #define __NM_IP4_CONFIG_H__ #if !((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE) - #error Cannot use this header. +#error Cannot use this header. #endif #include "nm-ip-config.h" diff --git a/src/libnm-client-impl/nm-ip6-config.h b/src/libnm-client-impl/nm-ip6-config.h index 0c7c2a9f0a..9438669166 100644 --- a/src/libnm-client-impl/nm-ip6-config.h +++ b/src/libnm-client-impl/nm-ip6-config.h @@ -8,7 +8,7 @@ #define __NM_IP6_CONFIG_H__ #if !((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE) - #error Cannot use this header. +#error Cannot use this header. #endif #include "nm-ip-config.h" diff --git a/src/libnm-client-impl/nm-object-private.h b/src/libnm-client-impl/nm-object-private.h index 9f78304d49..11afc63972 100644 --- a/src/libnm-client-impl/nm-object-private.h +++ b/src/libnm-client-impl/nm-object-private.h @@ -7,7 +7,7 @@ #define __NM_OBJECT_PRIVATE_H__ #if !((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE) - #error Cannot use this header. +#error Cannot use this header. #endif #include "nm-object.h" diff --git a/src/libnm-client-impl/nm-remote-connection-private.h b/src/libnm-client-impl/nm-remote-connection-private.h index 3ca934bf16..f086934702 100644 --- a/src/libnm-client-impl/nm-remote-connection-private.h +++ b/src/libnm-client-impl/nm-remote-connection-private.h @@ -7,7 +7,7 @@ #define __NM_REMOTE_CONNECTION_PRIVATE_H__ #if !((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE) - #error Cannot use this header. +#error Cannot use this header. #endif #define NM_REMOTE_CONNECTION_INIT_RESULT "init-result" diff --git a/src/libnm-client-impl/tests/test-libnm.c b/src/libnm-client-impl/tests/test-libnm.c index 6cb8076e38..c260aebed6 100644 --- a/src/libnm-client-impl/tests/test-libnm.c +++ b/src/libnm-client-impl/tests/test-libnm.c @@ -6,7 +6,7 @@ #include "libnm-client-impl/nm-default-libnm.h" #if defined(HAVE_DECL_MEMFD_CREATE) && HAVE_DECL_MEMFD_CREATE - #include +#include #endif #include diff --git a/src/libnm-client-public/NetworkManager.h b/src/libnm-client-public/NetworkManager.h index f9cc856555..97d3e649a1 100644 --- a/src/libnm-client-public/NetworkManager.h +++ b/src/libnm-client-public/NetworkManager.h @@ -118,13 +118,13 @@ #if !defined(NETWORKMANAGER_COMPILATION) \ && (!defined(NM_NO_INCLUDE_EXTRA_HEADERS) || !NM_NO_INCLUDE_EXTRA_HEADERS) - /* historically, NetworkManager.h drags in the following system headers. +/* historically, NetworkManager.h drags in the following system headers. * These are not strictly necessary and the user may wish to opt out from * including them. */ - #include - #include - #include - #include +#include +#include +#include +#include #endif #undef __NETWORKMANAGER_H_INSIDE__ diff --git a/src/libnm-client-public/nm-access-point.h b/src/libnm-client-public/nm-access-point.h index 0460ea0a73..50a7429601 100644 --- a/src/libnm-client-public/nm-access-point.h +++ b/src/libnm-client-public/nm-access-point.h @@ -8,7 +8,7 @@ #define __NM_ACCESS_POINT_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-object.h" diff --git a/src/libnm-client-public/nm-active-connection.h b/src/libnm-client-public/nm-active-connection.h index 44b715c7ee..76ea107a9d 100644 --- a/src/libnm-client-public/nm-active-connection.h +++ b/src/libnm-client-public/nm-active-connection.h @@ -8,7 +8,7 @@ #define __NM_ACTIVE_CONNECTION_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-object.h" diff --git a/src/libnm-client-public/nm-checkpoint.h b/src/libnm-client-public/nm-checkpoint.h index 3bc28f6f06..def1f5544c 100644 --- a/src/libnm-client-public/nm-checkpoint.h +++ b/src/libnm-client-public/nm-checkpoint.h @@ -7,7 +7,7 @@ #define __NM_CHECKPOINT_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-object.h" diff --git a/src/libnm-client-public/nm-client.h b/src/libnm-client-public/nm-client.h index 0145c5f4fc..02c8ee337b 100644 --- a/src/libnm-client-public/nm-client.h +++ b/src/libnm-client-public/nm-client.h @@ -8,7 +8,7 @@ #define __NM_CLIENT_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-types.h" diff --git a/src/libnm-client-public/nm-device-6lowpan.h b/src/libnm-client-public/nm-device-6lowpan.h index d46e6db457..2388bf3816 100644 --- a/src/libnm-client-public/nm-device-6lowpan.h +++ b/src/libnm-client-public/nm-device-6lowpan.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_6LOWPAN_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-adsl.h b/src/libnm-client-public/nm-device-adsl.h index 92eaf369f2..fa8a127899 100644 --- a/src/libnm-client-public/nm-device-adsl.h +++ b/src/libnm-client-public/nm-device-adsl.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_ADSL_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-bond.h b/src/libnm-client-public/nm-device-bond.h index 91c023a4b5..448d877901 100644 --- a/src/libnm-client-public/nm-device-bond.h +++ b/src/libnm-client-public/nm-device-bond.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_BOND_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-bridge.h b/src/libnm-client-public/nm-device-bridge.h index a6c50658a0..765f400531 100644 --- a/src/libnm-client-public/nm-device-bridge.h +++ b/src/libnm-client-public/nm-device-bridge.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_BRIDGE_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-bt.h b/src/libnm-client-public/nm-device-bt.h index a7cfc79682..c277bae99b 100644 --- a/src/libnm-client-public/nm-device-bt.h +++ b/src/libnm-client-public/nm-device-bt.h @@ -8,7 +8,7 @@ #define __NM_DEVICE_BT_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-dummy.h b/src/libnm-client-public/nm-device-dummy.h index ad34b65e55..d5b8cb2428 100644 --- a/src/libnm-client-public/nm-device-dummy.h +++ b/src/libnm-client-public/nm-device-dummy.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_DUMMY_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-ethernet.h b/src/libnm-client-public/nm-device-ethernet.h index 877930e6ad..636e5eb57a 100644 --- a/src/libnm-client-public/nm-device-ethernet.h +++ b/src/libnm-client-public/nm-device-ethernet.h @@ -8,7 +8,7 @@ #define __NM_DEVICE_ETHERNET_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-generic.h b/src/libnm-client-public/nm-device-generic.h index 5c1f308418..7b543b2ff6 100644 --- a/src/libnm-client-public/nm-device-generic.h +++ b/src/libnm-client-public/nm-device-generic.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_GENERIC_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-infiniband.h b/src/libnm-client-public/nm-device-infiniband.h index be9a26e50f..3999b2d560 100644 --- a/src/libnm-client-public/nm-device-infiniband.h +++ b/src/libnm-client-public/nm-device-infiniband.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_INFINIBAND_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-ip-tunnel.h b/src/libnm-client-public/nm-device-ip-tunnel.h index 0d9c3e55a1..d79127298b 100644 --- a/src/libnm-client-public/nm-device-ip-tunnel.h +++ b/src/libnm-client-public/nm-device-ip-tunnel.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_IP_TUNNEL_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-macsec.h b/src/libnm-client-public/nm-device-macsec.h index 5a036601e8..e468344fbb 100644 --- a/src/libnm-client-public/nm-device-macsec.h +++ b/src/libnm-client-public/nm-device-macsec.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_MACSEC_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-macvlan.h b/src/libnm-client-public/nm-device-macvlan.h index b8d2706616..ec7eb640a7 100644 --- a/src/libnm-client-public/nm-device-macvlan.h +++ b/src/libnm-client-public/nm-device-macvlan.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_MACVLAN_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-modem.h b/src/libnm-client-public/nm-device-modem.h index eced137aa8..f9dfc34815 100644 --- a/src/libnm-client-public/nm-device-modem.h +++ b/src/libnm-client-public/nm-device-modem.h @@ -8,7 +8,7 @@ #define __NM_DEVICE_MODEM_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-olpc-mesh.h b/src/libnm-client-public/nm-device-olpc-mesh.h index d8b835fac8..86ac2ce706 100644 --- a/src/libnm-client-public/nm-device-olpc-mesh.h +++ b/src/libnm-client-public/nm-device-olpc-mesh.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_OLPC_MESH_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-ovs-bridge.h b/src/libnm-client-public/nm-device-ovs-bridge.h index 50754e1109..f0ef154728 100644 --- a/src/libnm-client-public/nm-device-ovs-bridge.h +++ b/src/libnm-client-public/nm-device-ovs-bridge.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_OVS_BRIDGE_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-ovs-interface.h b/src/libnm-client-public/nm-device-ovs-interface.h index 6767ad4a0a..12b30a75b5 100644 --- a/src/libnm-client-public/nm-device-ovs-interface.h +++ b/src/libnm-client-public/nm-device-ovs-interface.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_OVS_INTERFACE_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-ovs-port.h b/src/libnm-client-public/nm-device-ovs-port.h index 1f69641bcc..170067f9cc 100644 --- a/src/libnm-client-public/nm-device-ovs-port.h +++ b/src/libnm-client-public/nm-device-ovs-port.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_OVS_PORT_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-ppp.h b/src/libnm-client-public/nm-device-ppp.h index 7bd282d709..ff99d9f974 100644 --- a/src/libnm-client-public/nm-device-ppp.h +++ b/src/libnm-client-public/nm-device-ppp.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_PPP_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif G_BEGIN_DECLS diff --git a/src/libnm-client-public/nm-device-team.h b/src/libnm-client-public/nm-device-team.h index 921353b699..eab5e4e6b4 100644 --- a/src/libnm-client-public/nm-device-team.h +++ b/src/libnm-client-public/nm-device-team.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_TEAM_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-tun.h b/src/libnm-client-public/nm-device-tun.h index ee7342de96..cc05b0c16f 100644 --- a/src/libnm-client-public/nm-device-tun.h +++ b/src/libnm-client-public/nm-device-tun.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_TUN_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-veth.h b/src/libnm-client-public/nm-device-veth.h index 689762a714..41b419156e 100644 --- a/src/libnm-client-public/nm-device-veth.h +++ b/src/libnm-client-public/nm-device-veth.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_VETH_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-vlan.h b/src/libnm-client-public/nm-device-vlan.h index 814305095a..c392058695 100644 --- a/src/libnm-client-public/nm-device-vlan.h +++ b/src/libnm-client-public/nm-device-vlan.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_VLAN_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-vrf.h b/src/libnm-client-public/nm-device-vrf.h index f835dd2f6c..3b59023acc 100644 --- a/src/libnm-client-public/nm-device-vrf.h +++ b/src/libnm-client-public/nm-device-vrf.h @@ -4,7 +4,7 @@ #define __NM_DEVICE_VRF_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-vxlan.h b/src/libnm-client-public/nm-device-vxlan.h index 9ef5eb2def..5264e9caf5 100644 --- a/src/libnm-client-public/nm-device-vxlan.h +++ b/src/libnm-client-public/nm-device-vxlan.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_VXLAN_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-wifi-p2p.h b/src/libnm-client-public/nm-device-wifi-p2p.h index 374ef4bda2..3395ca2906 100644 --- a/src/libnm-client-public/nm-device-wifi-p2p.h +++ b/src/libnm-client-public/nm-device-wifi-p2p.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_WIFI_P2P_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-wifi.h b/src/libnm-client-public/nm-device-wifi.h index bf712bbc7f..85062f518d 100644 --- a/src/libnm-client-public/nm-device-wifi.h +++ b/src/libnm-client-public/nm-device-wifi.h @@ -8,7 +8,7 @@ #define __NM_DEVICE_WIFI_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-wimax.h b/src/libnm-client-public/nm-device-wimax.h index 8a0fd901c5..123b95b26c 100644 --- a/src/libnm-client-public/nm-device-wimax.h +++ b/src/libnm-client-public/nm-device-wimax.h @@ -8,7 +8,7 @@ #define __NM_DEVICE_WIMAX_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-wireguard.h b/src/libnm-client-public/nm-device-wireguard.h index f54695ee6c..4a18bd8117 100644 --- a/src/libnm-client-public/nm-device-wireguard.h +++ b/src/libnm-client-public/nm-device-wireguard.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_WIREGUARD_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device-wpan.h b/src/libnm-client-public/nm-device-wpan.h index 7d50fd9eb0..b8a7a3bf85 100644 --- a/src/libnm-client-public/nm-device-wpan.h +++ b/src/libnm-client-public/nm-device-wpan.h @@ -7,7 +7,7 @@ #define __NM_DEVICE_WPAN_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-device.h" diff --git a/src/libnm-client-public/nm-device.h b/src/libnm-client-public/nm-device.h index 62baac924a..b98f594bb5 100644 --- a/src/libnm-client-public/nm-device.h +++ b/src/libnm-client-public/nm-device.h @@ -8,7 +8,7 @@ #define __NM_DEVICE_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-object.h" diff --git a/src/libnm-client-public/nm-dhcp-config.h b/src/libnm-client-public/nm-dhcp-config.h index 7663fb9af3..0188f9c23e 100644 --- a/src/libnm-client-public/nm-dhcp-config.h +++ b/src/libnm-client-public/nm-dhcp-config.h @@ -8,7 +8,7 @@ #define __NM_DHCP_CONFIG_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-object.h" diff --git a/src/libnm-client-public/nm-ip-config.h b/src/libnm-client-public/nm-ip-config.h index bdfebb6a57..a63dea67d0 100644 --- a/src/libnm-client-public/nm-ip-config.h +++ b/src/libnm-client-public/nm-ip-config.h @@ -8,7 +8,7 @@ #define __NM_IP_CONFIG_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-object.h" diff --git a/src/libnm-client-public/nm-object.h b/src/libnm-client-public/nm-object.h index 5f41751390..efa3aa536a 100644 --- a/src/libnm-client-public/nm-object.h +++ b/src/libnm-client-public/nm-object.h @@ -8,7 +8,7 @@ #define __NM_OBJECT_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-types.h" diff --git a/src/libnm-client-public/nm-remote-connection.h b/src/libnm-client-public/nm-remote-connection.h index e29bf07318..06088e8664 100644 --- a/src/libnm-client-public/nm-remote-connection.h +++ b/src/libnm-client-public/nm-remote-connection.h @@ -8,7 +8,7 @@ #define __NM_REMOTE_CONNECTION_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-object.h" diff --git a/src/libnm-client-public/nm-vpn-connection.h b/src/libnm-client-public/nm-vpn-connection.h index aac259d5bb..1a20d0afd7 100644 --- a/src/libnm-client-public/nm-vpn-connection.h +++ b/src/libnm-client-public/nm-vpn-connection.h @@ -8,7 +8,7 @@ #define __NM_VPN_CONNECTION_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-active-connection.h" diff --git a/src/libnm-client-public/nm-vpn-editor.h b/src/libnm-client-public/nm-vpn-editor.h index 8cd7805f4d..f89617a897 100644 --- a/src/libnm-client-public/nm-vpn-editor.h +++ b/src/libnm-client-public/nm-vpn-editor.h @@ -8,7 +8,7 @@ #define __NM_VPN_EDITOR_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include diff --git a/src/libnm-client-public/nm-vpn-service-plugin.h b/src/libnm-client-public/nm-vpn-service-plugin.h index e45622aa7d..916ea52a3d 100644 --- a/src/libnm-client-public/nm-vpn-service-plugin.h +++ b/src/libnm-client-public/nm-vpn-service-plugin.h @@ -8,7 +8,7 @@ #define __NM_VPN_SERVICE_PLUGIN_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include diff --git a/src/libnm-client-public/nm-wifi-p2p-peer.h b/src/libnm-client-public/nm-wifi-p2p-peer.h index 4ab7c0e6e6..73e6995cd2 100644 --- a/src/libnm-client-public/nm-wifi-p2p-peer.h +++ b/src/libnm-client-public/nm-wifi-p2p-peer.h @@ -7,7 +7,7 @@ #define __NM_WIFI_P2P_PEER_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-object.h" diff --git a/src/libnm-client-public/nm-wimax-nsp.h b/src/libnm-client-public/nm-wimax-nsp.h index 15b8daa04d..f19272db5a 100644 --- a/src/libnm-client-public/nm-wimax-nsp.h +++ b/src/libnm-client-public/nm-wimax-nsp.h @@ -8,7 +8,7 @@ #define __NM_WIMAX_NSP_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-object.h" diff --git a/src/libnm-core-impl/nm-connection-private.h b/src/libnm-core-impl/nm-connection-private.h index 0580625f4a..27769ec14e 100644 --- a/src/libnm-core-impl/nm-connection-private.h +++ b/src/libnm-core-impl/nm-connection-private.h @@ -7,7 +7,7 @@ #define __NM_CONNECTION_PRIVATE_H__ #if !((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_PRIVATE) - #error Cannot use this header. +#error Cannot use this header. #endif #include "nm-setting.h" diff --git a/src/libnm-core-impl/nm-meta-setting-base-impl.c b/src/libnm-core-impl/nm-meta-setting-base-impl.c index a952ced9aa..d79f2529cb 100644 --- a/src/libnm-core-impl/nm-meta-setting-base-impl.c +++ b/src/libnm-core-impl/nm-meta-setting-base-impl.c @@ -8,7 +8,7 @@ #include "nm-meta-setting-base.h" #if _NM_META_SETTING_BASE_IMPL_LIBNM - #include "libnm-core-impl/nm-default-libnm-core.h" +#include "libnm-core-impl/nm-default-libnm-core.h" #endif #include "nm-setting-6lowpan.h" @@ -64,7 +64,7 @@ #include "nm-setting-wpan.h" #if _NM_META_SETTING_BASE_IMPL_LIBNM - #include "nm-setting-private.h" +#include "nm-setting-private.h" #endif /*****************************************************************************/ diff --git a/src/libnm-core-impl/nm-property-compare.h b/src/libnm-core-impl/nm-property-compare.h index d422b1c8a4..2400bc4249 100644 --- a/src/libnm-core-impl/nm-property-compare.h +++ b/src/libnm-core-impl/nm-property-compare.h @@ -8,7 +8,7 @@ #define __NM_PROPERTY_COMPARE_H__ #if !((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_PRIVATE) - #error Cannot use this header. +#error Cannot use this header. #endif int nm_property_compare(GVariant *value1, GVariant *value2); diff --git a/src/libnm-core-impl/nm-setting-private.h b/src/libnm-core-impl/nm-setting-private.h index 434cab2ba2..a16004905b 100644 --- a/src/libnm-core-impl/nm-setting-private.h +++ b/src/libnm-core-impl/nm-setting-private.h @@ -7,7 +7,7 @@ #define __NM_SETTING_PRIVATE_H__ #if !((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_PRIVATE) - #error Cannot use this header. +#error Cannot use this header. #endif #include "nm-setting.h" diff --git a/src/libnm-core-impl/nm-setting-wpan.c b/src/libnm-core-impl/nm-setting-wpan.c index 28a6478f16..f1d532af8e 100644 --- a/src/libnm-core-impl/nm-setting-wpan.c +++ b/src/libnm-core-impl/nm-setting-wpan.c @@ -22,15 +22,15 @@ /* Ideally we'll be able to get these from a public header. */ #ifndef IEEE802154_ADDR_LEN - #define IEEE802154_ADDR_LEN 8 +#define IEEE802154_ADDR_LEN 8 #endif #ifndef IEEE802154_MAX_PAGE - #define IEEE802154_MAX_PAGE 31 +#define IEEE802154_MAX_PAGE 31 #endif #ifndef IEEE802154_MAX_CHANNEL - #define IEEE802154_MAX_CHANNEL 26 +#define IEEE802154_MAX_CHANNEL 26 #endif /*****************************************************************************/ diff --git a/src/libnm-core-impl/nm-team-utils.h b/src/libnm-core-impl/nm-team-utils.h index 2039c16ec7..41943eee8d 100644 --- a/src/libnm-core-impl/nm-team-utils.h +++ b/src/libnm-core-impl/nm-team-utils.h @@ -7,7 +7,7 @@ #define __NM_TEAM_UITLS_H__ #if !((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_PRIVATE) - #error Cannot use this header. +#error Cannot use this header. #endif #include "libnm-glib-aux/nm-value-type.h" diff --git a/src/libnm-core-impl/nm-utils-private.h b/src/libnm-core-impl/nm-utils-private.h index eb545d0fa8..5001aeb394 100644 --- a/src/libnm-core-impl/nm-utils-private.h +++ b/src/libnm-core-impl/nm-utils-private.h @@ -7,7 +7,7 @@ #define __NM_UTILS_PRIVATE_H__ #if !((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_PRIVATE) - #error Cannot use this header. +#error Cannot use this header. #endif #include "nm-setting-private.h" diff --git a/src/libnm-core-impl/tests/test-setting.c b/src/libnm-core-impl/tests/test-setting.c index 58e5e1a4a7..f29cd6a8c1 100644 --- a/src/libnm-core-impl/tests/test-setting.c +++ b/src/libnm-core-impl/tests/test-setting.c @@ -1211,7 +1211,7 @@ test_nm_json(void) #endif #if WITH_JANSSON != defined(JANSSON_SONAME) - #error "WITH_JANSON and JANSSON_SONAME are defined inconsistently." +#error "WITH_JANSON and JANSSON_SONAME are defined inconsistently." #endif } diff --git a/src/libnm-core-intern/nm-core-internal.h b/src/libnm-core-intern/nm-core-internal.h index 2ef2520956..9ffaa05fd9 100644 --- a/src/libnm-core-intern/nm-core-internal.h +++ b/src/libnm-core-intern/nm-core-internal.h @@ -17,7 +17,7 @@ * and some test programs. **/ #if !((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL) - #error Cannot use this header. +#error Cannot use this header. #endif #include "libnm-base/nm-base.h" diff --git a/src/libnm-core-intern/nm-keyfile-internal.h b/src/libnm-core-intern/nm-keyfile-internal.h index d8ccc60991..d3fd77d240 100644 --- a/src/libnm-core-intern/nm-keyfile-internal.h +++ b/src/libnm-core-intern/nm-keyfile-internal.h @@ -8,7 +8,7 @@ #define __NM_KEYFILE_INTERNAL_H__ #if !((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL) - #error Cannot use this header. +#error Cannot use this header. #endif #include diff --git a/src/libnm-core-intern/nm-keyfile-utils.h b/src/libnm-core-intern/nm-keyfile-utils.h index 450cc81cd9..4dde70295e 100644 --- a/src/libnm-core-intern/nm-keyfile-utils.h +++ b/src/libnm-core-intern/nm-keyfile-utils.h @@ -7,7 +7,7 @@ #define __NM_KEYFILE_UTILS_H__ #if !((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL) - #error Cannot use this header. +#error Cannot use this header. #endif /*****************************************************************************/ diff --git a/src/libnm-core-intern/nm-meta-setting-base-impl.h b/src/libnm-core-intern/nm-meta-setting-base-impl.h index 44bd9024c2..8aec1e8756 100644 --- a/src/libnm-core-intern/nm-meta-setting-base-impl.h +++ b/src/libnm-core-intern/nm-meta-setting-base-impl.h @@ -159,9 +159,9 @@ typedef enum _nm_packed { } NMMetaSettingType; #if _NM_META_SETTING_BASE_IMPL_LIBNM - #define _NMMetaSettingInfo_Alias _NMMetaSettingInfo +#define _NMMetaSettingInfo_Alias _NMMetaSettingInfo #else - #define _NMMetaSettingInfo_Alias _NMMetaSettingInfoCli +#define _NMMetaSettingInfo_Alias _NMMetaSettingInfoCli #endif struct _NMMetaSettingInfo_Alias { diff --git a/src/libnm-core-public/nm-connection.h b/src/libnm-core-public/nm-connection.h index fd985141a1..fb54ce88ed 100644 --- a/src/libnm-core-public/nm-connection.h +++ b/src/libnm-core-public/nm-connection.h @@ -8,7 +8,7 @@ #define __NM_CONNECTION_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-core-types.h" diff --git a/src/libnm-core-public/nm-dbus-interface.h b/src/libnm-core-public/nm-dbus-interface.h index 626b200670..7fd228ca46 100644 --- a/src/libnm-core-public/nm-dbus-interface.h +++ b/src/libnm-core-public/nm-dbus-interface.h @@ -15,8 +15,8 @@ /* This header must not include glib or libnm. */ #ifndef NM_VERSION_H - #define NM_AVAILABLE_IN_1_2 - #define NM_AVAILABLE_IN_1_8 +#define NM_AVAILABLE_IN_1_2 +#define NM_AVAILABLE_IN_1_8 #endif /* @@ -860,8 +860,8 @@ typedef enum /*< flags >*/ { } NMSecretAgentCapabilities; #ifndef NM_VERSION_H - #undef NM_AVAILABLE_IN_1_2 - #undef NM_AVAILABLE_IN_1_8 +#undef NM_AVAILABLE_IN_1_2 +#undef NM_AVAILABLE_IN_1_8 #endif #define NM_LLDP_ATTR_RAW "raw" diff --git a/src/libnm-core-public/nm-keyfile.h b/src/libnm-core-public/nm-keyfile.h index 28c052f999..e298aae8ef 100644 --- a/src/libnm-core-public/nm-keyfile.h +++ b/src/libnm-core-public/nm-keyfile.h @@ -4,7 +4,7 @@ #define __NM_KEYFILE_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-core-types.h" diff --git a/src/libnm-core-public/nm-setting-6lowpan.h b/src/libnm-core-public/nm-setting-6lowpan.h index 5a7c39866b..358ccff6e2 100644 --- a/src/libnm-core-public/nm-setting-6lowpan.h +++ b/src/libnm-core-public/nm-setting-6lowpan.h @@ -7,7 +7,7 @@ #define __NM_SETTING_6LOWPAN_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-8021x.h b/src/libnm-core-public/nm-setting-8021x.h index 98e26d12a0..f9ebdd1ce0 100644 --- a/src/libnm-core-public/nm-setting-8021x.h +++ b/src/libnm-core-public/nm-setting-8021x.h @@ -8,7 +8,7 @@ #define __NM_SETTING_8021X_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-adsl.h b/src/libnm-core-public/nm-setting-adsl.h index c655d74c0a..8c584fed4a 100644 --- a/src/libnm-core-public/nm-setting-adsl.h +++ b/src/libnm-core-public/nm-setting-adsl.h @@ -7,7 +7,7 @@ #define __NM_SETTING_ADSL_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-bluetooth.h b/src/libnm-core-public/nm-setting-bluetooth.h index 69f921eeb6..6388430a03 100644 --- a/src/libnm-core-public/nm-setting-bluetooth.h +++ b/src/libnm-core-public/nm-setting-bluetooth.h @@ -8,7 +8,7 @@ #define __NM_SETTING_BLUETOOTH_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-bond.h b/src/libnm-core-public/nm-setting-bond.h index c869e4c868..e819b4e104 100644 --- a/src/libnm-core-public/nm-setting-bond.h +++ b/src/libnm-core-public/nm-setting-bond.h @@ -7,7 +7,7 @@ #define __NM_SETTING_BOND_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-bridge-port.h b/src/libnm-core-public/nm-setting-bridge-port.h index 8e5c2b4a12..61da5ba5f7 100644 --- a/src/libnm-core-public/nm-setting-bridge-port.h +++ b/src/libnm-core-public/nm-setting-bridge-port.h @@ -7,7 +7,7 @@ #define __NM_SETTING_BRIDGE_PORT_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-bridge.h b/src/libnm-core-public/nm-setting-bridge.h index cda1861294..3a1298110b 100644 --- a/src/libnm-core-public/nm-setting-bridge.h +++ b/src/libnm-core-public/nm-setting-bridge.h @@ -7,7 +7,7 @@ #define __NM_SETTING_BRIDGE_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-cdma.h b/src/libnm-core-public/nm-setting-cdma.h index 9b72a839c9..1378f1705f 100644 --- a/src/libnm-core-public/nm-setting-cdma.h +++ b/src/libnm-core-public/nm-setting-cdma.h @@ -8,7 +8,7 @@ #define __NM_SETTING_CDMA_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-connection.h b/src/libnm-core-public/nm-setting-connection.h index 3b4da44aca..71402b58b9 100644 --- a/src/libnm-core-public/nm-setting-connection.h +++ b/src/libnm-core-public/nm-setting-connection.h @@ -8,7 +8,7 @@ #define __NM_SETTING_CONNECTION_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-dcb.h b/src/libnm-core-public/nm-setting-dcb.h index b342c46543..5378621355 100644 --- a/src/libnm-core-public/nm-setting-dcb.h +++ b/src/libnm-core-public/nm-setting-dcb.h @@ -7,7 +7,7 @@ #define __NM_SETTING_DCB_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-dummy.h b/src/libnm-core-public/nm-setting-dummy.h index 2231ea17f7..85e8a26008 100644 --- a/src/libnm-core-public/nm-setting-dummy.h +++ b/src/libnm-core-public/nm-setting-dummy.h @@ -7,7 +7,7 @@ #define __NM_SETTING_DUMMY_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-ethtool.h b/src/libnm-core-public/nm-setting-ethtool.h index eab447af09..698dcebe27 100644 --- a/src/libnm-core-public/nm-setting-ethtool.h +++ b/src/libnm-core-public/nm-setting-ethtool.h @@ -7,7 +7,7 @@ #define __NM_SETTING_ETHTOOL_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-generic.h b/src/libnm-core-public/nm-setting-generic.h index b5346abb23..9bdcd11d5f 100644 --- a/src/libnm-core-public/nm-setting-generic.h +++ b/src/libnm-core-public/nm-setting-generic.h @@ -7,7 +7,7 @@ #define __NM_SETTING_GENERIC_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-gsm.h b/src/libnm-core-public/nm-setting-gsm.h index 59703c3cd1..0d57511d9f 100644 --- a/src/libnm-core-public/nm-setting-gsm.h +++ b/src/libnm-core-public/nm-setting-gsm.h @@ -8,7 +8,7 @@ #define __NM_SETTING_GSM_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-hostname.h b/src/libnm-core-public/nm-setting-hostname.h index 02b4e373e4..f93e0efe38 100644 --- a/src/libnm-core-public/nm-setting-hostname.h +++ b/src/libnm-core-public/nm-setting-hostname.h @@ -7,7 +7,7 @@ #define NM_SETTING_HOSTNAME_H #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-infiniband.h b/src/libnm-core-public/nm-setting-infiniband.h index 3d4221330a..44f30839cb 100644 --- a/src/libnm-core-public/nm-setting-infiniband.h +++ b/src/libnm-core-public/nm-setting-infiniband.h @@ -7,7 +7,7 @@ #define __NM_SETTING_INFINIBAND_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-ip-config.h b/src/libnm-core-public/nm-setting-ip-config.h index 018216da90..8e0491a482 100644 --- a/src/libnm-core-public/nm-setting-ip-config.h +++ b/src/libnm-core-public/nm-setting-ip-config.h @@ -8,7 +8,7 @@ #define NM_SETTING_IP_CONFIG_H #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-ip-tunnel.h b/src/libnm-core-public/nm-setting-ip-tunnel.h index 0a83b0a22c..4710411cc4 100644 --- a/src/libnm-core-public/nm-setting-ip-tunnel.h +++ b/src/libnm-core-public/nm-setting-ip-tunnel.h @@ -7,7 +7,7 @@ #define __NM_SETTING_IP_TUNNEL_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-ip4-config.h b/src/libnm-core-public/nm-setting-ip4-config.h index ce917b11fb..d0bd836d4a 100644 --- a/src/libnm-core-public/nm-setting-ip4-config.h +++ b/src/libnm-core-public/nm-setting-ip4-config.h @@ -8,7 +8,7 @@ #define __NM_SETTING_IP4_CONFIG_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting-ip-config.h" diff --git a/src/libnm-core-public/nm-setting-ip6-config.h b/src/libnm-core-public/nm-setting-ip6-config.h index 5e5d459d4a..c51a74384f 100644 --- a/src/libnm-core-public/nm-setting-ip6-config.h +++ b/src/libnm-core-public/nm-setting-ip6-config.h @@ -7,7 +7,7 @@ #define __NM_SETTING_IP6_CONFIG_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting-ip-config.h" diff --git a/src/libnm-core-public/nm-setting-macsec.h b/src/libnm-core-public/nm-setting-macsec.h index 67801a6460..52e4313d45 100644 --- a/src/libnm-core-public/nm-setting-macsec.h +++ b/src/libnm-core-public/nm-setting-macsec.h @@ -7,7 +7,7 @@ #define __NM_SETTING_MACSEC_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-macvlan.h b/src/libnm-core-public/nm-setting-macvlan.h index 82a5b20d4d..88ee81e727 100644 --- a/src/libnm-core-public/nm-setting-macvlan.h +++ b/src/libnm-core-public/nm-setting-macvlan.h @@ -7,7 +7,7 @@ #define __NM_SETTING_MACVLAN_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-match.h b/src/libnm-core-public/nm-setting-match.h index 40d12b65ce..a4e283e2ad 100644 --- a/src/libnm-core-public/nm-setting-match.h +++ b/src/libnm-core-public/nm-setting-match.h @@ -7,7 +7,7 @@ #define NM_SETTING_MATCH_H #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-olpc-mesh.h b/src/libnm-core-public/nm-setting-olpc-mesh.h index f692d9a30b..c9903f756e 100644 --- a/src/libnm-core-public/nm-setting-olpc-mesh.h +++ b/src/libnm-core-public/nm-setting-olpc-mesh.h @@ -9,7 +9,7 @@ #define __NM_SETTING_OLPC_MESH_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-ovs-bridge.h b/src/libnm-core-public/nm-setting-ovs-bridge.h index b307871503..33e8dffbc0 100644 --- a/src/libnm-core-public/nm-setting-ovs-bridge.h +++ b/src/libnm-core-public/nm-setting-ovs-bridge.h @@ -7,7 +7,7 @@ #define __NM_SETTING_OVS_BRIDGE_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-ovs-dpdk.h b/src/libnm-core-public/nm-setting-ovs-dpdk.h index 72de2243c0..5d96aef439 100644 --- a/src/libnm-core-public/nm-setting-ovs-dpdk.h +++ b/src/libnm-core-public/nm-setting-ovs-dpdk.h @@ -7,7 +7,7 @@ #define __NM_SETTING_OVS_DPDK_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-ovs-external-ids.h b/src/libnm-core-public/nm-setting-ovs-external-ids.h index 906db392f1..3ae991a13a 100644 --- a/src/libnm-core-public/nm-setting-ovs-external-ids.h +++ b/src/libnm-core-public/nm-setting-ovs-external-ids.h @@ -7,7 +7,7 @@ #define __NM_SETTING_OVS_EXTERNAL_IDS_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-ovs-interface.h b/src/libnm-core-public/nm-setting-ovs-interface.h index 47ad5817cd..a36a1a5373 100644 --- a/src/libnm-core-public/nm-setting-ovs-interface.h +++ b/src/libnm-core-public/nm-setting-ovs-interface.h @@ -7,7 +7,7 @@ #define __NM_SETTING_OVS_INTERFACE_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-ovs-patch.h b/src/libnm-core-public/nm-setting-ovs-patch.h index fd80d45a48..1d5f48439c 100644 --- a/src/libnm-core-public/nm-setting-ovs-patch.h +++ b/src/libnm-core-public/nm-setting-ovs-patch.h @@ -7,7 +7,7 @@ #define __NM_SETTING_OVS_PATCH_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-ovs-port.h b/src/libnm-core-public/nm-setting-ovs-port.h index 06d3a2aa0f..eda23d3e7b 100644 --- a/src/libnm-core-public/nm-setting-ovs-port.h +++ b/src/libnm-core-public/nm-setting-ovs-port.h @@ -7,7 +7,7 @@ #define __NM_SETTING_OVS_PORT_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-ppp.h b/src/libnm-core-public/nm-setting-ppp.h index 2c85f3fd8f..d9f93a5b7d 100644 --- a/src/libnm-core-public/nm-setting-ppp.h +++ b/src/libnm-core-public/nm-setting-ppp.h @@ -8,7 +8,7 @@ #define __NM_SETTING_PPP_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-pppoe.h b/src/libnm-core-public/nm-setting-pppoe.h index b9eb34bb62..5abf9c9fef 100644 --- a/src/libnm-core-public/nm-setting-pppoe.h +++ b/src/libnm-core-public/nm-setting-pppoe.h @@ -8,7 +8,7 @@ #define __NM_SETTING_PPPOE_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-proxy.h b/src/libnm-core-public/nm-setting-proxy.h index a10786ab51..f28639165b 100644 --- a/src/libnm-core-public/nm-setting-proxy.h +++ b/src/libnm-core-public/nm-setting-proxy.h @@ -7,7 +7,7 @@ #define __NM_SETTING_PROXY_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-serial.h b/src/libnm-core-public/nm-setting-serial.h index b3b0421a5d..4f8ead8259 100644 --- a/src/libnm-core-public/nm-setting-serial.h +++ b/src/libnm-core-public/nm-setting-serial.h @@ -8,7 +8,7 @@ #define __NM_SETTING_SERIAL_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-sriov.h b/src/libnm-core-public/nm-setting-sriov.h index fe5fc3766f..93afde9896 100644 --- a/src/libnm-core-public/nm-setting-sriov.h +++ b/src/libnm-core-public/nm-setting-sriov.h @@ -7,7 +7,7 @@ #define NM_SETTING_SRIOV_H #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-tc-config.h b/src/libnm-core-public/nm-setting-tc-config.h index a2bc9a0dae..7e8a44b539 100644 --- a/src/libnm-core-public/nm-setting-tc-config.h +++ b/src/libnm-core-public/nm-setting-tc-config.h @@ -7,7 +7,7 @@ #define NM_SETTING_TC_CONFIG_H #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-team-port.h b/src/libnm-core-public/nm-setting-team-port.h index 7acd9bf22c..3e472257ec 100644 --- a/src/libnm-core-public/nm-setting-team-port.h +++ b/src/libnm-core-public/nm-setting-team-port.h @@ -7,7 +7,7 @@ #define __NM_SETTING_TEAM_PORT_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-team.h b/src/libnm-core-public/nm-setting-team.h index 5ed7ac36d5..821741524c 100644 --- a/src/libnm-core-public/nm-setting-team.h +++ b/src/libnm-core-public/nm-setting-team.h @@ -7,7 +7,7 @@ #define __NM_SETTING_TEAM_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-tun.h b/src/libnm-core-public/nm-setting-tun.h index b73769951c..8f8084109c 100644 --- a/src/libnm-core-public/nm-setting-tun.h +++ b/src/libnm-core-public/nm-setting-tun.h @@ -7,7 +7,7 @@ #define __NM_SETTING_TUN_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-user.h b/src/libnm-core-public/nm-setting-user.h index b151cd3ee6..7f44afaece 100644 --- a/src/libnm-core-public/nm-setting-user.h +++ b/src/libnm-core-public/nm-setting-user.h @@ -7,7 +7,7 @@ #define __NM_SETTING_USER_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-veth.h b/src/libnm-core-public/nm-setting-veth.h index 5dbc192742..2609a2c6ce 100644 --- a/src/libnm-core-public/nm-setting-veth.h +++ b/src/libnm-core-public/nm-setting-veth.h @@ -7,7 +7,7 @@ #define __NM_SETTING_VETH_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-vlan.h b/src/libnm-core-public/nm-setting-vlan.h index 1d2470b69e..09a407db50 100644 --- a/src/libnm-core-public/nm-setting-vlan.h +++ b/src/libnm-core-public/nm-setting-vlan.h @@ -7,7 +7,7 @@ #define __NM_SETTING_VLAN_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-vpn.h b/src/libnm-core-public/nm-setting-vpn.h index 3a74d0b163..9fbb791b81 100644 --- a/src/libnm-core-public/nm-setting-vpn.h +++ b/src/libnm-core-public/nm-setting-vpn.h @@ -8,7 +8,7 @@ #define __NM_SETTING_VPN_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-vrf.h b/src/libnm-core-public/nm-setting-vrf.h index afa044b830..01194863cb 100644 --- a/src/libnm-core-public/nm-setting-vrf.h +++ b/src/libnm-core-public/nm-setting-vrf.h @@ -4,7 +4,7 @@ #define __NM_SETTING_VRF_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-vxlan.h b/src/libnm-core-public/nm-setting-vxlan.h index 6531f1d2bf..0cf84eaf56 100644 --- a/src/libnm-core-public/nm-setting-vxlan.h +++ b/src/libnm-core-public/nm-setting-vxlan.h @@ -7,7 +7,7 @@ #define __NM_SETTING_VXLAN_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-wifi-p2p.h b/src/libnm-core-public/nm-setting-wifi-p2p.h index 029b75f065..50cafad49a 100644 --- a/src/libnm-core-public/nm-setting-wifi-p2p.h +++ b/src/libnm-core-public/nm-setting-wifi-p2p.h @@ -7,7 +7,7 @@ #define __NM_SETTING_WIFI_P2P_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-wimax.h b/src/libnm-core-public/nm-setting-wimax.h index 12125fb2c2..88c8588f5a 100644 --- a/src/libnm-core-public/nm-setting-wimax.h +++ b/src/libnm-core-public/nm-setting-wimax.h @@ -7,7 +7,7 @@ #define __NM_SETTING_WIMAX_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-wired.h b/src/libnm-core-public/nm-setting-wired.h index 3330860442..54c8f9c065 100644 --- a/src/libnm-core-public/nm-setting-wired.h +++ b/src/libnm-core-public/nm-setting-wired.h @@ -8,7 +8,7 @@ #define __NM_SETTING_WIRED_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-wireguard.h b/src/libnm-core-public/nm-setting-wireguard.h index 3f046fc713..cb475d271a 100644 --- a/src/libnm-core-public/nm-setting-wireguard.h +++ b/src/libnm-core-public/nm-setting-wireguard.h @@ -7,7 +7,7 @@ #define __NM_SETTING_WIREGUARD_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-wireless-security.h b/src/libnm-core-public/nm-setting-wireless-security.h index cf662a372e..9686e7d551 100644 --- a/src/libnm-core-public/nm-setting-wireless-security.h +++ b/src/libnm-core-public/nm-setting-wireless-security.h @@ -8,7 +8,7 @@ #define __NM_SETTING_WIRELESS_SECURITY_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-wireless.h b/src/libnm-core-public/nm-setting-wireless.h index 0b45e2a3df..4451785f16 100644 --- a/src/libnm-core-public/nm-setting-wireless.h +++ b/src/libnm-core-public/nm-setting-wireless.h @@ -8,7 +8,7 @@ #define __NM_SETTING_WIRELESS_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting-wpan.h b/src/libnm-core-public/nm-setting-wpan.h index 2a09d49bbd..883b77e165 100644 --- a/src/libnm-core-public/nm-setting-wpan.h +++ b/src/libnm-core-public/nm-setting-wpan.h @@ -7,7 +7,7 @@ #define __NM_SETTING_WPAN_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-setting.h" diff --git a/src/libnm-core-public/nm-setting.h b/src/libnm-core-public/nm-setting.h index 6206a77475..ea2525dc38 100644 --- a/src/libnm-core-public/nm-setting.h +++ b/src/libnm-core-public/nm-setting.h @@ -8,7 +8,7 @@ #define __NM_SETTING_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-core-types.h" diff --git a/src/libnm-core-public/nm-simple-connection.h b/src/libnm-core-public/nm-simple-connection.h index 6586c922d3..cc20bd16eb 100644 --- a/src/libnm-core-public/nm-simple-connection.h +++ b/src/libnm-core-public/nm-simple-connection.h @@ -7,7 +7,7 @@ #define __NM_SIMPLE_CONNECTION_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include "nm-connection.h" diff --git a/src/libnm-core-public/nm-utils.h b/src/libnm-core-public/nm-utils.h index 0f8dcda09e..5100b678a0 100644 --- a/src/libnm-core-public/nm-utils.h +++ b/src/libnm-core-public/nm-utils.h @@ -7,7 +7,7 @@ #define __NM_UTILS_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include diff --git a/src/libnm-core-public/nm-version.h b/src/libnm-core-public/nm-version.h index 2c51339ec2..f0f09fa809 100644 --- a/src/libnm-core-public/nm-version.h +++ b/src/libnm-core-public/nm-version.h @@ -13,290 +13,290 @@ /* Deprecation / Availability macros */ #if !defined(NM_VERSION_MIN_REQUIRED) || (NM_VERSION_MIN_REQUIRED == 0) - #undef NM_VERSION_MIN_REQUIRED - #define NM_VERSION_MIN_REQUIRED (NM_API_VERSION) +#undef NM_VERSION_MIN_REQUIRED +#define NM_VERSION_MIN_REQUIRED (NM_API_VERSION) #endif #if !defined(NM_VERSION_MAX_ALLOWED) || (NM_VERSION_MAX_ALLOWED == 0) - #undef NM_VERSION_MAX_ALLOWED - #define NM_VERSION_MAX_ALLOWED (NM_API_VERSION) +#undef NM_VERSION_MAX_ALLOWED +#define NM_VERSION_MAX_ALLOWED (NM_API_VERSION) #endif /* sanity checks */ #if NM_VERSION_MIN_REQUIRED > NM_API_VERSION - #error "NM_VERSION_MIN_REQUIRED must be <= NM_API_VERSION" +#error "NM_VERSION_MIN_REQUIRED must be <= NM_API_VERSION" #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_MIN_REQUIRED - #error "NM_VERSION_MAX_ALLOWED must be >= NM_VERSION_MIN_REQUIRED" +#error "NM_VERSION_MAX_ALLOWED must be >= NM_VERSION_MIN_REQUIRED" #endif #if NM_VERSION_MIN_REQUIRED < NM_VERSION_0_9_8 - #error "NM_VERSION_MIN_REQUIRED must be >= NM_VERSION_0_9_8" +#error "NM_VERSION_MIN_REQUIRED must be >= NM_VERSION_0_9_8" #endif #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_0_9_10 - #define NM_DEPRECATED_IN_0_9_10 G_DEPRECATED - #define NM_DEPRECATED_IN_0_9_10_FOR(f) G_DEPRECATED_FOR(f) +#define NM_DEPRECATED_IN_0_9_10 G_DEPRECATED +#define NM_DEPRECATED_IN_0_9_10_FOR(f) G_DEPRECATED_FOR(f) #else - #define NM_DEPRECATED_IN_0_9_10 - #define NM_DEPRECATED_IN_0_9_10_FOR(f) +#define NM_DEPRECATED_IN_0_9_10 +#define NM_DEPRECATED_IN_0_9_10_FOR(f) #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_0_9_10 - #define NM_AVAILABLE_IN_0_9_10 G_UNAVAILABLE(0.9, 10) +#define NM_AVAILABLE_IN_0_9_10 G_UNAVAILABLE(0.9, 10) #else - #define NM_AVAILABLE_IN_0_9_10 +#define NM_AVAILABLE_IN_0_9_10 #endif #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_0 - #define NM_DEPRECATED_IN_1_0 G_DEPRECATED - #define NM_DEPRECATED_IN_1_0_FOR(f) G_DEPRECATED_FOR(f) +#define NM_DEPRECATED_IN_1_0 G_DEPRECATED +#define NM_DEPRECATED_IN_1_0_FOR(f) G_DEPRECATED_FOR(f) #else - #define NM_DEPRECATED_IN_1_0 - #define NM_DEPRECATED_IN_1_0_FOR(f) +#define NM_DEPRECATED_IN_1_0 +#define NM_DEPRECATED_IN_1_0_FOR(f) #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_0 - #define NM_AVAILABLE_IN_1_0 G_UNAVAILABLE(1, 0) +#define NM_AVAILABLE_IN_1_0 G_UNAVAILABLE(1, 0) #else - #define NM_AVAILABLE_IN_1_0 +#define NM_AVAILABLE_IN_1_0 #endif #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_2 - #define NM_DEPRECATED_IN_1_2 G_DEPRECATED - #define NM_DEPRECATED_IN_1_2_FOR(f) G_DEPRECATED_FOR(f) +#define NM_DEPRECATED_IN_1_2 G_DEPRECATED +#define NM_DEPRECATED_IN_1_2_FOR(f) G_DEPRECATED_FOR(f) #else - #define NM_DEPRECATED_IN_1_2 - #define NM_DEPRECATED_IN_1_2_FOR(f) +#define NM_DEPRECATED_IN_1_2 +#define NM_DEPRECATED_IN_1_2_FOR(f) #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_2 - #define NM_AVAILABLE_IN_1_2 G_UNAVAILABLE(1, 2) +#define NM_AVAILABLE_IN_1_2 G_UNAVAILABLE(1, 2) #else - #define NM_AVAILABLE_IN_1_2 +#define NM_AVAILABLE_IN_1_2 #endif #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_4 - #define NM_DEPRECATED_IN_1_4 G_DEPRECATED - #define NM_DEPRECATED_IN_1_4_FOR(f) G_DEPRECATED_FOR(f) +#define NM_DEPRECATED_IN_1_4 G_DEPRECATED +#define NM_DEPRECATED_IN_1_4_FOR(f) G_DEPRECATED_FOR(f) #else - #define NM_DEPRECATED_IN_1_4 - #define NM_DEPRECATED_IN_1_4_FOR(f) +#define NM_DEPRECATED_IN_1_4 +#define NM_DEPRECATED_IN_1_4_FOR(f) #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_4 - #define NM_AVAILABLE_IN_1_4 G_UNAVAILABLE(1, 4) +#define NM_AVAILABLE_IN_1_4 G_UNAVAILABLE(1, 4) #else - #define NM_AVAILABLE_IN_1_4 +#define NM_AVAILABLE_IN_1_4 #endif #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_6 - #define NM_DEPRECATED_IN_1_6 G_DEPRECATED - #define NM_DEPRECATED_IN_1_6_FOR(f) G_DEPRECATED_FOR(f) +#define NM_DEPRECATED_IN_1_6 G_DEPRECATED +#define NM_DEPRECATED_IN_1_6_FOR(f) G_DEPRECATED_FOR(f) #else - #define NM_DEPRECATED_IN_1_6 - #define NM_DEPRECATED_IN_1_6_FOR(f) +#define NM_DEPRECATED_IN_1_6 +#define NM_DEPRECATED_IN_1_6_FOR(f) #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_6 - #define NM_AVAILABLE_IN_1_6 G_UNAVAILABLE(1, 6) +#define NM_AVAILABLE_IN_1_6 G_UNAVAILABLE(1, 6) #else - #define NM_AVAILABLE_IN_1_6 +#define NM_AVAILABLE_IN_1_6 #endif #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_8 - #define NM_DEPRECATED_IN_1_8 G_DEPRECATED - #define NM_DEPRECATED_IN_1_8_FOR(f) G_DEPRECATED_FOR(f) +#define NM_DEPRECATED_IN_1_8 G_DEPRECATED +#define NM_DEPRECATED_IN_1_8_FOR(f) G_DEPRECATED_FOR(f) #else - #define NM_DEPRECATED_IN_1_8 - #define NM_DEPRECATED_IN_1_8_FOR(f) +#define NM_DEPRECATED_IN_1_8 +#define NM_DEPRECATED_IN_1_8_FOR(f) #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_8 - #define NM_AVAILABLE_IN_1_8 G_UNAVAILABLE(1, 8) +#define NM_AVAILABLE_IN_1_8 G_UNAVAILABLE(1, 8) #else - #define NM_AVAILABLE_IN_1_8 +#define NM_AVAILABLE_IN_1_8 #endif #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_10 - #define NM_DEPRECATED_IN_1_10 G_DEPRECATED - #define NM_DEPRECATED_IN_1_10_FOR(f) G_DEPRECATED_FOR(f) +#define NM_DEPRECATED_IN_1_10 G_DEPRECATED +#define NM_DEPRECATED_IN_1_10_FOR(f) G_DEPRECATED_FOR(f) #else - #define NM_DEPRECATED_IN_1_10 - #define NM_DEPRECATED_IN_1_10_FOR(f) +#define NM_DEPRECATED_IN_1_10 +#define NM_DEPRECATED_IN_1_10_FOR(f) #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_10 - #define NM_AVAILABLE_IN_1_10 G_UNAVAILABLE(1, 10) +#define NM_AVAILABLE_IN_1_10 G_UNAVAILABLE(1, 10) #else - #define NM_AVAILABLE_IN_1_10 +#define NM_AVAILABLE_IN_1_10 #endif #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_12 - #define NM_DEPRECATED_IN_1_12 G_DEPRECATED - #define NM_DEPRECATED_IN_1_12_FOR(f) G_DEPRECATED_FOR(f) +#define NM_DEPRECATED_IN_1_12 G_DEPRECATED +#define NM_DEPRECATED_IN_1_12_FOR(f) G_DEPRECATED_FOR(f) #else - #define NM_DEPRECATED_IN_1_12 - #define NM_DEPRECATED_IN_1_12_FOR(f) +#define NM_DEPRECATED_IN_1_12 +#define NM_DEPRECATED_IN_1_12_FOR(f) #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_12 - #define NM_AVAILABLE_IN_1_12 G_UNAVAILABLE(1, 12) +#define NM_AVAILABLE_IN_1_12 G_UNAVAILABLE(1, 12) #else - #define NM_AVAILABLE_IN_1_12 +#define NM_AVAILABLE_IN_1_12 #endif #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_14 - #define NM_DEPRECATED_IN_1_14 G_DEPRECATED - #define NM_DEPRECATED_IN_1_14_FOR(f) G_DEPRECATED_FOR(f) +#define NM_DEPRECATED_IN_1_14 G_DEPRECATED +#define NM_DEPRECATED_IN_1_14_FOR(f) G_DEPRECATED_FOR(f) #else - #define NM_DEPRECATED_IN_1_14 - #define NM_DEPRECATED_IN_1_14_FOR(f) +#define NM_DEPRECATED_IN_1_14 +#define NM_DEPRECATED_IN_1_14_FOR(f) #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_14 - #define NM_AVAILABLE_IN_1_14 G_UNAVAILABLE(1, 14) +#define NM_AVAILABLE_IN_1_14 G_UNAVAILABLE(1, 14) #else - #define NM_AVAILABLE_IN_1_14 +#define NM_AVAILABLE_IN_1_14 #endif #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_16 - #define NM_DEPRECATED_IN_1_16 G_DEPRECATED - #define NM_DEPRECATED_IN_1_16_FOR(f) G_DEPRECATED_FOR(f) +#define NM_DEPRECATED_IN_1_16 G_DEPRECATED +#define NM_DEPRECATED_IN_1_16_FOR(f) G_DEPRECATED_FOR(f) #else - #define NM_DEPRECATED_IN_1_16 - #define NM_DEPRECATED_IN_1_16_FOR(f) +#define NM_DEPRECATED_IN_1_16 +#define NM_DEPRECATED_IN_1_16_FOR(f) #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_16 - #define NM_AVAILABLE_IN_1_16 G_UNAVAILABLE(1, 16) +#define NM_AVAILABLE_IN_1_16 G_UNAVAILABLE(1, 16) #else - #define NM_AVAILABLE_IN_1_16 +#define NM_AVAILABLE_IN_1_16 #endif #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_18 - #define NM_DEPRECATED_IN_1_18 G_DEPRECATED - #define NM_DEPRECATED_IN_1_18_FOR(f) G_DEPRECATED_FOR(f) +#define NM_DEPRECATED_IN_1_18 G_DEPRECATED +#define NM_DEPRECATED_IN_1_18_FOR(f) G_DEPRECATED_FOR(f) #else - #define NM_DEPRECATED_IN_1_18 - #define NM_DEPRECATED_IN_1_18_FOR(f) +#define NM_DEPRECATED_IN_1_18 +#define NM_DEPRECATED_IN_1_18_FOR(f) #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_18 - #define NM_AVAILABLE_IN_1_18 G_UNAVAILABLE(1, 18) +#define NM_AVAILABLE_IN_1_18 G_UNAVAILABLE(1, 18) #else - #define NM_AVAILABLE_IN_1_18 +#define NM_AVAILABLE_IN_1_18 #endif #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_20 - #define NM_DEPRECATED_IN_1_20 G_DEPRECATED - #define NM_DEPRECATED_IN_1_20_FOR(f) G_DEPRECATED_FOR(f) +#define NM_DEPRECATED_IN_1_20 G_DEPRECATED +#define NM_DEPRECATED_IN_1_20_FOR(f) G_DEPRECATED_FOR(f) #else - #define NM_DEPRECATED_IN_1_20 - #define NM_DEPRECATED_IN_1_20_FOR(f) +#define NM_DEPRECATED_IN_1_20 +#define NM_DEPRECATED_IN_1_20_FOR(f) #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_20 - #define NM_AVAILABLE_IN_1_20 G_UNAVAILABLE(1, 20) +#define NM_AVAILABLE_IN_1_20 G_UNAVAILABLE(1, 20) #else - #define NM_AVAILABLE_IN_1_20 +#define NM_AVAILABLE_IN_1_20 #endif #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_22 - #define NM_DEPRECATED_IN_1_22 G_DEPRECATED - #define NM_DEPRECATED_IN_1_22_FOR(f) G_DEPRECATED_FOR(f) +#define NM_DEPRECATED_IN_1_22 G_DEPRECATED +#define NM_DEPRECATED_IN_1_22_FOR(f) G_DEPRECATED_FOR(f) #else - #define NM_DEPRECATED_IN_1_22 - #define NM_DEPRECATED_IN_1_22_FOR(f) +#define NM_DEPRECATED_IN_1_22 +#define NM_DEPRECATED_IN_1_22_FOR(f) #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_22 - #define NM_AVAILABLE_IN_1_22 G_UNAVAILABLE(1, 22) +#define NM_AVAILABLE_IN_1_22 G_UNAVAILABLE(1, 22) #else - #define NM_AVAILABLE_IN_1_22 +#define NM_AVAILABLE_IN_1_22 #endif #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_24 - #define NM_DEPRECATED_IN_1_24 G_DEPRECATED - #define NM_DEPRECATED_IN_1_24_FOR(f) G_DEPRECATED_FOR(f) +#define NM_DEPRECATED_IN_1_24 G_DEPRECATED +#define NM_DEPRECATED_IN_1_24_FOR(f) G_DEPRECATED_FOR(f) #else - #define NM_DEPRECATED_IN_1_24 - #define NM_DEPRECATED_IN_1_24_FOR(f) +#define NM_DEPRECATED_IN_1_24 +#define NM_DEPRECATED_IN_1_24_FOR(f) #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_24 - #define NM_AVAILABLE_IN_1_24 G_UNAVAILABLE(1, 24) +#define NM_AVAILABLE_IN_1_24 G_UNAVAILABLE(1, 24) #else - #define NM_AVAILABLE_IN_1_24 +#define NM_AVAILABLE_IN_1_24 #endif #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_26 - #define NM_DEPRECATED_IN_1_26 G_DEPRECATED - #define NM_DEPRECATED_IN_1_26_FOR(f) G_DEPRECATED_FOR(f) +#define NM_DEPRECATED_IN_1_26 G_DEPRECATED +#define NM_DEPRECATED_IN_1_26_FOR(f) G_DEPRECATED_FOR(f) #else - #define NM_DEPRECATED_IN_1_26 - #define NM_DEPRECATED_IN_1_26_FOR(f) +#define NM_DEPRECATED_IN_1_26 +#define NM_DEPRECATED_IN_1_26_FOR(f) #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_26 - #define NM_AVAILABLE_IN_1_26 G_UNAVAILABLE(1, 26) +#define NM_AVAILABLE_IN_1_26 G_UNAVAILABLE(1, 26) #else - #define NM_AVAILABLE_IN_1_26 +#define NM_AVAILABLE_IN_1_26 #endif #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_28 - #define NM_DEPRECATED_IN_1_28 G_DEPRECATED - #define NM_DEPRECATED_IN_1_28_FOR(f) G_DEPRECATED_FOR(f) +#define NM_DEPRECATED_IN_1_28 G_DEPRECATED +#define NM_DEPRECATED_IN_1_28_FOR(f) G_DEPRECATED_FOR(f) #else - #define NM_DEPRECATED_IN_1_28 - #define NM_DEPRECATED_IN_1_28_FOR(f) +#define NM_DEPRECATED_IN_1_28 +#define NM_DEPRECATED_IN_1_28_FOR(f) #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_28 - #define NM_AVAILABLE_IN_1_28 G_UNAVAILABLE(1, 28) +#define NM_AVAILABLE_IN_1_28 G_UNAVAILABLE(1, 28) #else - #define NM_AVAILABLE_IN_1_28 +#define NM_AVAILABLE_IN_1_28 #endif #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_30 - #define NM_DEPRECATED_IN_1_30 G_DEPRECATED - #define NM_DEPRECATED_IN_1_30_FOR(f) G_DEPRECATED_FOR(f) +#define NM_DEPRECATED_IN_1_30 G_DEPRECATED +#define NM_DEPRECATED_IN_1_30_FOR(f) G_DEPRECATED_FOR(f) #else - #define NM_DEPRECATED_IN_1_30 - #define NM_DEPRECATED_IN_1_30_FOR(f) +#define NM_DEPRECATED_IN_1_30 +#define NM_DEPRECATED_IN_1_30_FOR(f) #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_30 - #define NM_AVAILABLE_IN_1_30 G_UNAVAILABLE(1, 30) +#define NM_AVAILABLE_IN_1_30 G_UNAVAILABLE(1, 30) #else - #define NM_AVAILABLE_IN_1_30 +#define NM_AVAILABLE_IN_1_30 #endif #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_32 - #define NM_DEPRECATED_IN_1_32 G_DEPRECATED - #define NM_DEPRECATED_IN_1_32_FOR(f) G_DEPRECATED_FOR(f) +#define NM_DEPRECATED_IN_1_32 G_DEPRECATED +#define NM_DEPRECATED_IN_1_32_FOR(f) G_DEPRECATED_FOR(f) #else - #define NM_DEPRECATED_IN_1_32 - #define NM_DEPRECATED_IN_1_32_FOR(f) +#define NM_DEPRECATED_IN_1_32 +#define NM_DEPRECATED_IN_1_32_FOR(f) #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_32 - #define NM_AVAILABLE_IN_1_32 G_UNAVAILABLE(1, 32) +#define NM_AVAILABLE_IN_1_32 G_UNAVAILABLE(1, 32) #else - #define NM_AVAILABLE_IN_1_32 +#define NM_AVAILABLE_IN_1_32 #endif #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_34 - #define NM_DEPRECATED_IN_1_34 G_DEPRECATED - #define NM_DEPRECATED_IN_1_34_FOR(f) G_DEPRECATED_FOR(f) +#define NM_DEPRECATED_IN_1_34 G_DEPRECATED +#define NM_DEPRECATED_IN_1_34_FOR(f) G_DEPRECATED_FOR(f) #else - #define NM_DEPRECATED_IN_1_34 - #define NM_DEPRECATED_IN_1_34_FOR(f) +#define NM_DEPRECATED_IN_1_34 +#define NM_DEPRECATED_IN_1_34_FOR(f) #endif #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_34 - #define NM_AVAILABLE_IN_1_34 G_UNAVAILABLE(1, 34) +#define NM_AVAILABLE_IN_1_34 G_UNAVAILABLE(1, 34) #else - #define NM_AVAILABLE_IN_1_34 +#define NM_AVAILABLE_IN_1_34 #endif /* diff --git a/src/libnm-core-public/nm-vpn-dbus-interface.h b/src/libnm-core-public/nm-vpn-dbus-interface.h index c0e23f6fc1..518999dd56 100644 --- a/src/libnm-core-public/nm-vpn-dbus-interface.h +++ b/src/libnm-core-public/nm-vpn-dbus-interface.h @@ -15,7 +15,7 @@ #include "nm-dbus-interface.h" #ifndef NM_VERSION_H - #define NM_DEPRECATED_IN_1_8_FOR(n) +#define NM_DEPRECATED_IN_1_8_FOR(n) #endif /* @@ -171,7 +171,7 @@ typedef enum { } NMVpnPluginFailure; #ifndef NM_VERSION_H - #undef NM_DEPRECATED_IN_1_8_FOR +#undef NM_DEPRECATED_IN_1_8_FOR #endif /*** Generic config ***/ diff --git a/src/libnm-core-public/nm-vpn-editor-plugin.h b/src/libnm-core-public/nm-vpn-editor-plugin.h index e318da07b8..e25c358e18 100644 --- a/src/libnm-core-public/nm-vpn-editor-plugin.h +++ b/src/libnm-core-public/nm-vpn-editor-plugin.h @@ -8,7 +8,7 @@ #define __NM_VPN_EDITOR_PLUGIN_H__ #if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) - #error "Only can be included directly." +#error "Only can be included directly." #endif #include diff --git a/src/libnm-glib-aux/nm-default-glib.h b/src/libnm-glib-aux/nm-default-glib.h index e5ccd47fd3..9d04ddc407 100644 --- a/src/libnm-glib-aux/nm-default-glib.h +++ b/src/libnm-glib-aux/nm-default-glib.h @@ -18,21 +18,21 @@ #include #if defined(_NETWORKMANAGER_COMPILATION_GLIB_I18N_PROG) - #if defined(_NETWORKMANAGER_COMPILATION_GLIB_I18N_LIB) - #error Cannot define _NETWORKMANAGER_COMPILATION_GLIB_I18N_LIB and _NETWORKMANAGER_COMPILATION_GLIB_I18N_PROG together - #endif - #undef _NETWORKMANAGER_COMPILATION_GLIB_I18N_PROG - #include +#if defined(_NETWORKMANAGER_COMPILATION_GLIB_I18N_LIB) +#error Cannot define _NETWORKMANAGER_COMPILATION_GLIB_I18N_LIB and _NETWORKMANAGER_COMPILATION_GLIB_I18N_PROG together +#endif +#undef _NETWORKMANAGER_COMPILATION_GLIB_I18N_PROG +#include #elif defined(_NETWORKMANAGER_COMPILATION_GLIB_I18N_LIB) - #undef _NETWORKMANAGER_COMPILATION_GLIB_I18N_LIB - #include +#undef _NETWORKMANAGER_COMPILATION_GLIB_I18N_LIB +#include #endif /*****************************************************************************/ #if NM_MORE_ASSERTS == 0 - #ifndef G_DISABLE_CAST_CHECKS - /* Unless compiling with G_DISABLE_CAST_CHECKS, glib performs type checking +#ifndef G_DISABLE_CAST_CHECKS +/* Unless compiling with G_DISABLE_CAST_CHECKS, glib performs type checking * during G_VARIANT_TYPE() via g_variant_type_checked_(). This is not necessary * because commonly this cast is needed during something like * @@ -54,9 +54,9 @@ * * Just patch G_VARIANT_TYPE() to perform no check. */ - #undef G_VARIANT_TYPE - #define G_VARIANT_TYPE(type_string) ((const GVariantType *) (type_string)) - #endif +#undef G_VARIANT_TYPE +#define G_VARIANT_TYPE(type_string) ((const GVariantType *) (type_string)) +#endif #endif /*****************************************************************************/ diff --git a/src/libnm-glib-aux/nm-gassert-patch.h b/src/libnm-glib-aux/nm-gassert-patch.h index bac8697c0e..e4ea23e400 100644 --- a/src/libnm-glib-aux/nm-gassert-patch.h +++ b/src/libnm-glib-aux/nm-gassert-patch.h @@ -25,50 +25,50 @@ _nm_g_return_if_fail_warning(const char *log_domain, const char *file, int line) g_return_if_fail_warning(log_domain, file_buf, ""); } - #define g_return_if_fail_warning(log_domain, pretty_function, expression) \ - _nm_g_return_if_fail_warning(log_domain, __FILE__, __LINE__) +#define g_return_if_fail_warning(log_domain, pretty_function, expression) \ + _nm_g_return_if_fail_warning(log_domain, __FILE__, __LINE__) - #define g_assertion_message_expr(domain, file, line, func, expr) \ - g_assertion_message_expr(domain, file, line, "", (expr) ? "" : NULL) +#define g_assertion_message_expr(domain, file, line, func, expr) \ + g_assertion_message_expr(domain, file, line, "", (expr) ? "" : NULL) - #undef g_return_val_if_reached - #define g_return_val_if_reached(val) \ - G_STMT_START \ - { \ - g_log(G_LOG_DOMAIN, \ - G_LOG_LEVEL_CRITICAL, \ - "file %s: line %d (%s): should not be reached", \ - __FILE__, \ - __LINE__, \ - ""); \ - return (val); \ - } \ - G_STMT_END +#undef g_return_val_if_reached +#define g_return_val_if_reached(val) \ + G_STMT_START \ + { \ + g_log(G_LOG_DOMAIN, \ + G_LOG_LEVEL_CRITICAL, \ + "file %s: line %d (%s): should not be reached", \ + __FILE__, \ + __LINE__, \ + ""); \ + return (val); \ + } \ + G_STMT_END - #undef g_return_if_reached - #define g_return_if_reached() \ - G_STMT_START \ - { \ - g_log(G_LOG_DOMAIN, \ - G_LOG_LEVEL_CRITICAL, \ - "file %s: line %d (%s): should not be reached", \ - __FILE__, \ - __LINE__, \ - ""); \ - return; \ - } \ - G_STMT_END +#undef g_return_if_reached +#define g_return_if_reached() \ + G_STMT_START \ + { \ + g_log(G_LOG_DOMAIN, \ + G_LOG_LEVEL_CRITICAL, \ + "file %s: line %d (%s): should not be reached", \ + __FILE__, \ + __LINE__, \ + ""); \ + return; \ + } \ + G_STMT_END #endif /*****************************************************************************/ #if NM_MORE_ASSERTS == 0 - #define NM_ASSERT_G_RETURN_EXPR(expr) "" - #define NM_ASSERT_NO_MSG 1 +#define NM_ASSERT_G_RETURN_EXPR(expr) "" +#define NM_ASSERT_NO_MSG 1 #else - #define NM_ASSERT_G_RETURN_EXPR(expr) "" expr "" - #define NM_ASSERT_NO_MSG 0 +#define NM_ASSERT_G_RETURN_EXPR(expr) "" expr "" +#define NM_ASSERT_NO_MSG 0 #endif /*****************************************************************************/ diff --git a/src/libnm-glib-aux/nm-glib.h b/src/libnm-glib-aux/nm-glib.h index 0af9e21f29..c283277b77 100644 --- a/src/libnm-glib-aux/nm-glib.h +++ b/src/libnm-glib-aux/nm-glib.h @@ -9,21 +9,21 @@ /*****************************************************************************/ #ifndef __NM_MACROS_INTERNAL_H__ - #error "nm-glib.h requires nm-macros-internal.h. Do not include this directly" +#error "nm-glib.h requires nm-macros-internal.h. Do not include this directly" #endif /*****************************************************************************/ #ifdef __clang__ - #undef G_GNUC_BEGIN_IGNORE_DEPRECATIONS - #undef G_GNUC_END_IGNORE_DEPRECATIONS +#undef G_GNUC_BEGIN_IGNORE_DEPRECATIONS +#undef G_GNUC_END_IGNORE_DEPRECATIONS - #define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - _Pragma("clang diagnostic push") \ - _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") +#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") - #define G_GNUC_END_IGNORE_DEPRECATIONS _Pragma("clang diagnostic pop") +#define G_GNUC_END_IGNORE_DEPRECATIONS _Pragma("clang diagnostic pop") #endif @@ -47,23 +47,23 @@ __g_type_ensure(GType type) #if !GLIB_CHECK_VERSION(2, 34, 0) - #define g_clear_pointer(pp, destroy) \ - G_STMT_START \ - { \ - G_STATIC_ASSERT(sizeof *(pp) == sizeof(gpointer)); \ - /* Only one access, please */ \ - gpointer *_pp = (gpointer *) (pp); \ - gpointer _p; \ - /* This assignment is needed to avoid a gcc warning */ \ - GDestroyNotify _destroy = (GDestroyNotify) (destroy); \ - \ - _p = *_pp; \ - if (_p) { \ - *_pp = NULL; \ - _destroy(_p); \ - } \ - } \ - G_STMT_END +#define g_clear_pointer(pp, destroy) \ + G_STMT_START \ + { \ + G_STATIC_ASSERT(sizeof *(pp) == sizeof(gpointer)); \ + /* Only one access, please */ \ + gpointer *_pp = (gpointer *) (pp); \ + gpointer _p; \ + /* This assignment is needed to avoid a gcc warning */ \ + GDestroyNotify _destroy = (GDestroyNotify) (destroy); \ + \ + _p = *_pp; \ + if (_p) { \ + *_pp = NULL; \ + _destroy(_p); \ + } \ + } \ + G_STMT_END #endif @@ -71,94 +71,94 @@ __g_type_ensure(GType type) #if !GLIB_CHECK_VERSION(2, 34, 0) - /* These are used to clean up the output of test programs; we can just let +/* These are used to clean up the output of test programs; we can just let * them no-op in older glib. */ - #define g_test_expect_message(log_domain, log_level, pattern) - #define g_test_assert_expected_messages() +#define g_test_expect_message(log_domain, log_level, pattern) +#define g_test_assert_expected_messages() #else - /* We build with -DGLIB_MAX_ALLOWED_VERSION set to 2.32 to make sure we don't +/* We build with -DGLIB_MAX_ALLOWED_VERSION set to 2.32 to make sure we don't * accidentally use new API that we shouldn't. But we don't want warnings for * the APIs that we emulate above. */ - #define g_test_expect_message(domain, level, format...) \ - G_STMT_START \ - { \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_test_expect_message(domain, level, format); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - } \ - G_STMT_END +#define g_test_expect_message(domain, level, format...) \ + G_STMT_START \ + { \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_test_expect_message(domain, level, format); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + } \ + G_STMT_END - #define g_test_assert_expected_messages_internal(domain, file, line, func) \ - G_STMT_START \ - { \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_test_assert_expected_messages_internal(domain, file, line, func); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - } \ - G_STMT_END +#define g_test_assert_expected_messages_internal(domain, file, line, func) \ + G_STMT_START \ + { \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_test_assert_expected_messages_internal(domain, file, line, func); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + } \ + G_STMT_END #endif /*****************************************************************************/ #if GLIB_CHECK_VERSION(2, 35, 0) - /* For glib >= 2.36, g_type_init() is deprecated. +/* For glib >= 2.36, g_type_init() is deprecated. * But since 2.35.1 (7c42ab23b55c43ab96d0ac2124b550bf1f49c1ec) this function * does nothing. Replace the call with empty statement. */ - #define nm_g_type_init() \ - G_STMT_START \ - { \ - (void) 0; \ - } \ - G_STMT_END +#define nm_g_type_init() \ + G_STMT_START \ + { \ + (void) 0; \ + } \ + G_STMT_END #else - #define nm_g_type_init() \ - G_STMT_START \ - { \ - g_type_init(); \ - } \ - G_STMT_END +#define nm_g_type_init() \ + G_STMT_START \ + { \ + g_type_init(); \ + } \ + G_STMT_END #endif /*****************************************************************************/ /* g_test_initialized() is only available since glib 2.36. */ #if !GLIB_CHECK_VERSION(2, 36, 0) - #define g_test_initialized() (g_test_config_vars->test_initialized) +#define g_test_initialized() (g_test_config_vars->test_initialized) #endif /*****************************************************************************/ /* g_assert_cmpmem() is only available since glib 2.46. */ #if !GLIB_CHECK_VERSION(2, 45, 7) - #define g_assert_cmpmem(m1, l1, m2, l2) \ - G_STMT_START \ - { \ - gconstpointer __m1 = m1, __m2 = m2; \ - int __l1 = l1, __l2 = l2; \ - if (__l1 != __l2) \ - g_assertion_message_cmpnum(G_LOG_DOMAIN, \ - __FILE__, \ - __LINE__, \ - G_STRFUNC, \ - #l1 " (len(" #m1 ")) == " #l2 " (len(" #m2 "))", \ - __l1, \ - "==", \ - __l2, \ - 'i'); \ - else if (memcmp(__m1, __m2, __l1) != 0) \ - g_assertion_message(G_LOG_DOMAIN, \ - __FILE__, \ - __LINE__, \ - G_STRFUNC, \ - "assertion failed (" #m1 " == " #m2 ")"); \ - } \ - G_STMT_END +#define g_assert_cmpmem(m1, l1, m2, l2) \ + G_STMT_START \ + { \ + gconstpointer __m1 = m1, __m2 = m2; \ + int __l1 = l1, __l2 = l2; \ + if (__l1 != __l2) \ + g_assertion_message_cmpnum(G_LOG_DOMAIN, \ + __FILE__, \ + __LINE__, \ + G_STRFUNC, \ + #l1 " (len(" #m1 ")) == " #l2 " (len(" #m2 "))", \ + __l1, \ + "==", \ + __l2, \ + 'i'); \ + else if (memcmp(__m1, __m2, __l1) != 0) \ + g_assertion_message(G_LOG_DOMAIN, \ + __FILE__, \ + __LINE__, \ + G_STRFUNC, \ + "assertion failed (" #m1 " == " #m2 ")"); \ + } \ + G_STMT_END #endif /*****************************************************************************/ @@ -288,21 +288,21 @@ _nm_g_ptr_array_insert(GPtrArray *array, int index_, gpointer data) #endif #if !GLIB_CHECK_VERSION(2, 40, 0) - #define g_ptr_array_insert(array, index, data) \ - G_STMT_START \ - { \ - _nm_g_ptr_array_insert(array, index, data); \ - } \ - G_STMT_END +#define g_ptr_array_insert(array, index, data) \ + G_STMT_START \ + { \ + _nm_g_ptr_array_insert(array, index, data); \ + } \ + G_STMT_END #else - #define g_ptr_array_insert(array, index, data) \ - G_STMT_START \ - { \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_ptr_array_insert(array, index, data); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - } \ - G_STMT_END +#define g_ptr_array_insert(array, index, data) \ + G_STMT_START \ + { \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_ptr_array_insert(array, index, data); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + } \ + G_STMT_END #endif /*****************************************************************************/ @@ -327,37 +327,37 @@ _g_key_file_save_to_file(GKeyFile *key_file, const char *filename, GError **erro return success; } - #define g_key_file_save_to_file(key_file, filename, error) \ - _g_key_file_save_to_file(key_file, filename, error) +#define g_key_file_save_to_file(key_file, filename, error) \ + _g_key_file_save_to_file(key_file, filename, error) #else - #define g_key_file_save_to_file(key_file, filename, error) \ - ({ \ - gboolean _success; \ - \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - _success = g_key_file_save_to_file(key_file, filename, error); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - _success; \ - }) +#define g_key_file_save_to_file(key_file, filename, error) \ + ({ \ + gboolean _success; \ + \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + _success = g_key_file_save_to_file(key_file, filename, error); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + _success; \ + }) #endif /*****************************************************************************/ #if GLIB_CHECK_VERSION(2, 36, 0) - #define g_credentials_get_unix_pid(creds, error) \ - ({ \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS(g_credentials_get_unix_pid)((creds), (error)); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - }) +#define g_credentials_get_unix_pid(creds, error) \ + ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS(g_credentials_get_unix_pid)((creds), (error)); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) #else - #define g_credentials_get_unix_pid(creds, error) \ - ({ \ - struct ucred *native_creds; \ - \ - native_creds = g_credentials_get_native((creds), G_CREDENTIALS_TYPE_LINUX_UCRED); \ - g_assert(native_creds); \ - native_creds->pid; \ - }) +#define g_credentials_get_unix_pid(creds, error) \ + ({ \ + struct ucred *native_creds; \ + \ + native_creds = g_credentials_get_native((creds), G_CREDENTIALS_TYPE_LINUX_UCRED); \ + g_assert(native_creds); \ + native_creds->pid; \ + }) #endif /*****************************************************************************/ @@ -387,28 +387,28 @@ _nm_g_hash_table_get_keys_as_array(GHashTable *hash_table, guint *length) } #endif #if !GLIB_CHECK_VERSION(2, 40, 0) - #define g_hash_table_get_keys_as_array(hash_table, length) \ - ({ _nm_g_hash_table_get_keys_as_array(hash_table, length); }) +#define g_hash_table_get_keys_as_array(hash_table, length) \ + ({ _nm_g_hash_table_get_keys_as_array(hash_table, length); }) #else - #define g_hash_table_get_keys_as_array(hash_table, length) \ - ({ \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS(g_hash_table_get_keys_as_array) \ - ((hash_table), (length)); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - }) +#define g_hash_table_get_keys_as_array(hash_table, length) \ + ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS(g_hash_table_get_keys_as_array) \ + ((hash_table), (length)); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) #endif /*****************************************************************************/ #ifndef g_info - /* g_info was only added with 2.39.2 */ - #define g_info(...) g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, __VA_ARGS__) +/* g_info was only added with 2.39.2 */ +#define g_info(...) g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, __VA_ARGS__) #endif /*****************************************************************************/ #ifdef g_steal_pointer - #undef g_steal_pointer +#undef g_steal_pointer #endif #define g_steal_pointer(pp) \ @@ -460,7 +460,7 @@ _nm_g_variant_new_take_string(char *string) return value; #elif !GLIB_CHECK_VERSION(2, 38, 0) GVariant *value; - GBytes * bytes; + GBytes *bytes; g_return_val_if_fail(string != NULL, NULL); g_return_val_if_fail(g_utf8_validate(string, -1, NULL), NULL); @@ -494,17 +494,17 @@ _nm_printf(1, 2) static inline GVariant *_nm_g_variant_new_printf(const char *fo return g_variant_new_take_string(string); } - #define g_variant_new_printf(...) _nm_g_variant_new_printf(__VA_ARGS__) +#define g_variant_new_printf(...) _nm_g_variant_new_printf(__VA_ARGS__) #else - #define g_variant_new_printf(...) \ - ({ \ - GVariant *_v; \ - \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - _v = g_variant_new_printf(__VA_ARGS__); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - _v; \ - }) +#define g_variant_new_printf(...) \ + ({ \ + GVariant *_v; \ + \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + _v = g_variant_new_printf(__VA_ARGS__); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + _v; \ + }) #endif /*****************************************************************************/ @@ -525,11 +525,11 @@ _nm_printf(1, 2) static inline GVariant *_nm_g_variant_new_printf(const char *fo /*****************************************************************************/ #ifndef g_autofree - /* we still don't rely on recent glib to provide g_autofree. Hence, we continue +/* we still don't rely on recent glib to provide g_autofree. Hence, we continue * to use our gs_* free macros that we took from libgsystem. * * To ease migration towards g_auto*, add a compat define for g_autofree. */ - #define g_autofree gs_free +#define g_autofree gs_free #endif /*****************************************************************************/ @@ -553,7 +553,7 @@ _nm_g_value_unset(GValue *value) if (value->g_type != 0) g_value_unset(value); } - #define g_value_unset _nm_g_value_unset +#define g_value_unset _nm_g_value_unset #endif /* G_PID_FORMAT was added only in 2.53.5. Define it ourself. @@ -666,20 +666,20 @@ g_hash_table_steal_extended(GHashTable * hash_table, return FALSE; } #else - #define g_hash_table_steal_extended(hash_table, lookup_key, stolen_key, stolen_value) \ - ({ \ - gpointer *_stolen_key = (stolen_key); \ - gpointer *_stolen_value = (stolen_value); \ - \ - /* we cannot allow NULL arguments, because then we would leak the values in +#define g_hash_table_steal_extended(hash_table, lookup_key, stolen_key, stolen_value) \ + ({ \ + gpointer *_stolen_key = (stolen_key); \ + gpointer *_stolen_value = (stolen_value); \ + \ + /* we cannot allow NULL arguments, because then we would leak the values in * the compat implementation. */ \ - g_assert(_stolen_key); \ - g_assert(_stolen_value); \ - \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_hash_table_steal_extended(hash_table, lookup_key, _stolen_key, _stolen_value); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - }) + g_assert(_stolen_key); \ + g_assert(_stolen_value); \ + \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_hash_table_steal_extended(hash_table, lookup_key, _stolen_key, _stolen_value); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) #endif /*****************************************************************************/ diff --git a/src/libnm-glib-aux/nm-hash-utils.h b/src/libnm-glib-aux/nm-hash-utils.h index 0a68bde685..a36a8b8a2a 100644 --- a/src/libnm-glib-aux/nm-hash-utils.h +++ b/src/libnm-glib-aux/nm-hash-utils.h @@ -189,15 +189,15 @@ nm_hash_update_str(NMHashState *state, const char *str) } #if _NM_CC_SUPPORT_GENERIC - /* Like nm_hash_update_str(), but restricted to arrays only. nm_hash_update_str() only works +/* Like nm_hash_update_str(), but restricted to arrays only. nm_hash_update_str() only works * with a @str argument that cannot be NULL. If you have a string pointer, that is never NULL, use * nm_hash_update() instead. */ - #define nm_hash_update_strarr(state, str) \ - (_Generic(&(str), const char(*)[sizeof(str)] \ - : nm_hash_update_str((state), (str)), char(*)[sizeof(str)] \ - : nm_hash_update_str((state), (str)))) +#define nm_hash_update_strarr(state, str) \ + (_Generic(&(str), const char(*)[sizeof(str)] \ + : nm_hash_update_str((state), (str)), char(*)[sizeof(str)] \ + : nm_hash_update_str((state), (str)))) #else - #define nm_hash_update_strarr(state, str) nm_hash_update_str((state), (str)) +#define nm_hash_update_strarr(state, str) nm_hash_update_str((state), (str)) #endif guint nm_hash_ptr(gconstpointer ptr); diff --git a/src/libnm-glib-aux/nm-jansson.h b/src/libnm-glib-aux/nm-jansson.h index 6173a7ac61..a907d2bbe6 100644 --- a/src/libnm-glib-aux/nm-jansson.h +++ b/src/libnm-glib-aux/nm-jansson.h @@ -10,20 +10,20 @@ #if WITH_JANSSON - #include +#include - /* Added in Jansson v2.8 */ - #ifndef json_object_foreach_safe - #define json_object_foreach_safe(object, n, key, value) \ - for (key = json_object_iter_key(json_object_iter(object)), \ - n = json_object_iter_next(object, json_object_key_to_iter(key)); \ - key && (value = json_object_iter_value(json_object_key_to_iter(key))); \ - key = json_object_iter_key(n), \ - n = json_object_iter_next(object, json_object_key_to_iter(key))) - #endif +/* Added in Jansson v2.8 */ +#ifndef json_object_foreach_safe +#define json_object_foreach_safe(object, n, key, value) \ + for (key = json_object_iter_key(json_object_iter(object)), \ + n = json_object_iter_next(object, json_object_key_to_iter(key)); \ + key && (value = json_object_iter_value(json_object_key_to_iter(key))); \ + key = json_object_iter_key(n), \ + n = json_object_iter_next(object, json_object_key_to_iter(key))) +#endif NM_AUTO_DEFINE_FCN0(json_t *, _nm_auto_decref_json, json_decref); - #define nm_auto_decref_json nm_auto(_nm_auto_decref_json) +#define nm_auto_decref_json nm_auto(_nm_auto_decref_json) #endif /* WITH_JANSON */ diff --git a/src/libnm-glib-aux/nm-json-aux.c b/src/libnm-glib-aux/nm-json-aux.c index dc67d6d593..0a3b25f8e3 100644 --- a/src/libnm-glib-aux/nm-json-aux.c +++ b/src/libnm-glib-aux/nm-json-aux.c @@ -16,7 +16,7 @@ * program). But that needs to be fixed by the json libraries, and it is by adding * symbol versioning in recent versions. */ #ifndef RTLD_DEEPBIND - #define RTLD_DEEPBIND 0 +#define RTLD_DEEPBIND 0 #endif /*****************************************************************************/ @@ -174,7 +174,7 @@ _nm_json_vt_internal_load(void) #elif !WITH_JANSSON && !defined(JANSSON_SONAME) soname = NULL; #else - #error "WITH_JANSON and JANSSON_SONAME are defined inconsistently." +#error "WITH_JANSON and JANSSON_SONAME are defined inconsistently." #endif if (!soname) diff --git a/src/libnm-glib-aux/nm-logging-fwd.h b/src/libnm-glib-aux/nm-logging-fwd.h index 0ede91b2bc..3e999c4a9c 100644 --- a/src/libnm-glib-aux/nm-logging-fwd.h +++ b/src/libnm-glib-aux/nm-logging-fwd.h @@ -182,28 +182,28 @@ extern void _nm_utils_monotonic_timestamp_initialized(const struct timespec *tp, /* _LOGT() and _LOGt() both log with level TRACE, but the latter is disabled by default, * unless building with --with-more-logging. */ #if NM_MORE_LOGGING - #define _LOGt_ENABLED(...) _NMLOG_ENABLED(_LOGL_TRACE, ##__VA_ARGS__) - #define _LOGt(...) _NMLOG(_LOGL_TRACE, __VA_ARGS__) - #define _LOGt_err(errsv, ...) _NMLOG_err(errsv, _LOGL_TRACE, __VA_ARGS__) +#define _LOGt_ENABLED(...) _NMLOG_ENABLED(_LOGL_TRACE, ##__VA_ARGS__) +#define _LOGt(...) _NMLOG(_LOGL_TRACE, __VA_ARGS__) +#define _LOGt_err(errsv, ...) _NMLOG_err(errsv, _LOGL_TRACE, __VA_ARGS__) #else - /* still call the logging macros to get compile time checks, but they will be optimized out. */ - #define _LOGt_ENABLED(...) (FALSE && (_NMLOG_ENABLED(_LOGL_TRACE, ##__VA_ARGS__))) - #define _LOGt(...) \ - G_STMT_START \ - { \ - if (FALSE) { \ - _NMLOG(_LOGL_TRACE, __VA_ARGS__); \ - } \ - } \ - G_STMT_END - #define _LOGt_err(errsv, ...) \ - G_STMT_START \ - { \ - if (FALSE) { \ - _NMLOG_err(errsv, _LOGL_TRACE, __VA_ARGS__); \ - } \ - } \ - G_STMT_END +/* still call the logging macros to get compile time checks, but they will be optimized out. */ +#define _LOGt_ENABLED(...) (FALSE && (_NMLOG_ENABLED(_LOGL_TRACE, ##__VA_ARGS__))) +#define _LOGt(...) \ + G_STMT_START \ + { \ + if (FALSE) { \ + _NMLOG(_LOGL_TRACE, __VA_ARGS__); \ + } \ + } \ + G_STMT_END +#define _LOGt_err(errsv, ...) \ + G_STMT_START \ + { \ + if (FALSE) { \ + _NMLOG_err(errsv, _LOGL_TRACE, __VA_ARGS__); \ + } \ + } \ + G_STMT_END #endif /*****************************************************************************/ @@ -236,28 +236,28 @@ extern void _nm_utils_monotonic_timestamp_initialized(const struct timespec *tp, #define _LOG2E_err(errsv, ...) _NMLOG2_err(errsv, _LOGL_ERR, __VA_ARGS__) #if NM_MORE_LOGGING - #define _LOG2t_ENABLED(...) _NMLOG2_ENABLED(_LOGL_TRACE, ##__VA_ARGS__) - #define _LOG2t(...) _NMLOG2(_LOGL_TRACE, __VA_ARGS__) - #define _LOG2t_err(errsv, ...) _NMLOG2_err(errsv, _LOGL_TRACE, __VA_ARGS__) +#define _LOG2t_ENABLED(...) _NMLOG2_ENABLED(_LOGL_TRACE, ##__VA_ARGS__) +#define _LOG2t(...) _NMLOG2(_LOGL_TRACE, __VA_ARGS__) +#define _LOG2t_err(errsv, ...) _NMLOG2_err(errsv, _LOGL_TRACE, __VA_ARGS__) #else - /* still call the logging macros to get compile time checks, but they will be optimized out. */ - #define _LOG2t_ENABLED(...) (FALSE && (_NMLOG2_ENABLED(_LOGL_TRACE, ##__VA_ARGS__))) - #define _LOG2t(...) \ - G_STMT_START \ - { \ - if (FALSE) { \ - _NMLOG2(_LOGL_TRACE, __VA_ARGS__); \ - } \ - } \ - G_STMT_END - #define _LOG2t_err(errsv, ...) \ - G_STMT_START \ - { \ - if (FALSE) { \ - _NMLOG2_err(errsv, _LOGL_TRACE, __VA_ARGS__); \ - } \ - } \ - G_STMT_END +/* still call the logging macros to get compile time checks, but they will be optimized out. */ +#define _LOG2t_ENABLED(...) (FALSE && (_NMLOG2_ENABLED(_LOGL_TRACE, ##__VA_ARGS__))) +#define _LOG2t(...) \ + G_STMT_START \ + { \ + if (FALSE) { \ + _NMLOG2(_LOGL_TRACE, __VA_ARGS__); \ + } \ + } \ + G_STMT_END +#define _LOG2t_err(errsv, ...) \ + G_STMT_START \ + { \ + if (FALSE) { \ + _NMLOG2_err(errsv, _LOGL_TRACE, __VA_ARGS__); \ + } \ + } \ + G_STMT_END #endif #define _NMLOG3_ENABLED(level) (nm_logging_enabled((level), (_NMLOG3_DOMAIN))) @@ -281,28 +281,28 @@ extern void _nm_utils_monotonic_timestamp_initialized(const struct timespec *tp, #define _LOG3E_err(errsv, ...) _NMLOG3_err(errsv, _LOGL_ERR, __VA_ARGS__) #if NM_MORE_LOGGING - #define _LOG3t_ENABLED(...) _NMLOG3_ENABLED(_LOGL_TRACE, ##__VA_ARGS__) - #define _LOG3t(...) _NMLOG3(_LOGL_TRACE, __VA_ARGS__) - #define _LOG3t_err(errsv, ...) _NMLOG3_err(errsv, _LOGL_TRACE, __VA_ARGS__) +#define _LOG3t_ENABLED(...) _NMLOG3_ENABLED(_LOGL_TRACE, ##__VA_ARGS__) +#define _LOG3t(...) _NMLOG3(_LOGL_TRACE, __VA_ARGS__) +#define _LOG3t_err(errsv, ...) _NMLOG3_err(errsv, _LOGL_TRACE, __VA_ARGS__) #else - /* still call the logging macros to get compile time checks, but they will be optimized out. */ - #define _LOG3t_ENABLED(...) (FALSE && (_NMLOG3_ENABLED(_LOGL_TRACE, ##__VA_ARGS__))) - #define _LOG3t(...) \ - G_STMT_START \ - { \ - if (FALSE) { \ - _NMLOG3(_LOGL_TRACE, __VA_ARGS__); \ - } \ - } \ - G_STMT_END - #define _LOG3t_err(errsv, ...) \ - G_STMT_START \ - { \ - if (FALSE) { \ - _NMLOG3_err(errsv, _LOGL_TRACE, __VA_ARGS__); \ - } \ - } \ - G_STMT_END +/* still call the logging macros to get compile time checks, but they will be optimized out. */ +#define _LOG3t_ENABLED(...) (FALSE && (_NMLOG3_ENABLED(_LOGL_TRACE, ##__VA_ARGS__))) +#define _LOG3t(...) \ + G_STMT_START \ + { \ + if (FALSE) { \ + _NMLOG3(_LOGL_TRACE, __VA_ARGS__); \ + } \ + } \ + G_STMT_END +#define _LOG3t_err(errsv, ...) \ + G_STMT_START \ + { \ + if (FALSE) { \ + _NMLOG3_err(errsv, _LOGL_TRACE, __VA_ARGS__); \ + } \ + } \ + G_STMT_END #endif /*****************************************************************************/ diff --git a/src/libnm-glib-aux/nm-macros-internal.h b/src/libnm-glib-aux/nm-macros-internal.h index f838c56eed..21fc91d86b 100644 --- a/src/libnm-glib-aux/nm-macros-internal.h +++ b/src/libnm-glib-aux/nm-macros-internal.h @@ -176,9 +176,9 @@ _nm_auto_freev(gpointer ptr) /*****************************************************************************/ #if defined(__GNUC__) - #define _NM_PRAGMA_WARNING_DO(warning) G_STRINGIFY(GCC diagnostic ignored warning) +#define _NM_PRAGMA_WARNING_DO(warning) G_STRINGIFY(GCC diagnostic ignored warning) #elif defined(__clang__) - #define _NM_PRAGMA_WARNING_DO(warning) G_STRINGIFY(clang diagnostic ignored warning) +#define _NM_PRAGMA_WARNING_DO(warning) G_STRINGIFY(clang diagnostic ignored warning) #endif /* you can only suppress a specific warning that the compiler @@ -188,23 +188,22 @@ _nm_auto_freev(gpointer ptr) * same name for the same warning. */ #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) - #define NM_PRAGMA_WARNING_DISABLE(warning) \ - _Pragma("GCC diagnostic push") _Pragma(_NM_PRAGMA_WARNING_DO(warning)) +#define NM_PRAGMA_WARNING_DISABLE(warning) \ + _Pragma("GCC diagnostic push") _Pragma(_NM_PRAGMA_WARNING_DO(warning)) #elif defined(__clang__) - #define NM_PRAGMA_WARNING_DISABLE(warning) \ - _Pragma("clang diagnostic push") \ - _Pragma(_NM_PRAGMA_WARNING_DO("-Wunknown-warning-option")) \ - _Pragma(_NM_PRAGMA_WARNING_DO(warning)) +#define NM_PRAGMA_WARNING_DISABLE(warning) \ + _Pragma("clang diagnostic push") _Pragma(_NM_PRAGMA_WARNING_DO("-Wunknown-warning-option")) \ + _Pragma(_NM_PRAGMA_WARNING_DO(warning)) #else - #define NM_PRAGMA_WARNING_DISABLE(warning) +#define NM_PRAGMA_WARNING_DISABLE(warning) #endif #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) - #define NM_PRAGMA_WARNING_REENABLE _Pragma("GCC diagnostic pop") +#define NM_PRAGMA_WARNING_REENABLE _Pragma("GCC diagnostic pop") #elif defined(__clang__) - #define NM_PRAGMA_WARNING_REENABLE _Pragma("clang diagnostic pop") +#define NM_PRAGMA_WARNING_REENABLE _Pragma("clang diagnostic pop") #else - #define NM_PRAGMA_WARNING_REENABLE +#define NM_PRAGMA_WARNING_REENABLE #endif /*****************************************************************************/ @@ -230,15 +229,15 @@ NM_G_ERROR_MSG(GError *error) /*****************************************************************************/ #ifndef _NM_CC_SUPPORT_AUTO_TYPE - #if (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9))) - #define _NM_CC_SUPPORT_AUTO_TYPE 1 - #else - #define _NM_CC_SUPPORT_AUTO_TYPE 0 - #endif +#if (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9))) +#define _NM_CC_SUPPORT_AUTO_TYPE 1 +#else +#define _NM_CC_SUPPORT_AUTO_TYPE 0 +#endif #endif #ifndef _NM_CC_SUPPORT_GENERIC - /* In the meantime, NetworkManager requires C11 and _Generic() should always be available. +/* In the meantime, NetworkManager requires C11 and _Generic() should always be available. * However, shared/nm-utils may also be used in VPN/applet, which possibly did not yet * bump the C standard requirement. Leave this for the moment, but eventually we can * drop it. @@ -246,20 +245,20 @@ NM_G_ERROR_MSG(GError *error) * Technically, gcc 4.9 already has some support for _Generic(). But there seems * to be issues with propagating "const char *[5]" to "const char **". Only assume * we have _Generic() since gcc 5. */ - #if (defined(__GNUC__) && __GNUC__ >= 5) || (defined(__clang__)) - #define _NM_CC_SUPPORT_GENERIC 1 - #else - #define _NM_CC_SUPPORT_GENERIC 0 - #endif +#if (defined(__GNUC__) && __GNUC__ >= 5) || (defined(__clang__)) +#define _NM_CC_SUPPORT_GENERIC 1 +#else +#define _NM_CC_SUPPORT_GENERIC 0 +#endif #endif #if _NM_CC_SUPPORT_AUTO_TYPE - #define _nm_auto_type __auto_type +#define _nm_auto_type __auto_type #endif #if _NM_CC_SUPPORT_GENERIC - #define _NM_CONSTCAST_FULL_1(type, obj_expr, obj) \ - (_Generic ((obj_expr), \ +#define _NM_CONSTCAST_FULL_1(type, obj_expr, obj) \ + (_Generic ((obj_expr), \ const void *const: ((const type *) (obj)), \ const void * : ((const type *) (obj)), \ void *const: (( type *) (obj)), \ @@ -268,8 +267,8 @@ NM_G_ERROR_MSG(GError *error) const type * : ((const type *) (obj)), \ type *const: (( type *) (obj)), \ type * : (( type *) (obj)))) - #define _NM_CONSTCAST_FULL_2(type, obj_expr, obj, alias_type2) \ - (_Generic ((obj_expr), \ +#define _NM_CONSTCAST_FULL_2(type, obj_expr, obj, alias_type2) \ + (_Generic ((obj_expr), \ const void *const: ((const type *) (obj)), \ const void * : ((const type *) (obj)), \ void *const: (( type *) (obj)), \ @@ -282,8 +281,8 @@ NM_G_ERROR_MSG(GError *error) const type * : ((const type *) (obj)), \ type *const: (( type *) (obj)), \ type * : (( type *) (obj)))) - #define _NM_CONSTCAST_FULL_3(type, obj_expr, obj, alias_type2, alias_type3) \ - (_Generic ((obj_expr), \ +#define _NM_CONSTCAST_FULL_3(type, obj_expr, obj, alias_type2, alias_type3) \ + (_Generic ((obj_expr), \ const void *const: ((const type *) (obj)), \ const void * : ((const type *) (obj)), \ void *const: (( type *) (obj)), \ @@ -300,8 +299,8 @@ NM_G_ERROR_MSG(GError *error) const type * : ((const type *) (obj)), \ type *const: (( type *) (obj)), \ type * : (( type *) (obj)))) - #define _NM_CONSTCAST_FULL_4(type, obj_expr, obj, alias_type2, alias_type3, alias_type4) \ - (_Generic ((obj_expr), \ +#define _NM_CONSTCAST_FULL_4(type, obj_expr, obj, alias_type2, alias_type3, alias_type4) \ + (_Generic ((obj_expr), \ const void *const: ((const type *) (obj)), \ const void * : ((const type *) (obj)), \ void *const: (( type *) (obj)), \ @@ -322,34 +321,34 @@ NM_G_ERROR_MSG(GError *error) const type * : ((const type *) (obj)), \ type *const: (( type *) (obj)), \ type * : (( type *) (obj)))) - #define _NM_CONSTCAST_FULL_x(type, obj_expr, obj, n, ...) \ - (_NM_CONSTCAST_FULL_##n(type, obj_expr, obj, ##__VA_ARGS__)) - #define _NM_CONSTCAST_FULL_y(type, obj_expr, obj, n, ...) \ - (_NM_CONSTCAST_FULL_x(type, obj_expr, obj, n, ##__VA_ARGS__)) - #define NM_CONSTCAST_FULL(type, obj_expr, obj, ...) \ - (_NM_CONSTCAST_FULL_y(type, obj_expr, obj, NM_NARG(dummy, ##__VA_ARGS__), ##__VA_ARGS__)) +#define _NM_CONSTCAST_FULL_x(type, obj_expr, obj, n, ...) \ + (_NM_CONSTCAST_FULL_##n(type, obj_expr, obj, ##__VA_ARGS__)) +#define _NM_CONSTCAST_FULL_y(type, obj_expr, obj, n, ...) \ + (_NM_CONSTCAST_FULL_x(type, obj_expr, obj, n, ##__VA_ARGS__)) +#define NM_CONSTCAST_FULL(type, obj_expr, obj, ...) \ + (_NM_CONSTCAST_FULL_y(type, obj_expr, obj, NM_NARG(dummy, ##__VA_ARGS__), ##__VA_ARGS__)) #else - #define NM_CONSTCAST_FULL(type, obj_expr, obj, ...) ((type *) (obj)) +#define NM_CONSTCAST_FULL(type, obj_expr, obj, ...) ((type *) (obj)) #endif #define NM_CONSTCAST(type, obj, ...) NM_CONSTCAST_FULL(type, (obj), (obj), ##__VA_ARGS__) #if _NM_CC_SUPPORT_GENERIC - #define NM_UNCONST_PTR(type, arg) \ - _Generic((arg), const type * : ((type *) (arg)), type * : ((type *) (arg))) +#define NM_UNCONST_PTR(type, arg) \ + _Generic((arg), const type * : ((type *) (arg)), type * : ((type *) (arg))) #else - #define NM_UNCONST_PTR(type, arg) ((type *) (arg)) +#define NM_UNCONST_PTR(type, arg) ((type *) (arg)) #endif #if _NM_CC_SUPPORT_GENERIC - #define NM_UNCONST_PPTR(type, arg) \ - _Generic ((arg), \ +#define NM_UNCONST_PPTR(type, arg) \ + _Generic ((arg), \ const type * *: ((type **) (arg)), \ type * *: ((type **) (arg)), \ const type *const*: ((type **) (arg)), \ type *const*: ((type **) (arg))) #else - #define NM_UNCONST_PPTR(type, arg) ((type **) (arg)) +#define NM_UNCONST_PPTR(type, arg) ((type **) (arg)) #endif #define NM_GOBJECT_CAST(type, obj, is_check, ...) \ @@ -377,29 +376,29 @@ NM_G_ERROR_MSG(GError *error) }) #if _NM_CC_SUPPORT_GENERIC - /* returns @value, if the type of @value matches @type. +/* returns @value, if the type of @value matches @type. * This requires support for C11 _Generic(). If no support is * present, this returns @value directly. * * It's useful to check the let the compiler ensure that @value is * of a certain type. */ - #define _NM_ENSURE_TYPE(type, value) (_Generic((value), type : (value))) - #define _NM_ENSURE_TYPE_CONST(type, value) \ - (_Generic((value), const type \ - : ((const type) (value)), const type const \ - : ((const type) (value)), type \ - : ((const type) (value)), type const \ - : ((const type) (value)))) +#define _NM_ENSURE_TYPE(type, value) (_Generic((value), type : (value))) +#define _NM_ENSURE_TYPE_CONST(type, value) \ + (_Generic((value), const type \ + : ((const type) (value)), const type const \ + : ((const type) (value)), type \ + : ((const type) (value)), type const \ + : ((const type) (value)))) #else - #define _NM_ENSURE_TYPE(type, value) (value) - #define _NM_ENSURE_TYPE_CONST(type, value) ((const type) (value)) +#define _NM_ENSURE_TYPE(type, value) (value) +#define _NM_ENSURE_TYPE_CONST(type, value) ((const type) (value)) #endif #if _NM_CC_SUPPORT_GENERIC && (!defined(__clang__) || __clang_major__ > 3) - #define NM_STRUCT_OFFSET_ENSURE_TYPE(type, container, field) \ - (_Generic((&(((container *) NULL)->field))[0], type : G_STRUCT_OFFSET(container, field))) +#define NM_STRUCT_OFFSET_ENSURE_TYPE(type, container, field) \ + (_Generic((&(((container *) NULL)->field))[0], type : G_STRUCT_OFFSET(container, field))) #else - #define NM_STRUCT_OFFSET_ENSURE_TYPE(type, container, field) G_STRUCT_OFFSET(container, field) +#define NM_STRUCT_OFFSET_ENSURE_TYPE(type, container, field) G_STRUCT_OFFSET(container, field) #endif /* Casts (arg) to (type**), but also having a compile time check that @@ -418,7 +417,7 @@ NM_G_ERROR_MSG(GError *error) }) #if _NM_CC_SUPPORT_GENERIC - /* these macros cast (value) to +/* these macros cast (value) to * - "const char **" (for "MC", mutable-const) * - "const char *const*" (for "CC", const-const) * The point is to do this cast, but only accepting pointers @@ -434,13 +433,13 @@ NM_G_ERROR_MSG(GError *error) * These macros do the cast, but they only accept a compatible input * type, otherwise they will fail compilation. */ - #define NM_CAST_STRV_MC(value) \ - (_Generic ((value), \ +#define NM_CAST_STRV_MC(value) \ + (_Generic ((value), \ const char * *: (const char * *) (value), \ char * *: (const char * *) (value), \ void *: (const char * *) (value))) - #define NM_CAST_STRV_CC(value) \ - (_Generic ((value), \ +#define NM_CAST_STRV_CC(value) \ + (_Generic ((value), \ const char *const*: (const char *const*) (value), \ const char * *: (const char *const*) (value), \ char *const*: (const char *const*) (value), \ @@ -454,18 +453,18 @@ NM_G_ERROR_MSG(GError *error) const void *const: (const char *const*) (value), \ void *const: (const char *const*) (value))) #else - #define NM_CAST_STRV_MC(value) ((const char **) (value)) - #define NM_CAST_STRV_CC(value) ((const char *const *) (value)) +#define NM_CAST_STRV_MC(value) ((const char **) (value)) +#define NM_CAST_STRV_CC(value) ((const char *const *) (value)) #endif #if _NM_CC_SUPPORT_GENERIC - #define NM_PROPAGATE_CONST(test_expr, ptr) \ - (_Generic ((test_expr), \ +#define NM_PROPAGATE_CONST(test_expr, ptr) \ + (_Generic ((test_expr), \ const typeof (*(test_expr)) *: ((const typeof (*(ptr)) *) (ptr)), \ default: (_Generic ((test_expr), \ typeof (*(test_expr)) *: (ptr))))) #else - #define NM_PROPAGATE_CONST(test_expr, ptr) (ptr) +#define NM_PROPAGATE_CONST(test_expr, ptr) (ptr) #endif /* with the way it is implemented, the caller may or may not pass a trailing @@ -685,16 +684,16 @@ nm_str_realloc(char *str) #define _NM_GET_PRIVATE(self, type, is_check, ...) \ (&(NM_GOBJECT_CAST_NON_NULL(type, (self), is_check, ##__VA_ARGS__)->_priv)) #if _NM_CC_SUPPORT_AUTO_TYPE - #define _NM_GET_PRIVATE_PTR(self, type, is_check, ...) \ - ({ \ - _nm_auto_type _self_get_private = \ - NM_GOBJECT_CAST_NON_NULL(type, (self), is_check, ##__VA_ARGS__); \ - \ - NM_PROPAGATE_CONST(_self_get_private, _self_get_private->_priv); \ - }) +#define _NM_GET_PRIVATE_PTR(self, type, is_check, ...) \ + ({ \ + _nm_auto_type _self_get_private = \ + NM_GOBJECT_CAST_NON_NULL(type, (self), is_check, ##__VA_ARGS__); \ + \ + NM_PROPAGATE_CONST(_self_get_private, _self_get_private->_priv); \ + }) #else - #define _NM_GET_PRIVATE_PTR(self, type, is_check, ...) \ - (NM_GOBJECT_CAST_NON_NULL(type, (self), is_check, ##__VA_ARGS__)->_priv) +#define _NM_GET_PRIVATE_PTR(self, type, is_check, ...) \ + (NM_GOBJECT_CAST_NON_NULL(type, (self), is_check, ##__VA_ARGS__)->_priv) #endif /*****************************************************************************/ @@ -972,15 +971,15 @@ nm_g_variant_take_ref(GVariant *v) return (v); \ } #define NM_UTILS_LOOKUP_ITEM(v, n) \ -case v: \ - return (n); + case v: \ + return (n); #define NM_UTILS_LOOKUP_STR_ITEM(v, n) NM_UTILS_LOOKUP_ITEM(v, "" n "") #define NM_UTILS_LOOKUP_ITEM_IGNORE(v) \ -case v: \ - break; + case v: \ + break; #define NM_UTILS_LOOKUP_ITEM_IGNORE_OTHER() \ -default: \ - break; + default: \ + break; #define NM_UTILS_LOOKUP_DEFINE(fcn_name, lookup_type, result_type, unknown_val, ...) \ result_type fcn_name(lookup_type val) \ @@ -1387,28 +1386,28 @@ _nm_strndup_a_step(char *s, const char *str, gsize len) * * Instead, this generic macro is supposed to handle all integers correctly. */ #if _NM_CC_SUPPORT_GENERIC - #define nm_strdup_int(val) \ - _Generic((val), char \ - : g_strdup_printf("%d", (int) (val)), \ - \ - signed char \ - : g_strdup_printf("%d", (signed) (val)), signed short \ - : g_strdup_printf("%d", (signed) (val)), signed \ - : g_strdup_printf("%d", (signed) (val)), signed long \ - : g_strdup_printf("%ld", (signed long) (val)), signed long long \ - : g_strdup_printf("%lld", (signed long long) (val)), \ - \ - unsigned char \ - : g_strdup_printf("%u", (unsigned) (val)), unsigned short \ - : g_strdup_printf("%u", (unsigned) (val)), unsigned \ - : g_strdup_printf("%u", (unsigned) (val)), unsigned long \ - : g_strdup_printf("%lu", (unsigned long) (val)), unsigned long long \ - : g_strdup_printf("%llu", (unsigned long long) (val))) +#define nm_strdup_int(val) \ + _Generic((val), char \ + : g_strdup_printf("%d", (int) (val)), \ + \ + signed char \ + : g_strdup_printf("%d", (signed) (val)), signed short \ + : g_strdup_printf("%d", (signed) (val)), signed \ + : g_strdup_printf("%d", (signed) (val)), signed long \ + : g_strdup_printf("%ld", (signed long) (val)), signed long long \ + : g_strdup_printf("%lld", (signed long long) (val)), \ + \ + unsigned char \ + : g_strdup_printf("%u", (unsigned) (val)), unsigned short \ + : g_strdup_printf("%u", (unsigned) (val)), unsigned \ + : g_strdup_printf("%u", (unsigned) (val)), unsigned long \ + : g_strdup_printf("%lu", (unsigned long) (val)), unsigned long long \ + : g_strdup_printf("%llu", (unsigned long long) (val))) #else - #define nm_strdup_int(val) \ - ((sizeof(val) == sizeof(guint64) && ((typeof(val)) -1) > 0) \ - ? g_strdup_printf("%" G_GUINT64_FORMAT, (guint64) (val)) \ - : g_strdup_printf("%" G_GINT64_FORMAT, (gint64) (val))) +#define nm_strdup_int(val) \ + ((sizeof(val) == sizeof(guint64) && ((typeof(val)) -1) > 0) \ + ? g_strdup_printf("%" G_GUINT64_FORMAT, (guint64) (val)) \ + : g_strdup_printf("%" G_GINT64_FORMAT, (gint64) (val))) #endif /*****************************************************************************/ @@ -1596,7 +1595,7 @@ nm_decode_version(guint version, guint *major, guint *minor, guint *micro) /*****************************************************************************/ #ifdef _G_BOOLEAN_EXPR - /* g_assert() uses G_LIKELY(), which in turn uses _G_BOOLEAN_EXPR(). +/* g_assert() uses G_LIKELY(), which in turn uses _G_BOOLEAN_EXPR(). * As glib's implementation uses a local variable _g_boolean_var_, * we cannot do * g_assert (some_macro ()); @@ -1606,8 +1605,8 @@ nm_decode_version(guint version, guint *major, guint *minor, guint *micro) * * Workaround that by re-defining _G_BOOLEAN_EXPR() **/ - #undef _G_BOOLEAN_EXPR - #define _G_BOOLEAN_EXPR(expr) NM_BOOLEAN_EXPR(expr) +#undef _G_BOOLEAN_EXPR +#define _G_BOOLEAN_EXPR(expr) NM_BOOLEAN_EXPR(expr) #endif /*****************************************************************************/ diff --git a/src/libnm-glib-aux/nm-random-utils.c b/src/libnm-glib-aux/nm-random-utils.c index 4f861be055..e42eb309d0 100644 --- a/src/libnm-glib-aux/nm-random-utils.c +++ b/src/libnm-glib-aux/nm-random-utils.c @@ -11,9 +11,9 @@ #include #if USE_SYS_RANDOM_H - #include +#include #else - #include +#include #endif #include "nm-shared-utils.h" diff --git a/src/libnm-glib-aux/nm-shared-utils.h b/src/libnm-glib-aux/nm-shared-utils.h index 06b7e164fa..aa6fdc70c7 100644 --- a/src/libnm-glib-aux/nm-shared-utils.h +++ b/src/libnm-glib-aux/nm-shared-utils.h @@ -35,19 +35,19 @@ pid_t nm_utils_gettid(void); gboolean _nm_assert_on_main_thread(void); #if NM_MORE_ASSERTS > 5 - #define NM_ASSERT_ON_MAIN_THREAD() \ - G_STMT_START \ - { \ - nm_assert(_nm_assert_on_main_thread()); \ - } \ - G_STMT_END +#define NM_ASSERT_ON_MAIN_THREAD() \ + G_STMT_START \ + { \ + nm_assert(_nm_assert_on_main_thread()); \ + } \ + G_STMT_END #else - #define NM_ASSERT_ON_MAIN_THREAD() \ - G_STMT_START \ - { \ - ; \ - } \ - G_STMT_END +#define NM_ASSERT_ON_MAIN_THREAD() \ + G_STMT_START \ + { \ + ; \ + } \ + G_STMT_END #endif /*****************************************************************************/ @@ -79,20 +79,20 @@ _NM_INT_NOT_NEGATIVE(gssize val) * Together with the G_STATIC_ASSERT(), we make sure that this is always satisfied. */ G_STATIC_ASSERT(sizeof(int) == sizeof(gint32)); #if _NM_CC_SUPPORT_GENERIC - #define _NM_INT_LE_MAXINT32(value) \ - ({ \ - _nm_unused typeof(value) _value = (value); \ - \ - _Generic((value), int : TRUE); \ - }) +#define _NM_INT_LE_MAXINT32(value) \ + ({ \ + _nm_unused typeof(value) _value = (value); \ + \ + _Generic((value), int : TRUE); \ + }) #else - #define _NM_INT_LE_MAXINT32(value) \ - ({ \ - _nm_unused typeof(value) _value = (value); \ - _nm_unused const int * _p_value = &_value; \ - \ - TRUE; \ - }) +#define _NM_INT_LE_MAXINT32(value) \ + ({ \ + _nm_unused typeof(value) _value = (value); \ + _nm_unused const int * _p_value = &_value; \ + \ + TRUE; \ + }) #endif /*****************************************************************************/ @@ -1075,12 +1075,12 @@ const char *nm_utils_flags2str(const NMUtilsFlags2StrDesc *descs, /*****************************************************************************/ #define NM_UTILS_ENUM2STR(v, n) \ -case v: \ - s = "" n ""; \ - break; + case v: \ + s = "" n ""; \ + break; #define NM_UTILS_ENUM2STR_IGNORE(v) \ -case v: \ - break; + case v: \ + break; #define NM_UTILS_ENUM2STR_DEFINE_FULL(fcn_name, lookup_type, int_fmt, ...) \ const char *fcn_name(lookup_type val, char *buf, gsize len) \ @@ -2129,17 +2129,17 @@ GPtrArray *_nm_g_ptr_array_copy(GPtrArray * array, * Note that the @element_free_func MUST correspond to free function set in @array. */ #if GLIB_CHECK_VERSION(2, 62, 0) - #define nm_g_ptr_array_copy(array, func, user_data, element_free_func) \ - ({ \ - _nm_unused GDestroyNotify const _element_free_func = (element_free_func); \ - \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS; \ - g_ptr_array_copy((array), (func), (user_data)); \ - G_GNUC_END_IGNORE_DEPRECATIONS; \ - }) +#define nm_g_ptr_array_copy(array, func, user_data, element_free_func) \ + ({ \ + _nm_unused GDestroyNotify const _element_free_func = (element_free_func); \ + \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS; \ + g_ptr_array_copy((array), (func), (user_data)); \ + G_GNUC_END_IGNORE_DEPRECATIONS; \ + }) #else - #define nm_g_ptr_array_copy(array, func, user_data, element_free_func) \ - _nm_g_ptr_array_copy((array), (func), (user_data), (element_free_func)) +#define nm_g_ptr_array_copy(array, func, user_data, element_free_func) \ + _nm_g_ptr_array_copy((array), (func), (user_data), (element_free_func)) #endif /*****************************************************************************/ diff --git a/src/libnm-glib-aux/nm-test-utils.h b/src/libnm-glib-aux/nm-test-utils.h index ff8eb60662..cb092f6a85 100644 --- a/src/libnm-glib-aux/nm-test-utils.h +++ b/src/libnm-glib-aux/nm-test-utils.h @@ -81,8 +81,8 @@ *******************************************************************************/ #if defined(NM_ASSERT_NO_MSG) && NM_ASSERT_NO_MSG - #undef g_return_if_fail_warning - #undef g_assertion_message_expr +#undef g_return_if_fail_warning +#undef g_assertion_message_expr #endif #include @@ -693,42 +693,42 @@ nmtst_test_quick(void) } #if GLIB_CHECK_VERSION(2, 34, 0) - #undef g_test_expect_message - #define g_test_expect_message(...) \ - G_STMT_START \ - { \ - g_assert(nmtst_initialized()); \ - if (__nmtst_internal.assert_logging && __nmtst_internal.no_expect_message) { \ - g_debug("nmtst: assert-logging: g_test_expect_message %s", \ - G_STRINGIFY((__VA_ARGS__))); \ - } else { \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_test_expect_message(__VA_ARGS__); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - } \ - } \ - G_STMT_END - #undef g_test_assert_expected_messages_internal - #define g_test_assert_expected_messages_internal(domain, file, line, func) \ - G_STMT_START \ - { \ - const char *_domain = (domain); \ - const char *_file = (file); \ - const char *_func = (func); \ - int _line = (line); \ - \ - if (__nmtst_internal.assert_logging && __nmtst_internal.no_expect_message) \ - g_debug("nmtst: assert-logging: g_test_assert_expected_messages(%s, %s:%d, %s)", \ - _domain ?: "", \ - _file ?: "", \ - _line, \ - _func ?: ""); \ - \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_test_assert_expected_messages_internal(_domain, _file, _line, _func); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - } \ - G_STMT_END +#undef g_test_expect_message +#define g_test_expect_message(...) \ + G_STMT_START \ + { \ + g_assert(nmtst_initialized()); \ + if (__nmtst_internal.assert_logging && __nmtst_internal.no_expect_message) { \ + g_debug("nmtst: assert-logging: g_test_expect_message %s", \ + G_STRINGIFY((__VA_ARGS__))); \ + } else { \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_test_expect_message(__VA_ARGS__); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + } \ + } \ + G_STMT_END +#undef g_test_assert_expected_messages_internal +#define g_test_assert_expected_messages_internal(domain, file, line, func) \ + G_STMT_START \ + { \ + const char *_domain = (domain); \ + const char *_file = (file); \ + const char *_func = (func); \ + int _line = (line); \ + \ + if (__nmtst_internal.assert_logging && __nmtst_internal.no_expect_message) \ + g_debug("nmtst: assert-logging: g_test_assert_expected_messages(%s, %s:%d, %s)", \ + _domain ?: "", \ + _file ?: "", \ + _line, \ + _func ?: ""); \ + \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_test_assert_expected_messages_internal(_domain, _file, _line, _func); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + } \ + G_STMT_END #endif #define NMTST_EXPECT(domain, level, msg) g_test_expect_message(domain, level, msg) @@ -1475,9 +1475,9 @@ __define_nmtst_static(01, 1024) __define_nmtst_static(02, 1024) __define_nmtst_s #if defined(__NM_UTILS_H__) || defined(NM_UTILS_H) - #define NMTST_UUID_INIT(uuid) \ - gs_free char * _nmtst_hidden_##uuid = nm_utils_uuid_generate(); \ - const char *const uuid = _nmtst_hidden_##uuid +#define NMTST_UUID_INIT(uuid) \ + gs_free char * _nmtst_hidden_##uuid = nm_utils_uuid_generate(); \ + const char *const uuid = _nmtst_hidden_##uuid static inline const char *nmtst_uuid_generate(void) { @@ -1819,13 +1819,13 @@ _nmtst_assert_resolve_relative_path_equals(const char *f1, #ifdef __NETWORKMANAGER_LOGGING_H__ - #define NMTST_EXPECT_NM(level, msg) NMTST_EXPECT("NetworkManager", level, msg) +#define NMTST_EXPECT_NM(level, msg) NMTST_EXPECT("NetworkManager", level, msg) - #define NMTST_EXPECT_NM_ERROR(msg) NMTST_EXPECT_NM(G_LOG_LEVEL_MESSAGE, "* [*] " msg) - #define NMTST_EXPECT_NM_WARN(msg) NMTST_EXPECT_NM(G_LOG_LEVEL_MESSAGE, "* [*] " msg) - #define NMTST_EXPECT_NM_INFO(msg) NMTST_EXPECT_NM(G_LOG_LEVEL_INFO, "* [*] " msg) - #define NMTST_EXPECT_NM_DEBUG(msg) NMTST_EXPECT_NM(G_LOG_LEVEL_DEBUG, "* [*] " msg) - #define NMTST_EXPECT_NM_TRACE(msg) NMTST_EXPECT_NM(G_LOG_LEVEL_DEBUG, "* [*] " msg) +#define NMTST_EXPECT_NM_ERROR(msg) NMTST_EXPECT_NM(G_LOG_LEVEL_MESSAGE, "* [*] " msg) +#define NMTST_EXPECT_NM_WARN(msg) NMTST_EXPECT_NM(G_LOG_LEVEL_MESSAGE, "* [*] " msg) +#define NMTST_EXPECT_NM_INFO(msg) NMTST_EXPECT_NM(G_LOG_LEVEL_INFO, "* [*] " msg) +#define NMTST_EXPECT_NM_DEBUG(msg) NMTST_EXPECT_NM(G_LOG_LEVEL_DEBUG, "* [*] " msg) +#define NMTST_EXPECT_NM_TRACE(msg) NMTST_EXPECT_NM(G_LOG_LEVEL_DEBUG, "* [*] " msg) static inline void nmtst_init_with_logging(int *argc, char ***argv, const char *log_level, const char *log_domains) @@ -1987,11 +1987,11 @@ nmtst_clone_connection(NMConnection *connection) { g_assert(NM_IS_CONNECTION(connection)); - #if defined(__NM_SIMPLE_CONNECTION_H__) +#if defined(__NM_SIMPLE_CONNECTION_H__) return nm_simple_connection_new_clone(connection); - #else +#else return nm_connection_duplicate(connection); - #endif +#endif } static inline NMConnection * @@ -2015,11 +2015,11 @@ nmtst_create_minimal_connection(const char * id, if (type) { GType type_g; - #if defined(__NM_SIMPLE_CONNECTION_H__) +#if defined(__NM_SIMPLE_CONNECTION_H__) type_g = nm_setting_lookup_type(type); - #else +#else type_g = nm_connection_lookup_setting_type(type); - #endif +#endif g_assert(type_g != G_TYPE_INVALID); @@ -2027,11 +2027,11 @@ nmtst_create_minimal_connection(const char * id, g_assert(NM_IS_SETTING(s_base)); } - #if defined(__NM_SIMPLE_CONNECTION_H__) +#if defined(__NM_SIMPLE_CONNECTION_H__) con = nm_simple_connection_new(); - #else +#else con = nm_connection_new(); - #endif +#endif g_assert(con); @@ -2096,8 +2096,8 @@ _nmtst_connection_normalize(NMConnection *connection, ...) return was_modified; } - #define nmtst_connection_normalize(connection, ...) \ - _nmtst_connection_normalize(connection, ##__VA_ARGS__, NULL) +#define nmtst_connection_normalize(connection, ...) \ + _nmtst_connection_normalize(connection, ##__VA_ARGS__, NULL) static inline NMConnection * _nmtst_connection_duplicate_and_normalize(NMConnection *connection, ...) @@ -2112,8 +2112,8 @@ _nmtst_connection_duplicate_and_normalize(NMConnection *connection, ...) return connection; } - #define nmtst_connection_duplicate_and_normalize(connection, ...) \ - _nmtst_connection_duplicate_and_normalize(connection, ##__VA_ARGS__, NULL) +#define nmtst_connection_duplicate_and_normalize(connection, ...) \ + _nmtst_connection_duplicate_and_normalize(connection, ##__VA_ARGS__, NULL) static inline void nmtst_assert_connection_equals(NMConnection *a, @@ -2152,7 +2152,7 @@ nmtst_assert_connection_equals(NMConnection *a, } } - #ifdef __NM_KEYFILE_INTERNAL_H__ +#ifdef __NM_KEYFILE_INTERNAL_H__ { nm_auto_unref_keyfile GKeyFile *kf_a = NULL, *kf_b = NULL; gs_free char * str_a = NULL, *str_b = NULL; @@ -2174,7 +2174,7 @@ nmtst_assert_connection_equals(NMConnection *a, "the difference*):\n%s", str_b); } - #endif +#endif } g_assert(compare); g_assert(!out_settings); @@ -2308,8 +2308,8 @@ nmtst_assert_setting_verifies(NMSetting *setting) g_assert(success); } - #if defined(__NM_SIMPLE_CONNECTION_H__) && NM_CHECK_VERSION(1, 10, 0) \ - && (!defined(NM_VERSION_MAX_ALLOWED) || NM_VERSION_MAX_ALLOWED >= NM_VERSION_1_10) +#if defined(__NM_SIMPLE_CONNECTION_H__) && NM_CHECK_VERSION(1, 10, 0) \ + && (!defined(NM_VERSION_MAX_ALLOWED) || NM_VERSION_MAX_ALLOWED >= NM_VERSION_1_10) static inline void _nmtst_assert_connection_has_settings(NMConnection *connection, gboolean has_at_least, @@ -2363,13 +2363,13 @@ _nmtst_assert_connection_has_settings(NMConnection *connection, has_str); } } - #define nmtst_assert_connection_has_settings(connection, ...) \ - _nmtst_assert_connection_has_settings((connection), TRUE, TRUE, __VA_ARGS__, NULL) - #define nmtst_assert_connection_has_settings_at_least(connection, ...) \ - _nmtst_assert_connection_has_settings((connection), TRUE, FALSE, __VA_ARGS__, NULL) - #define nmtst_assert_connection_has_settings_at_most(connection, ...) \ - _nmtst_assert_connection_has_settings((connection), FALSE, TRUE, __VA_ARGS__, NULL) - #endif +#define nmtst_assert_connection_has_settings(connection, ...) \ + _nmtst_assert_connection_has_settings((connection), TRUE, TRUE, __VA_ARGS__, NULL) +#define nmtst_assert_connection_has_settings_at_least(connection, ...) \ + _nmtst_assert_connection_has_settings((connection), TRUE, FALSE, __VA_ARGS__, NULL) +#define nmtst_assert_connection_has_settings_at_most(connection, ...) \ + _nmtst_assert_connection_has_settings((connection), FALSE, TRUE, __VA_ARGS__, NULL) +#endif static inline void nmtst_assert_setting_verify_fails(NMSetting *setting, @@ -2485,8 +2485,8 @@ nmtst_assert_hwaddr_equals(gconstpointer hwaddr1, hwaddr1_len); } } - #define nmtst_assert_hwaddr_equals(hwaddr1, hwaddr1_len, expected) \ - nmtst_assert_hwaddr_equals(hwaddr1, hwaddr1_len, expected, __FILE__, __LINE__) +#define nmtst_assert_hwaddr_equals(hwaddr1, hwaddr1_len, expected) \ + nmtst_assert_hwaddr_equals(hwaddr1, hwaddr1_len, expected, __FILE__, __LINE__) #endif #if defined(__NM_SIMPLE_CONNECTION_H__) && defined(__NM_SETTING_CONNECTION_H__) \ @@ -2547,89 +2547,89 @@ _nmtst_variant_new_vardict(int dummy, ...) return g_variant_builder_end(&builder); } - #define nmtst_variant_new_vardict(...) _nmtst_variant_new_vardict(0, __VA_ARGS__, NULL) +#define nmtst_variant_new_vardict(...) _nmtst_variant_new_vardict(0, __VA_ARGS__, NULL) - #define nmtst_assert_variant_is_of_type(variant, type) \ - G_STMT_START \ - { \ - GVariant *_variantx = (variant); \ - \ - g_assert(_variantx); \ - g_assert(g_variant_is_of_type(_variantx, (type))); \ - } \ - G_STMT_END +#define nmtst_assert_variant_is_of_type(variant, type) \ + G_STMT_START \ + { \ + GVariant *_variantx = (variant); \ + \ + g_assert(_variantx); \ + g_assert(g_variant_is_of_type(_variantx, (type))); \ + } \ + G_STMT_END - #define nmtst_assert_variant_uint32(variant, val) \ - G_STMT_START \ - { \ - GVariant *_variant = (variant); \ +#define nmtst_assert_variant_uint32(variant, val) \ + G_STMT_START \ + { \ + GVariant *_variant = (variant); \ + \ + nmtst_assert_variant_is_of_type(_variant, G_VARIANT_TYPE_UINT32); \ + g_assert_cmpint(g_variant_get_uint32(_variant), ==, (val)); \ + } \ + G_STMT_END + +#define nmtst_assert_variant_string(variant, str) \ + G_STMT_START \ + { \ + gsize _l; \ + GVariant * _variant = (variant); \ + const char *_str = (str); \ + \ + nmtst_assert_variant_is_of_type(_variant, G_VARIANT_TYPE_STRING); \ + g_assert(_str); \ + g_assert_cmpstr(g_variant_get_string(_variant, &_l), ==, _str); \ + g_assert_cmpint(_l, ==, strlen(_str)); \ + } \ + G_STMT_END + +#ifdef __NM_SHARED_UTILS_H__ +#define _nmtst_assert_variant_bytestring_cmp_str(_ptr, _ptr2, _len) \ + G_STMT_START \ + { \ + if (memcmp(_ptr2, _ptr, _len) != 0) { \ + gs_free char *_x1 = NULL; \ + gs_free char *_x2 = NULL; \ + const char * _xx1; \ + const char * _xx2; \ + \ + _xx1 = nm_utils_buf_utf8safe_escape(_ptr, \ + _len, \ + NM_UTILS_STR_UTF8_SAFE_FLAG_ESCAPE_CTRL, \ + &_x1); \ + _xx2 = nm_utils_buf_utf8safe_escape(_ptr2, \ + _len, \ + NM_UTILS_STR_UTF8_SAFE_FLAG_ESCAPE_CTRL, \ + &_x2); \ + g_assert_cmpstr(_xx1, ==, _xx2); \ + g_assert_not_reached(); \ + } \ + } \ + G_STMT_END +#else +#define _nmtst_assert_variant_bytestring_cmp_str(_ptr, _ptr2, _len) \ + G_STMT_START {} \ + G_STMT_END +#endif + +#define nmtst_assert_variant_bytestring(variant, ptr, len) \ + G_STMT_START \ + { \ + GVariant * _variant = (variant); \ + gconstpointer _ptr = (ptr); \ + gconstpointer _ptr2; \ + gsize _len = (len); \ + gsize _len2; \ \ - nmtst_assert_variant_is_of_type(_variant, G_VARIANT_TYPE_UINT32); \ - g_assert_cmpint(g_variant_get_uint32(_variant), ==, (val)); \ + nmtst_assert_variant_is_of_type(_variant, G_VARIANT_TYPE_BYTESTRING); \ + _ptr2 = g_variant_get_fixed_array(_variant, &_len2, 1); \ + g_assert_cmpint(_len2, ==, _len); \ + if (_len != 0 && _ptr) { \ + _nmtst_assert_variant_bytestring_cmp_str(_ptr, _ptr2, _len); \ + g_assert_cmpmem(_ptr2, _len2, _ptr, _len); \ } \ - G_STMT_END - - #define nmtst_assert_variant_string(variant, str) \ - G_STMT_START \ - { \ - gsize _l; \ - GVariant * _variant = (variant); \ - const char *_str = (str); \ - \ - nmtst_assert_variant_is_of_type(_variant, G_VARIANT_TYPE_STRING); \ - g_assert(_str); \ - g_assert_cmpstr(g_variant_get_string(_variant, &_l), ==, _str); \ - g_assert_cmpint(_l, ==, strlen(_str)); \ - } \ - G_STMT_END - - #ifdef __NM_SHARED_UTILS_H__ - #define _nmtst_assert_variant_bytestring_cmp_str(_ptr, _ptr2, _len) \ - G_STMT_START \ - { \ - if (memcmp(_ptr2, _ptr, _len) != 0) { \ - gs_free char *_x1 = NULL; \ - gs_free char *_x2 = NULL; \ - const char * _xx1; \ - const char * _xx2; \ - \ - _xx1 = nm_utils_buf_utf8safe_escape(_ptr, \ - _len, \ - NM_UTILS_STR_UTF8_SAFE_FLAG_ESCAPE_CTRL, \ - &_x1); \ - _xx2 = nm_utils_buf_utf8safe_escape(_ptr2, \ - _len, \ - NM_UTILS_STR_UTF8_SAFE_FLAG_ESCAPE_CTRL, \ - &_x2); \ - g_assert_cmpstr(_xx1, ==, _xx2); \ - g_assert_not_reached(); \ - } \ - } \ - G_STMT_END - #else - #define _nmtst_assert_variant_bytestring_cmp_str(_ptr, _ptr2, _len) \ - G_STMT_START {} \ - G_STMT_END - #endif - - #define nmtst_assert_variant_bytestring(variant, ptr, len) \ - G_STMT_START \ - { \ - GVariant * _variant = (variant); \ - gconstpointer _ptr = (ptr); \ - gconstpointer _ptr2; \ - gsize _len = (len); \ - gsize _len2; \ - \ - nmtst_assert_variant_is_of_type(_variant, G_VARIANT_TYPE_BYTESTRING); \ - _ptr2 = g_variant_get_fixed_array(_variant, &_len2, 1); \ - g_assert_cmpint(_len2, ==, _len); \ - if (_len != 0 && _ptr) { \ - _nmtst_assert_variant_bytestring_cmp_str(_ptr, _ptr2, _len); \ - g_assert_cmpmem(_ptr2, _len2, _ptr, _len); \ - } \ - } \ - G_STMT_END + } \ + G_STMT_END typedef enum { NMTST_VARIANT_EDITOR_CONNECTION, @@ -2637,120 +2637,117 @@ typedef enum { NMTST_VARIANT_EDITOR_PROPERTY } NmtstVariantEditorPhase; - #define NMTST_VARIANT_EDITOR(__connection_variant, __code) \ - G_STMT_START \ - { \ - GVariantIter __connection_iter, *__setting_iter; \ - GVariantBuilder __connection_builder, __setting_builder; \ - const char * __cur_setting_name, *__cur_property_name; \ - GVariant * __property_val; \ - NmtstVariantEditorPhase __phase; \ - \ - g_variant_builder_init(&__connection_builder, NM_VARIANT_TYPE_CONNECTION); \ - g_variant_iter_init(&__connection_iter, __connection_variant); \ - \ - __phase = NMTST_VARIANT_EDITOR_CONNECTION; \ - __cur_setting_name = NULL; \ - __cur_property_name = NULL; \ - __code; \ - while (g_variant_iter_next(&__connection_iter, \ - "{&sa{sv}}", \ - &__cur_setting_name, \ - &__setting_iter)) { \ - g_variant_builder_init(&__setting_builder, NM_VARIANT_TYPE_SETTING); \ - __phase = NMTST_VARIANT_EDITOR_SETTING; \ - __cur_property_name = NULL; \ - __code; \ - \ - while (__cur_setting_name \ - && g_variant_iter_next(__setting_iter, \ - "{&sv}", \ - &__cur_property_name, \ - &__property_val)) { \ - __phase = NMTST_VARIANT_EDITOR_PROPERTY; \ - __code; \ - \ - if (__cur_property_name) { \ - g_variant_builder_add(&__setting_builder, \ - "{sv}", \ - __cur_property_name, \ - __property_val); \ - } \ - g_variant_unref(__property_val); \ - } \ - \ - if (__cur_setting_name) \ - g_variant_builder_add(&__connection_builder, \ - "{sa{sv}}", \ - __cur_setting_name, \ - &__setting_builder); \ - else \ - g_variant_builder_clear(&__setting_builder); \ - g_variant_iter_free(__setting_iter); \ - } \ - \ - g_variant_unref(__connection_variant); \ - \ - __connection_variant = g_variant_builder_end(&__connection_builder); \ - } \ - G_STMT_END; - - #define NMTST_VARIANT_ADD_SETTING(__setting_name, __setting_variant) \ - G_STMT_START \ - { \ - if (__phase == NMTST_VARIANT_EDITOR_CONNECTION) \ - g_variant_builder_add(&__connection_builder, \ - "{s@a{sv}}", \ - __setting_name, \ - __setting_variant); \ - } \ - G_STMT_END - - #define NMTST_VARIANT_DROP_SETTING(__setting_name) \ - G_STMT_START \ - { \ - if (__phase == NMTST_VARIANT_EDITOR_SETTING && __cur_setting_name) { \ - if (!strcmp(__cur_setting_name, __setting_name)) \ - __cur_setting_name = NULL; \ - } \ - } \ - G_STMT_END - - #define NMTST_VARIANT_ADD_PROPERTY(__setting_name, __property_name, __format_string, __value) \ - G_STMT_START \ - { \ - if (__phase == NMTST_VARIANT_EDITOR_SETTING) { \ - if (!strcmp(__cur_setting_name, __setting_name)) { \ - g_variant_builder_add(&__setting_builder, \ - "{sv}", \ - __property_name, \ - g_variant_new(__format_string, __value)); \ - } \ - } \ - } \ - G_STMT_END - - #define NMTST_VARIANT_DROP_PROPERTY(__setting_name, __property_name) \ - G_STMT_START \ - { \ - if (__phase == NMTST_VARIANT_EDITOR_PROPERTY && __cur_property_name) { \ - if (!strcmp(__cur_setting_name, __setting_name) \ - && !strcmp(__cur_property_name, __property_name)) \ - __cur_property_name = NULL; \ +#define NMTST_VARIANT_EDITOR(__connection_variant, __code) \ + G_STMT_START \ + { \ + GVariantIter __connection_iter, *__setting_iter; \ + GVariantBuilder __connection_builder, __setting_builder; \ + const char * __cur_setting_name, *__cur_property_name; \ + GVariant * __property_val; \ + NmtstVariantEditorPhase __phase; \ + \ + g_variant_builder_init(&__connection_builder, NM_VARIANT_TYPE_CONNECTION); \ + g_variant_iter_init(&__connection_iter, __connection_variant); \ + \ + __phase = NMTST_VARIANT_EDITOR_CONNECTION; \ + __cur_setting_name = NULL; \ + __cur_property_name = NULL; \ + __code; \ + while (g_variant_iter_next(&__connection_iter, \ + "{&sa{sv}}", \ + &__cur_setting_name, \ + &__setting_iter)) { \ + g_variant_builder_init(&__setting_builder, NM_VARIANT_TYPE_SETTING); \ + __phase = NMTST_VARIANT_EDITOR_SETTING; \ + __cur_property_name = NULL; \ + __code; \ + \ + while (__cur_setting_name \ + && g_variant_iter_next(__setting_iter, \ + "{&sv}", \ + &__cur_property_name, \ + &__property_val)) { \ + __phase = NMTST_VARIANT_EDITOR_PROPERTY; \ + __code; \ + \ + if (__cur_property_name) { \ + g_variant_builder_add(&__setting_builder, \ + "{sv}", \ + __cur_property_name, \ + __property_val); \ + } \ + g_variant_unref(__property_val); \ } \ + \ + if (__cur_setting_name) \ + g_variant_builder_add(&__connection_builder, \ + "{sa{sv}}", \ + __cur_setting_name, \ + &__setting_builder); \ + else \ + g_variant_builder_clear(&__setting_builder); \ + g_variant_iter_free(__setting_iter); \ } \ - G_STMT_END + \ + g_variant_unref(__connection_variant); \ + \ + __connection_variant = g_variant_builder_end(&__connection_builder); \ + } \ + G_STMT_END; - #define NMTST_VARIANT_CHANGE_PROPERTY(__setting_name, \ - __property_name, \ - __format_string, \ - __value) \ - G_STMT_START \ - { \ - NMTST_VARIANT_DROP_PROPERTY(__setting_name, __property_name); \ - NMTST_VARIANT_ADD_PROPERTY(__setting_name, __property_name, __format_string, __value); \ - } \ - G_STMT_END +#define NMTST_VARIANT_ADD_SETTING(__setting_name, __setting_variant) \ + G_STMT_START \ + { \ + if (__phase == NMTST_VARIANT_EDITOR_CONNECTION) \ + g_variant_builder_add(&__connection_builder, \ + "{s@a{sv}}", \ + __setting_name, \ + __setting_variant); \ + } \ + G_STMT_END + +#define NMTST_VARIANT_DROP_SETTING(__setting_name) \ + G_STMT_START \ + { \ + if (__phase == NMTST_VARIANT_EDITOR_SETTING && __cur_setting_name) { \ + if (!strcmp(__cur_setting_name, __setting_name)) \ + __cur_setting_name = NULL; \ + } \ + } \ + G_STMT_END + +#define NMTST_VARIANT_ADD_PROPERTY(__setting_name, __property_name, __format_string, __value) \ + G_STMT_START \ + { \ + if (__phase == NMTST_VARIANT_EDITOR_SETTING) { \ + if (!strcmp(__cur_setting_name, __setting_name)) { \ + g_variant_builder_add(&__setting_builder, \ + "{sv}", \ + __property_name, \ + g_variant_new(__format_string, __value)); \ + } \ + } \ + } \ + G_STMT_END + +#define NMTST_VARIANT_DROP_PROPERTY(__setting_name, __property_name) \ + G_STMT_START \ + { \ + if (__phase == NMTST_VARIANT_EDITOR_PROPERTY && __cur_property_name) { \ + if (!strcmp(__cur_setting_name, __setting_name) \ + && !strcmp(__cur_property_name, __property_name)) \ + __cur_property_name = NULL; \ + } \ + } \ + G_STMT_END + +#define NMTST_VARIANT_CHANGE_PROPERTY(__setting_name, __property_name, __format_string, __value) \ + G_STMT_START \ + { \ + NMTST_VARIANT_DROP_PROPERTY(__setting_name, __property_name); \ + NMTST_VARIANT_ADD_PROPERTY(__setting_name, __property_name, __format_string, __value); \ + } \ + G_STMT_END #endif /* __NM_CONNECTION_H__ */ diff --git a/src/libnm-glib-aux/nm-value-type.h b/src/libnm-glib-aux/nm-value-type.h index f1cce4800b..6156896c14 100644 --- a/src/libnm-glib-aux/nm-value-type.h +++ b/src/libnm-glib-aux/nm-value-type.h @@ -35,37 +35,37 @@ typedef union { } NMValueTypUnion; - /* Set the NMValueTypUnion. You can also assign the member directly. +/* Set the NMValueTypUnion. You can also assign the member directly. * The only purpose of this is that it also returns a pointer to the * union. So, you can do * * ptr = NM_VALUE_TYP_UNION_SET (&value_typ_union_storage, v_bool, TRUE); */ - #define NM_VALUE_TYP_UNION_SET(_arg, _type, _val) \ - ({ \ - NMValueTypUnion *const _arg2 = (_arg); \ - \ - *_arg2 = (NMValueTypUnion){ \ - ._type = (_val), \ - }; \ - _arg2; \ - }) +#define NM_VALUE_TYP_UNION_SET(_arg, _type, _val) \ + ({ \ + NMValueTypUnion *const _arg2 = (_arg); \ + \ + *_arg2 = (NMValueTypUnion){ \ + ._type = (_val), \ + }; \ + _arg2; \ + }) typedef struct { bool has; NMValueTypUnion val; } NMValueTypUnioMaybe; - #define NM_VALUE_TYP_UNIO_MAYBE_SET(_arg, _type, _val) \ - ({ \ - NMValueTypUnioMaybe *const _arg2 = (_arg); \ - \ - *_arg2 = (NMValueTypUnioMaybe){ \ - .has = TRUE, \ - .val._type = (_val), \ - }; \ - _arg2; \ - }) +#define NM_VALUE_TYP_UNIO_MAYBE_SET(_arg, _type, _val) \ + ({ \ + NMValueTypUnioMaybe *const _arg2 = (_arg); \ + \ + *_arg2 = (NMValueTypUnioMaybe){ \ + .has = TRUE, \ + .val._type = (_val), \ + }; \ + _arg2; \ + }) /*****************************************************************************/ @@ -232,7 +232,7 @@ nm_value_type_get_variant_type(NMValueType value_type) return NULL; } - /*****************************************************************************/ +/*****************************************************************************/ #endif /* NM_VALUE_TYPE_DEFINE_FUNCTIONS */ diff --git a/src/libnm-log-core/nm-logging.c b/src/libnm-log-core/nm-logging.c index 2ab0d92e07..aca0e02f64 100644 --- a/src/libnm-log-core/nm-logging.c +++ b/src/libnm-log-core/nm-logging.c @@ -18,8 +18,8 @@ #include #if SYSTEMD_JOURNAL - #define SD_JOURNAL_SUPPRESS_LOCATION - #include +#define SD_JOURNAL_SUPPRESS_LOCATION +#include #endif #include "libnm-glib-aux/nm-logging-base.h" @@ -600,7 +600,7 @@ _iovec_set_string(struct iovec *iov, const char *str) _iovec_set(iov, str, strlen(str)); } - #define _iovec_set_string_literal(iov, str) _iovec_set((iov), "" str "", NM_STRLEN(str)) +#define _iovec_set_string_literal(iov, str) _iovec_set((iov), "" str "", NM_STRLEN(str)) _nm_printf(3, 4) static void _iovec_set_format(struct iovec *iov, char ** iov_free, @@ -618,34 +618,34 @@ _nm_printf(3, 4) static void _iovec_set_format(struct iovec *iov, *iov_free = str; } - #define _iovec_set_format_a(iov, reserve_extra, format, ...) \ - G_STMT_START \ - { \ - const gsize _size = (reserve_extra) + (NM_STRLEN(format) + 3); \ - char *const _buf = g_alloca(_size); \ - int _len; \ - \ - G_STATIC_ASSERT_EXPR((reserve_extra) + (NM_STRLEN(format) + 3) <= 96); \ - \ - _len = g_snprintf(_buf, _size, "" format "", ##__VA_ARGS__); \ - \ - nm_assert(_len >= 0); \ - nm_assert(_len < _size); \ - nm_assert(_len == strlen(_buf)); \ - \ - _iovec_set((iov), _buf, _len); \ - } \ - G_STMT_END +#define _iovec_set_format_a(iov, reserve_extra, format, ...) \ + G_STMT_START \ + { \ + const gsize _size = (reserve_extra) + (NM_STRLEN(format) + 3); \ + char *const _buf = g_alloca(_size); \ + int _len; \ + \ + G_STATIC_ASSERT_EXPR((reserve_extra) + (NM_STRLEN(format) + 3) <= 96); \ + \ + _len = g_snprintf(_buf, _size, "" format "", ##__VA_ARGS__); \ + \ + nm_assert(_len >= 0); \ + nm_assert(_len < _size); \ + nm_assert(_len == strlen(_buf)); \ + \ + _iovec_set((iov), _buf, _len); \ + } \ + G_STMT_END - #define _iovec_set_format_str_a(iov, max_str_len, format, str_arg) \ - G_STMT_START \ - { \ - const char *_str_arg = (str_arg); \ - \ - nm_assert(_str_arg &&strlen(_str_arg) < (max_str_len)); \ - _iovec_set_format_a((iov), (max_str_len), format, str_arg); \ - } \ - G_STMT_END +#define _iovec_set_format_str_a(iov, max_str_len, format, str_arg) \ + G_STMT_START \ + { \ + const char *_str_arg = (str_arg); \ + \ + nm_assert(_str_arg &&strlen(_str_arg) < (max_str_len)); \ + _iovec_set_format_a((iov), (max_str_len), format, str_arg); \ + } \ + G_STMT_END #endif diff --git a/src/libnm-log-core/nm-logging.h b/src/libnm-log-core/nm-logging.h index 8eecb7e41b..8071967552 100644 --- a/src/libnm-log-core/nm-logging.h +++ b/src/libnm-log-core/nm-logging.h @@ -8,7 +8,7 @@ #define __NETWORKMANAGER_LOGGING_H__ #ifdef __NM_TEST_UTILS_H__ - #error nm-test-utils.h must be included as last header +#error nm-test-utils.h must be included as last header #endif #include "libnm-glib-aux/nm-logging-fwd.h" diff --git a/src/libnm-platform/nm-linux-platform.c b/src/libnm-platform/nm-linux-platform.c index bdeae826a1..0801fae29d 100644 --- a/src/libnm-platform/nm-linux-platform.c +++ b/src/libnm-platform/nm-linux-platform.c @@ -80,7 +80,7 @@ enum { TCA_DEF_UNSPEC, TCA_DEF_TM, TCA_DEF_PARMS, TCA_DEF_DATA, TCA_DEF_PAD, __T /*****************************************************************************/ #ifndef IFLA_PROMISCUITY - #define IFLA_PROMISCUITY 30 +#define IFLA_PROMISCUITY 30 #endif #define IFLA_NUM_TX_QUEUES 31 #define IFLA_NUM_RX_QUEUES 32 @@ -114,7 +114,7 @@ enum { TCA_DEF_UNSPEC, TCA_DEF_TM, TCA_DEF_PARMS, TCA_DEF_DATA, TCA_DEF_PAD, __T #define IFLA_IPTUN_PMTUDISC 10 #define __IFLA_IPTUN_MAX 19 #ifndef IFLA_IPTUN_MAX - #define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1) +#define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1) #endif #define IFLA_TUN_UNSPEC 0 @@ -136,7 +136,7 @@ G_STATIC_ASSERT(RTA_MAX == (__RTA_MAX - 1)); #define RTA_MAX (MAX((__RTA_MAX - 1), RTA_PREF)) #ifndef MACVLAN_FLAG_NOPROMISC - #define MACVLAN_FLAG_NOPROMISC 1 +#define MACVLAN_FLAG_NOPROMISC 1 #endif #define IP6_FLOWINFO_TCLASS_MASK 0x0FF00000 @@ -149,7 +149,7 @@ G_STATIC_ASSERT(RTA_MAX == (__RTA_MAX - 1)); /* Appeared in the kernel prior to 3.13 dated 19 January, 2014 */ #ifndef ARPHRD_6LOWPAN - #define ARPHRD_6LOWPAN 825 +#define ARPHRD_6LOWPAN 825 #endif /*****************************************************************************/ @@ -267,8 +267,8 @@ struct _ifla_vf_vlan_info { /* Appeared in the kernel 4.0 dated April 12, 2015 */ #ifndef BRIDGE_VLAN_INFO_RANGE_BEGIN - #define BRIDGE_VLAN_INFO_RANGE_BEGIN (1 << 3) /* VLAN is start of vlan range */ - #define BRIDGE_VLAN_INFO_RANGE_END (1 << 4) /* VLAN is end of vlan range */ +#define BRIDGE_VLAN_INFO_RANGE_BEGIN (1 << 3) /* VLAN is start of vlan range */ +#define BRIDGE_VLAN_INFO_RANGE_END (1 << 4) /* VLAN is end of vlan range */ #endif /*****************************************************************************/ diff --git a/src/libnm-platform/nm-netlink.c b/src/libnm-platform/nm-netlink.c index e92c4dfea3..dc23be5860 100644 --- a/src/libnm-platform/nm-netlink.c +++ b/src/libnm-platform/nm-netlink.c @@ -13,7 +13,7 @@ /*****************************************************************************/ #ifndef SOL_NETLINK - #define SOL_NETLINK 270 +#define SOL_NETLINK 270 #endif /*****************************************************************************/ @@ -24,7 +24,7 @@ #define NL_NO_AUTO_ACK (1 << 5) #ifndef NETLINK_EXT_ACK - #define NETLINK_EXT_ACK 11 +#define NETLINK_EXT_ACK 11 #endif struct nl_msg { diff --git a/src/libnm-platform/nm-netlink.h b/src/libnm-platform/nm-netlink.h index ab355f7495..bcc321194d 100644 --- a/src/libnm-platform/nm-netlink.h +++ b/src/libnm-platform/nm-netlink.h @@ -21,7 +21,7 @@ #define NLMSGERR_ATTR_MAX 3 #ifndef NLM_F_ACK_TLVS - #define NLM_F_ACK_TLVS 0x200 +#define NLM_F_ACK_TLVS 0x200 #endif /*****************************************************************************/ diff --git a/src/libnm-platform/nm-platform-utils.c b/src/libnm-platform/nm-platform-utils.c index 2470704a6f..830a963e5a 100644 --- a/src/libnm-platform/nm-platform-utils.c +++ b/src/libnm-platform/nm-platform-utils.c @@ -307,14 +307,14 @@ _ethtool_edata_to_string(gpointer edata, gsize edata_size, char *sbuf, gsize sbu /*****************************************************************************/ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) - #define ethtool_cmd_speed(pedata) ((pedata)->speed) +#define ethtool_cmd_speed(pedata) ((pedata)->speed) - #define ethtool_cmd_speed_set(pedata, speed) \ - G_STMT_START \ - { \ - (pedata)->speed = (guint16) (speed); \ - } \ - G_STMT_END +#define ethtool_cmd_speed_set(pedata, speed) \ + G_STMT_START \ + { \ + (pedata)->speed = (guint16) (speed); \ + } \ + G_STMT_END #endif static int diff --git a/src/libnm-platform/nm-platform.h b/src/libnm-platform/nm-platform.h index e627917698..6fe723cba4 100644 --- a/src/libnm-platform/nm-platform.h +++ b/src/libnm-platform/nm-platform.h @@ -42,10 +42,10 @@ typedef gboolean (*NMPObjectPredicateFunc)(const NMPObject *obj, gpointer user_d /* workaround for older libnl version, that does not define these flags. */ #ifndef IFA_F_MANAGETEMPADDR - #define IFA_F_MANAGETEMPADDR 0x100 +#define IFA_F_MANAGETEMPADDR 0x100 #endif #ifndef IFA_F_NOPREFIXROUTE - #define IFA_F_NOPREFIXROUTE 0x200 +#define IFA_F_NOPREFIXROUTE 0x200 #endif #define NM_RT_SCOPE_LINK 253 /* RT_SCOPE_LINK */ diff --git a/src/libnm-platform/wifi/nm-wifi-utils-wext.c b/src/libnm-platform/wifi/nm-wifi-utils-wext.c index 13b47c2cfa..6fb37c49eb 100644 --- a/src/libnm-platform/wifi/nm-wifi-utils-wext.c +++ b/src/libnm-platform/wifi/nm-wifi-utils-wext.c @@ -14,7 +14,7 @@ /* Hacks necessary to #include wireless.h; yay for WEXT */ #ifndef __user - #define __user +#define __user #endif #include #include diff --git a/src/libnm-platform/wifi/nm-wifi-utils.c b/src/libnm-platform/wifi/nm-wifi-utils.c index 3c952b6fcd..0b5f8d7124 100644 --- a/src/libnm-platform/wifi/nm-wifi-utils.c +++ b/src/libnm-platform/wifi/nm-wifi-utils.c @@ -15,7 +15,7 @@ #include "nm-wifi-utils-private.h" #include "nm-wifi-utils-nl80211.h" #if HAVE_WEXT - #include "nm-wifi-utils-wext.h" +#include "nm-wifi-utils-wext.h" #endif #include "libnm-platform/nm-platform-utils.h" diff --git a/src/libnm-std-aux/nm-default-std.h b/src/libnm-std-aux/nm-default-std.h index 5f4af3a548..23f5fc604b 100644 --- a/src/libnm-std-aux/nm-default-std.h +++ b/src/libnm-std-aux/nm-default-std.h @@ -9,11 +9,11 @@ #include "nm-networkmanager-compilation.h" #ifdef NETWORKMANAGER_COMPILATION - #error Dont define NETWORKMANAGER_COMPILATION +#error Dont define NETWORKMANAGER_COMPILATION #endif #ifndef G_LOG_DOMAIN - #define G_LOG_DOMAIN "nm" +#define G_LOG_DOMAIN "nm" #endif /*****************************************************************************/ @@ -25,8 +25,8 @@ /* always include these headers for our internal source files. */ #ifndef ___CONFIG_H__ - #define ___CONFIG_H__ - #include +#define ___CONFIG_H__ +#include #endif #include "config-extra.h" @@ -37,11 +37,11 @@ #define NM_VERSION_MIN_REQUIRED NM_VERSION_0_9_8 #ifndef NM_MORE_ASSERTS - #define NM_MORE_ASSERTS 0 +#define NM_MORE_ASSERTS 0 #endif #if NM_MORE_ASSERTS == 0 - /* The cast macros like NM_TYPE() are implemented via G_TYPE_CHECK_INSTANCE_CAST() +/* The cast macros like NM_TYPE() are implemented via G_TYPE_CHECK_INSTANCE_CAST() * and _G_TYPE_CIC(). The latter, by default performs runtime checks of the type * by calling g_type_check_instance_cast(). * This check has a certain overhead without being helpful. @@ -88,9 +88,9 @@ * Example 3 is how it should be done. Type checks in NM_TYPE() are pointless. * Disable them for our production builds. */ - #ifndef G_DISABLE_CAST_CHECKS - #define G_DISABLE_CAST_CHECKS - #endif +#ifndef G_DISABLE_CAST_CHECKS +#define G_DISABLE_CAST_CHECKS +#endif #endif /*****************************************************************************/ diff --git a/src/libnm-std-aux/nm-std-aux.h b/src/libnm-std-aux/nm-std-aux.h index 947ca36033..0bc4d5b805 100644 --- a/src/libnm-std-aux/nm-std-aux.h +++ b/src/libnm-std-aux/nm-std-aux.h @@ -33,25 +33,25 @@ * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200#c28 */ #ifndef __clang__ - #define _nm_externally_visible __attribute__((__externally_visible__)) +#define _nm_externally_visible __attribute__((__externally_visible__)) #else - #define _nm_externally_visible +#define _nm_externally_visible #endif #if __GNUC__ >= 7 - #define _nm_fallthrough __attribute__((__fallthrough__)) +#define _nm_fallthrough __attribute__((__fallthrough__)) #else - #define _nm_fallthrough +#define _nm_fallthrough #endif /*****************************************************************************/ #ifdef __CHECKER__ - #define _nm_bitwise __attribute__((__bitwise__)) - #define _nm_force __attribute__((__force__)) +#define _nm_bitwise __attribute__((__bitwise__)) +#define _nm_force __attribute__((__force__)) #else - #define _nm_bitwise - #define _nm_force +#define _nm_bitwise +#define _nm_force #endif typedef uint16_t _nm_bitwise nm_le16_t; @@ -64,7 +64,7 @@ typedef uint64_t _nm_bitwise nm_be64_t; /*****************************************************************************/ #ifdef thread_local - #define _nm_thread_local thread_local +#define _nm_thread_local thread_local /* * Don't break on glibc < 2.16 that doesn't define __STDC_NO_THREADS__ * see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53769 @@ -72,9 +72,9 @@ typedef uint64_t _nm_bitwise nm_be64_t; #elif __STDC_VERSION__ >= 201112L \ && !(defined(__STDC_NO_THREADS__) \ || (defined(__GNU_LIBRARY__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 16)) - #define _nm_thread_local _Thread_local +#define _nm_thread_local _Thread_local #else - #define _nm_thread_local __thread +#define _nm_thread_local __thread #endif /*****************************************************************************/ @@ -110,11 +110,11 @@ typedef uint64_t _nm_bitwise nm_be64_t; #define NM_BOOLEAN_EXPR(expr) _NM_BOOLEAN_EXPR_IMPL(NM_UNIQ, expr) #if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__) - #define NM_LIKELY(expr) (__builtin_expect(NM_BOOLEAN_EXPR(expr), 1)) - #define NM_UNLIKELY(expr) (__builtin_expect(NM_BOOLEAN_EXPR(expr), 0)) +#define NM_LIKELY(expr) (__builtin_expect(NM_BOOLEAN_EXPR(expr), 1)) +#define NM_UNLIKELY(expr) (__builtin_expect(NM_BOOLEAN_EXPR(expr), 0)) #else - #define NM_LIKELY(expr) NM_BOOLEAN_EXPR(expr) - #define NM_UNLIKELY(expr) NM_BOOLEAN_EXPR(expr) +#define NM_LIKELY(expr) NM_BOOLEAN_EXPR(expr) +#define NM_UNLIKELY(expr) NM_BOOLEAN_EXPR(expr) #endif /*****************************************************************************/ @@ -132,48 +132,48 @@ typedef uint64_t _nm_bitwise nm_be64_t; * depend less on runtime conditions (that is, are generally expected to be true). */ #ifndef NM_MORE_ASSERTS - #define NM_MORE_ASSERTS 0 +#define NM_MORE_ASSERTS 0 #endif #ifndef _nm_assert_call - #define _nm_assert_call(cond) assert(cond) - #define _nm_assert_call_not_reached() assert(0) +#define _nm_assert_call(cond) assert(cond) +#define _nm_assert_call_not_reached() assert(0) #endif #if NM_MORE_ASSERTS - #define nm_assert(cond) \ - do { \ - _nm_assert_call(cond); \ - } while (0) - #define nm_assert_se(cond) \ - do { \ - if (NM_LIKELY(cond)) { \ - ; \ - } else { \ - _nm_assert_call(0 && (cond)); \ - } \ - } while (0) - #define nm_assert_not_reached() \ - do { \ - _nm_assert_call_not_reached(); \ - } while (0) +#define nm_assert(cond) \ + do { \ + _nm_assert_call(cond); \ + } while (0) +#define nm_assert_se(cond) \ + do { \ + if (NM_LIKELY(cond)) { \ + ; \ + } else { \ + _nm_assert_call(0 && (cond)); \ + } \ + } while (0) +#define nm_assert_not_reached() \ + do { \ + _nm_assert_call_not_reached(); \ + } while (0) #else - #define nm_assert(cond) \ - do { \ - if (0) { \ - if (cond) {} \ - } \ - } while (0) - #define nm_assert_se(cond) \ - do { \ - if (NM_LIKELY(cond)) { \ - ; \ - } \ - } while (0) - #define nm_assert_not_reached() \ - do { \ - ; \ - } while (0) +#define nm_assert(cond) \ + do { \ + if (0) { \ + if (cond) {} \ + } \ + } while (0) +#define nm_assert_se(cond) \ + do { \ + if (NM_LIKELY(cond)) { \ + ; \ + } \ + } while (0) +#define nm_assert_not_reached() \ + do { \ + ; \ + } while (0) #endif #define nm_assert_unreachable_val(val) \ diff --git a/src/libnm-systemd-core/sd-adapt-core/nm-sd-adapt-core.h b/src/libnm-systemd-core/sd-adapt-core/nm-sd-adapt-core.h index 4aae34b8b7..c3f345a8e2 100644 --- a/src/libnm-systemd-core/sd-adapt-core/nm-sd-adapt-core.h +++ b/src/libnm-systemd-core/sd-adapt-core/nm-sd-adapt-core.h @@ -18,7 +18,7 @@ #define NETWORKMANAGER_COMPILATION NM_NETWORKMANAGER_COMPILATION_SYSTEMD #ifndef HAVE_SYS_AUXV_H - #define HAVE_SYS_AUXV_H 0 +#define HAVE_SYS_AUXV_H 0 #endif /***************************************************************************** @@ -28,36 +28,36 @@ #if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_SYSTEMD - #include - #include - #include - #include - #include - #ifdef HAVE_SYS_AUXV_H - #include - #endif - #include - #include - #include +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_AUXV_H +#include +#endif +#include +#include +#include - /* Missing in Linux 3.2.0, in Ubuntu 12.04 */ - #ifndef BPF_XOR - #define BPF_XOR 0xa0 - #endif +/* Missing in Linux 3.2.0, in Ubuntu 12.04 */ +#ifndef BPF_XOR +#define BPF_XOR 0xa0 +#endif - #ifndef ETHERTYPE_LLDP - #define ETHERTYPE_LLDP 0x88cc - #endif +#ifndef ETHERTYPE_LLDP +#define ETHERTYPE_LLDP 0x88cc +#endif - #ifndef HAVE_SECURE_GETENV - #ifdef HAVE___SECURE_GETENV - #define secure_getenv __secure_getenv - #else - #error neither secure_getenv nor __secure_getenv is available - #endif - #endif +#ifndef HAVE_SECURE_GETENV +#ifdef HAVE___SECURE_GETENV +#define secure_getenv __secure_getenv +#else +#error neither secure_getenv nor __secure_getenv is available +#endif +#endif - #include "libnm-base/nm-base.h" +#include "libnm-base/nm-base.h" /*****************************************************************************/ @@ -67,23 +67,23 @@ sd_notify(int unset_environment, const char *state) return 0; } - /* Can't include both net/if.h and linux/if.h; so have to define this here */ - #ifndef IF_NAMESIZE - #define IF_NAMESIZE 16 - #endif +/* Can't include both net/if.h and linux/if.h; so have to define this here */ +#ifndef IF_NAMESIZE +#define IF_NAMESIZE 16 +#endif - #ifndef IFNAMSIZ - #define IFNAMSIZ IF_NAMESIZE - #endif +#ifndef IFNAMSIZ +#define IFNAMSIZ IF_NAMESIZE +#endif - #ifndef MAX_HANDLE_SZ - #define MAX_HANDLE_SZ 128 - #endif +#ifndef MAX_HANDLE_SZ +#define MAX_HANDLE_SZ 128 +#endif - #include "sd-id128.h" - #include "sparse-endian.h" - #include "async.h" - #include "util.h" +#include "sd-id128.h" +#include "sparse-endian.h" +#include "async.h" +#include "util.h" #endif /* (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_SYSTEMD */ diff --git a/src/libnm-systemd-shared/sd-adapt-shared/nm-sd-adapt-shared.h b/src/libnm-systemd-shared/sd-adapt-shared/nm-sd-adapt-shared.h index 2f6188dc55..586c3a7eb8 100644 --- a/src/libnm-systemd-shared/sd-adapt-shared/nm-sd-adapt-shared.h +++ b/src/libnm-systemd-shared/sd-adapt-shared/nm-sd-adapt-shared.h @@ -29,7 +29,7 @@ /*****************************************************************************/ #ifndef VALGRIND - #define VALGRIND 0 +#define VALGRIND 0 #endif #define ENABLE_DEBUG_HASHMAP 0 @@ -41,17 +41,17 @@ #if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_SYSTEMD - #include - #include - #include +#include +#include +#include - #define ENABLE_GSHADOW FALSE +#define ENABLE_GSHADOW FALSE - #define HAVE_SECCOMP 0 +#define HAVE_SECCOMP 0 - #define LOG_TRACE 0 +#define LOG_TRACE 0 - #define BUILD_MODE_DEVELOPER (NM_MORE_ASSERTS > 0) +#define BUILD_MODE_DEVELOPER (NM_MORE_ASSERTS > 0) /*****************************************************************************/ @@ -68,63 +68,63 @@ struct statx; static inline pid_t raw_getpid(void) { - #if defined(__alpha__) +#if defined(__alpha__) return (pid_t) syscall(__NR_getxpid); - #else +#else return (pid_t) syscall(__NR_getpid); - #endif +#endif } - #define gettid() nm_utils_gettid() +#define gettid() nm_utils_gettid() - /* we build with C11 and thus provides char32_t,char16_t. */ - #define HAVE_CHAR32_T 1 - #define HAVE_CHAR16_T 1 +/* we build with C11 and thus provides char32_t,char16_t. */ +#define HAVE_CHAR32_T 1 +#define HAVE_CHAR16_T 1 - #if defined(HAVE_DECL_REALLOCARRAY) && HAVE_DECL_REALLOCARRAY == 1 - #define HAVE_REALLOCARRAY 1 - #else - #define HAVE_REALLOCARRAY 0 - #endif +#if defined(HAVE_DECL_REALLOCARRAY) && HAVE_DECL_REALLOCARRAY == 1 +#define HAVE_REALLOCARRAY 1 +#else +#define HAVE_REALLOCARRAY 0 +#endif - #if defined(HAVE_DECL_EXPLICIT_BZERO) && HAVE_DECL_EXPLICIT_BZERO == 1 - #define HAVE_EXPLICIT_BZERO 1 - #else - #define HAVE_EXPLICIT_BZERO 0 - #endif +#if defined(HAVE_DECL_EXPLICIT_BZERO) && HAVE_DECL_EXPLICIT_BZERO == 1 +#define HAVE_EXPLICIT_BZERO 1 +#else +#define HAVE_EXPLICIT_BZERO 0 +#endif - #if defined(HAVE_DECL_PIDFD_OPEN) && HAVE_DECL_PIDFD_OPEN == 1 - #define HAVE_PIDFD_OPEN 1 - #else - #define HAVE_PIDFD_OPEN 0 - #endif +#if defined(HAVE_DECL_PIDFD_OPEN) && HAVE_DECL_PIDFD_OPEN == 1 +#define HAVE_PIDFD_OPEN 1 +#else +#define HAVE_PIDFD_OPEN 0 +#endif - #if defined(HAVE_DECL_PIDFD_SEND_SIGNAL) && HAVE_DECL_PIDFD_SEND_SIGNAL == 1 - #define HAVE_PIDFD_SEND_SIGNAL 1 - #else - #define HAVE_PIDFD_SEND_SIGNAL 0 - #endif +#if defined(HAVE_DECL_PIDFD_SEND_SIGNAL) && HAVE_DECL_PIDFD_SEND_SIGNAL == 1 +#define HAVE_PIDFD_SEND_SIGNAL 1 +#else +#define HAVE_PIDFD_SEND_SIGNAL 0 +#endif - #if defined(HAVE_DECL_RT_SIGQUEUEINFO) && HAVE_DECL_RT_SIGQUEUEINFO == 1 - #define HAVE_RT_SIGQUEUEINFO 1 - #else - #define HAVE_RT_SIGQUEUEINFO 0 - #endif +#if defined(HAVE_DECL_RT_SIGQUEUEINFO) && HAVE_DECL_RT_SIGQUEUEINFO == 1 +#define HAVE_RT_SIGQUEUEINFO 1 +#else +#define HAVE_RT_SIGQUEUEINFO 0 +#endif - #ifndef ALTIFNAMSIZ - #define ALTIFNAMSIZ 128 - #endif +#ifndef ALTIFNAMSIZ +#define ALTIFNAMSIZ 128 +#endif - #define HAVE_LINUX_TIME_TYPES_H 0 +#define HAVE_LINUX_TIME_TYPES_H 0 - #ifndef __COMPAR_FN_T - #define __COMPAR_FN_T +#ifndef __COMPAR_FN_T +#define __COMPAR_FN_T typedef int (*__compar_fn_t)(const void *, const void *); typedef __compar_fn_t comparison_fn_t; typedef int (*__compar_d_fn_t)(const void *, const void *, void *); - #endif +#endif - #ifndef __GLIBC__ +#ifndef __GLIBC__ static inline int __register_atfork(void (*prepare)(void), void (*parent)(void), @@ -133,7 +133,7 @@ __register_atfork(void (*prepare)(void), { return pthread_atfork(prepare, parent, child); } - #endif +#endif #endif /* (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_SYSTEMD */ diff --git a/src/libnmc-base/qrcodegen.c b/src/libnmc-base/qrcodegen.c index 2c40fcb94a..0aacdb0141 100644 --- a/src/libnmc-base/qrcodegen.c +++ b/src/libnmc-base/qrcodegen.c @@ -28,9 +28,9 @@ #include "qrcodegen.h" #ifndef QRCODEGEN_TEST - #define testable static // Keep functions private +#define testable static // Keep functions private #else - #define testable // Expose private functions +#define testable // Expose private functions #endif /*---- Forward declarations for private functions ----*/ diff --git a/src/libnmc-setting/nm-meta-setting-base-impl.c b/src/libnmc-setting/nm-meta-setting-base-impl.c index a952ced9aa..d79f2529cb 100644 --- a/src/libnmc-setting/nm-meta-setting-base-impl.c +++ b/src/libnmc-setting/nm-meta-setting-base-impl.c @@ -8,7 +8,7 @@ #include "nm-meta-setting-base.h" #if _NM_META_SETTING_BASE_IMPL_LIBNM - #include "libnm-core-impl/nm-default-libnm-core.h" +#include "libnm-core-impl/nm-default-libnm-core.h" #endif #include "nm-setting-6lowpan.h" @@ -64,7 +64,7 @@ #include "nm-setting-wpan.h" #if _NM_META_SETTING_BASE_IMPL_LIBNM - #include "nm-setting-private.h" +#include "nm-setting-private.h" #endif /*****************************************************************************/ diff --git a/src/libnmc-setting/nm-meta-setting-base-impl.h b/src/libnmc-setting/nm-meta-setting-base-impl.h index 44bd9024c2..8aec1e8756 100644 --- a/src/libnmc-setting/nm-meta-setting-base-impl.h +++ b/src/libnmc-setting/nm-meta-setting-base-impl.h @@ -159,9 +159,9 @@ typedef enum _nm_packed { } NMMetaSettingType; #if _NM_META_SETTING_BASE_IMPL_LIBNM - #define _NMMetaSettingInfo_Alias _NMMetaSettingInfo +#define _NMMetaSettingInfo_Alias _NMMetaSettingInfo #else - #define _NMMetaSettingInfo_Alias _NMMetaSettingInfoCli +#define _NMMetaSettingInfo_Alias _NMMetaSettingInfoCli #endif struct _NMMetaSettingInfo_Alias { diff --git a/src/libnmc-setting/nm-meta-setting-desc.c b/src/libnmc-setting/nm-meta-setting-desc.c index 1cc5f9c15f..b8281bb7f3 100644 --- a/src/libnmc-setting/nm-meta-setting-desc.c +++ b/src/libnmc-setting/nm-meta-setting-desc.c @@ -1494,7 +1494,7 @@ static gboolean _set_fcn_gobject_mtu(ARGS_SET_FCN) /* Ideally we'll be able to get this from a public header. */ #ifndef IEEE802154_ADDR_LEN - #define IEEE802154_ADDR_LEN 8 +#define IEEE802154_ADDR_LEN 8 #endif static gboolean _set_fcn_gobject_mac(ARGS_SET_FCN) diff --git a/src/linux-headers/nl802154.h b/src/linux-headers/nl802154.h index c21bd0791c..54c5280625 100644 --- a/src/linux-headers/nl802154.h +++ b/src/linux-headers/nl802154.h @@ -442,8 +442,8 @@ enum nl802154_key { NL802154_KEY_ATTR_MAX = __NL802154_KEY_ATTR_AFTER_LAST - 1 }; - #define NL802154_KEY_SIZE 16 - #define NL802154_CMD_FRAME_NR_IDS 256 +#define NL802154_KEY_SIZE 16 +#define NL802154_CMD_FRAME_NR_IDS 256 #endif /* CONFIG_IEEE802154_NL802154_EXPERIMENTAL */ diff --git a/src/nm-cloud-setup/nm-cloud-setup-utils.h b/src/nm-cloud-setup/nm-cloud-setup-utils.h index d863170160..151b0a3627 100644 --- a/src/nm-cloud-setup/nm-cloud-setup-utils.h +++ b/src/nm-cloud-setup/nm-cloud-setup-utils.h @@ -41,7 +41,7 @@ void _nm_log_impl_cs(NMLogLevel level, const char *fmt, ...) _nm_printf(2, 3); /*****************************************************************************/ #ifndef NM_DIST_VERSION - #define NM_DIST_VERSION VERSION +#define NM_DIST_VERSION VERSION #endif /*****************************************************************************/ diff --git a/src/nm-daemon-helper/nm-daemon-helper.c b/src/nm-daemon-helper/nm-daemon-helper.c index e91e71845b..21a71e3c4a 100644 --- a/src/nm-daemon-helper/nm-daemon-helper.c +++ b/src/nm-daemon-helper/nm-daemon-helper.c @@ -7,7 +7,7 @@ #include #include #if defined(__GLIBC__) - #include +#include #endif #include "libnm-std-aux/nm-std-aux.h" diff --git a/src/nmcli/nmcli.c b/src/nmcli/nmcli.c index c8f9fb5641..9c6a791187 100644 --- a/src/nmcli/nmcli.c +++ b/src/nmcli/nmcli.c @@ -27,9 +27,9 @@ #include "settings.h" #if defined(NM_DIST_VERSION) - #define NMCLI_VERSION NM_DIST_VERSION +#define NMCLI_VERSION NM_DIST_VERSION #else - #define NMCLI_VERSION VERSION +#define NMCLI_VERSION VERSION #endif #define _NMC_COLOR_PALETTE_INIT() \ diff --git a/src/nmtui/nm-editor-utils.c b/src/nmtui/nm-editor-utils.c index c6b03bd880..02d7d6b263 100644 --- a/src/nmtui/nm-editor-utils.c +++ b/src/nmtui/nm-editor-utils.c @@ -16,7 +16,7 @@ #include "nm-editor-utils.h" #if 0 - #include "libnmc-base/nm-vpn-helpers.h" +#include "libnmc-base/nm-vpn-helpers.h" static GSList *vpn_plugins;