From 97e0d773e10ed9f43f20e475a300bb9c8001729b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 30 Aug 2021 13:11:12 +0200 Subject: [PATCH] format: reformat code with clang-format-12.0.1-1.fc34 The formatting produced by clang-format depends on the version of the tool. The version that we use is the one of the current Fedora release. Fedora 34 recently updated clang (and clang-tools-extra) from version 12.0.0 to 12.0.1. This brings some changes. Update the formatting. (cherry picked from commit 10e0c4261e59fa9516f5008893919051c58de2b0) --- src/core/ndisc/nm-lndp-ndisc.c | 16 ++++++++-------- .../plugins/ifcfg-rh/nms-ifcfg-rh-writer.c | 12 ++++++------ src/libnm-client-impl/tests/test-libnm.c | 2 +- src/libnm-core-impl/nm-dbus-utils.c | 2 +- src/libnm-core-impl/nm-setting-8021x.c | 2 +- src/libnm-core-impl/nm-setting-private.h | 4 ++-- src/libnm-glib-aux/nm-glib.h | 2 +- src/libnm-glib-aux/nm-macros-internal.h | 14 +++++++------- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/core/ndisc/nm-lndp-ndisc.c b/src/core/ndisc/nm-lndp-ndisc.c index f11178f824..177f4e35c1 100644 --- a/src/core/ndisc/nm-lndp-ndisc.c +++ b/src/core/ndisc/nm-lndp-ndisc.c @@ -85,14 +85,14 @@ send_rs(NMNDisc *ndisc, GError **error) static NMIcmpv6RouterPref _route_preference_coerce(enum ndp_route_preference pref) { -#define _ASSERT_ENUM(v1, v2) \ - G_STMT_START \ - { \ - G_STATIC_ASSERT((NMIcmpv6RouterPref) (v1) == (v2)); \ - G_STATIC_ASSERT((enum ndp_route_preference) (v2) == (v1)); \ - G_STATIC_ASSERT((gint64) (v1) == (v2)); \ - G_STATIC_ASSERT((gint64) (v2) == (v1)); \ - } \ +#define _ASSERT_ENUM(v1, v2) \ + G_STMT_START \ + { \ + G_STATIC_ASSERT((NMIcmpv6RouterPref) (v1) == (v2)); \ + G_STATIC_ASSERT((enum ndp_route_preference)(v2) == (v1)); \ + G_STATIC_ASSERT((gint64) (v1) == (v2)); \ + G_STATIC_ASSERT((gint64) (v2) == (v1)); \ + } \ G_STMT_END switch (pref) { diff --git a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c index ef85b6bfb5..7a5003325e 100644 --- a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c +++ b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c @@ -204,18 +204,18 @@ write_object(NMSetting8021x * s_8021x, g_return_val_if_fail(ifcfg != NULL, FALSE); g_return_val_if_fail(objtype != NULL, FALSE); - scheme = (*(objtype->vtable->scheme_func)) (s_8021x); + scheme = (*(objtype->vtable->scheme_func))(s_8021x); switch (scheme) { case NM_SETTING_802_1X_CK_SCHEME_UNKNOWN: break; case NM_SETTING_802_1X_CK_SCHEME_BLOB: - blob = (*(objtype->vtable->blob_func)) (s_8021x); + blob = (*(objtype->vtable->blob_func))(s_8021x); break; case NM_SETTING_802_1X_CK_SCHEME_PATH: - value = (*(objtype->vtable->path_func)) (s_8021x); + value = (*(objtype->vtable->path_func))(s_8021x); break; case NM_SETTING_802_1X_CK_SCHEME_PKCS11: - value = (*(objtype->vtable->uri_func)) (s_8021x); + value = (*(objtype->vtable->uri_func))(s_8021x); break; default: g_set_error(error, @@ -228,8 +228,8 @@ write_object(NMSetting8021x * s_8021x, /* Set the password for certificate/private key. */ nm_sprintf_buf(secret_name, "%s_PASSWORD", objtype->ifcfg_rh_key); nm_sprintf_buf(secret_flags, "%s_PASSWORD_FLAGS", objtype->ifcfg_rh_key); - password = (*(objtype->vtable->passwd_func)) (s_8021x); - flags = (*(objtype->vtable->pwflag_func)) (s_8021x); + password = (*(objtype->vtable->passwd_func))(s_8021x); + flags = (*(objtype->vtable->pwflag_func))(s_8021x); set_secret(ifcfg, secrets, secret_name, password, secret_flags, flags); if (!objtype->vtable->format_func) diff --git a/src/libnm-client-impl/tests/test-libnm.c b/src/libnm-client-impl/tests/test-libnm.c index e470c63e19..d4e0de31dc 100644 --- a/src/libnm-client-impl/tests/test-libnm.c +++ b/src/libnm-client-impl/tests/test-libnm.c @@ -2758,7 +2758,7 @@ test_types(void) for (i_type = 0; i_type < G_N_ELEMENTS(get_type_fcns); i_type++) { nm_auto_unref_gtypeclass GObjectClass *klass_unref = NULL; - GType gtype = (get_type_fcns[i_type]) (); + GType gtype = (get_type_fcns[i_type])(); GObjectClass * klass; g_assert(g_str_has_prefix(g_type_name(gtype), "NM")); diff --git a/src/libnm-core-impl/nm-dbus-utils.c b/src/libnm-core-impl/nm-dbus-utils.c index bcc8cf9cac..a272f08ce9 100644 --- a/src/libnm-core-impl/nm-dbus-utils.c +++ b/src/libnm-core-impl/nm-dbus-utils.c @@ -132,7 +132,7 @@ _nm_dbus_signal_connect_data(GDBusProxy * proxy, sd->signal_name = g_strdup(signal_name); sd->signature = signature; - closure = (swapped ? g_cclosure_new_swap : g_cclosure_new) (c_handler, data, destroy_data); + closure = (swapped ? g_cclosure_new_swap : g_cclosure_new)(c_handler, data, destroy_data); g_closure_set_marshal(closure, g_cclosure_marshal_generic); g_closure_set_meta_marshal(closure, sd, dbus_signal_meta_marshal); g_closure_add_finalize_notifier(closure, sd, dbus_signal_data_free); diff --git a/src/libnm-core-impl/nm-setting-8021x.c b/src/libnm-core-impl/nm-setting-8021x.c index 6ddbd68066..e8413fc9c4 100644 --- a/src/libnm-core-impl/nm-setting-8021x.c +++ b/src/libnm-core-impl/nm-setting-8021x.c @@ -2931,7 +2931,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) if (eap_methods_table[i].v_func == NULL) continue; if (!strcmp(eap_methods_table[i].method, method)) { - if (!(*eap_methods_table[i].v_func) (self, FALSE, error)) + if (!(*eap_methods_table[i].v_func)(self, FALSE, error)) return FALSE; break; } diff --git a/src/libnm-core-impl/nm-setting-private.h b/src/libnm-core-impl/nm-setting-private.h index 061fc901ff..94296e6e7a 100644 --- a/src/libnm-core-impl/nm-setting-private.h +++ b/src/libnm-core-impl/nm-setting-private.h @@ -424,7 +424,7 @@ _nm_properties_override(GArray *properties_override, const NMSettInfoProperty *p _param_spec, \ _property_type, \ .to_dbus_data.get_boolean = \ - (gboolean(*)(NMSetting *)) (get_fcn), \ + (gboolean(*)(NMSetting *))(get_fcn), \ __VA_ARGS__); \ } \ G_STMT_END @@ -482,7 +482,7 @@ _nm_properties_override(GArray *properties_override, const NMSettInfoProperty *p _param_spec, \ _property_type, \ .to_dbus_data.get_string = \ - (const char *(*) (NMSetting *) ) (get_fcn), \ + (const char *(*) (NMSetting *) )(get_fcn), \ __VA_ARGS__); \ } \ G_STMT_END diff --git a/src/libnm-glib-aux/nm-glib.h b/src/libnm-glib-aux/nm-glib.h index 66e5c16e14..19709d51b8 100644 --- a/src/libnm-glib-aux/nm-glib.h +++ b/src/libnm-glib-aux/nm-glib.h @@ -571,7 +571,7 @@ _nm_g_value_unset(GValue *value) /* G_SOURCE_FUNC was added in 2.57.2. */ #undef G_SOURCE_FUNC -#define G_SOURCE_FUNC(f) ((GSourceFunc) (void (*)(void)) (f)) +#define G_SOURCE_FUNC(f) ((GSourceFunc) (void (*)(void))(f)) /*****************************************************************************/ diff --git a/src/libnm-glib-aux/nm-macros-internal.h b/src/libnm-glib-aux/nm-macros-internal.h index f2d81e1ccf..c5b096d6ec 100644 --- a/src/libnm-glib-aux/nm-macros-internal.h +++ b/src/libnm-glib-aux/nm-macros-internal.h @@ -657,15 +657,15 @@ NM_G_ERROR_MSG(GError *error) * 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_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_CONST(type, value) ((const type)(value)) #endif #if _NM_CC_SUPPORT_GENERIC && (!defined(__clang__) || __clang_major__ > 3)