diff options
author | Thomas Haller <thaller@redhat.com> | 2020-09-29 09:02:29 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-09-29 09:12:27 +0200 |
commit | 8841d529e1bd1d5b6733b0b6c17e06379229180d (patch) | |
tree | d582cd5c174f0adfb8631765cdb28a88cd4016f2 | |
parent | 89ed75df16499ab3aa2fba6c8b8adf646036cf01 (diff) | |
download | NetworkManager-8841d529e1bd1d5b6733b0b6c17e06379229180d.tar.gz |
format: manually replace remaining tabs with spaces and reformat
29 files changed, 264 insertions, 262 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 80b7aa46ec..86e8b463dc 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -6212,7 +6212,7 @@ extract_setting_and_property(const char *prompt, const char *line, char **settin if (prompt) { /* prompt looks like this: - "nmcli 802-1x>" or "nmcli 802-1x.pac-file>" */ + * "nmcli 802-1x>" or "nmcli 802-1x.pac-file>" */ const char *p1, *p2, *dot; size_t num1, num2; p1 = strchr(prompt, ' '); @@ -6233,7 +6233,7 @@ extract_setting_and_property(const char *prompt, const char *line, char **settin if (line) { /* line looks like this: - " set 802-1x.pac-file ..." or " set pac-file ..." */ + * " set 802-1x.pac-file ..." or " set pac-file ..." */ const char *p1, *p2, *dot; size_t n1, n2, n3, n4; size_t num1, num2, len; diff --git a/clients/cli/nmcli.c b/clients/cli/nmcli.c index f2f44d4618..92143e9d17 100644 --- a/clients/cli/nmcli.c +++ b/clients/cli/nmcli.c @@ -821,7 +821,7 @@ process_command_line(NmCli *nmc, int argc, char **argv_orig) /* We want fixed tabular mode here, but just set the mode specified and rely on defaults: * in this way we allow use of "-m multiline" to swap the output mode also if placed * before the "-g <field>" option (-g may be still more practical and easy to remember than -t -f). - */ + */ nmc->mode_specified = TRUE; } else if (matches_arg(nmc, &argc, &argv, "-nocheck", NULL)) { /* ignore for backward compatibility */ diff --git a/clients/common/nm-client-utils.c b/clients/common/nm-client-utils.c index d9f8692934..ce7613c35d 100644 --- a/clients/common/nm-client-utils.c +++ b/clients/common/nm-client-utils.c @@ -101,8 +101,8 @@ nmc_string_to_bool(const char *str, gboolean *val_bool, GError **error) 1, 0, /* TRANSLATORS: the first %s is the partial value entered by - * the user, the second %s a list of compatible values. - */ + * the user, the second %s a list of compatible values. + */ _("'%s' is ambiguous (%s)"), str, "on x off"); @@ -140,8 +140,8 @@ nmc_string_to_ternary(const char *str, NMTernary *val, GError **error) 1, 0, /* TRANSLATORS: the first %s is the partial value entered by - * the user, the second %s a list of compatible values. - */ + * the user, the second %s a list of compatible values. + */ _("'%s' is ambiguous (%s)"), str, "on x off"); diff --git a/clients/tui/nm-editor-utils.c b/clients/tui/nm-editor-utils.c index c1e988b71a..5462707b6e 100644 --- a/clients/tui/nm-editor-utils.c +++ b/clients/tui/nm-editor-utils.c @@ -23,20 +23,20 @@ static GSList *vpn_plugins; static int sort_vpn_plugins (gconstpointer a, gconstpointer b) { - NMVpnEditorPlugin *aa = NM_VPN_EDITOR_PLUGIN (a); - NMVpnEditorPlugin *bb = NM_VPN_EDITOR_PLUGIN (b); - char *aa_desc = NULL, *bb_desc = NULL; - int ret; + NMVpnEditorPlugin *aa = NM_VPN_EDITOR_PLUGIN (a); + NMVpnEditorPlugin *bb = NM_VPN_EDITOR_PLUGIN (b); + char *aa_desc = NULL, *bb_desc = NULL; + int ret; - g_object_get (aa, NM_VPN_EDITOR_PLUGIN_NAME, &aa_desc, NULL); - g_object_get (bb, NM_VPN_EDITOR_PLUGIN_NAME, &bb_desc, NULL); + g_object_get (aa, NM_VPN_EDITOR_PLUGIN_NAME, &aa_desc, NULL); + g_object_get (bb, NM_VPN_EDITOR_PLUGIN_NAME, &bb_desc, NULL); - ret = g_strcmp0 (aa_desc, bb_desc); + ret = g_strcmp0 (aa_desc, bb_desc); - g_free (aa_desc); - g_free (bb_desc); + g_free (aa_desc); + g_free (bb_desc); - return ret; + return ret; } #endif @@ -115,8 +115,8 @@ nm_editor_utils_get_connection_type_list(void) NMEditorConnectionTypeDataReal * item; static NMEditorConnectionTypeData **list; #if 0 - GHashTable *vpn_plugins_hash; - gboolean have_vpn_plugins; + GHashTable *vpn_plugins_hash; + gboolean have_vpn_plugins; #endif if (list) @@ -150,13 +150,13 @@ nm_editor_utils_get_connection_type_list(void) g_ptr_array_add(array, item); #if 0 - item = g_new0 (NMEditorConnectionTypeDataReal, 1); - item->data.name = _("Mobile Broadband"); - item->data.setting_type = NM_TYPE_SETTING_GSM; - item->data.virtual = FALSE; - item->id_format = _("Mobile broadband connection %d"); - item->no_autoconnect = TRUE; - g_ptr_array_add (array, item); + item = g_new0 (NMEditorConnectionTypeDataReal, 1); + item->data.name = _("Mobile Broadband"); + item->data.setting_type = NM_TYPE_SETTING_GSM; + item->data.virtual = FALSE; + item->id_format = _("Mobile broadband connection %d"); + item->no_autoconnect = TRUE; + g_ptr_array_add (array, item); #endif item = g_new0(NMEditorConnectionTypeDataReal, 1); @@ -212,27 +212,27 @@ nm_editor_utils_get_connection_type_list(void) g_ptr_array_add(array, item); #if 0 - /* Add "VPN" only if there are plugins */ - vpn_plugins_hash = nm_vpn_get_plugin_infos (); - have_vpn_plugins = vpn_plugins_hash && g_hash_table_size (vpn_plugins_hash); - if (have_vpn_plugins) { - GHashTableIter iter; - gpointer name, plugin; - - item = g_new0 (NMEditorConnectionTypeDataReal, 1); - item->data.name = _("VPN"); - item->data.setting_type = NM_TYPE_SETTING_VPN; - item->data.virtual = TRUE; - item->id_format = _("VPN connection %d"); - item->no_autoconnect = TRUE; - g_ptr_array_add (array, item); - - vpn_plugins = NULL; - g_hash_table_iter_init (&iter, vpn_plugins_hash); - while (g_hash_table_iter_next (&iter, &name, &plugin)) - vpn_plugins = g_slist_prepend (vpn_plugins, plugin); - vpn_plugins = g_slist_sort (vpn_plugins, sort_vpn_plugins); - } + /* Add "VPN" only if there are plugins */ + vpn_plugins_hash = nm_vpn_get_plugin_infos (); + have_vpn_plugins = vpn_plugins_hash && g_hash_table_size (vpn_plugins_hash); + if (have_vpn_plugins) { + GHashTableIter iter; + gpointer name, plugin; + + item = g_new0 (NMEditorConnectionTypeDataReal, 1); + item->data.name = _("VPN"); + item->data.setting_type = NM_TYPE_SETTING_VPN; + item->data.virtual = TRUE; + item->id_format = _("VPN connection %d"); + item->no_autoconnect = TRUE; + g_ptr_array_add (array, item); + + vpn_plugins = NULL; + g_hash_table_iter_init (&iter, vpn_plugins_hash); + while (g_hash_table_iter_next (&iter, &name, &plugin)) + vpn_plugins = g_slist_prepend (vpn_plugins, plugin); + vpn_plugins = g_slist_sort (vpn_plugins, sort_vpn_plugins); + } #endif g_ptr_array_sort(array, sort_types); diff --git a/clients/tui/nmt-device-entry.c b/clients/tui/nmt-device-entry.c index 399f1a623b..a6156d51b8 100644 --- a/clients/tui/nmt-device-entry.c +++ b/clients/tui/nmt-device-entry.c @@ -345,9 +345,9 @@ nmt_device_entry_init(NmtDeviceEntry *deventry) g_signal_connect(priv->entry, "notify::text", G_CALLBACK(entry_text_changed), deventry); #if 0 - priv->button = nmt_newt_button_new (_("Select...")); - g_signal_connect (priv->button, "clicked", - G_CALLBACK (do_select_dialog), deventry); + priv->button = nmt_newt_button_new (_("Select...")); + g_signal_connect (priv->button, "clicked", + G_CALLBACK (do_select_dialog), deventry); #endif } diff --git a/clients/tui/nmtui-edit.c b/clients/tui/nmtui-edit.c index 4aee2bb0b1..eb2b795662 100644 --- a/clients/tui/nmtui-edit.c +++ b/clients/tui/nmtui-edit.c @@ -362,9 +362,9 @@ nmt_add_connection_class_init(NmtAddConnectionClass *add_class) "", "", #if 0 - _("If you are creating a VPN, and the VPN connection you " - "wish to create does not appear in the list, you may " - "not have the correct VPN plugin installed."), + _("If you are creating a VPN, and the VPN connection you " + "wish to create does not appear in the list, you may " + "not have the correct VPN plugin installed."), #else NULL, #endif diff --git a/libnm-core/nm-connection.c b/libnm-core/nm-connection.c index 0a08244e86..ab14f2e93e 100644 --- a/libnm-core/nm-connection.c +++ b/libnm-core/nm-connection.c @@ -916,8 +916,8 @@ _normalize_ip_config(NMConnection *self, GHashTable *parameters) default_ip4_method = NM_SETTING_IP4_CONFIG_METHOD_DISABLED; /* But if no IP4 setting was specified, assume the caller was just - * being lazy and use the default method. - */ + * being lazy and use the default method. + */ setting = nm_setting_ip4_config_new(); g_object_set(setting, NM_SETTING_IP_CONFIG_METHOD, default_ip4_method, NULL); diff --git a/libnm-core/nm-setting-bond.c b/libnm-core/nm-setting-bond.c index f8d72458a7..af9c7780d4 100644 --- a/libnm-core/nm-setting-bond.c +++ b/libnm-core/nm-setting-bond.c @@ -1167,13 +1167,13 @@ nm_setting_bond_class_init(NMSettingBondClass *klass) &nm_sett_info_propert_type_strdict); /* ---dbus--- - * property: interface-name - * format: string - * description: Deprecated in favor of connection.interface-name, but can - * be used for backward-compatibility with older daemons, to set the - * bond's interface name. - * ---end--- - */ + * property: interface-name + * format: string + * description: Deprecated in favor of connection.interface-name, but can + * be used for backward-compatibility with older daemons, to set the + * bond's interface name. + * ---end--- + */ _nm_properties_override_dbus(properties_override, "interface-name", &nm_sett_info_propert_type_deprecated_interface_name); diff --git a/libnm-core/nm-setting-ip-config.c b/libnm-core/nm-setting-ip-config.c index 6fff903451..e5dc45a778 100644 --- a/libnm-core/nm-setting-ip-config.c +++ b/libnm-core/nm-setting-ip-config.c @@ -5970,12 +5970,12 @@ nm_setting_ip_config_class_init(NMSettingIPConfigClass *klass) "", "", G_TYPE_PTR_ARRAY, - G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | - /* "addresses" is a legacy D-Bus property, because the - * "addresses" GObject property normally gets set from - * the "address-data" D-Bus property... - */ - NM_SETTING_PARAM_LEGACY | G_PARAM_STATIC_STRINGS); + /* "addresses" is a legacy D-Bus property, because the + * "addresses" GObject property normally gets set from + * the "address-data" D-Bus property... + */ + G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | NM_SETTING_PARAM_LEGACY + | G_PARAM_STATIC_STRINGS); /** * NMSettingIPConfig:gateway: diff --git a/libnm-core/tests/test-crypto.c b/libnm-core/tests/test-crypto.c index 97a574de13..b3d60aac3f 100644 --- a/libnm-core/tests/test-crypto.c +++ b/libnm-core/tests/test-crypto.c @@ -29,51 +29,51 @@ static const char *pem_dsa_key_end = "-----END DSA PRIVATE KEY-----"; static void dump_key_to_pem (const char *key, gsize key_len, int key_type) { - char *b64 = NULL; - GString *str = NULL; - const char *start_tag; - const char *end_tag; - char *p; - - switch (key_type) { - case NM_CRYPTO_KEY_TYPE_RSA: - start_tag = pem_rsa_key_begin; - end_tag = pem_rsa_key_end; - break; - case NM_CRYPTO_KEY_TYPE_DSA: - start_tag = pem_dsa_key_begin; - end_tag = pem_dsa_key_end; - break; - default: - g_warning ("Unknown key type %d", key_type); - return; - } - - b64 = g_base64_encode ((const unsigned char *) key, key_len); - if (!b64) { - g_warning ("Couldn't base64 encode the key."); - goto out; - } - - str = g_string_new (NULL); - - g_string_append (str, start_tag); - g_string_append_c (str, '\n'); - - for (p = b64; p < (b64 + strlen (b64)); p += 64) { - g_string_append_len (str, p, strnlen (p, 64)); - g_string_append_c (str, '\n'); - } - - g_string_append (str, end_tag); - g_string_append_c (str, '\n'); - - g_message ("Decrypted private key:\n\n%s", str->str); + char *b64 = NULL; + GString *str = NULL; + const char *start_tag; + const char *end_tag; + char *p; + + switch (key_type) { + case NM_CRYPTO_KEY_TYPE_RSA: + start_tag = pem_rsa_key_begin; + end_tag = pem_rsa_key_end; + break; + case NM_CRYPTO_KEY_TYPE_DSA: + start_tag = pem_dsa_key_begin; + end_tag = pem_dsa_key_end; + break; + default: + g_warning ("Unknown key type %d", key_type); + return; + } + + b64 = g_base64_encode ((const unsigned char *) key, key_len); + if (!b64) { + g_warning ("Couldn't base64 encode the key."); + goto out; + } + + str = g_string_new (NULL); + + g_string_append (str, start_tag); + g_string_append_c (str, '\n'); + + for (p = b64; p < (b64 + strlen (b64)); p += 64) { + g_string_append_len (str, p, strnlen (p, 64)); + g_string_append_c (str, '\n'); + } + + g_string_append (str, end_tag); + g_string_append_c (str, '\n'); + + g_message ("Decrypted private key:\n\n%s", str->str); out: - g_free (b64); - if (str) - g_string_free (str, TRUE); + g_free (b64); + if (str) + g_string_free (str, TRUE); } #endif @@ -384,9 +384,9 @@ test_md5(void) memset(digest, 0, sizeof(digest)); nm_crypto_md5_hash((const guint8 *) md5_tests[i].salt, /* nm_crypto_md5_hash() used to clamp salt_len to 8. It - * doesn't any more, so we need to do it here now to - * get output that matches md5_tests[i].result. - */ + * doesn't any more, so we need to do it here now to + * get output that matches md5_tests[i].result. + */ md5_tests[i].salt ? 8 : 0, (const guint8 *) md5_tests[i].password, strlen(md5_tests[i].password), diff --git a/shared/nm-glib-aux/nm-errno.c b/shared/nm-glib-aux/nm-errno.c index fa9c50db77..7f238e1903 100644 --- a/shared/nm-glib-aux/nm-errno.c +++ b/shared/nm-glib-aux/nm-errno.c @@ -14,7 +14,7 @@ static NM_UTILS_LOOKUP_STR_DEFINE( _geterror, #if 0 - enum _NMErrno, + enum _NMErrno, #else int, #endif diff --git a/shared/nm-glib-aux/nm-macros-internal.h b/shared/nm-glib-aux/nm-macros-internal.h index 4ba280dbe3..83c9206fa8 100644 --- a/shared/nm-glib-aux/nm-macros-internal.h +++ b/shared/nm-glib-aux/nm-macros-internal.h @@ -538,68 +538,68 @@ NM_G_ERROR_MSG(GError *error) #if _NM_CC_SUPPORT_GENERIC #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)), \ - void * : (( type *) (obj)), \ - const type *const: ((const type *) (obj)), \ - const type * : ((const type *) (obj)), \ - type *const: (( type *) (obj)), \ - type * : (( type *) (obj)))) + const void *const: ((const type *) (obj)), \ + const void * : ((const type *) (obj)), \ + void *const: (( type *) (obj)), \ + void * : (( type *) (obj)), \ + const type *const: ((const type *) (obj)), \ + 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), \ - const void *const: ((const type *) (obj)), \ - const void * : ((const type *) (obj)), \ - void *const: (( type *) (obj)), \ - void * : (( type *) (obj)), \ - const alias_type2 *const: ((const type *) (obj)), \ - const alias_type2 * : ((const type *) (obj)), \ - alias_type2 *const: (( type *) (obj)), \ - alias_type2 * : (( type *) (obj)), \ - const type *const: ((const type *) (obj)), \ - const type * : ((const type *) (obj)), \ - type *const: (( type *) (obj)), \ - type * : (( type *) (obj)))) + const void *const: ((const type *) (obj)), \ + const void * : ((const type *) (obj)), \ + void *const: (( type *) (obj)), \ + void * : (( type *) (obj)), \ + const alias_type2 *const: ((const type *) (obj)), \ + const alias_type2 * : ((const type *) (obj)), \ + alias_type2 *const: (( type *) (obj)), \ + alias_type2 * : (( type *) (obj)), \ + const type *const: ((const type *) (obj)), \ + 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), \ - const void *const: ((const type *) (obj)), \ - const void * : ((const type *) (obj)), \ - void *const: (( type *) (obj)), \ - void * : (( type *) (obj)), \ - const alias_type2 *const: ((const type *) (obj)), \ - const alias_type2 * : ((const type *) (obj)), \ - alias_type2 *const: (( type *) (obj)), \ - alias_type2 * : (( type *) (obj)), \ - const alias_type3 *const: ((const type *) (obj)), \ - const alias_type3 * : ((const type *) (obj)), \ - alias_type3 *const: (( type *) (obj)), \ - alias_type3 * : (( type *) (obj)), \ - const type *const: ((const type *) (obj)), \ - const type * : ((const type *) (obj)), \ - type *const: (( type *) (obj)), \ - type * : (( type *) (obj)))) + const void *const: ((const type *) (obj)), \ + const void * : ((const type *) (obj)), \ + void *const: (( type *) (obj)), \ + void * : (( type *) (obj)), \ + const alias_type2 *const: ((const type *) (obj)), \ + const alias_type2 * : ((const type *) (obj)), \ + alias_type2 *const: (( type *) (obj)), \ + alias_type2 * : (( type *) (obj)), \ + const alias_type3 *const: ((const type *) (obj)), \ + const alias_type3 * : ((const type *) (obj)), \ + alias_type3 *const: (( type *) (obj)), \ + alias_type3 * : (( type *) (obj)), \ + const type *const: ((const type *) (obj)), \ + 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), \ - const void *const: ((const type *) (obj)), \ - const void * : ((const type *) (obj)), \ - void *const: (( type *) (obj)), \ - void * : (( type *) (obj)), \ - const alias_type2 *const: ((const type *) (obj)), \ - const alias_type2 * : ((const type *) (obj)), \ - alias_type2 *const: (( type *) (obj)), \ - alias_type2 * : (( type *) (obj)), \ - const alias_type3 *const: ((const type *) (obj)), \ - const alias_type3 * : ((const type *) (obj)), \ - alias_type3 *const: (( type *) (obj)), \ - alias_type3 * : (( type *) (obj)), \ - const alias_type4 *const: ((const type *) (obj)), \ - const alias_type4 * : ((const type *) (obj)), \ - alias_type4 *const: (( type *) (obj)), \ - alias_type4 * : (( type *) (obj)), \ - const type *const: ((const type *) (obj)), \ - const type * : ((const type *) (obj)), \ - type *const: (( type *) (obj)), \ - type * : (( type *) (obj)))) + const void *const: ((const type *) (obj)), \ + const void * : ((const type *) (obj)), \ + void *const: (( type *) (obj)), \ + void * : (( type *) (obj)), \ + const alias_type2 *const: ((const type *) (obj)), \ + const alias_type2 * : ((const type *) (obj)), \ + alias_type2 *const: (( type *) (obj)), \ + alias_type2 * : (( type *) (obj)), \ + const alias_type3 *const: ((const type *) (obj)), \ + const alias_type3 * : ((const type *) (obj)), \ + alias_type3 *const: (( type *) (obj)), \ + alias_type3 * : (( type *) (obj)), \ + const alias_type4 *const: ((const type *) (obj)), \ + const alias_type4 * : ((const type *) (obj)), \ + alias_type4 *const: (( type *) (obj)), \ + alias_type4 * : (( type *) (obj)), \ + const type *const: ((const type *) (obj)), \ + 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, ...) \ @@ -622,10 +622,10 @@ NM_G_ERROR_MSG(GError *error) #if _NM_CC_SUPPORT_GENERIC #define NM_UNCONST_PPTR(type, arg) \ _Generic ((arg), \ - const type * *: ((type **) (arg)), \ - type * *: ((type **) (arg)), \ - const type *const*: ((type **) (arg)), \ - type *const*: ((type **) (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)) #endif @@ -699,17 +699,17 @@ NM_G_ERROR_MSG(GError *error) */ #define NM_CAST_STRV_MC(value) \ (_Generic ((value), \ - const char * *: (const char * *) (value), \ - char * *: (const char * *) (value), \ - void *: (const char * *) (value))) + const char * *: (const char * *) (value), \ + char * *: (const char * *) (value), \ + void *: (const char * *) (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), \ - char * *: (const char *const*) (value), \ - const void *: (const char *const*) (value), \ - void *: (const char *const*) (value))) + const char *const*: (const char *const*) (value), \ + const char * *: (const char *const*) (value), \ + char *const*: (const char *const*) (value), \ + char * *: (const char *const*) (value), \ + const void *: (const char *const*) (value), \ + void *: (const char *const*) (value))) #else #define NM_CAST_STRV_MC(value) ((const char **) (value)) #define NM_CAST_STRV_CC(value) ((const char *const *) (value)) @@ -718,9 +718,9 @@ NM_G_ERROR_MSG(GError *error) #if _NM_CC_SUPPORT_GENERIC #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))))) + 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) #endif diff --git a/shared/nm-glib-aux/nm-shared-utils.c b/shared/nm-glib-aux/nm-shared-utils.c index d2ad22f8a3..0a0492698f 100644 --- a/shared/nm-glib-aux/nm-shared-utils.c +++ b/shared/nm-glib-aux/nm-shared-utils.c @@ -5189,9 +5189,9 @@ _nm_utils_ifname_valid_ovs(const char *name, GError **error) const char *ch; /* OVS actually accepts a wider range of chars (all printable UTF-8 chars), - NetworkManager restricts this to ASCII char as it's a safer option for - now since OVS is not well documented on this matter. - */ + * NetworkManager restricts this to ASCII char as it's a safer option for + * now since OVS is not well documented on this matter. + **/ for (ch = name; *ch; ++ch) { if (*ch == '\\' || *ch == '/' || !g_ascii_isgraph(*ch)) { g_set_error_literal(error, diff --git a/shared/systemd/src/basic/siphash24.h b/shared/systemd/src/basic/siphash24.h index 621301f9d4..474d9c9d21 100644 --- a/shared/systemd/src/basic/siphash24.h +++ b/shared/systemd/src/basic/siphash24.h @@ -19,31 +19,31 @@ struct siphash { }; #else /* NM_IGNORED */ struct siphash { - CSipHash _csiphash; + CSipHash _csiphash; }; static inline void siphash24_init (struct siphash *state, const uint8_t k[16]) { - c_siphash_init ((CSipHash *) state, k); + c_siphash_init ((CSipHash *) state, k); } static inline void siphash24_compress (const void *in, size_t inlen, struct siphash *state) { - c_siphash_append ((CSipHash *) state, in, inlen); + c_siphash_append ((CSipHash *) state, in, inlen); } static inline uint64_t siphash24_finalize (struct siphash *state) { - return c_siphash_finalize ((CSipHash *) state); + return c_siphash_finalize ((CSipHash *) state); } static inline uint64_t siphash24 (const void *in, size_t inlen, const uint8_t k[16]) { - return c_siphash_hash (k, in, inlen); + return c_siphash_hash (k, in, inlen); } #endif /* NM_IGNORED */ diff --git a/src/devices/nm-device-private.h b/src/devices/nm-device-private.h index 17483f28ea..3a0bb8ee32 100644 --- a/src/devices/nm-device-private.h +++ b/src/devices/nm-device-private.h @@ -31,9 +31,9 @@ enum NMActStageReturn { NM_ACT_STAGE_RETURN_POSTPONE, /* Long-running operation in progress */ NM_ACT_STAGE_RETURN_IP_WAIT, /* IP config stage is waiting (state IP_WAIT) */ NM_ACT_STAGE_RETURN_IP_DONE, /* IP config stage is done (state IP_DONE), - For the ip-config stage, this is similar to - NM_ACT_STAGE_RETURN_SUCCESS, except that no - IP config should be committed. */ + * For the ip-config stage, this is similar to + * NM_ACT_STAGE_RETURN_SUCCESS, except that no + * IP config should be committed. */ NM_ACT_STAGE_RETURN_IP_FAIL, /* IP config stage failed (state IP_FAIL), activation may proceed */ }; diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 1dd5953c67..04331bd3a3 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -174,7 +174,7 @@ typedef enum { typedef struct { NMIPConfig *orig; /* the original configuration applied to the device */ NMIPConfig *current; /* configuration after external changes. NULL means - that the original configuration didn't change. */ + * that the original configuration didn't change. */ } AppliedConfig; typedef struct { @@ -4879,7 +4879,7 @@ carrier_changed(NMDevice *self, gboolean carrier) if (nm_device_is_master(self)) { if (carrier) { /* Force master to retry getting ip addresses when carrier - * is restored. */ + * is restored. */ if (priv->state == NM_DEVICE_STATE_ACTIVATED) nm_device_update_dynamic_ip_setup(self); /* If needed, also resume IP configuration that is @@ -7605,8 +7605,8 @@ nm_device_queue_recheck_available(NMDevice * self, if (!priv->recheck_available.call_id) { priv->recheck_available.call_id = g_idle_add(recheck_available, self); nm_device_add_pending_action (self, NM_PENDING_ACTION_RECHECK_AVAILABLE, - FALSE /* cannot assert, because of how recheck_available() first clears - the call-id and postpones removing the pending-action. */); + FALSE /* cannot assert, because of how recheck_available() first clears + * the call-id and postpones removing the pending-action. */); } } diff --git a/src/devices/wifi/nm-wifi-ap.c b/src/devices/wifi/nm-wifi-ap.c index 518c568762..590ae0f005 100644 --- a/src/devices/wifi/nm-wifi-ap.c +++ b/src/devices/wifi/nm-wifi-ap.c @@ -49,7 +49,7 @@ struct _NMWifiAPPrivate { gint64 last_seen_msec; /* Timestamp when the AP was seen lastly (in nm_utils_get_monotonic_timestamp_*() scale). - * Note that this value might be negative! */ + * Note that this value might be negative! */ NM80211ApFlags flags; /* General flags */ NM80211ApSecurityFlags wpa_flags; /* WPA-related flags */ diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c index 0165526385..9cf4fb3112 100644 --- a/src/devices/wwan/nm-device-modem.c +++ b/src/devices/wwan/nm-device-modem.c @@ -368,8 +368,8 @@ modem_state_cb(NMModem *modem, int new_state_i, int old_state_i, gpointer user_d if (dev_state == NM_DEVICE_STATE_NEED_AUTH) { /* The modem was unlocked externally to NetworkManager, - deactivate so the default connection can be - automatically activated again */ + * deactivate so the default connection can be + * automatically activated again */ nm_device_state_changed(device, NM_DEVICE_STATE_DEACTIVATING, NM_DEVICE_STATE_REASON_MODEM_AVAILABLE); diff --git a/src/dhcp/nm-dhcp-utils.c b/src/dhcp/nm-dhcp-utils.c index ae73303845..50fb9fc5d8 100644 --- a/src/dhcp/nm-dhcp-utils.c +++ b/src/dhcp/nm-dhcp-utils.c @@ -320,9 +320,9 @@ process_classful_routes(const char * iface, memset(&route, 0, sizeof(route)); route.network = rt_addr; /* RFC 2132, updated by RFC 3442: - The Static Routes option (option 33) does not provide a subnet mask - for each route - it is assumed that the subnet mask is implicit in - whatever network number is specified in each route entry */ + * The Static Routes option (option 33) does not provide a subnet mask + * for each route - it is assumed that the subnet mask is implicit in + * whatever network number is specified in each route entry */ route.plen = _nm_utils_ip4_get_default_prefix(rt_addr); if (rt_addr & ~_nm_utils_ip4_prefix_to_netmask(route.plen)) { /* RFC 943: target not "this network"; using host routing */ diff --git a/src/dns/nm-dns-manager.c b/src/dns/nm-dns-manager.c index c1f3cc960a..6e9e401bfe 100644 --- a/src/dns/nm-dns-manager.c +++ b/src/dns/nm-dns-manager.c @@ -1623,7 +1623,7 @@ plugin_skip:; } /* Unless we've already done it, update private resolv.conf in NMRUNDIR - ignoring any errors */ + * ignoring any errors */ if (!resolv_conf_updated) { update_resolv_conf(self, NM_CAST_STRV_CC(searches), diff --git a/src/nm-config.c b/src/nm-config.c index 4f2a0f72e9..eda7f68245 100644 --- a/src/nm-config.c +++ b/src/nm-config.c @@ -3141,7 +3141,7 @@ nm_config_class_init(NMConfigClass *config_class) 3, NM_TYPE_CONFIG_DATA, /* Use plain guint type for changes argument. This avoids - * glib/ffi bug https://bugzilla.redhat.com/show_bug.cgi?id=1260577 */ + * glib/ffi bug https://bugzilla.redhat.com/show_bug.cgi?id=1260577 */ /* NM_TYPE_CONFIG_CHANGE_FLAGS, */ G_TYPE_UINT, NM_TYPE_CONFIG_DATA); diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c index 3e3b3db213..d048a86ee3 100644 --- a/src/nm-core-utils.c +++ b/src/nm-core-utils.c @@ -2903,11 +2903,11 @@ _host_id_hash_v2(const guint8 *seed_arr, char slen[100]; /* - (stat -c '%s' /var/lib/NetworkManager/secret_key; - echo -n ' '; - cat /var/lib/NetworkManager/secret_key; - cat /etc/machine-id | tr -d '\n' | sed -n 's/[a-f0-9-]/\0/pg') | sha256sum - */ + (stat -c '%s' /var/lib/NetworkManager/secret_key; + echo -n ' '; + cat /var/lib/NetworkManager/secret_key; + cat /etc/machine-id | tr -d '\n' | sed -n 's/[a-f0-9-]/\0/pg') | sha256sum + */ nm_sprintf_buf(slen, "%" G_GSIZE_FORMAT " ", seed_len); g_checksum_update(sum, (const guchar *) slen, strlen(slen)); @@ -3380,7 +3380,7 @@ nm_utils_get_ipv6_interface_identifier(NMLinkType link_type, return TRUE; case NM_LINK_TYPE_6LOWPAN: /* The hardware address is already 64-bit. This is the case for - * IEEE 802.15.4 networks. */ + * IEEE 802.15.4 networks. */ memcpy(out_iid->id_u8, hwaddr, sizeof(out_iid->id_u8)); return TRUE; default: diff --git a/src/nm-ip4-config.h b/src/nm-ip4-config.h index bfdb681c93..82992d1ebf 100644 --- a/src/nm-ip4-config.h +++ b/src/nm-ip4-config.h @@ -287,22 +287,22 @@ NM_IS_IP_CONFIG_ADDR_FAMILY(gconstpointer config, int addr_family) ({ \ 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)), \ - void * : (NM_IS_IP4_CONFIG (_config) || NM_IS_IP6_CONFIG (_config)), \ - const NMIPConfig *const: (NM_IS_IP4_CONFIG (_config) || NM_IS_IP6_CONFIG (_config)), \ - const NMIPConfig * : (NM_IS_IP4_CONFIG (_config) || NM_IS_IP6_CONFIG (_config)), \ - NMIPConfig *const: (NM_IS_IP4_CONFIG (_config) || NM_IS_IP6_CONFIG (_config)), \ - NMIPConfig * : (NM_IS_IP4_CONFIG (_config) || NM_IS_IP6_CONFIG (_config)), \ - const NMIP4Config *const: (NM_IS_IP4_CONFIG (_config)), \ - const NMIP4Config * : (NM_IS_IP4_CONFIG (_config)), \ - NMIP4Config *const: (NM_IS_IP4_CONFIG (_config)), \ - NMIP4Config * : (NM_IS_IP4_CONFIG (_config)), \ - const NMIP6Config *const: (NM_IS_IP6_CONFIG (_config)), \ - const NMIP6Config * : (NM_IS_IP6_CONFIG (_config)), \ - NMIP6Config *const: (NM_IS_IP6_CONFIG (_config)), \ - NMIP6Config * : (NM_IS_IP6_CONFIG (_config))); \ + 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)), \ + void * : (NM_IS_IP4_CONFIG (_config) || NM_IS_IP6_CONFIG (_config)), \ + const NMIPConfig *const: (NM_IS_IP4_CONFIG (_config) || NM_IS_IP6_CONFIG (_config)), \ + const NMIPConfig * : (NM_IS_IP4_CONFIG (_config) || NM_IS_IP6_CONFIG (_config)), \ + NMIPConfig *const: (NM_IS_IP4_CONFIG (_config) || NM_IS_IP6_CONFIG (_config)), \ + NMIPConfig * : (NM_IS_IP4_CONFIG (_config) || NM_IS_IP6_CONFIG (_config)), \ + const NMIP4Config *const: (NM_IS_IP4_CONFIG (_config)), \ + const NMIP4Config * : (NM_IS_IP4_CONFIG (_config)), \ + NMIP4Config *const: (NM_IS_IP4_CONFIG (_config)), \ + NMIP4Config * : (NM_IS_IP4_CONFIG (_config)), \ + const NMIP6Config *const: (NM_IS_IP6_CONFIG (_config)), \ + 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) diff --git a/src/nm-policy.c b/src/nm-policy.c index 202cbf47e2..469b467eea 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -160,7 +160,7 @@ typedef struct { NMPlatformIP6Address prefix; NMDevice * device; /* The requesting ("uplink") device */ guint64 next_subnet; /* Cache of the next subnet number to be - * assigned from this prefix */ + * assigned from this prefix */ GHashTable * subnets; /* ifindex -> NMPlatformIP6Address */ } IP6PrefixDelegation; diff --git a/src/platform/linux/nl802154.h b/src/platform/linux/nl802154.h index fc8b166f79..c21bd0791c 100644 --- a/src/platform/linux/nl802154.h +++ b/src/platform/linux/nl802154.h @@ -167,8 +167,7 @@ enum nl802154_iftype { * * @__NL802154_CAP_ATTR_INVALID: attribute number 0 is reserved * @NL802154_CAP_ATTR_CHANNELS: a nested attribute for nl802154_channel_attr - * @NL802154_CAP_ATTR_TX_POWERS: a nested attribute for - * nl802154_wpan_phy_tx_power + * @NL802154_CAP_ATTR_TX_POWERS: a nested attribute for nl802154_wpan_phy_tx_power * @NL802154_CAP_ATTR_MIN_CCA_ED_LEVEL: minimum value for cca_ed_level * @NL802154_CAP_ATTR_MAX_CCA_ED_LEVEL: maxmimum value for cca_ed_level * @NL802154_CAP_ATTR_CCA_MODES: nl802154_cca_modes flags @@ -226,8 +225,7 @@ enum nl802154_wpan_phy_capability_attr { * @NL802154_CCA_ENERGY_CARRIER: Carrier sense with energy above threshold * @NL802154_CCA_ALOHA: CCA shall always report an idle medium * @NL802154_CCA_UWB_SHR: UWB preamble sense based on the SHR of a frame - * @NL802154_CCA_UWB_MULTIPLEXED: UWB preamble sense based on the packet with - * the multiplexed preamble + * @NL802154_CCA_UWB_MULTIPLEXED: UWB preamble sense based on the packet with the multiplexed preamble * @__NL802154_CCA_ATTR_AFTER_LAST: Internal * @NL802154_CCA_ATTR_MAX: Maximum CCA attribute number */ diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h index c01008018a..d2dd4ccaf9 100644 --- a/src/platform/nm-platform.h +++ b/src/platform/nm-platform.h @@ -637,20 +637,24 @@ typedef struct { guint32 target; guint32 interval; guint32 quantum; - guint32 ce_threshold; /* TCA_FQ_CODEL_CE_THRESHOLD: kernel internally stores this value as - * ((val64 * NSEC_PER_USEC) >> CODEL_SHIFT). The default value (in - * the domain with this coercion) is CODEL_DISABLED_THRESHOLD (INT_MAX). - * That means, "disabled" is expressed on RTM_NEWQDISC netlink API by absence of the - * netlink attribute but also as the special value 0x83126E97u - * (NM_PLATFORM_FQ_CODEL_CE_THRESHOLD_DISABLED). - * Beware: zero is not the default you must always explicitly set this value. */ - guint32 - memory_limit; /* TCA_FQ_CODEL_MEMORY_LIMIT: note that only values <= 2^31 are accepted by kernel - * and kernel defaults to 32MB. - * Note that we use the special value NM_PLATFORM_FQ_CODEL_MEMORY_LIMIT_UNSET - * to indicate that no explicit limit is set (when we send a RTM_NEWQDISC request). - * This will cause kernel to choose the default (32MB). - * Beware: zero is not the default you must always explicitly set this value. */ + + /* TCA_FQ_CODEL_CE_THRESHOLD: kernel internally stores this value as + * ((val64 * NSEC_PER_USEC) >> CODEL_SHIFT). The default value (in + * the domain with this coercion) is CODEL_DISABLED_THRESHOLD (INT_MAX). + * That means, "disabled" is expressed on RTM_NEWQDISC netlink API by absence of the + * netlink attribute but also as the special value 0x83126E97u + * (NM_PLATFORM_FQ_CODEL_CE_THRESHOLD_DISABLED). + * Beware: zero is not the default you must always explicitly set this value. */ + guint32 ce_threshold; + + /* TCA_FQ_CODEL_MEMORY_LIMIT: note that only values <= 2^31 are accepted by kernel + * and kernel defaults to 32MB. + * Note that we use the special value NM_PLATFORM_FQ_CODEL_MEMORY_LIMIT_UNSET + * to indicate that no explicit limit is set (when we send a RTM_NEWQDISC request). + * This will cause kernel to choose the default (32MB). + * Beware: zero is not the default you must always explicitly set this value. */ + guint32 memory_limit; + bool ecn : 1; } NMPlatformQdiscFqCodel; diff --git a/src/platform/nmp-object.h b/src/platform/nmp-object.h index e6c664fb7c..e9e2c39a8b 100644 --- a/src/platform/nmp-object.h +++ b/src/platform/nmp-object.h @@ -524,7 +524,7 @@ _NMP_OBJECT_TYPE_IS_OBJ_WITH_IFINDEX(NMPObjectType obj_type) typeof(obj) _obj = (obj); \ \ nm_assert ( !_obj \ - || nmp_class_from_type (NMP_OBJECT_GET_TYPE (_obj)))); \ + || nmp_class_from_type (NMP_OBJECT_GET_TYPE (_obj)))); \ _obj ? &NM_CONSTCAST(NMPObject, _obj)->object : NULL; \ }) diff --git a/src/ppp/nm-ppp-manager.c b/src/ppp/nm-ppp-manager.c index 324f3b3e1c..6515b37fb7 100644 --- a/src/ppp/nm-ppp-manager.c +++ b/src/ppp/nm-ppp-manager.c @@ -946,14 +946,14 @@ pppoe_fill_defaults(NMSettingPpp *setting) /* FIXME: These commented settings should be set as well, update NMSettingPpp first. */ #if 0 - setting->noipdefault = TRUE; - setting->default_asyncmap = TRUE; - setting->defaultroute = TRUE; - setting->hide_password = TRUE; - setting->noaccomp = TRUE; - setting->nopcomp = TRUE; - setting->novj = TRUE; - setting->novjccomp = TRUE; + setting->noipdefault = TRUE; + setting->default_asyncmap = TRUE; + setting->defaultroute = TRUE; + setting->hide_password = TRUE; + setting->noaccomp = TRUE; + setting->nopcomp = TRUE; + setting->novj = TRUE; + setting->novjccomp = TRUE; #endif } diff --git a/src/supplicant/nm-supplicant-settings-verify.c b/src/supplicant/nm-supplicant-settings-verify.c index b50cf1d606..7c7340fe99 100644 --- a/src/supplicant/nm-supplicant-settings-verify.c +++ b/src/supplicant/nm-supplicant-settings-verify.c @@ -182,8 +182,8 @@ validate_type_utf8(const struct Opt *opt, const char *value, const guint32 len) check_len = opt->int_high ?: 255; /* Note that we deliberately don't validate the UTF-8, because - some "UTF-8" fields, such as 8021x.password, do not actually - have to be valid UTF-8 */ + * some "UTF-8" fields, such as 8021x.password, do not actually + * have to be valid UTF-8 */ if (g_utf8_strlen(value, len) > check_len) return FALSE; |