mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-15 20:45:32 +00:00
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.
This commit is contained in:
parent
ccd398caf7
commit
10e0c4261e
|
@ -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) {
|
||||
|
|
|
@ -205,18 +205,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,
|
||||
|
@ -229,8 +229,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)
|
||||
|
|
|
@ -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"));
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -2924,7 +2924,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;
|
||||
}
|
||||
|
|
|
@ -572,7 +572,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))
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
|
|
@ -256,15 +256,15 @@ typedef uint64_t _nm_bitwise nm_be64_t;
|
|||
* 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
|
||||
|
||||
/* returns void, but does a compile time check that the argument is a pointer
|
||||
|
|
Loading…
Reference in a new issue