mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-15 20:45:32 +00:00
clang-format: reformat code with clang-format 15.0.4-1.fc37
This is the version shipped in Fedora 37. As Fedora 37 is now out, the core developers switch to it. Our gitlab-ci will also use that as base image for the check-{patch.tree} tests and to generate the pages. There is a need that everybody agrees on which clang-format version to use, and that version should be the one of the currently used Fedora release. Also update the used Fedora image in "contrib/scripts/nm-code-format-container.sh" script. The gitlab-ci still needs update in the following commit. The change in isolation will break the "check-tree" test.
This commit is contained in:
parent
fe7bea9685
commit
3fb8c0f614
|
@ -10,7 +10,7 @@ die() {
|
|||
DIR="$(realpath "$(dirname "$0")/../../")"
|
||||
cd "$DIR"
|
||||
|
||||
FEDORA_VERSION=36
|
||||
FEDORA_VERSION=37
|
||||
|
||||
PODNAME="nm-code-format-f$FEDORA_VERSION"
|
||||
|
||||
|
|
|
@ -208,7 +208,8 @@ NMDevice *nm_device_factory_create_device(NMDeviceFactory *factory,
|
|||
\
|
||||
NM_DEVICE_FACTORY_DECLARE_TYPES(st_code) \
|
||||
\
|
||||
static void nm_##lower##_device_factory_init(NM##mixed##DeviceFactory *self) {} \
|
||||
static void nm_##lower##_device_factory_init(NM##mixed##DeviceFactory *self) \
|
||||
{} \
|
||||
\
|
||||
static void nm_##lower##_device_factory_class_init(NM##mixed##DeviceFactoryClass *klass) \
|
||||
{ \
|
||||
|
|
|
@ -1602,7 +1602,7 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg)
|
|||
json_t *items;
|
||||
json_t *external_ids;
|
||||
json_error_t json_error = {
|
||||
0,
|
||||
0,
|
||||
};
|
||||
void *iter;
|
||||
const char *name;
|
||||
|
@ -2003,7 +2003,7 @@ ovsdb_got_msg(NMOvsdb *self, json_t *msg)
|
|||
{
|
||||
NMOvsdbPrivate *priv = NM_OVSDB_GET_PRIVATE(self);
|
||||
json_error_t json_error = {
|
||||
0,
|
||||
0,
|
||||
};
|
||||
json_t *json_id = NULL;
|
||||
json_int_t id = (json_int_t) -1;
|
||||
|
@ -2145,7 +2145,7 @@ ovsdb_read_cb(GObject *source_object, GAsyncResult *res, gpointer user_data)
|
|||
gssize size;
|
||||
json_t *msg;
|
||||
json_error_t json_error = {
|
||||
0,
|
||||
0,
|
||||
};
|
||||
|
||||
size = g_input_stream_read_finish(stream, res, &error);
|
||||
|
|
|
@ -1576,7 +1576,7 @@ nm_dhcp_client_handle_event(gpointer unused,
|
|||
nm_auto_unref_l3cd_init NML3ConfigData *l3cd = NULL;
|
||||
NMDhcpClientEventType client_event_type;
|
||||
NMPlatformIP6Address prefix = {
|
||||
0,
|
||||
0,
|
||||
};
|
||||
|
||||
g_return_val_if_fail(NM_IS_DHCP_CLIENT(self), FALSE);
|
||||
|
|
|
@ -593,7 +593,7 @@ nm_dhcp_utils_ip6_prefix_from_options(GHashTable *options)
|
|||
{
|
||||
gs_strfreev char **split_addr = NULL;
|
||||
NMPlatformIP6Address address = {
|
||||
0,
|
||||
0,
|
||||
};
|
||||
struct in6_addr tmp_addr;
|
||||
char *str = NULL;
|
||||
|
|
|
@ -284,7 +284,7 @@ test_classless_static_routes_1(void)
|
|||
const char *expected_route2_dest = "10.0.0.0";
|
||||
const char *expected_route2_gw = "10.17.66.41";
|
||||
static const Option data[] = {
|
||||
/* dhclient custom format */
|
||||
/* dhclient custom format */
|
||||
{"rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 8 10 10 17 66 41"},
|
||||
{NULL, NULL}};
|
||||
|
||||
|
@ -309,7 +309,7 @@ test_classless_static_routes_2(void)
|
|||
const char *expected_route2_dest = "10.0.0.0";
|
||||
const char *expected_route2_gw = "10.17.66.41";
|
||||
static const Option data[] = {
|
||||
/* dhcpcd format */
|
||||
/* dhcpcd format */
|
||||
{"classless_static_routes", "192.168.10.0/24 192.168.1.1 10.0.0.0/8 10.17.66.41"},
|
||||
{NULL, NULL}};
|
||||
|
||||
|
@ -335,7 +335,7 @@ test_fedora_dhclient_classless_static_routes(void)
|
|||
const char *expected_route2_gw = "10.34.255.6";
|
||||
const char *expected_gateway = "192.168.0.113";
|
||||
static const Option data[] = {
|
||||
/* Fedora dhclient format */
|
||||
/* Fedora dhclient format */
|
||||
{"classless_static_routes",
|
||||
"0 192.168.0.113 25.129.210.177.132 192.168.0.113 7.2 10.34.255.6"},
|
||||
{NULL, NULL}};
|
||||
|
@ -361,7 +361,7 @@ test_dhclient_invalid_classless_routes_1(void)
|
|||
const char *expected_route1_dest = "192.168.10.0";
|
||||
const char *expected_route1_gw = "192.168.1.1";
|
||||
static const Option data[] = {
|
||||
/* dhclient format */
|
||||
/* dhclient format */
|
||||
{"rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 45 10 17 66 41"},
|
||||
{NULL, NULL}};
|
||||
|
||||
|
@ -388,7 +388,7 @@ test_dhcpcd_invalid_classless_routes_1(void)
|
|||
const char *expected_route2_dest = "100.99.88.56";
|
||||
const char *expected_route2_gw = "10.1.1.1";
|
||||
static const Option data[] = {
|
||||
/* dhcpcd format */
|
||||
/* dhcpcd format */
|
||||
{"classless_static_routes", "192.168.10.0/24 192.168.1.1 10.0.adfadf/44 10.17.66.41"},
|
||||
{NULL, NULL}};
|
||||
|
||||
|
@ -418,8 +418,8 @@ test_dhclient_invalid_classless_routes_2(void)
|
|||
const char *expected_route2_dest = "100.99.88.56";
|
||||
const char *expected_route2_gw = "10.1.1.1";
|
||||
static const Option data[] = {
|
||||
{"rfc3442_classless_static_routes", "45 10 17 66 41 24 192 168 10 192 168 1 1"},
|
||||
{NULL, NULL}};
|
||||
{"rfc3442_classless_static_routes", "45 10 17 66 41 24 192 168 10 192 168 1 1"},
|
||||
{NULL, NULL}};
|
||||
|
||||
options = fill_table(generic_options, NULL);
|
||||
options = fill_table(data, options);
|
||||
|
@ -447,8 +447,8 @@ test_dhcpcd_invalid_classless_routes_2(void)
|
|||
const char *expected_route2_dest = "100.99.88.56";
|
||||
const char *expected_route2_gw = "10.1.1.1";
|
||||
static const Option data[] = {
|
||||
{"classless_static_routes", "10.0.adfadf/44 10.17.66.41 192.168.10.0/24 192.168.1.1"},
|
||||
{NULL, NULL}};
|
||||
{"classless_static_routes", "10.0.adfadf/44 10.17.66.41 192.168.10.0/24 192.168.1.1"},
|
||||
{NULL, NULL}};
|
||||
|
||||
options = fill_table(generic_options, NULL);
|
||||
options = fill_table(data, options);
|
||||
|
@ -476,8 +476,8 @@ test_dhclient_invalid_classless_routes_3(void)
|
|||
const char *expected_route1_dest = "192.168.10.0";
|
||||
const char *expected_route1_gw = "192.168.1.1";
|
||||
static const Option data[] = {
|
||||
{"rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 32 128 10 17 66 41"},
|
||||
{NULL, NULL}};
|
||||
{"rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 32 128 10 17 66 41"},
|
||||
{NULL, NULL}};
|
||||
|
||||
options = fill_table(generic_options, NULL);
|
||||
options = fill_table(data, options);
|
||||
|
@ -500,8 +500,8 @@ test_dhcpcd_invalid_classless_routes_3(void)
|
|||
const char *expected_route1_dest = "192.168.10.0";
|
||||
const char *expected_route1_gw = "192.168.1.1";
|
||||
static Option data[] = {
|
||||
{"classless_static_routes", "192.168.10.0/24 192.168.1.1 128/32 10.17.66.41"},
|
||||
{NULL, NULL}};
|
||||
{"classless_static_routes", "192.168.10.0/24 192.168.1.1 128/32 10.17.66.41"},
|
||||
{NULL, NULL}};
|
||||
|
||||
options = fill_table(generic_options, NULL);
|
||||
options = fill_table(data, options);
|
||||
|
@ -525,8 +525,8 @@ test_dhclient_gw_in_classless_routes(void)
|
|||
const char *expected_route1_gw = "192.168.1.1";
|
||||
const char *expected_gateway = "192.2.3.4";
|
||||
static Option data[] = {
|
||||
{"rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 0 192 2 3 4"},
|
||||
{NULL, NULL}};
|
||||
{"rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 0 192 2 3 4"},
|
||||
{NULL, NULL}};
|
||||
|
||||
options = fill_table(generic_options, NULL);
|
||||
options = fill_table(data, options);
|
||||
|
@ -549,8 +549,8 @@ test_dhcpcd_gw_in_classless_routes(void)
|
|||
const char *expected_route1_gw = "192.168.1.1";
|
||||
const char *expected_gateway = "192.2.3.4";
|
||||
static Option data[] = {
|
||||
{"classless_static_routes", "192.168.10.0/24 192.168.1.1 0.0.0.0/0 192.2.3.4"},
|
||||
{NULL, NULL}};
|
||||
{"classless_static_routes", "192.168.10.0/24 192.168.1.1 0.0.0.0/0 192.2.3.4"},
|
||||
{NULL, NULL}};
|
||||
|
||||
options = fill_table(generic_options, NULL);
|
||||
options = fill_table(data, options);
|
||||
|
|
|
@ -575,63 +575,63 @@ nm_config_cmd_line_options_add_to_entries(NMConfigCmdLineOptions *cli, GOptionCo
|
|||
{
|
||||
GOptionGroup *group;
|
||||
GOptionEntry config_options[] = {
|
||||
{"config",
|
||||
{"config",
|
||||
0,
|
||||
0,
|
||||
G_OPTION_ARG_FILENAME,
|
||||
&cli->config_main_file,
|
||||
N_("Config file location"),
|
||||
DEFAULT_CONFIG_MAIN_FILE},
|
||||
{"config-dir",
|
||||
{"config-dir",
|
||||
0,
|
||||
0,
|
||||
G_OPTION_ARG_FILENAME,
|
||||
&cli->config_dir,
|
||||
N_("Config directory location"),
|
||||
DEFAULT_CONFIG_DIR},
|
||||
{"system-config-dir",
|
||||
{"system-config-dir",
|
||||
0,
|
||||
0,
|
||||
G_OPTION_ARG_FILENAME,
|
||||
&cli->system_config_dir,
|
||||
N_("System config directory location"),
|
||||
DEFAULT_SYSTEM_CONFIG_DIR},
|
||||
{"intern-config",
|
||||
{"intern-config",
|
||||
0,
|
||||
0,
|
||||
G_OPTION_ARG_FILENAME,
|
||||
&cli->intern_config_file,
|
||||
N_("Internal config file location"),
|
||||
DEFAULT_INTERN_CONFIG_FILE},
|
||||
{"state-file",
|
||||
{"state-file",
|
||||
0,
|
||||
0,
|
||||
G_OPTION_ARG_FILENAME,
|
||||
&cli->state_file,
|
||||
N_("State file location"),
|
||||
DEFAULT_STATE_FILE},
|
||||
{"no-auto-default",
|
||||
{"no-auto-default",
|
||||
0,
|
||||
G_OPTION_FLAG_HIDDEN,
|
||||
G_OPTION_ARG_FILENAME,
|
||||
&cli->no_auto_default_file,
|
||||
N_("State file for no-auto-default devices"),
|
||||
DEFAULT_NO_AUTO_DEFAULT_FILE},
|
||||
{"plugins",
|
||||
{"plugins",
|
||||
0,
|
||||
0,
|
||||
G_OPTION_ARG_STRING,
|
||||
&cli->plugins,
|
||||
N_("List of plugins separated by ','"),
|
||||
NM_CONFIG_DEFAULT_MAIN_PLUGINS},
|
||||
{"configure-and-quit",
|
||||
{"configure-and-quit",
|
||||
0,
|
||||
G_OPTION_FLAG_OPTIONAL_ARG,
|
||||
G_OPTION_ARG_CALLBACK,
|
||||
parse_configure_and_quit,
|
||||
N_("Quit after initial configuration"),
|
||||
NULL},
|
||||
{"debug",
|
||||
{"debug",
|
||||
'd',
|
||||
0,
|
||||
G_OPTION_ARG_NONE,
|
||||
|
@ -639,29 +639,29 @@ nm_config_cmd_line_options_add_to_entries(NMConfigCmdLineOptions *cli, GOptionCo
|
|||
N_("Don't become a daemon, and log to stderr"),
|
||||
NULL},
|
||||
|
||||
/* These three are hidden for now, and should eventually just go away. */
|
||||
{"connectivity-uri",
|
||||
/* These three are hidden for now, and should eventually just go away. */
|
||||
{"connectivity-uri",
|
||||
0,
|
||||
G_OPTION_FLAG_HIDDEN,
|
||||
G_OPTION_ARG_STRING,
|
||||
&cli->connectivity_uri,
|
||||
N_("An http(s) address for checking internet connectivity"),
|
||||
"http://example.com"},
|
||||
{"connectivity-interval",
|
||||
{"connectivity-interval",
|
||||
0,
|
||||
G_OPTION_FLAG_HIDDEN,
|
||||
G_OPTION_ARG_INT,
|
||||
&cli->connectivity_interval,
|
||||
N_("The interval between connectivity checks (in seconds)"),
|
||||
G_STRINGIFY(NM_CONFIG_DEFAULT_CONNECTIVITY_INTERVAL)},
|
||||
{"connectivity-response",
|
||||
{"connectivity-response",
|
||||
0,
|
||||
G_OPTION_FLAG_HIDDEN,
|
||||
G_OPTION_ARG_STRING,
|
||||
&cli->connectivity_response,
|
||||
N_("The expected start of the response"),
|
||||
NM_CONFIG_DEFAULT_CONNECTIVITY_RESPONSE},
|
||||
{0},
|
||||
{0},
|
||||
};
|
||||
|
||||
g_return_if_fail(opt_ctx);
|
||||
|
|
|
@ -3863,7 +3863,7 @@ nm_utils_dhcp_client_id_duid(guint32 iaid, const guint8 *duid, gsize duid_len)
|
|||
guint8 type;
|
||||
guint32 iaid;
|
||||
guint8 duid[];
|
||||
} * client_id;
|
||||
} *client_id;
|
||||
gsize total_size;
|
||||
|
||||
/* the @duid must include the 16 bit duid-type and the data (of max 128 bytes). */
|
||||
|
@ -3913,7 +3913,7 @@ nm_utils_dhcp_client_id_systemd_node_specific_full(guint32 iaid,
|
|||
} en;
|
||||
};
|
||||
} duid;
|
||||
} * client_id;
|
||||
} *client_id;
|
||||
guint64 u64;
|
||||
|
||||
g_return_val_if_fail(machine_id, NULL);
|
||||
|
|
|
@ -43,21 +43,21 @@ read_argv(int *argc, char ***argv)
|
|||
{
|
||||
GOptionContext *context;
|
||||
GOptionEntry options[] = {
|
||||
{"no-persist",
|
||||
{"no-persist",
|
||||
'P',
|
||||
G_OPTION_FLAG_REVERSE,
|
||||
G_OPTION_ARG_NONE,
|
||||
&global_opt.persist,
|
||||
"Exit after processing netlink messages",
|
||||
NULL},
|
||||
{"state-file",
|
||||
{"state-file",
|
||||
'S',
|
||||
0,
|
||||
G_OPTION_ARG_FILENAME,
|
||||
&global_opt.state_file,
|
||||
"Dump the platform cache to this file",
|
||||
"FILE"},
|
||||
{0},
|
||||
{0},
|
||||
};
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
|
|
|
@ -1934,10 +1934,10 @@ nmtstp_link_macvlan_add(NMPlatform *platform,
|
|||
if (external_command) {
|
||||
const char *dev;
|
||||
char *modes[] = {
|
||||
[MACVLAN_MODE_BRIDGE] = "bridge",
|
||||
[MACVLAN_MODE_VEPA] = "vepa",
|
||||
[MACVLAN_MODE_PRIVATE] = "private",
|
||||
[MACVLAN_MODE_PASSTHRU] = "passthru",
|
||||
[MACVLAN_MODE_BRIDGE] = "bridge",
|
||||
[MACVLAN_MODE_VEPA] = "vepa",
|
||||
[MACVLAN_MODE_PRIVATE] = "private",
|
||||
[MACVLAN_MODE_PASSTHRU] = "passthru",
|
||||
};
|
||||
|
||||
dev = nm_platform_link_get_name(platform, parent);
|
||||
|
|
|
@ -1176,7 +1176,7 @@ _rule_check_kernel_support(NMPlatform *platform, int attribute)
|
|||
.addr_family = AF_INET,
|
||||
.priority = PROBE_PRORITY,
|
||||
.uid_range =
|
||||
{
|
||||
{
|
||||
.start = 0,
|
||||
.end = 0,
|
||||
},
|
||||
|
|
|
@ -2049,11 +2049,11 @@ test_read_wired_aliases_good(gconstpointer test_data)
|
|||
NULL};
|
||||
const char *expected_address_3[] = {"192.168.1.5", "192.168.1.6", NULL};
|
||||
const char *expected_label_0[] = {
|
||||
NULL,
|
||||
"aliasem0:1",
|
||||
"aliasem0:2",
|
||||
"aliasem0:99",
|
||||
NULL,
|
||||
NULL,
|
||||
"aliasem0:1",
|
||||
"aliasem0:2",
|
||||
"aliasem0:99",
|
||||
NULL,
|
||||
};
|
||||
const char *expected_label_3[] = {
|
||||
NULL,
|
||||
|
|
|
@ -1103,9 +1103,9 @@ test_config_set_values(void)
|
|||
const char *CONFIG_USER = BUILD_DIR "/test-set-values-user.conf";
|
||||
const char *CONFIG_INTERN = BUILD_DIR "/test-set-values-intern.conf";
|
||||
const char *atomic_section_prefixes[] = {
|
||||
"atomic-prefix-1.",
|
||||
"atomic-prefix-2.",
|
||||
NULL,
|
||||
"atomic-prefix-1.",
|
||||
"atomic-prefix-2.",
|
||||
NULL,
|
||||
};
|
||||
|
||||
g_assert(g_file_set_contents(CONFIG_USER, "", 0, NULL));
|
||||
|
|
|
@ -227,11 +227,11 @@ do_test_nm_utils_kill_child(void)
|
|||
{
|
||||
GLogLevelFlags fatal_mask;
|
||||
char *argv_watchdog[] = {
|
||||
"bash",
|
||||
"-c",
|
||||
"sleep 4; "
|
||||
"kill -KILL 0; #watchdog for #" TEST_TOKEN,
|
||||
NULL,
|
||||
"bash",
|
||||
"-c",
|
||||
"sleep 4; "
|
||||
"kill -KILL 0; #watchdog for #" TEST_TOKEN,
|
||||
NULL,
|
||||
};
|
||||
char *argv1[] = {
|
||||
"bash",
|
||||
|
|
|
@ -3099,7 +3099,7 @@ check_dbus_properties:
|
|||
const struct {
|
||||
const char *dbus_type;
|
||||
GType default_gtype;
|
||||
} * p_expected_type, *p_expected_type_2,
|
||||
} *p_expected_type, *p_expected_type_2,
|
||||
expected_types[] = {
|
||||
{"b", G_TYPE_BOOLEAN}, {"q", G_TYPE_UINT},
|
||||
{"y", G_TYPE_UCHAR}, {"i", G_TYPE_INT},
|
||||
|
|
|
@ -2148,11 +2148,11 @@ nm_team_setting_config_set(NMTeamSetting *self, const char *js_str)
|
|||
else {
|
||||
gboolean unrecognized_content = FALSE;
|
||||
bool has_lst[_NM_TEAM_ATTRIBUTE_NUM] = {
|
||||
FALSE,
|
||||
FALSE,
|
||||
};
|
||||
NMValueTypUnion val_lst[_NM_TEAM_ATTRIBUTE_NUM];
|
||||
nm_json_t *found_keys[_NM_TEAM_ATTRIBUTE_NUM] = {
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
gs_unref_ptrarray GPtrArray *ptr_array_master_runner_tx_hash_free = NULL;
|
||||
gs_unref_ptrarray GPtrArray *ptr_array_link_watchers_free = NULL;
|
||||
|
|
|
@ -4052,11 +4052,11 @@ test_connection_diff_different(void)
|
|||
NMSettingIPConfig *s_ip4;
|
||||
gboolean same;
|
||||
const DiffSetting settings[] = {
|
||||
{NM_SETTING_IP4_CONFIG_SETTING_NAME,
|
||||
{NM_SETTING_IP4_CONFIG_SETTING_NAME,
|
||||
{
|
||||
{NM_SETTING_IP_CONFIG_METHOD,
|
||||
{NM_SETTING_IP_CONFIG_METHOD,
|
||||
NM_SETTING_DIFF_RESULT_IN_A | NM_SETTING_DIFF_RESULT_IN_B},
|
||||
{NULL, NM_SETTING_DIFF_RESULT_UNKNOWN},
|
||||
{NULL, NM_SETTING_DIFF_RESULT_UNKNOWN},
|
||||
}},
|
||||
};
|
||||
|
||||
|
@ -4137,10 +4137,10 @@ test_connection_diff_inferrable(void)
|
|||
NMSettingIPConfig *s_ip4;
|
||||
char *uuid;
|
||||
const DiffSetting settings[] = {
|
||||
{NM_SETTING_CONNECTION_SETTING_NAME,
|
||||
{NM_SETTING_CONNECTION_SETTING_NAME,
|
||||
{
|
||||
{NM_SETTING_CONNECTION_INTERFACE_NAME, NM_SETTING_DIFF_RESULT_IN_A},
|
||||
{NULL, NM_SETTING_DIFF_RESULT_UNKNOWN},
|
||||
{NM_SETTING_CONNECTION_INTERFACE_NAME, NM_SETTING_DIFF_RESULT_IN_A},
|
||||
{NULL, NM_SETTING_DIFF_RESULT_UNKNOWN},
|
||||
}},
|
||||
};
|
||||
|
||||
|
@ -8475,7 +8475,7 @@ test_nm_utils_strstrdictkey(void)
|
|||
const char *v1;
|
||||
const char *v2;
|
||||
NMUtilsStrStrDictKey *v_static;
|
||||
} * val1, *val2,
|
||||
} *val1, *val2,
|
||||
values[] = {
|
||||
{NULL, NULL},
|
||||
{"", NULL},
|
||||
|
|
|
@ -1010,15 +1010,15 @@ nm_g_variant_equal(GVariant *a, GVariant *b)
|
|||
const typeof(flags) _flags = (flags); \
|
||||
const typeof(flags) _val = (val); \
|
||||
\
|
||||
_flags &(~_val); \
|
||||
_flags & (~_val); \
|
||||
})
|
||||
|
||||
#define NM_FLAGS_ASSIGN(flags, val, assign) \
|
||||
({ \
|
||||
const typeof(flags) _flags = (flags); \
|
||||
const typeof(flags) _val = (val); \
|
||||
\
|
||||
(assign) ? _flags | (_val) : _flags &(~_val); \
|
||||
#define NM_FLAGS_ASSIGN(flags, val, assign) \
|
||||
({ \
|
||||
const typeof(flags) _flags = (flags); \
|
||||
const typeof(flags) _val = (val); \
|
||||
\
|
||||
(assign) ? _flags | (_val) : _flags & (~_val); \
|
||||
})
|
||||
|
||||
#define NM_FLAGS_ASSIGN_MASK(flags, mask, val) \
|
||||
|
|
|
@ -2723,7 +2723,8 @@ _nmtst_variant_new_vardict(int dummy, ...)
|
|||
G_STMT_END
|
||||
#else
|
||||
#define _nmtst_assert_variant_bytestring_cmp_str(_ptr, _ptr2, _len) \
|
||||
G_STMT_START {} \
|
||||
G_STMT_START \
|
||||
{} \
|
||||
G_STMT_END
|
||||
#endif
|
||||
|
||||
|
|
|
@ -153,8 +153,8 @@ test_make_strv(void)
|
|||
const char *const *v2a = NM_MAKE_STRV("a", "b");
|
||||
const char *const *v2b = NM_MAKE_STRV("a", "b", );
|
||||
const char *const v3[] = {
|
||||
"a",
|
||||
"b",
|
||||
"a",
|
||||
"b",
|
||||
};
|
||||
const char *const *v4b = NM_MAKE_STRV("a", _make_strv_foo(), );
|
||||
|
||||
|
|
|
@ -5572,7 +5572,7 @@ _nl_msg_new_tfilter(uint16_t nlmsg_type, uint16_t nlmsg_flags, const NMPlatformT
|
|||
if (nm_streq(action->kind, NM_PLATFORM_ACTION_KIND_SIMPLE)) {
|
||||
const NMPlatformActionSimple *simple = &action->simple;
|
||||
struct tc_defact sel = {
|
||||
0,
|
||||
0,
|
||||
};
|
||||
|
||||
if (!(act_options = nla_nest_start(msg, TCA_ACT_OPTIONS)))
|
||||
|
@ -5586,7 +5586,7 @@ _nl_msg_new_tfilter(uint16_t nlmsg_type, uint16_t nlmsg_flags, const NMPlatformT
|
|||
} else if (nm_streq(action->kind, NM_PLATFORM_ACTION_KIND_MIRRED)) {
|
||||
const NMPlatformActionMirred *mirred = &action->mirred;
|
||||
struct tc_mirred sel = {
|
||||
0,
|
||||
0,
|
||||
};
|
||||
|
||||
if (!(act_options = nla_nest_start(msg, TCA_ACT_OPTIONS)))
|
||||
|
@ -8319,7 +8319,7 @@ link_set_address(NMPlatform *platform, int ifindex, gconstpointer address, size_
|
|||
nm_auto_nlmsg struct nl_msg *nlmsg = NULL;
|
||||
const ChangeLinkData d = {
|
||||
.set_address =
|
||||
{
|
||||
{
|
||||
.address = address,
|
||||
.length = length,
|
||||
},
|
||||
|
|
|
@ -199,13 +199,13 @@ nm_vpn_openconnect_authenticate_helper(const char *host,
|
|||
const char *const *iter;
|
||||
const char *path;
|
||||
const char *const DEFAULT_PATHS[] = {
|
||||
"/sbin/",
|
||||
"/usr/sbin/",
|
||||
"/usr/local/sbin/",
|
||||
"/bin/",
|
||||
"/usr/bin/",
|
||||
"/usr/local/bin/",
|
||||
NULL,
|
||||
"/sbin/",
|
||||
"/usr/sbin/",
|
||||
"/usr/local/sbin/",
|
||||
"/bin/",
|
||||
"/usr/bin/",
|
||||
"/usr/local/bin/",
|
||||
NULL,
|
||||
};
|
||||
|
||||
path = nm_utils_file_search_in_paths("openconnect",
|
||||
|
|
|
@ -1138,25 +1138,25 @@ _initial_setup(int *p_argc, char ***p_argv, GError **error)
|
|||
GOptionContext *opt_ctx;
|
||||
gboolean arg_debug = FALSE;
|
||||
GOptionEntry entries[] = {{
|
||||
"debug",
|
||||
0,
|
||||
0,
|
||||
G_OPTION_ARG_NONE,
|
||||
&arg_debug,
|
||||
"Output to console rather than syslog",
|
||||
NULL,
|
||||
"debug",
|
||||
0,
|
||||
0,
|
||||
G_OPTION_ARG_NONE,
|
||||
&arg_debug,
|
||||
"Output to console rather than syslog",
|
||||
NULL,
|
||||
},
|
||||
{
|
||||
"persist",
|
||||
0,
|
||||
0,
|
||||
G_OPTION_ARG_NONE,
|
||||
&gl.persist,
|
||||
"Don't quit after a short timeout",
|
||||
NULL,
|
||||
"persist",
|
||||
0,
|
||||
0,
|
||||
G_OPTION_ARG_NONE,
|
||||
&gl.persist,
|
||||
"Don't quit after a short timeout",
|
||||
NULL,
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
NULL,
|
||||
}};
|
||||
gboolean success;
|
||||
|
||||
|
|
|
@ -103,50 +103,50 @@ main(int argc, char *argv[])
|
|||
gboolean dump_to_stdout = FALSE;
|
||||
gs_strfreev char **remaining = NULL;
|
||||
GOptionEntry option_entries[] = {
|
||||
{"connections-dir",
|
||||
{"connections-dir",
|
||||
'c',
|
||||
0,
|
||||
G_OPTION_ARG_FILENAME,
|
||||
&connections_dir,
|
||||
"Output connection directory",
|
||||
NM_KEYFILE_PATH_NAME_RUN},
|
||||
{"persistent-connections-dir",
|
||||
{"persistent-connections-dir",
|
||||
'p',
|
||||
0,
|
||||
G_OPTION_ARG_FILENAME,
|
||||
&etc_connections_dir,
|
||||
"Persistent connection directory",
|
||||
NM_KEYFILE_PATH_NAME_ETC_DEFAULT},
|
||||
{"initrd-data-dir",
|
||||
{"initrd-data-dir",
|
||||
'i',
|
||||
0,
|
||||
G_OPTION_ARG_FILENAME,
|
||||
&initrd_dir,
|
||||
"Output initrd data directory",
|
||||
DEFAULT_INITRD_DATA_DIR},
|
||||
{"sysfs-dir",
|
||||
{"sysfs-dir",
|
||||
'd',
|
||||
0,
|
||||
G_OPTION_ARG_FILENAME,
|
||||
&sysfs_dir,
|
||||
"The sysfs mount point",
|
||||
DEFAULT_SYSFS_DIR},
|
||||
{"run-config-dir",
|
||||
{"run-config-dir",
|
||||
'r',
|
||||
0,
|
||||
G_OPTION_ARG_FILENAME,
|
||||
&run_config_dir,
|
||||
"Output config directory",
|
||||
DEFAULT_RUN_CONFIG_DIR},
|
||||
{"stdout",
|
||||
{"stdout",
|
||||
's',
|
||||
0,
|
||||
G_OPTION_ARG_NONE,
|
||||
&dump_to_stdout,
|
||||
"Dump connections to standard output",
|
||||
NULL},
|
||||
{G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &remaining, NULL, NULL},
|
||||
{NULL}};
|
||||
{G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &remaining, NULL, NULL},
|
||||
{NULL}};
|
||||
nm_auto_free_option_context GOptionContext *option_context = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gs_free char *hostname = NULL;
|
||||
|
|
|
@ -539,8 +539,8 @@ reader_parse_ip(Reader *reader, const char *sysfs_dir, char *argument)
|
|||
int client_ip_prefix = -1;
|
||||
gboolean clear_ip4_required_timeout = TRUE;
|
||||
const char *dns[2] = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
int dns_addr_family[2] = {
|
||||
AF_UNSPEC,
|
||||
|
|
|
@ -233,15 +233,15 @@ main(int argc, char *argv[])
|
|||
GOptionContext *opt_ctx = NULL;
|
||||
gboolean success;
|
||||
GOptionEntry options[] = {
|
||||
{"quiet", 'q', 0, G_OPTION_ARG_NONE, &data.quiet, N_("Don't print anything"), NULL},
|
||||
{"wait-for-startup",
|
||||
{"quiet", 'q', 0, G_OPTION_ARG_NONE, &data.quiet, N_("Don't print anything"), NULL},
|
||||
{"wait-for-startup",
|
||||
's',
|
||||
0,
|
||||
G_OPTION_ARG_NONE,
|
||||
&data.wait_startup,
|
||||
N_("Wait for NetworkManager startup instead of a connection"),
|
||||
NULL},
|
||||
{"timeout",
|
||||
{"timeout",
|
||||
't',
|
||||
0,
|
||||
G_OPTION_ARG_INT,
|
||||
|
@ -249,14 +249,14 @@ main(int argc, char *argv[])
|
|||
N_("Time to wait for a connection, in seconds (without the option, default value is 30). "
|
||||
"Maximum value is 2073600 seconds."),
|
||||
"<timeout>"},
|
||||
{"exit",
|
||||
{"exit",
|
||||
'x',
|
||||
0,
|
||||
G_OPTION_ARG_NONE,
|
||||
&data.exit_no_nm,
|
||||
N_("Exit immediately if NetworkManager is not running or connecting"),
|
||||
NULL},
|
||||
{NULL},
|
||||
{NULL},
|
||||
};
|
||||
|
||||
/* Set locale to be able to use environment variables */
|
||||
|
|
|
@ -1035,7 +1035,7 @@ nmc_readline_echo(const NmcConfig *nmc_config, gboolean echo_on, const char *pro
|
|||
#if HAVE_READLINE_HISTORY
|
||||
nm_auto_free HISTORY_STATE *saved_history = NULL;
|
||||
HISTORY_STATE passwd_history = {
|
||||
0,
|
||||
0,
|
||||
};
|
||||
#else
|
||||
int start, curpos;
|
||||
|
|
|
@ -133,10 +133,10 @@ nmt_password_fields_init(NmtPasswordFields *fields)
|
|||
{
|
||||
NmtPasswordFieldsPrivate *priv = NMT_PASSWORD_FIELDS_GET_PRIVATE(fields);
|
||||
NmtNewtPopupEntry entries[] = {
|
||||
{_("Store password for all users"), NULL},
|
||||
{_("Store password only for this user"), NULL},
|
||||
{_("Ask password every time"), NULL},
|
||||
{},
|
||||
{_("Store password for all users"), NULL},
|
||||
{_("Store password only for this user"), NULL},
|
||||
{_("Ask password every time"), NULL},
|
||||
{},
|
||||
};
|
||||
|
||||
priv->entry = NMT_NEWT_ENTRY(nmt_newt_entry_new(-1, 0));
|
||||
|
|
Loading…
Reference in a new issue