format: run nm-code-format

Reformat with:

  clang-format version 19.1.0 (Fedora 19.1.0-1.fc41)

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2046
This commit is contained in:
Beniamino Galvani 2024-10-04 10:45:56 +02:00
parent 09e822edba
commit bb6881f88c
156 changed files with 721 additions and 731 deletions

View file

@ -107,7 +107,7 @@ connection_add(NMConnection *conn)
nm_connection_get_id(conn), nm_connection_get_id(conn),
nm_connection_get_uuid(conn)); nm_connection_get_uuid(conn));
rdata = (RequestData){ rdata = (RequestData) {
.loop = g_main_loop_new(NULL, FALSE), .loop = g_main_loop_new(NULL, FALSE),
.rconn = NULL, .rconn = NULL,
.error = NULL, .error = NULL,

View file

@ -967,7 +967,7 @@ nm_match_spec_device_data_init_from_device(struct _NMMatchSpecDeviceData *out_da
nm_assert(out_data); nm_assert(out_data);
if (!device) { if (!device) {
*out_data = (NMMatchSpecDeviceData){}; *out_data = (NMMatchSpecDeviceData) {};
return out_data; return out_data;
} }
@ -983,7 +983,7 @@ nm_match_spec_device_data_init_from_device(struct _NMMatchSpecDeviceData *out_da
* *
* The returned data is only valid, until NMDevice gets modified again. */ * The returned data is only valid, until NMDevice gets modified again. */
*out_data = (NMMatchSpecDeviceData){ *out_data = (NMMatchSpecDeviceData) {
.interface_name = nm_device_get_iface(device), .interface_name = nm_device_get_iface(device),
.device_type = nm_device_get_type_description(device), .device_type = nm_device_get_type_description(device),
.driver = nm_device_get_driver(device), .driver = nm_device_get_driver(device),
@ -1010,7 +1010,7 @@ nm_match_spec_device_data_init_from_platform(NMMatchSpecDeviceData *out_data,
* It's still useful because of specs like "*" and "except:interface-name:eth0", * It's still useful because of specs like "*" and "except:interface-name:eth0",
* which match even in that case. */ * which match even in that case. */
*out_data = (NMMatchSpecDeviceData){ *out_data = (NMMatchSpecDeviceData) {
.interface_name = pllink ? pllink->name : NULL, .interface_name = pllink ? pllink->name : NULL,
.device_type = match_device_type, .device_type = match_device_type,
.driver = pllink ? pllink->driver : NULL, .driver = pllink ? pllink->driver : NULL,
@ -1057,7 +1057,7 @@ nm_ip_routing_rule_to_platform(const NMIPRoutingRule *rule, NMPlatformRoutingRul
uid_range_has = nm_ip_routing_rule_get_uid_range(rule, &uid_range_start, &uid_range_end); uid_range_has = nm_ip_routing_rule_get_uid_range(rule, &uid_range_start, &uid_range_end);
*out_pl = (NMPlatformRoutingRule){ *out_pl = (NMPlatformRoutingRule) {
.addr_family = nm_ip_routing_rule_get_addr_family(rule), .addr_family = nm_ip_routing_rule_get_addr_family(rule),
.flags = (nm_ip_routing_rule_get_invert(rule) ? FIB_RULE_INVERT : 0), .flags = (nm_ip_routing_rule_get_invert(rule) ? FIB_RULE_INVERT : 0),
.priority = nm_ip_routing_rule_get_priority(rule), .priority = nm_ip_routing_rule_get_priority(rule),
@ -1200,7 +1200,7 @@ nm_shutdown_wait_obj_register_full(gpointer watched_obj,
* make sure to use the default context. */ * make sure to use the default context. */
handle = g_slice_new(NMShutdownWaitObjHandle); handle = g_slice_new(NMShutdownWaitObjHandle);
*handle = (NMShutdownWaitObjHandle){ *handle = (NMShutdownWaitObjHandle) {
/* depending on @free_msg_reason, we take ownership of @msg_reason. /* depending on @free_msg_reason, we take ownership of @msg_reason.
* In either case, we just reference the string without cloning * In either case, we just reference the string without cloning
* it. */ * it. */

View file

@ -494,7 +494,7 @@ act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
_LOGD(LOGD_ADSL, "starting PPPoA"); _LOGD(LOGD_ADSL, "starting PPPoA");
} }
priv->ppp_mgr = nm_ppp_mgr_start(&((const NMPppMgrConfig){ priv->ppp_mgr = nm_ppp_mgr_start(&((const NMPppMgrConfig) {
.netns = nm_device_get_netns(device), .netns = nm_device_get_netns(device),
.parent_iface = ppp_iface, .parent_iface = ppp_iface,
.callback = _ppp_mgr_callback, .callback = _ppp_mgr_callback,

View file

@ -334,7 +334,7 @@ _bz_dbus_obj_new(NMBluezManager *self, const char *object_path)
l = strlen(object_path) + 1; l = strlen(object_path) + 1;
bzobj = g_malloc(sizeof(BzDBusObj) + l); bzobj = g_malloc(sizeof(BzDBusObj) + l);
*bzobj = (BzDBusObj){ *bzobj = (BzDBusObj) {
.object_path = bzobj->_object_path_intern, .object_path = bzobj->_object_path_intern,
.self = self, .self = self,
.x_network_server.lst = C_LIST_INIT(bzobj->x_network_server.lst), .x_network_server.lst = C_LIST_INIT(bzobj->x_network_server.lst),
@ -751,7 +751,7 @@ _conn_data_head_new(NMBluetoothCapabilities bt_type, const char *bdaddr)
l = strlen(bdaddr) + 1; l = strlen(bdaddr) + 1;
cdata_hd = g_malloc(sizeof(ConnDataHead) + l); cdata_hd = g_malloc(sizeof(ConnDataHead) + l);
*cdata_hd = (ConnDataHead){ *cdata_hd = (ConnDataHead) {
.bdaddr = cdata_hd->bdaddr_data, .bdaddr = cdata_hd->bdaddr_data,
.lst_head = C_LIST_INIT(cdata_hd->lst_head), .lst_head = C_LIST_INIT(cdata_hd->lst_head),
.bt_type = bt_type, .bt_type = bt_type,
@ -1143,7 +1143,7 @@ _network_server_vt_register_bridge(const NMBtVTableNetworkServer *vtable,
bzobj->d_adapter.address); bzobj->d_adapter.address);
r_req_data = g_slice_new(NetworkServerRegisterReqData); r_req_data = g_slice_new(NetworkServerRegisterReqData);
*r_req_data = (NetworkServerRegisterReqData){ *r_req_data = (NetworkServerRegisterReqData) {
.int_cancellable = g_cancellable_new(), .int_cancellable = g_cancellable_new(),
.ext_cancellable = g_object_ref(cancellable), .ext_cancellable = g_object_ref(cancellable),
.callback = callback, .callback = callback,
@ -2749,7 +2749,7 @@ nm_bluez_manager_connect(NMBluezManager *self,
} }
c_req_data = g_slice_new(DeviceConnectReqData); c_req_data = g_slice_new(DeviceConnectReqData);
*c_req_data = (DeviceConnectReqData){ *c_req_data = (DeviceConnectReqData) {
.int_cancellable = g_steal_pointer(&int_cancellable), .int_cancellable = g_steal_pointer(&int_cancellable),
.ext_cancellable = g_object_ref(cancellable), .ext_cancellable = g_object_ref(cancellable),
.callback = callback, .callback = callback,
@ -2814,7 +2814,7 @@ nm_bluez_manager_init(NMBluezManager *self)
{ {
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self); NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
priv->vtable_network_server = (NMBtVTableNetworkServer){ priv->vtable_network_server = (NMBtVTableNetworkServer) {
.is_available = _network_server_vt_is_available, .is_available = _network_server_vt_is_available,
.register_bridge = _network_server_vt_register_bridge, .register_bridge = _network_server_vt_register_bridge,
.unregister_bridge = _network_server_vt_unregister_bridge, .unregister_bridge = _network_server_vt_unregister_bridge,

View file

@ -683,7 +683,7 @@ nm_bluez5_dun_connect(const char *adapter,
dst_l = strlen(remote) + 1; dst_l = strlen(remote) + 1;
cdat = g_slice_new(ConnectData); cdat = g_slice_new(ConnectData);
*cdat = (ConnectData){ *cdat = (ConnectData) {
.callback = callback, .callback = callback,
.callback_user_data = callback_user_data, .callback_user_data = callback_user_data,
.cancellable = g_object_ref(cancellable), .cancellable = g_object_ref(cancellable),
@ -691,7 +691,7 @@ nm_bluez5_dun_connect(const char *adapter,
}; };
context = g_malloc(sizeof(NMBluez5DunContext) + src_l + dst_l); context = g_malloc(sizeof(NMBluez5DunContext) + src_l + dst_l);
*context = (NMBluez5DunContext){ *context = (NMBluez5DunContext) {
.cdat = cdat, .cdat = cdat,
.notify_tty_hangup_cb = notify_tty_hangup_cb, .notify_tty_hangup_cb = notify_tty_hangup_cb,
.notify_tty_hangup_user_data = notify_tty_hangup_user_data, .notify_tty_hangup_user_data = notify_tty_hangup_user_data,

View file

@ -436,7 +436,7 @@ _platform_lnk_bond_init_from_setting(NMSettingBond *s_bond, NMPlatformLnkBond *p
#define _v_u32(s_bond, opt) _nm_setting_bond_opt_value_as_u32((s_bond), (opt)) #define _v_u32(s_bond, opt) _nm_setting_bond_opt_value_as_u32((s_bond), (opt))
#define _v_intbool(s_bond, opt) _nm_setting_bond_opt_value_as_intbool((s_bond), (opt)) #define _v_intbool(s_bond, opt) _nm_setting_bond_opt_value_as_intbool((s_bond), (opt))
*props = (NMPlatformLnkBond){ *props = (NMPlatformLnkBond) {
.mode = _v_fcn(_nm_setting_bond_mode_from_string, s_bond, NM_SETTING_BOND_OPTION_MODE), .mode = _v_fcn(_nm_setting_bond_mode_from_string, s_bond, NM_SETTING_BOND_OPTION_MODE),
.primary = _setting_bond_primary_opt_as_ifindex(s_bond), .primary = _setting_bond_primary_opt_as_ifindex(s_bond),
.miimon = _v_u32(s_bond, NM_SETTING_BOND_OPTION_MIIMON), .miimon = _v_u32(s_bond, NM_SETTING_BOND_OPTION_MIIMON),
@ -681,7 +681,7 @@ commit_port_options(NMDevice *bond_device, NMDevice *port, NMSettingBondPort *s_
nm_platform_link_change(nm_device_get_platform(port), nm_platform_link_change(nm_device_get_platform(port),
nm_device_get_ifindex(port), nm_device_get_ifindex(port),
NULL, NULL,
&((NMPlatformLinkBondPort){ &((NMPlatformLinkBondPort) {
.queue_id = s_port ? nm_setting_bond_port_get_queue_id(s_port) .queue_id = s_port ? nm_setting_bond_port_get_queue_id(s_port)
: NM_BOND_PORT_QUEUE_ID_DEF, : NM_BOND_PORT_QUEUE_ID_DEF,
.prio = prio_has ? prio : 0, .prio = prio_has ? prio : 0,

View file

@ -439,7 +439,7 @@ setting_vlans_to_platform(GPtrArray *array, guint *out_len)
nm_bridge_vlan_get_vid_range(vlan, &vid_start, &vid_end); nm_bridge_vlan_get_vid_range(vlan, &vid_start, &vid_end);
arr[i] = (NMPlatformBridgeVlan){ arr[i] = (NMPlatformBridgeVlan) {
.vid_start = vid_start, .vid_start = vid_start,
.vid_end = vid_end, .vid_end = vid_end,
.pvid = nm_bridge_vlan_is_pvid(vlan), .pvid = nm_bridge_vlan_is_pvid(vlan),
@ -468,7 +468,7 @@ commit_port_options(NMDevice *device, NMSettingBridgePort *setting)
nm_device_get_ifindex(device), nm_device_get_ifindex(device),
NULL, NULL,
NULL, NULL,
&((NMPlatformLinkBridgePort){ &((NMPlatformLinkBridgePort) {
.path_cost = path_cost, .path_cost = path_cost,
.priority = priority, .priority = priority,
.hairpin = nm_setting_bridge_port_get_hairpin_mode(setting), .hairpin = nm_setting_bridge_port_get_hairpin_mode(setting),
@ -660,10 +660,10 @@ bridge_set_vlan_options(NMDevice *device, NMSettingBridge *s_bridge, gboolean is
nm_platform_link_set_bridge_info( nm_platform_link_set_bridge_info(
plat, plat,
ifindex, ifindex,
&((NMPlatformLinkSetBridgeInfoData){.vlan_filtering_has = TRUE, &((NMPlatformLinkSetBridgeInfoData) {.vlan_filtering_has = TRUE,
.vlan_filtering_val = FALSE, .vlan_filtering_val = FALSE,
.vlan_default_pvid_has = TRUE, .vlan_default_pvid_has = TRUE,
.vlan_default_pvid_val = 1})); .vlan_default_pvid_val = 1}));
nm_platform_link_set_bridge_vlans(plat, ifindex, FALSE, NULL, 0); nm_platform_link_set_bridge_vlans(plat, ifindex, FALSE, NULL, 0);
return TRUE; return TRUE;
} }
@ -690,10 +690,10 @@ bridge_set_vlan_options(NMDevice *device, NMSettingBridge *s_bridge, gboolean is
nm_platform_link_set_bridge_info( nm_platform_link_set_bridge_info(
plat, plat,
ifindex, ifindex,
&((NMPlatformLinkSetBridgeInfoData){.vlan_filtering_has = TRUE, &((NMPlatformLinkSetBridgeInfoData) {.vlan_filtering_has = TRUE,
.vlan_filtering_val = FALSE, .vlan_filtering_val = FALSE,
.vlan_default_pvid_has = TRUE, .vlan_default_pvid_has = TRUE,
.vlan_default_pvid_val = 0})); .vlan_default_pvid_val = 0}));
/* Clear all existing VLANs */ /* Clear all existing VLANs */
if (!nm_platform_link_set_bridge_vlans(plat, ifindex, FALSE, NULL, 0)) if (!nm_platform_link_set_bridge_vlans(plat, ifindex, FALSE, NULL, 0))
@ -706,8 +706,8 @@ bridge_set_vlan_options(NMDevice *device, NMSettingBridge *s_bridge, gboolean is
nm_platform_link_set_bridge_info( nm_platform_link_set_bridge_info(
plat, plat,
ifindex, ifindex,
&((NMPlatformLinkSetBridgeInfoData){.vlan_default_pvid_has = TRUE, &((NMPlatformLinkSetBridgeInfoData) {.vlan_default_pvid_has = TRUE,
.vlan_default_pvid_val = pvid})); .vlan_default_pvid_val = pvid}));
} }
} }
@ -721,7 +721,7 @@ bridge_set_vlan_options(NMDevice *device, NMSettingBridge *s_bridge, gboolean is
nm_platform_link_set_bridge_info(plat, nm_platform_link_set_bridge_info(plat,
ifindex, ifindex,
&((NMPlatformLinkSetBridgeInfoData){ &((NMPlatformLinkSetBridgeInfoData) {
.vlan_filtering_has = TRUE, .vlan_filtering_has = TRUE,
.vlan_filtering_val = TRUE, .vlan_filtering_val = TRUE,
})); }));
@ -757,7 +757,7 @@ merge_bridge_vlan_default_pvid(NMPlatformBridgeVlan *vlans, guint *num_vlans, gu
* Set the PVID flag only if the port didn't have one. */ * Set the PVID flag only if the port didn't have one. */
vlans = g_realloc_n(vlans, *num_vlans + 1, sizeof(NMPlatformBridgeVlan)); vlans = g_realloc_n(vlans, *num_vlans + 1, sizeof(NMPlatformBridgeVlan));
(*num_vlans)++; (*num_vlans)++;
vlans[*num_vlans - 1] = (NMPlatformBridgeVlan){ vlans[*num_vlans - 1] = (NMPlatformBridgeVlan) {
.vid_start = default_pvid, .vid_start = default_pvid,
.vid_end = default_pvid, .vid_end = default_pvid,
.untagged = TRUE, .untagged = TRUE,
@ -847,7 +847,7 @@ nm_device_reapply_bridge_port_vlans(NMDevice *device)
static void static void
_platform_lnk_bridge_init_from_setting(NMSettingBridge *s_bridge, NMPlatformLnkBridge *props) _platform_lnk_bridge_init_from_setting(NMSettingBridge *s_bridge, NMPlatformLnkBridge *props)
{ {
*props = (NMPlatformLnkBridge){ *props = (NMPlatformLnkBridge) {
.forward_delay = _DEFAULT_IF_ZERO(nm_setting_bridge_get_forward_delay(s_bridge) * 100u, .forward_delay = _DEFAULT_IF_ZERO(nm_setting_bridge_get_forward_delay(s_bridge) * 100u,
NM_BRIDGE_FORWARD_DELAY_DEF_SYS), NM_BRIDGE_FORWARD_DELAY_DEF_SYS),
.hello_time = _DEFAULT_IF_ZERO(nm_setting_bridge_get_hello_time(s_bridge) * 100u, .hello_time = _DEFAULT_IF_ZERO(nm_setting_bridge_get_hello_time(s_bridge) * 100u,

View file

@ -1451,7 +1451,7 @@ act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
g_return_val_if_fail(s_pppoe, NM_ACT_STAGE_RETURN_FAILURE); g_return_val_if_fail(s_pppoe, NM_ACT_STAGE_RETURN_FAILURE);
priv->ppp_data.ppp_mgr = priv->ppp_data.ppp_mgr =
nm_ppp_mgr_start(&((const NMPppMgrConfig){ nm_ppp_mgr_start(&((const NMPppMgrConfig) {
.netns = nm_device_get_netns(device), .netns = nm_device_get_netns(device),
.parent_iface = nm_device_get_iface(device), .parent_iface = nm_device_get_iface(device),
.callback = _ppp_mgr_callback, .callback = _ppp_mgr_callback,

View file

@ -188,7 +188,7 @@ act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
s_pppoe = nm_device_get_applied_setting(device, NM_TYPE_SETTING_PPPOE); s_pppoe = nm_device_get_applied_setting(device, NM_TYPE_SETTING_PPPOE);
g_return_val_if_fail(s_pppoe, NM_ACT_STAGE_RETURN_FAILURE); g_return_val_if_fail(s_pppoe, NM_ACT_STAGE_RETURN_FAILURE);
priv->ppp_mgr = nm_ppp_mgr_start(&((const NMPppMgrConfig){ priv->ppp_mgr = nm_ppp_mgr_start(&((const NMPppMgrConfig) {
.netns = nm_device_get_netns(device), .netns = nm_device_get_netns(device),
.parent_iface = nm_setting_pppoe_get_parent(s_pppoe), .parent_iface = nm_setting_pppoe_get_parent(s_pppoe),
.callback = _ppp_mgr_callback, .callback = _ppp_mgr_callback,

View file

@ -355,7 +355,7 @@ nm_device_resolve_address(int addr_family,
NMDnsSystemdResolved *resolved; NMDnsSystemdResolved *resolved;
info = g_new(ResolveAddrInfo, 1); info = g_new(ResolveAddrInfo, 1);
*info = (ResolveAddrInfo){ *info = (ResolveAddrInfo) {
.task = nm_g_task_new(NULL, cancellable, nm_device_resolve_address, callback, cb_data), .task = nm_g_task_new(NULL, cancellable, nm_device_resolve_address, callback, cb_data),
.addr_family = addr_family, .addr_family = addr_family,
.address = nm_ip_addr_init(addr_family, address), .address = nm_ip_addr_init(addr_family, address),

View file

@ -241,7 +241,7 @@ create_and_realize(NMDevice *device,
r = nm_platform_link_vlan_add(nm_device_get_platform(device), r = nm_platform_link_vlan_add(nm_device_get_platform(device),
iface, iface,
parent_ifindex, parent_ifindex,
&((NMPlatformLnkVlan){ &((NMPlatformLnkVlan) {
.id = vlan_id, .id = vlan_id,
.flags = nm_setting_vlan_get_flags(s_vlan), .flags = nm_setting_vlan_get_flags(s_vlan),
.protocol = protocol, .protocol = protocol,

View file

@ -48,7 +48,7 @@ do_update_properties(NMDeviceVrf *self, const NMPlatformLnkVrf *props)
NMPlatformLnkVrf props_null; NMPlatformLnkVrf props_null;
if (!props) { if (!props) {
props_null = (NMPlatformLnkVrf){}; props_null = (NMPlatformLnkVrf) {};
props = &props_null; props = &props_null;
} }

View file

@ -430,7 +430,7 @@ get_extra_rules(NMDevice *device)
g_ptr_array_add(extra_rules, g_ptr_array_add(extra_rules,
nmp_object_new(NMP_OBJECT_TYPE_ROUTING_RULE, nmp_object_new(NMP_OBJECT_TYPE_ROUTING_RULE,
&((const NMPlatformRoutingRule){ &((const NMPlatformRoutingRule) {
.priority = priority, .priority = priority,
.addr_family = addr_family, .addr_family = addr_family,
.action = FR_ACT_TO_TBL, .action = FR_ACT_TO_TBL,
@ -440,7 +440,7 @@ get_extra_rules(NMDevice *device)
g_ptr_array_add(extra_rules, g_ptr_array_add(extra_rules,
nmp_object_new(NMP_OBJECT_TYPE_ROUTING_RULE, nmp_object_new(NMP_OBJECT_TYPE_ROUTING_RULE,
&((const NMPlatformRoutingRule){ &((const NMPlatformRoutingRule) {
.priority = priority + 1u, .priority = priority + 1u,
.addr_family = addr_family, .addr_family = addr_family,
.action = FR_ACT_TO_TBL, .action = FR_ACT_TO_TBL,
@ -588,7 +588,7 @@ _peers_add(NMDeviceWireGuard *self, NMWireGuardPeer *peer)
nm_assert(!_peers_find(priv, peer)); nm_assert(!_peers_find(priv, peer));
peer_data = g_slice_new(PeerData); peer_data = g_slice_new(PeerData);
*peer_data = (PeerData){ *peer_data = (PeerData) {
.self = self, .self = self,
.peer = nm_wireguard_peer_ref(peer), .peer = nm_wireguard_peer_ref(peer),
.ep_resolv = .ep_resolv =
@ -792,7 +792,7 @@ _peers_resolve_cb(GObject *source_object, GAsyncResult *res, gpointer user_data)
switch (g_inet_address_get_family(a)) { switch (g_inet_address_get_family(a)) {
case G_SOCKET_FAMILY_IPV4: case G_SOCKET_FAMILY_IPV4:
nm_assert(g_inet_address_get_native_size(a) == sizeof(struct in_addr)); nm_assert(g_inet_address_get_native_size(a) == sizeof(struct in_addr));
s->in = (struct sockaddr_in){ s->in = (struct sockaddr_in) {
.sin_family = AF_INET, .sin_family = AF_INET,
.sin_port = htons(nm_sock_addr_endpoint_get_port( .sin_port = htons(nm_sock_addr_endpoint_get_port(
_nm_wireguard_peer_get_endpoint(peer_data->peer))), _nm_wireguard_peer_get_endpoint(peer_data->peer))),
@ -801,7 +801,7 @@ _peers_resolve_cb(GObject *source_object, GAsyncResult *res, gpointer user_data)
break; break;
case G_SOCKET_FAMILY_IPV6: case G_SOCKET_FAMILY_IPV6:
nm_assert(g_inet_address_get_native_size(a) == sizeof(struct in6_addr)); nm_assert(g_inet_address_get_native_size(a) == sizeof(struct in6_addr));
s->in6 = (struct sockaddr_in6){ s->in6 = (struct sockaddr_in6) {
.sin6_family = AF_INET6, .sin6_family = AF_INET6,
.sin6_port = htons(nm_sock_addr_endpoint_get_port( .sin6_port = htons(nm_sock_addr_endpoint_get_port(
_nm_wireguard_peer_get_endpoint(peer_data->peer))), _nm_wireguard_peer_get_endpoint(peer_data->peer))),
@ -985,7 +985,7 @@ _peers_update(NMDeviceWireGuard *self,
if (nm_clear_g_cancellable(&peer_data->ep_resolv.cancellable)) if (nm_clear_g_cancellable(&peer_data->ep_resolv.cancellable))
_peers_resolving_cnt_decrement(self); _peers_resolving_cnt_decrement(self);
peer_data->ep_resolv = (PeerEndpointResolveData){ peer_data->ep_resolv = (PeerEndpointResolveData) {
.sockaddr = sockaddr, .sockaddr = sockaddr,
.resolv_fail_count = 0, .resolv_fail_count = 0,
.cancellable = NULL, .cancellable = NULL,
@ -1166,7 +1166,7 @@ _peers_get_platform_list(NMDeviceWireGuardPrivate *priv,
prefix = addr_family == AF_INET ? 32 : 128; prefix = addr_family == AF_INET ? 32 : 128;
g_array_append_val(allowed_ips, g_array_append_val(allowed_ips,
((NMPWireGuardAllowedIP){ ((NMPWireGuardAllowedIP) {
.family = addr_family, .family = addr_family,
.mask = prefix, .mask = prefix,
.addr = addrbin, .addr = addrbin,
@ -1486,7 +1486,7 @@ link_config(NMDeviceWireGuard *self,
_peers_update_all(self, s_wg, &peers_removed); _peers_update_all(self, s_wg, &peers_removed);
wg_lnk = (NMPlatformLnkWireGuard){}; wg_lnk = (NMPlatformLnkWireGuard) {};
wg_change_flags = NM_PLATFORM_WIREGUARD_CHANGE_FLAG_NONE; wg_change_flags = NM_PLATFORM_WIREGUARD_CHANGE_FLAG_NONE;
@ -1733,7 +1733,7 @@ _get_dev2_ip_config(NMDeviceWireGuard *self, int addr_family)
} }
if (addr_family == AF_INET) { if (addr_family == AF_INET) {
rt.r4 = (NMPlatformIP4Route){ rt.r4 = (NMPlatformIP4Route) {
.network = addrbin.addr4, .network = addrbin.addr4,
.plen = prefix, .plen = prefix,
.ifindex = ip_ifindex, .ifindex = ip_ifindex,
@ -1742,7 +1742,7 @@ _get_dev2_ip_config(NMDeviceWireGuard *self, int addr_family)
.metric = route_metric, .metric = route_metric,
}; };
} else { } else {
rt.r6 = (NMPlatformIP6Route){ rt.r6 = (NMPlatformIP6Route) {
.network = addrbin.addr6, .network = addrbin.addr6,
.plen = prefix, .plen = prefix,
.ifindex = ip_ifindex, .ifindex = ip_ifindex,

View file

@ -3142,7 +3142,7 @@ link_properties_fill_from_setting(NMDevice *self, NMPlatformLinkProps *props)
NMSettingLink *s_link; NMSettingLink *s_link;
gint64 v; gint64 v;
*props = (NMPlatformLinkProps){}; *props = (NMPlatformLinkProps) {};
s_link = nm_device_get_applied_setting(self, NM_TYPE_SETTING_LINK); s_link = nm_device_get_applied_setting(self, NM_TYPE_SETTING_LINK);
if (!s_link) if (!s_link)
@ -7943,9 +7943,9 @@ sriov_op_queue(NMDevice *self,
* grace period we pull the plug and cancel it. */ * grace period we pull the plug and cancel it. */
op = g_slice_new(SriovOp); op = g_slice_new(SriovOp);
*op = (SriovOp){ *op = (SriovOp) {
.sriov_params = .sriov_params =
(NMPlatformSriovParams){ (NMPlatformSriovParams) {
.num_vfs = num_vfs, .num_vfs = num_vfs,
.autoprobe = autoprobe, .autoprobe = autoprobe,
.eswitch_mode = (_NMSriovEswitchMode) eswitch_mode, .eswitch_mode = (_NMSriovEswitchMode) eswitch_mode,
@ -11278,7 +11278,7 @@ _dev_ipdhcpx_start(NMDevice *self, int addr_family)
hostname = nm_setting_ip_config_get_dhcp_hostname(s_ip); hostname = nm_setting_ip_config_get_dhcp_hostname(s_ip);
} }
config = (NMDhcpClientConfig){ config = (NMDhcpClientConfig) {
.addr_family = AF_INET, .addr_family = AF_INET,
.l3cfg = nm_device_get_l3cfg(self), .l3cfg = nm_device_get_l3cfg(self),
.iface = nm_device_get_ip_iface(self), .iface = nm_device_get_ip_iface(self),
@ -11319,7 +11319,7 @@ _dev_ipdhcpx_start(NMDevice *self, int addr_family)
iaid = _prop_get_ipvx_dhcp_iaid(self, AF_INET6, connection, FALSE, &iaid_explicit); iaid = _prop_get_ipvx_dhcp_iaid(self, AF_INET6, connection, FALSE, &iaid_explicit);
duid = _prop_get_ipv6_dhcp_duid(self, connection, hwaddr, &enforce_duid); duid = _prop_get_ipv6_dhcp_duid(self, connection, hwaddr, &enforce_duid);
config = (NMDhcpClientConfig){ config = (NMDhcpClientConfig) {
.addr_family = AF_INET6, .addr_family = AF_INET6,
.l3cfg = nm_device_get_l3cfg(self), .l3cfg = nm_device_get_l3cfg(self),
.iface = nm_device_get_ip_iface(self), .iface = nm_device_get_ip_iface(self),
@ -14111,7 +14111,7 @@ impl_device_reapply(NMDBusObject *obj,
} }
reapply_data = g_slice_new(ReapplyData); reapply_data = g_slice_new(ReapplyData);
*reapply_data = (ReapplyData){ *reapply_data = (ReapplyData) {
.connection = connection, .connection = connection,
.version_id = version_id, .version_id = version_id,
.reapply_flags = reapply_flags, .reapply_flags = reapply_flags,
@ -18364,7 +18364,7 @@ nm_device_get_hostname_from_dns_lookup(NMDevice *self, int addr_family, gboolean
resolver = priv->hostname_resolver_x[IS_IPv4]; resolver = priv->hostname_resolver_x[IS_IPv4];
if (!resolver) { if (!resolver) {
resolver = g_slice_new(HostnameResolver); resolver = g_slice_new(HostnameResolver);
*resolver = (HostnameResolver){ *resolver = (HostnameResolver) {
.device = self, .device = self,
.addr_family = addr_family, .addr_family = addr_family,
.state = RESOLVER_WAIT_ADDRESS, .state = RESOLVER_WAIT_ADDRESS,

View file

@ -397,7 +397,7 @@ lldp_neighbor_new(NMLldpNeighbor *neighbor_nm)
} }
neigh = g_slice_new(LldpNeighbor); neigh = g_slice_new(LldpNeighbor);
*neigh = (LldpNeighbor){ *neigh = (LldpNeighbor) {
.neighbor_nm = nm_lldp_neighbor_ref(neighbor_nm), .neighbor_nm = nm_lldp_neighbor_ref(neighbor_nm),
.chassis_id_type = chassis_id_type, .chassis_id_type = chassis_id_type,
.chassis_id = g_steal_pointer(&s_chassis_id), .chassis_id = g_steal_pointer(&s_chassis_id),
@ -522,7 +522,7 @@ lldp_neighbor_to_variant(LldpNeighbor *neigh)
if (len <= 6) if (len <= 6)
continue; continue;
/* skip over leading TLV, OUI and subtype */ /* skip over leading TLV, OUI and subtype */
#if NM_MORE_ASSERTS > 5 #if NM_MORE_ASSERTS > 5
{ {
guint8 check_hdr[] = {0xfe | (((len - 2) >> 8) & 0x01), guint8 check_hdr[] = {0xfe | (((len - 2) >> 8) & 0x01),
@ -721,7 +721,7 @@ nmtst_lldp_parse_from_raw(const guint8 *raw_data, gsize raw_len)
g_assert(raw_data); g_assert(raw_data);
g_assert(raw_len > 0); g_assert(raw_len > 0);
lldp_rx = nm_lldp_rx_new(&((NMLldpRXConfig){ lldp_rx = nm_lldp_rx_new(&((NMLldpRXConfig) {
.ifindex = 1, .ifindex = 1,
.neighbors_max = MAX_NEIGHBORS, .neighbors_max = MAX_NEIGHBORS,
.callback = nmtst_lldp_event_handler, .callback = nmtst_lldp_event_handler,
@ -889,7 +889,7 @@ nm_lldp_listener_new(int ifindex,
g_return_val_if_fail(notify_callback, FALSE); g_return_val_if_fail(notify_callback, FALSE);
self = g_slice_new(NMLldpListener); self = g_slice_new(NMLldpListener);
*self = (NMLldpListener){ *self = (NMLldpListener) {
.ifindex = ifindex, .ifindex = ifindex,
.notify_callback = notify_callback, .notify_callback = notify_callback,
.notify_user_data = notify_user_data, .notify_user_data = notify_user_data,
@ -897,7 +897,7 @@ nm_lldp_listener_new(int ifindex,
nm_assert(nm_g_main_context_is_thread_default(g_main_context_default())); nm_assert(nm_g_main_context_is_thread_default(g_main_context_default()));
lldp_rx = nm_lldp_rx_new(&((NMLldpRXConfig){ lldp_rx = nm_lldp_rx_new(&((NMLldpRXConfig) {
.ifindex = ifindex, .ifindex = ifindex,
.neighbors_max = MAX_NEIGHBORS, .neighbors_max = MAX_NEIGHBORS,
.callback = lldp_event_handler, .callback = lldp_event_handler,

View file

@ -603,7 +603,7 @@ deactivate_async(NMDevice *device,
* with a timeout. * with a timeout.
*/ */
data = g_slice_new(DeactivateData); data = g_slice_new(DeactivateData);
*data = (DeactivateData){ *data = (DeactivateData) {
.self = g_object_ref(self), .self = g_object_ref(self),
.cancellable = g_object_ref(cancellable), .cancellable = g_object_ref(cancellable),
.callback = callback, .callback = callback,

View file

@ -175,7 +175,7 @@ attach_port(NMDevice *device,
} }
data = g_slice_new(AttachPortData); data = g_slice_new(AttachPortData);
*data = (AttachPortData){ *data = (AttachPortData) {
.device = g_object_ref(device), .device = g_object_ref(device),
.port = g_object_ref(port), .port = g_object_ref(port),
.cancellable = g_object_ref(cancellable), .cancellable = g_object_ref(cancellable),
@ -233,7 +233,7 @@ detach_port(NMDevice *device,
AttachPortData *data; AttachPortData *data;
data = g_slice_new(AttachPortData); data = g_slice_new(AttachPortData);
*data = (AttachPortData){ *data = (AttachPortData) {
.device = g_object_ref(device), .device = g_object_ref(device),
.port = g_object_ref(port), .port = g_object_ref(port),
.cancellable = nm_g_object_ref(cancellable), .cancellable = nm_g_object_ref(cancellable),

View file

@ -205,7 +205,7 @@ static void cleanup_check_ready(NMOvsdb *self);
/*****************************************************************************/ /*****************************************************************************/
#define OVSDB_METHOD_PAYLOAD_MONITOR() \ #define OVSDB_METHOD_PAYLOAD_MONITOR() \
(&((const OvsdbMethodPayload){ \ (&((const OvsdbMethodPayload) { \
.monitor = {}, \ .monitor = {}, \
})) }))
@ -214,7 +214,7 @@ static void cleanup_check_ready(NMOvsdb *self);
xinterface, \ xinterface, \
xbridge_device, \ xbridge_device, \
xinterface_device) \ xinterface_device) \
(&((const OvsdbMethodPayload){ \ (&((const OvsdbMethodPayload) { \
.add_interface = \ .add_interface = \
{ \ { \
.bridge = (xbridge), \ .bridge = (xbridge), \
@ -226,7 +226,7 @@ static void cleanup_check_ready(NMOvsdb *self);
})) }))
#define OVSDB_METHOD_PAYLOAD_DEL_INTERFACE(xifname) \ #define OVSDB_METHOD_PAYLOAD_DEL_INTERFACE(xifname) \
(&((const OvsdbMethodPayload){ \ (&((const OvsdbMethodPayload) { \
.del_interface = \ .del_interface = \
{ \ { \
.ifname = (char *) NM_CONSTCAST(char, (xifname)), \ .ifname = (char *) NM_CONSTCAST(char, (xifname)), \
@ -234,7 +234,7 @@ static void cleanup_check_ready(NMOvsdb *self);
})) }))
#define OVSDB_METHOD_PAYLOAD_SET_INTERFACE_MTU(xifname, xmtu) \ #define OVSDB_METHOD_PAYLOAD_SET_INTERFACE_MTU(xifname, xmtu) \
(&((const OvsdbMethodPayload){ \ (&((const OvsdbMethodPayload) { \
.set_interface_mtu = \ .set_interface_mtu = \
{ \ { \
.ifname = (char *) NM_CONSTCAST(char, (xifname)), \ .ifname = (char *) NM_CONSTCAST(char, (xifname)), \
@ -249,7 +249,7 @@ static void cleanup_check_ready(NMOvsdb *self);
xexternal_ids_new, \ xexternal_ids_new, \
xother_config_old, \ xother_config_old, \
xother_config_new) \ xother_config_new) \
(&((const OvsdbMethodPayload){ \ (&((const OvsdbMethodPayload) { \
.set_reapply = \ .set_reapply = \
{ \ { \
.device_type = xdevice_type, \ .device_type = xdevice_type, \
@ -420,7 +420,7 @@ ovsdb_call_method(NMOvsdb *self,
ovsdb_try_connect(self); ovsdb_try_connect(self);
call = g_slice_new(OvsdbMethodCall); call = g_slice_new(OvsdbMethodCall);
*call = (OvsdbMethodCall){ *call = (OvsdbMethodCall) {
.self = self, .self = self,
.call_id = CALL_ID_UNSPEC, .call_id = CALL_ID_UNSPEC,
.command = command, .command = command,
@ -1682,7 +1682,7 @@ _strdict_extract(json_t *strdict, GArray **out_array)
} }
v = nm_g_array_append_new(*out_array, NMUtilsNamedValue); v = nm_g_array_append_new(*out_array, NMUtilsNamedValue);
*v = (NMUtilsNamedValue){ *v = (NMUtilsNamedValue) {
.name = g_strdup(key), .name = g_strdup(key),
.value_str = g_strdup(val), .value_str = g_strdup(val),
}; };
@ -1909,7 +1909,7 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg)
gs_free char *strtmp2 = NULL; gs_free char *strtmp2 = NULL;
ovs_interface = g_slice_new(OpenvswitchInterface); ovs_interface = g_slice_new(OpenvswitchInterface);
*ovs_interface = (OpenvswitchInterface){ *ovs_interface = (OpenvswitchInterface) {
.interface_uuid = g_strdup(key), .interface_uuid = g_strdup(key),
.name = g_strdup(name), .name = g_strdup(name),
.type = g_strdup(type), .type = g_strdup(type),
@ -2040,7 +2040,7 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg)
gs_free char *strtmp2 = NULL; gs_free char *strtmp2 = NULL;
ovs_port = g_slice_new(OpenvswitchPort); ovs_port = g_slice_new(OpenvswitchPort);
*ovs_port = (OpenvswitchPort){ *ovs_port = (OpenvswitchPort) {
.port_uuid = g_strdup(key), .port_uuid = g_strdup(key),
.name = g_strdup(name), .name = g_strdup(name),
.connection_uuid = g_strdup(connection_uuid), .connection_uuid = g_strdup(connection_uuid),
@ -2161,7 +2161,7 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg)
gs_free char *strtmp2 = NULL; gs_free char *strtmp2 = NULL;
ovs_bridge = g_slice_new(OpenvswitchBridge); ovs_bridge = g_slice_new(OpenvswitchBridge);
*ovs_bridge = (OpenvswitchBridge){ *ovs_bridge = (OpenvswitchBridge) {
.bridge_uuid = g_strdup(key), .bridge_uuid = g_strdup(key),
.name = g_strdup(name), .name = g_strdup(name),
.connection_uuid = g_strdup(connection_uuid), .connection_uuid = g_strdup(connection_uuid),
@ -2905,7 +2905,7 @@ ovsdb_call_new(NMOvsdbCallback callback, gpointer user_data)
OvsdbCall *call; OvsdbCall *call;
call = g_slice_new(OvsdbCall); call = g_slice_new(OvsdbCall);
*call = (OvsdbCall){ *call = (OvsdbCall) {
.callback = callback, .callback = callback,
.user_data = user_data, .user_data = user_data,
}; };

View file

@ -275,7 +275,7 @@ ap_from_network(NMDeviceIwd *self,
ssid = g_bytes_new(name, NM_MIN(32u, strlen(name))); ssid = g_bytes_new(name, NM_MIN(32u, strlen(name)));
bss_info = (NMSupplicantBssInfo){ bss_info = (NMSupplicantBssInfo) {
.bss_path = bss_path, .bss_path = bss_path,
.last_seen_msec = last_seen_msec, .last_seen_msec = last_seen_msec,
.bssid_valid = TRUE, .bssid_valid = TRUE,
@ -3602,7 +3602,7 @@ nm_device_iwd_parse_netconfig(NMDeviceIwd *self, int addr_family, GVariantIter *
preferred_lifetime = valid_lifetime; preferred_lifetime = valid_lifetime;
if (addr_family == AF_INET) { if (addr_family == AF_INET) {
a.a4 = (NMPlatformIP4Address){ a.a4 = (NMPlatformIP4Address) {
.address = addr_bin.addr4, .address = addr_bin.addr4,
.peer_address = addr_bin.addr4, .peer_address = addr_bin.addr4,
.plen = plen, .plen = plen,
@ -3614,7 +3614,7 @@ nm_device_iwd_parse_netconfig(NMDeviceIwd *self, int addr_family, GVariantIter *
.broadcast_address = bcast_bin.addr4, .broadcast_address = bcast_bin.addr4,
}; };
} else { } else {
a.a6 = (NMPlatformIP6Address){ a.a6 = (NMPlatformIP6Address) {
.address = addr_bin.addr6, .address = addr_bin.addr6,
.plen = 128, .plen = 128,
.timestamp = (valid_lifetime != NM_PLATFORM_LIFETIME_PERMANENT) ? timestamp : 0, .timestamp = (valid_lifetime != NM_PLATFORM_LIFETIME_PERMANENT) ? timestamp : 0,
@ -3703,7 +3703,7 @@ nm_device_iwd_parse_netconfig(NMDeviceIwd *self, int addr_family, GVariantIter *
} }
if (addr_family == AF_INET) { if (addr_family == AF_INET) {
r.r4 = (NMPlatformIP4Route){ r.r4 = (NMPlatformIP4Route) {
.network = dst_addr_str ? dst_addr_bin.addr4 : 0, .network = dst_addr_str ? dst_addr_bin.addr4 : 0,
.plen = dst_addr_str ? dst_plen : 0, .plen = dst_addr_str ? dst_plen : 0,
.gateway = router_str ? router_bin.addr4 : 0, .gateway = router_str ? router_bin.addr4 : 0,
@ -3712,7 +3712,7 @@ nm_device_iwd_parse_netconfig(NMDeviceIwd *self, int addr_family, GVariantIter *
nm_platform_route_scope_inv(router_str ? RT_SCOPE_UNIVERSE : RT_SCOPE_LINK), nm_platform_route_scope_inv(router_str ? RT_SCOPE_UNIVERSE : RT_SCOPE_LINK),
}; };
} else { } else {
r.r6 = (NMPlatformIP6Route){ r.r6 = (NMPlatformIP6Route) {
.network = dst_addr_str ? dst_addr_bin.addr6 : nm_ip_addr_zero.addr6, .network = dst_addr_str ? dst_addr_bin.addr6 : nm_ip_addr_zero.addr6,
.plen = dst_addr_str ? dst_plen : 0, .plen = dst_addr_str ? dst_plen : 0,
.gateway = router_str ? router_bin.addr6 : nm_ip_addr_zero.addr6, .gateway = router_str ? router_bin.addr6 : nm_ip_addr_zero.addr6,

View file

@ -340,7 +340,7 @@ _scan_request_ssids_track(NMDeviceWifiPrivate *priv, const GPtrArray *ssids)
d = g_hash_table_lookup(priv->scan_request_ssids_hash, &ssid); d = g_hash_table_lookup(priv->scan_request_ssids_hash, &ssid);
if (!d) { if (!d) {
d = g_slice_new(ScanRequestSsidData); d = g_slice_new(ScanRequestSsidData);
*d = (ScanRequestSsidData){ *d = (ScanRequestSsidData) {
.lst = C_LIST_INIT(d->lst), .lst = C_LIST_INIT(d->lst),
.timestamp_msec = now_msec, .timestamp_msec = now_msec,
.ssid = g_bytes_ref(ssid), .ssid = g_bytes_ref(ssid),

View file

@ -1116,7 +1116,7 @@ stage3_ip_config_start(NMModem *modem, int addr_family, NMModemIPMethod ip_metho
ifindex, ifindex,
NM_IP_CONFIG_SOURCE_WWAN); NM_IP_CONFIG_SOURCE_WWAN);
address = (NMPlatformIP4Address){ address = (NMPlatformIP4Address) {
.address = address_network, .address = address_network,
.peer_address = address_network, .peer_address = address_network,
.plen = mm_bearer_ip_config_get_prefix(self->_priv.ipv4_config), .plen = mm_bearer_ip_config_get_prefix(self->_priv.ipv4_config),
@ -1127,7 +1127,7 @@ stage3_ip_config_start(NMModem *modem, int addr_family, NMModemIPMethod ip_metho
_LOGI(" address %s", nm_platform_ip4_address_to_string(&address, sbuf, sizeof(sbuf))); _LOGI(" address %s", nm_platform_ip4_address_to_string(&address, sbuf, sizeof(sbuf)));
route = (NMPlatformIP4Route){ route = (NMPlatformIP4Route) {
.rt_source = NM_IP_CONFIG_SOURCE_WWAN, .rt_source = NM_IP_CONFIG_SOURCE_WWAN,
.gateway = gw, .gateway = gw,
.table_any = TRUE, .table_any = TRUE,
@ -1193,7 +1193,7 @@ stage3_ip_config_start(NMModem *modem, int addr_family, NMModemIPMethod ip_metho
do_auto = TRUE; do_auto = TRUE;
if (address_string) { if (address_string) {
address = (NMPlatformIP6Address){}; address = (NMPlatformIP6Address) {};
if (!inet_pton(AF_INET6, address_string, &address.address)) { if (!inet_pton(AF_INET6, address_string, &address.address)) {
g_set_error(&error, g_set_error(&error,

View file

@ -1256,7 +1256,7 @@ handle_settings(NMModemOfono *self, GVariant *v_dict)
goto out; goto out;
} }
address = (NMPlatformIP4Address){ address = (NMPlatformIP4Address) {
.ifindex = ifindex, .ifindex = ifindex,
.address = address_network, .address = address_network,
.addr_source = NM_IP_CONFIG_SOURCE_WWAN, .addr_source = NM_IP_CONFIG_SOURCE_WWAN,

View file

@ -1065,7 +1065,7 @@ nm_modem_act_stage2_config(NMModem *self, NMDevice *device, NMDeviceStateReason
else else
baud_override = 0; baud_override = 0;
priv->ppp_mgr = nm_ppp_mgr_start(&((const NMPppMgrConfig){ priv->ppp_mgr = nm_ppp_mgr_start(&((const NMPppMgrConfig) {
.netns = nm_device_get_netns(device), .netns = nm_device_get_netns(device),
.parent_iface = priv->data_port, .parent_iface = priv->data_port,
.callback = _ppp_mgr_callback, .callback = _ppp_mgr_callback,

View file

@ -321,7 +321,7 @@ _emit_notify_data(NMDhcpClient *self, const NMDhcpClientNotifyData *notify_data)
#define _emit_notify(self, _notify_type, ...) \ #define _emit_notify(self, _notify_type, ...) \
_emit_notify_data( \ _emit_notify_data( \
(self), \ (self), \
&((const NMDhcpClientNotifyData){.notify_type = (_notify_type), __VA_ARGS__})) &((const NMDhcpClientNotifyData) {.notify_type = (_notify_type), __VA_ARGS__}))
/*****************************************************************************/ /*****************************************************************************/
@ -669,7 +669,7 @@ _acd_check_lease(NMDhcpClient *self, NMOptionBool *out_acd_state)
now_msec = nm_utils_get_monotonic_timestamp_msec(); now_msec = nm_utils_get_monotonic_timestamp_msec();
g_array_append_val(priv->v4.acd.reglist, g_array_append_val(priv->v4.acd.reglist,
((AcdRegListData){ ((AcdRegListData) {
.l3cd = nm_l3_config_data_ref(priv->l3cd_next), .l3cd = nm_l3_config_data_ref(priv->l3cd_next),
.addr = addr, .addr = addr,
.expiry_msec = now_msec + ACD_REGLIST_GRACE_PERIOD_MSEC, .expiry_msec = now_msec + ACD_REGLIST_GRACE_PERIOD_MSEC,
@ -1928,7 +1928,7 @@ set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *ps
/* I know, this is technically not necessary. It just feels nicer to /* I know, this is technically not necessary. It just feels nicer to
* explicitly initialize the respective union member. */ * explicitly initialize the respective union member. */
if (NM_IS_IPv4(priv->config.addr_family)) { if (NM_IS_IPv4(priv->config.addr_family)) {
priv->v4 = (typeof(priv->v4)){ priv->v4 = (typeof(priv->v4)) {
.acd = .acd =
{ {
.addr = INADDR_ANY, .addr = INADDR_ANY,
@ -1938,7 +1938,7 @@ set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *ps
}, },
}; };
} else { } else {
priv->v6 = (typeof(priv->v6)){ priv->v6 = (typeof(priv->v6)) {
.lladdr_timeout_source = NULL, .lladdr_timeout_source = NULL,
}; };
} }

View file

@ -305,7 +305,7 @@ lease_parse_address(NMDhcpNettools *self /* for logging context only */,
} }
nm_l3_config_data_add_address_4(l3cd, nm_l3_config_data_add_address_4(l3cd,
&((const NMPlatformIP4Address){ &((const NMPlatformIP4Address) {
.address = a_address.s_addr, .address = a_address.s_addr,
.peer_address = a_address.s_addr, .peer_address = a_address.s_addr,
.plen = a_plen, .plen = a_plen,
@ -445,7 +445,7 @@ lease_parse_routes(NDhcp4ClientLease *lease,
m = 0; m = 0;
nm_l3_config_data_add_route_4(l3cd, nm_l3_config_data_add_route_4(l3cd,
&((const NMPlatformIP4Route){ &((const NMPlatformIP4Route) {
.rt_source = NM_IP_CONFIG_SOURCE_DHCP, .rt_source = NM_IP_CONFIG_SOURCE_DHCP,
.network = dest, .network = dest,
.plen = plen, .plen = plen,
@ -489,7 +489,7 @@ lease_parse_routes(NDhcp4ClientLease *lease,
} }
nm_l3_config_data_add_route_4(l3cd, nm_l3_config_data_add_route_4(l3cd,
&((const NMPlatformIP4Route){ &((const NMPlatformIP4Route) {
.rt_source = NM_IP_CONFIG_SOURCE_DHCP, .rt_source = NM_IP_CONFIG_SOURCE_DHCP,
.network = dest, .network = dest,
.plen = plen, .plen = plen,
@ -533,7 +533,7 @@ lease_parse_routes(NDhcp4ClientLease *lease,
m = default_route_metric_offset++; m = default_route_metric_offset++;
nm_l3_config_data_add_route_4(l3cd, nm_l3_config_data_add_route_4(l3cd,
&((const NMPlatformIP4Route){ &((const NMPlatformIP4Route) {
.rt_source = NM_IP_CONFIG_SOURCE_DHCP, .rt_source = NM_IP_CONFIG_SOURCE_DHCP,
.gateway = gateway, .gateway = gateway,
.pref_src = lease_address, .pref_src = lease_address,

View file

@ -92,7 +92,7 @@ ip4_process_dhcpcd_rfc3442_routes(const char *iface,
nm_l3_config_data_add_route_4( nm_l3_config_data_add_route_4(
l3cd, l3cd,
&((const NMPlatformIP4Route){ &((const NMPlatformIP4Route) {
.rt_source = NM_IP_CONFIG_SOURCE_DHCP, .rt_source = NM_IP_CONFIG_SOURCE_DHCP,
.network = nm_ip4_addr_clear_host_address(rt_addr, rt_cidr), .network = nm_ip4_addr_clear_host_address(rt_addr, rt_cidr),
.plen = rt_cidr, .plen = rt_cidr,
@ -147,7 +147,7 @@ process_dhclient_rfc3442_route(const char *const **p_octets, NMPlatformIP4Route
if (inet_pton(AF_INET, next_hop, &tmp_addr) <= 0) if (inet_pton(AF_INET, next_hop, &tmp_addr) <= 0)
return FALSE; return FALSE;
*route = (NMPlatformIP4Route){ *route = (NMPlatformIP4Route) {
.network = v_network, .network = v_network,
.plen = v_plen, .plen = v_plen,
.gateway = tmp_addr, .gateway = tmp_addr,
@ -316,7 +316,7 @@ process_classful_routes(const char *iface,
// FIXME: ensure the IP address and route are sane // FIXME: ensure the IP address and route are sane
route = (NMPlatformIP4Route){ route = (NMPlatformIP4Route) {
.network = rt_addr, .network = rt_addr,
}; };
@ -409,7 +409,7 @@ nm_dhcp_utils_ip4_config_from_options(NMDedupMultiIndex *multi_idx,
now = nm_utils_get_monotonic_timestamp_sec(); now = nm_utils_get_monotonic_timestamp_sec();
address = (NMPlatformIP4Address){ address = (NMPlatformIP4Address) {
.timestamp = now, .timestamp = now,
}; };
@ -655,7 +655,7 @@ nm_dhcp_utils_ip6_config_from_options(NMDedupMultiIndex *multi_idx,
now = nm_utils_get_monotonic_timestamp_sec(); now = nm_utils_get_monotonic_timestamp_sec();
address = (NMPlatformIP6Address){ address = (NMPlatformIP6Address) {
.plen = 128, .plen = 128,
.timestamp = now, .timestamp = now,
}; };

View file

@ -1023,7 +1023,7 @@ _check_duid_impl(const guint8 *duid_bin,
g_assert_cmpint(contents_len, ==, strlen(contents)); g_assert_cmpint(contents_len, ==, strlen(contents));
} }
#define _DUID(...) ((const guint8[]){__VA_ARGS__}) #define _DUID(...) ((const guint8[]) {__VA_ARGS__})
#define _check_duid(duid, enforce_duid, old_content, new_content) \ #define _check_duid(duid, enforce_duid, old_content, new_content) \
_check_duid_impl((duid), sizeof(duid), (enforce_duid), (old_content), (new_content)) _check_duid_impl((duid), sizeof(duid), (enforce_duid), (old_content), (new_content))

View file

@ -194,16 +194,16 @@ test_parse_search_list(void)
guint8 *data; guint8 *data;
char **domains; char **domains;
data = (guint8[]){0x05, 'l', 'o', 'c', 'a', 'l', 0x00}; data = (guint8[]) {0x05, 'l', 'o', 'c', 'a', 'l', 0x00};
domains = nm_dhcp_lease_data_parse_search_list(data, 7, NULL, 0, 0); domains = nm_dhcp_lease_data_parse_search_list(data, 7, NULL, 0, 0);
g_assert(domains); g_assert(domains);
g_assert_cmpint(g_strv_length(domains), ==, 1); g_assert_cmpint(g_strv_length(domains), ==, 1);
g_assert_cmpstr(domains[0], ==, "local"); g_assert_cmpstr(domains[0], ==, "local");
g_strfreev(domains); g_strfreev(domains);
data = (guint8[]){0x04, 't', 'e', 's', 't', 0x07, 'e', 'x', 'a', 'm', 'p', 'l', data = (guint8[]) {0x04, 't', 'e', 's', 't', 0x07, 'e', 'x', 'a', 'm', 'p', 'l',
'e', 0x03, 'c', 'o', 'm', 0x00, 0xc0, 0x05, 0x03, 'a', 'b', 'c', 'e', 0x03, 'c', 'o', 'm', 0x00, 0xc0, 0x05, 0x03, 'a', 'b', 'c',
0xc0, 0x0d, 0x06, 'f', 'o', 'o', 'b', 'a', 'r', 0x00}; 0xc0, 0x0d, 0x06, 'f', 'o', 'o', 'b', 'a', 'r', 0x00};
domains = nm_dhcp_lease_data_parse_search_list(data, 34, NULL, 0, 0); domains = nm_dhcp_lease_data_parse_search_list(data, 34, NULL, 0, 0);
g_assert(domains); g_assert(domains);
g_assert_cmpint(g_strv_length(domains), ==, 4); g_assert_cmpint(g_strv_length(domains), ==, 4);
@ -213,7 +213,7 @@ test_parse_search_list(void)
g_assert_cmpstr(domains[3], ==, "foobar"); g_assert_cmpstr(domains[3], ==, "foobar");
g_strfreev(domains); g_strfreev(domains);
data = (guint8[]){ data = (guint8[]) {
0x40, 0x40,
'b', 'b',
'a', 'a',
@ -222,7 +222,7 @@ test_parse_search_list(void)
domains = nm_dhcp_lease_data_parse_search_list(data, 4, NULL, 0, 0); domains = nm_dhcp_lease_data_parse_search_list(data, 4, NULL, 0, 0);
g_assert(!domains); g_assert(!domains);
data = (guint8[]){ data = (guint8[]) {
0x04, 0x04,
'o', 'o',
'k', 'k',

View file

@ -263,7 +263,7 @@ handle_kill:
PIDFILE); PIDFILE);
gl_pid.kill_external_data = g_slice_new(GlPidKillExternalData); gl_pid.kill_external_data = g_slice_new(GlPidKillExternalData);
*gl_pid.kill_external_data = (GlPidKillExternalData){ *gl_pid.kill_external_data = (GlPidKillExternalData) {
.shutdown_wait_handle = nm_shutdown_wait_obj_register_handle_full( .shutdown_wait_handle = nm_shutdown_wait_obj_register_handle_full(
g_strdup_printf("kill-external-dnsmasq-process-%" G_PID_FORMAT, pid), g_strdup_printf("kill-external-dnsmasq-process-%" G_PID_FORMAT, pid),
TRUE), TRUE),
@ -623,7 +623,7 @@ _gl_pid_spawn(const char *dm_binary,
nm_assert(notify); nm_assert(notify);
nm_assert(G_IS_CANCELLABLE(cancellable)); nm_assert(G_IS_CANCELLABLE(cancellable));
gl_pid.spawn_data = g_slice_new(GlPidSpawnAsyncData); gl_pid.spawn_data = g_slice_new(GlPidSpawnAsyncData);
*gl_pid.spawn_data = (GlPidSpawnAsyncData){ *gl_pid.spawn_data = (GlPidSpawnAsyncData) {
.dm_binary = dm_binary, .dm_binary = dm_binary,
.notify = notify, .notify = notify,
.notify_user_data = notify_user_data, .notify_user_data = notify_user_data,

View file

@ -401,7 +401,7 @@ _dns_config_ip_data_new(NMDnsConfigData *data,
nm_assert(ip_config_type != NM_DNS_IP_CONFIG_TYPE_REMOVED); nm_assert(ip_config_type != NM_DNS_IP_CONFIG_TYPE_REMOVED);
ip_data = g_slice_new(NMDnsConfigIPData); ip_data = g_slice_new(NMDnsConfigIPData);
*ip_data = (NMDnsConfigIPData){ *ip_data = (NMDnsConfigIPData) {
.data = data, .data = data,
.source_tag = source_tag, .source_tag = source_tag,
.l3cd = nm_l3_config_data_ref_and_seal(l3cd), .l3cd = nm_l3_config_data_ref_and_seal(l3cd),
@ -2108,7 +2108,7 @@ nm_dns_manager_set_ip_config(NMDnsManager *self,
if (!data) { if (!data) {
data = g_slice_new(NMDnsConfigData); data = g_slice_new(NMDnsConfigData);
*data = (NMDnsConfigData){ *data = (NMDnsConfigData) {
.ifindex = ifindex, .ifindex = ifindex,
.self = self, .self = self,
.data_lst_head = C_LIST_INIT(data->data_lst_head), .data_lst_head = C_LIST_INIT(data->data_lst_head),

View file

@ -248,7 +248,7 @@ _request_item_append(NMDnsSystemdResolved *self,
RequestItem *request_item; RequestItem *request_item;
request_item = g_slice_new(RequestItem); request_item = g_slice_new(RequestItem);
*request_item = (RequestItem){ *request_item = (RequestItem) {
.ref_count = 1, .ref_count = 1,
.operation = operation, .operation = operation,
.argument = g_variant_ref_sink(argument), .argument = g_variant_ref_sink(argument),
@ -803,7 +803,7 @@ update(NMDnsPlugin *plugin,
ic = g_hash_table_lookup(interfaces, GINT_TO_POINTER(ifindex)); ic = g_hash_table_lookup(interfaces, GINT_TO_POINTER(ifindex));
if (!ic) { if (!ic) {
ic = g_slice_new(InterfaceConfig); ic = g_slice_new(InterfaceConfig);
*ic = (InterfaceConfig){ *ic = (InterfaceConfig) {
.ifindex = ifindex, .ifindex = ifindex,
.ip_data_list = g_ptr_array_sized_new(4), .ip_data_list = g_ptr_array_sized_new(4),
}; };
@ -855,7 +855,7 @@ update(NMDnsPlugin *plugin,
InterfaceConfig ic; InterfaceConfig ic;
_LOGT("clear previously configured ifindex %d", ifindex); _LOGT("clear previously configured ifindex %d", ifindex);
ic = (InterfaceConfig){ ic = (InterfaceConfig) {
.ifindex = ifindex, .ifindex = ifindex,
.ip_data_list = NULL, .ip_data_list = NULL,
}; };
@ -1053,7 +1053,7 @@ _resolve_handle_call_cb(GObject *source, GAsyncResult *result, gpointer user_dat
NMDnsSystemdResolvedAddressResult *n; NMDnsSystemdResolvedAddressResult *n;
n = nm_g_array_append_new(v_names, NMDnsSystemdResolvedAddressResult); n = nm_g_array_append_new(v_names, NMDnsSystemdResolvedAddressResult);
*n = (NMDnsSystemdResolvedAddressResult){ *n = (NMDnsSystemdResolvedAddressResult) {
.name = g_steal_pointer(&v_name), .name = g_steal_pointer(&v_name),
.ifindex = v_ifindex, .ifindex = v_ifindex,
}; };
@ -1167,7 +1167,7 @@ nm_dns_systemd_resolved_resolve_address(NMDnsSystemdResolved
nm_assert(callback); nm_assert(callback);
handle = g_slice_new(NMDnsSystemdResolvedResolveHandle); handle = g_slice_new(NMDnsSystemdResolvedResolveHandle);
*handle = (NMDnsSystemdResolvedResolveHandle){ *handle = (NMDnsSystemdResolvedResolveHandle) {
.self = self, .self = self,
.timeout_msec = timeout_msec, .timeout_msec = timeout_msec,
.callback_user_data = user_data, .callback_user_data = user_data,

View file

@ -161,7 +161,7 @@ nm_fake_ndisc_add_prefix(NMFakeNDisc *self,
g_assert(ra); g_assert(ra);
prefix = nm_g_array_append_new(ra->prefixes, FakePrefix); prefix = nm_g_array_append_new(ra->prefixes, FakePrefix);
*prefix = (FakePrefix){ *prefix = (FakePrefix) {
.plen = plen, .plen = plen,
.expiry_msec = expiry_msec, .expiry_msec = expiry_msec,
.expiry_preferred_msec = expiry_preferred_msec, .expiry_preferred_msec = expiry_preferred_msec,

View file

@ -130,7 +130,7 @@ nm_ndisc_data_to_l3cd(NMDedupMultiIndex *multi_idx,
const NMNDiscAddress *ndisc_addr = &rdata->addresses[i]; const NMNDiscAddress *ndisc_addr = &rdata->addresses[i];
NMPlatformIP6Address a; NMPlatformIP6Address a;
a = (NMPlatformIP6Address){ a = (NMPlatformIP6Address) {
.ifindex = ifindex, .ifindex = ifindex,
.address = ndisc_addr->address, .address = ndisc_addr->address,
.plen = 64, .plen = 64,
@ -151,7 +151,7 @@ nm_ndisc_data_to_l3cd(NMDedupMultiIndex *multi_idx,
const NMNDiscRoute *ndisc_route = &rdata->routes[i]; const NMNDiscRoute *ndisc_route = &rdata->routes[i];
NMPlatformIP6Route r; NMPlatformIP6Route r;
r = (NMPlatformIP6Route){ r = (NMPlatformIP6Route) {
.ifindex = ifindex, .ifindex = ifindex,
.network = ndisc_route->network, .network = ndisc_route->network,
.plen = ndisc_route->plen, .plen = ndisc_route->plen,
@ -836,7 +836,7 @@ nm_ndisc_add_dns_domain(NMNDisc *ndisc, const NMNDiscDNSDomain *new_item, gint64
return FALSE; return FALSE;
item = nm_g_array_append_new(rdata->dns_domains, NMNDiscDNSDomain); item = nm_g_array_append_new(rdata->dns_domains, NMNDiscDNSDomain);
*item = (NMNDiscDNSDomain){ *item = (NMNDiscDNSDomain) {
.domain = g_strdup(new_item->domain), .domain = g_strdup(new_item->domain),
.expiry_msec = new_item->expiry_msec, .expiry_msec = new_item->expiry_msec,
}; };
@ -1090,7 +1090,7 @@ nm_ndisc_set_config(NMNDisc *ndisc, const NML3ConfigData *l3cd)
if (!lifetime) if (!lifetime)
continue; continue;
a = (NMNDiscAddress){ a = (NMNDiscAddress) {
.address = addr->address, .address = addr->address,
.expiry_msec = _nm_ndisc_lifetime_to_expiry(NM_NDISC_EXPIRY_BASE_TIMESTAMP, lifetime), .expiry_msec = _nm_ndisc_lifetime_to_expiry(NM_NDISC_EXPIRY_BASE_TIMESTAMP, lifetime),
.expiry_preferred_msec = .expiry_preferred_msec =
@ -1112,7 +1112,7 @@ nm_ndisc_set_config(NMNDisc *ndisc, const NML3ConfigData *l3cd)
if (!nm_utils_dnsname_parse_assert(AF_INET6, strvarr[i], NULL, &a, NULL)) if (!nm_utils_dnsname_parse_assert(AF_INET6, strvarr[i], NULL, &a, NULL))
continue; continue;
n = (NMNDiscDNSServer){ n = (NMNDiscDNSServer) {
.address = a, .address = a,
.expiry_msec = _nm_ndisc_lifetime_to_expiry(NM_NDISC_EXPIRY_BASE_TIMESTAMP, .expiry_msec = _nm_ndisc_lifetime_to_expiry(NM_NDISC_EXPIRY_BASE_TIMESTAMP,
NM_NDISC_ROUTER_LIFETIME), NM_NDISC_ROUTER_LIFETIME),
@ -1128,7 +1128,7 @@ nm_ndisc_set_config(NMNDisc *ndisc, const NML3ConfigData *l3cd)
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
NMNDiscDNSDomain n; NMNDiscDNSDomain n;
n = (NMNDiscDNSDomain){ n = (NMNDiscDNSDomain) {
.domain = (char *) strvarr[i], .domain = (char *) strvarr[i],
.expiry_msec = _nm_ndisc_lifetime_to_expiry(NM_NDISC_EXPIRY_BASE_TIMESTAMP, .expiry_msec = _nm_ndisc_lifetime_to_expiry(NM_NDISC_EXPIRY_BASE_TIMESTAMP,
NM_NDISC_ROUTER_LIFETIME), NM_NDISC_ROUTER_LIFETIME),

View file

@ -40,7 +40,7 @@ typedef enum {
const char *nm_ndisc_dhcp_level_to_string(NMNDiscDHCPLevel level); const char *nm_ndisc_dhcp_level_to_string(NMNDiscDHCPLevel level);
#define NM_NDISC_INFINITY_U32 ((uint32_t) - 1) #define NM_NDISC_INFINITY_U32 ((uint32_t) -1)
/* It's important that this is G_MAXINT64, so that we can meaningfully do /* It's important that this is G_MAXINT64, so that we can meaningfully do
* MIN(e1, e2) to find the minimum expiry time (and properly handle if any * MIN(e1, e2) to find the minimum expiry time (and properly handle if any

View file

@ -62,7 +62,7 @@ main(int argc, char **argv)
l3cfg = nm_netns_l3cfg_acquire(NM_NETNS_GET, ifindex); l3cfg = nm_netns_l3cfg_acquire(NM_NETNS_GET, ifindex);
config = (NMNDiscConfig){ config = (NMNDiscConfig) {
.l3cfg = l3cfg, .l3cfg = l3cfg,
.ifname = nm_l3cfg_get_ifname(l3cfg, TRUE), .ifname = nm_l3cfg_get_ifname(l3cfg, TRUE),
.stable_type = NM_UTILS_STABLE_TYPE_UUID, .stable_type = NM_UTILS_STABLE_TYPE_UUID,

View file

@ -90,7 +90,7 @@ _audit_field_init_string(AuditField *field,
gboolean need_encoding, gboolean need_encoding,
AuditBackend backends) AuditBackend backends)
{ {
*field = (AuditField){ *field = (AuditField) {
.name = name, .name = name,
.need_encoding = need_encoding, .need_encoding = need_encoding,
.backends = backends, .backends = backends,
@ -102,7 +102,7 @@ _audit_field_init_string(AuditField *field,
static void static void
_audit_field_init_uint64(AuditField *field, const char *name, guint64 val, AuditBackend backends) _audit_field_init_uint64(AuditField *field, const char *name, guint64 val, AuditBackend backends)
{ {
*field = (AuditField){ *field = (AuditField) {
.name = name, .name = name,
.backends = backends, .backends = backends,
.value_type = NM_VALUE_TYPE_UINT64, .value_type = NM_VALUE_TYPE_UINT64,

View file

@ -327,7 +327,7 @@ nm_auth_manager_check_authorization(NMAuthManager *self
: POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE; : POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE;
call_id = g_slice_new(NMAuthManagerCallId); call_id = g_slice_new(NMAuthManagerCallId);
*call_id = (NMAuthManagerCallId){ *call_id = (NMAuthManagerCallId) {
.self = g_object_ref(self), .self = g_object_ref(self),
.callback = callback, .callback = callback,
.user_data = user_data, .user_data = user_data,

View file

@ -293,7 +293,7 @@ nm_auth_chain_set_data_unsafe(NMAuthChain *self,
} }
chain_data = &self->data_arr[self->data_len++]; chain_data = &self->data_arr[self->data_len++];
*chain_data = (ChainData){ *chain_data = (ChainData) {
.tag = tag, .tag = tag,
.data = data, .data = data,
.destroy = data_destroy, .destroy = data_destroy,
@ -445,7 +445,7 @@ nm_auth_chain_add_call_unsafe(NMAuthChain *self, const char *permission, gboolea
} }
call = g_slice_new(AuthCall); call = g_slice_new(AuthCall);
*call = (AuthCall){ *call = (AuthCall) {
.chain = self, .chain = self,
.call_id = NULL, .call_id = NULL,
.result = NM_AUTH_CALL_RESULT_UNKNOWN, .result = NM_AUTH_CALL_RESULT_UNKNOWN,
@ -520,7 +520,7 @@ nm_auth_chain_new_subject(NMAuthSubject *subject,
nm_assert(done_func); nm_assert(done_func);
self = g_slice_new(NMAuthChain); self = g_slice_new(NMAuthChain);
*self = (NMAuthChain){ *self = (NMAuthChain) {
.done_func = done_func, .done_func = done_func,
.user_data = user_data, .user_data = user_data,
.context = nm_g_object_ref(context), .context = nm_g_object_ref(context),

View file

@ -880,7 +880,7 @@ nm_bond_manager_new(struct _NMPlatform *platform,
nm_assert(ifindex > 0); nm_assert(ifindex > 0);
self = g_slice_new(NMBondManager); self = g_slice_new(NMBondManager);
*self = (NMBondManager){ *self = (NMBondManager) {
.platform = g_object_ref(platform), .platform = g_object_ref(platform),
.ifindex = ifindex, .ifindex = ifindex,
.reg_state = REGISTRATION_STATE_NONE, .reg_state = REGISTRATION_STATE_NONE,

View file

@ -399,7 +399,7 @@ nm_config_data_get_ignore_carrier_for_port(const NMConfigData *self,
if (!nm_utils_ifname_valid_kernel(controller, NULL)) if (!nm_utils_ifname_valid_kernel(controller, NULL))
goto out_default; goto out_default;
match_data = (NMMatchSpecDeviceData){ match_data = (NMMatchSpecDeviceData) {
.interface_name = controller, .interface_name = controller,
.device_type = port_type, .device_type = port_type,
}; };
@ -1879,7 +1879,7 @@ _match_section_info_init(MatchSectionInfo *connection_info,
if (!value) if (!value)
continue; continue;
vals[j++] = (NMUtilsNamedValue){ vals[j++] = (NMUtilsNamedValue) {
.name = g_steal_pointer(&key), .name = g_steal_pointer(&key),
.value_str = value, .value_str = value,
}; };

View file

@ -497,7 +497,7 @@ multi_socket_cb(CURL *e_handle, curl_socket_t fd, int what, void *userdata, void
if (!fdp) { if (!fdp) {
fdp = g_slice_new(ConCurlSockData); fdp = g_slice_new(ConCurlSockData);
*fdp = (ConCurlSockData){ *fdp = (ConCurlSockData) {
.cb_data = cb_data, .cb_data = cb_data,
}; };
curl_multi_assign(cb_data->concheck.curl_mhandle, fd, fdp); curl_multi_assign(cb_data->concheck.curl_mhandle, fd, fdp);
@ -1291,7 +1291,7 @@ update_config(NMConnectivity *self, NMConfigData *config_data)
} }
_con_config_unref(priv->con_config); _con_config_unref(priv->con_config);
priv->con_config = g_slice_new(ConConfig); priv->con_config = g_slice_new(ConConfig);
*priv->con_config = (ConConfig){ *priv->con_config = (ConConfig) {
.ref_count = 1, .ref_count = 1,
.uri = g_strdup(new_uri), .uri = g_strdup(new_uri),
.response = g_strdup(new_response), .response = g_strdup(new_response),

View file

@ -1434,7 +1434,7 @@ nm_match_spec_device(const GSList *specs, const NMMatchSpecDeviceData *data)
if (!specs) if (!specs)
return NM_MATCH_SPEC_NO_MATCH; return NM_MATCH_SPEC_NO_MATCH;
match_data = (MatchSpecDeviceData){ match_data = (MatchSpecDeviceData) {
.data = data, .data = data,
.device_type = nm_str_not_empty(data->device_type), .device_type = nm_str_not_empty(data->device_type),
.driver = nm_str_not_empty(data->driver), .driver = nm_str_not_empty(data->driver),
@ -3011,7 +3011,7 @@ nmtst_utils_host_id_push(const guint8 *host_id,
h = nm_g_array_append_new(nmtst_host_id_stack, HostIdData); h = nm_g_array_append_new(nmtst_host_id_stack, HostIdData);
*h = (HostIdData){ *h = (HostIdData) {
.host_id = nm_memdup(host_id, host_id_len), .host_id = nm_memdup(host_id, host_id_len),
.host_id_len = host_id_len, .host_id_len = host_id_len,
.timestamp_nsec = p_timestamp_nsec ? *p_timestamp_nsec : 0, .timestamp_nsec = p_timestamp_nsec ? *p_timestamp_nsec : 0,
@ -3585,11 +3585,11 @@ _is_reserved_ipv6_iid(const guint8 *iid)
/* 0200:5EFF:FE00:0000 - 0200:5EFF:FE00:5212 (Reserved IPv6 Interface Identifiers corresponding to the IANA Ethernet Block [RFC4291]) /* 0200:5EFF:FE00:0000 - 0200:5EFF:FE00:5212 (Reserved IPv6 Interface Identifiers corresponding to the IANA Ethernet Block [RFC4291])
* 0200:5EFF:FE00:5213 (Proxy Mobile IPv6 [RFC6543]) * 0200:5EFF:FE00:5213 (Proxy Mobile IPv6 [RFC6543])
* 0200:5EFF:FE00:5214 - 0200:5EFF:FEFF:FFFF (Reserved IPv6 Interface Identifiers corresponding to the IANA Ethernet Block [RFC4291]) */ * 0200:5EFF:FE00:5214 - 0200:5EFF:FEFF:FFFF (Reserved IPv6 Interface Identifiers corresponding to the IANA Ethernet Block [RFC4291]) */
if (memcmp(iid, (const guint8[]){0x02, 0x00, 0x5E, 0xFF, 0xFE}, 5) == 0) if (memcmp(iid, (const guint8[]) {0x02, 0x00, 0x5E, 0xFF, 0xFE}, 5) == 0)
return TRUE; return TRUE;
/* FDFF:FFFF:FFFF:FF80 - FDFF:FFFF:FFFF:FFFF (Reserved Subnet Anycast Addresses [RFC2526]) */ /* FDFF:FFFF:FFFF:FF80 - FDFF:FFFF:FFFF:FFFF (Reserved Subnet Anycast Addresses [RFC2526]) */
if (memcmp(iid, (const guint8[]){0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, 7) == 0) { if (memcmp(iid, (const guint8[]) {0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, 7) == 0) {
if (iid[7] & 0x80) if (iid[7] & 0x80)
return TRUE; return TRUE;
} }
@ -5255,7 +5255,7 @@ nm_utils_spawn_helper(const char *const *args,
nm_assert(args && args[0]); nm_assert(args && args[0]);
info = g_new(HelperInfo, 1); info = g_new(HelperInfo, 1);
*info = (HelperInfo){ *info = (HelperInfo) {
.task = nm_g_task_new(NULL, cancellable, nm_utils_spawn_helper, callback, cb_data), .task = nm_g_task_new(NULL, cancellable, nm_utils_spawn_helper, callback, cb_data),
}; };

View file

@ -549,7 +549,7 @@ _get_caller_info_ensure(NMDBusManager *self,
gsize l = strlen(sender) + 1; gsize l = strlen(sender) + 1;
caller_info = g_malloc(sizeof(CallerInfo) + l); caller_info = g_malloc(sizeof(CallerInfo) + l);
*caller_info = (CallerInfo){ *caller_info = (CallerInfo) {
.uid_checked_at = -CALLER_INFO_MAX_AGE, .uid_checked_at = -CALLER_INFO_MAX_AGE,
.pid_checked_at = -CALLER_INFO_MAX_AGE, .pid_checked_at = -CALLER_INFO_MAX_AGE,
}; };

View file

@ -29,7 +29,7 @@ typedef struct {
#define NM_DBUS_EXPORT_PATH_STATIC(basepath) \ #define NM_DBUS_EXPORT_PATH_STATIC(basepath) \
({ \ ({ \
((NMDBusExportPath){ \ ((NMDBusExportPath) { \
.path = "" basepath "", \ .path = "" basepath "", \
}); \ }); \
}) })
@ -37,7 +37,7 @@ typedef struct {
#define NM_DBUS_EXPORT_PATH_NUMBERED(basepath) \ #define NM_DBUS_EXPORT_PATH_NUMBERED(basepath) \
({ \ ({ \
static long long unsigned _int_counter = 0; \ static long long unsigned _int_counter = 0; \
((NMDBusExportPath){ \ ((NMDBusExportPath) { \
.path = "" basepath "/%llu", \ .path = "" basepath "/%llu", \
.int_counter = &_int_counter, \ .int_counter = &_int_counter, \
}); \ }); \
@ -81,7 +81,7 @@ struct _NMDBusObject {
}; };
#define NM_DEFINE_DBUS_INTERFACE_INFO(...) \ #define NM_DEFINE_DBUS_INTERFACE_INFO(...) \
((NMDBusInterfaceInfo *) (&((const NMDBusInterfaceInfo){__VA_ARGS__}))) ((NMDBusInterfaceInfo *) (&((const NMDBusInterfaceInfo) {__VA_ARGS__})))
typedef struct { typedef struct {
GObjectClass parent; GObjectClass parent;

View file

@ -50,10 +50,10 @@ extern const GDBusAnnotationInfo _nm_gdbus_annotation_info_deprecated;
#define NM_GDBUS_ANNOTATION_INFO_DEPRECATED() \ #define NM_GDBUS_ANNOTATION_INFO_DEPRECATED() \
((GDBusAnnotationInfo *) &_nm_gdbus_annotation_info_deprecated) ((GDBusAnnotationInfo *) &_nm_gdbus_annotation_info_deprecated)
#define NM_DEFINE_DBUS_ANNOTATION_INFO(a_key, a_value) \ #define NM_DEFINE_DBUS_ANNOTATION_INFO(a_key, a_value) \
((GDBusAnnotationInfo *) &((const GDBusAnnotationInfo){ \ ((GDBusAnnotationInfo *) &((const GDBusAnnotationInfo) { \
.key = (a_key), \ .key = (a_key), \
.value = (a_value), \ .value = (a_value), \
})) }))
extern const GDBusAnnotationInfo *const _nm_gdbus_annotation_info_list_deprecated[]; extern const GDBusAnnotationInfo *const _nm_gdbus_annotation_info_list_deprecated[];
@ -67,10 +67,10 @@ extern const GDBusAnnotationInfo *const _nm_gdbus_annotation_info_list_deprecate
((GDBusAnnotationInfo **) _nm_gdbus_annotation_info_list_deprecated) ((GDBusAnnotationInfo **) _nm_gdbus_annotation_info_list_deprecated)
#define NM_DEFINE_DBUS_ANNOTATION_INFOS(...) \ #define NM_DEFINE_DBUS_ANNOTATION_INFOS(...) \
((GDBusAnnotationInfo **) ((const GDBusAnnotationInfo *const[]){__VA_ARGS__, NULL})) ((GDBusAnnotationInfo **) ((const GDBusAnnotationInfo *const[]) {__VA_ARGS__, NULL}))
#define NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE(m_name, m_signature, m_property_name, ...) \ #define NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE(m_name, m_signature, m_property_name, ...) \
((GDBusPropertyInfo *) &((const struct _NMDBusPropertyInfoExtendedBase){ \ ((GDBusPropertyInfo *) &((const struct _NMDBusPropertyInfoExtendedBase) { \
._parent = {.ref_count = -1, \ ._parent = {.ref_count = -1, \
.name = m_name, \ .name = m_name, \
.signature = m_signature, \ .signature = m_signature, \
@ -79,25 +79,25 @@ extern const GDBusAnnotationInfo *const _nm_gdbus_annotation_info_list_deprecate
.property_name = m_property_name, \ .property_name = m_property_name, \
})) }))
#define NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READWRITABLE(m_name, \ #define NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READWRITABLE(m_name, \
m_signature, \ m_signature, \
m_property_name, \ m_property_name, \
m_permission, \ m_permission, \
m_audit_op, \ m_audit_op, \
...) \ ...) \
((GDBusPropertyInfo *) &((const struct _NMDBusPropertyInfoExtendedReadWritable){ \ ((GDBusPropertyInfo *) &((const struct _NMDBusPropertyInfoExtendedReadWritable) { \
._base = \ ._base = \
{ \ { \
._parent = {.ref_count = -1, \ ._parent = {.ref_count = -1, \
.name = m_name, \ .name = m_name, \
.signature = m_signature, \ .signature = m_signature, \
.flags = G_DBUS_PROPERTY_INFO_FLAGS_READABLE \ .flags = G_DBUS_PROPERTY_INFO_FLAGS_READABLE \
| G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, \ | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, \
__VA_ARGS__}, \ __VA_ARGS__}, \
.property_name = m_property_name, \ .property_name = m_property_name, \
}, \ }, \
.permission = m_permission, \ .permission = m_permission, \
.audit_op = m_audit_op, \ .audit_op = m_audit_op, \
})) }))
typedef struct _NMDBusMethodInfoExtended { typedef struct _NMDBusMethodInfoExtended {
@ -113,7 +113,7 @@ typedef struct _NMDBusMethodInfoExtended {
} NMDBusMethodInfoExtended; } NMDBusMethodInfoExtended;
#define NM_DEFINE_DBUS_METHOD_INFO_EXTENDED(parent_, ...) \ #define NM_DEFINE_DBUS_METHOD_INFO_EXTENDED(parent_, ...) \
((GDBusMethodInfo *) (&((const NMDBusMethodInfoExtended){.parent = parent_, __VA_ARGS__}))) ((GDBusMethodInfo *) (&((const NMDBusMethodInfoExtended) {.parent = parent_, __VA_ARGS__})))
typedef struct _NMDBusInterfaceInfoExtended { typedef struct _NMDBusInterfaceInfoExtended {
GDBusInterfaceInfo parent; GDBusInterfaceInfo parent;

View file

@ -566,7 +566,7 @@ nm_firewall_nft_call(GBytes *stdin_buf,
gs_free char *ss1 = NULL; gs_free char *ss1 = NULL;
call_data = g_slice_new(FwNftCallData); call_data = g_slice_new(FwNftCallData);
*call_data = (FwNftCallData){ *call_data = (FwNftCallData) {
.task = .task =
nm_g_task_new(NULL, cancellable, nm_firewall_nft_call, callback, callback_user_data), nm_g_task_new(NULL, cancellable, nm_firewall_nft_call, callback, callback_user_data),
.subprocess = NULL, .subprocess = NULL,
@ -661,7 +661,7 @@ _fw_nft_call_sync(GBytes *stdin_buf, GError **error)
nm_auto_pop_and_unref_gmaincontext GMainContext *main_context = nm_auto_pop_and_unref_gmaincontext GMainContext *main_context =
nm_g_main_context_push_thread_default(g_main_context_new()); nm_g_main_context_push_thread_default(g_main_context_new());
nm_auto_unref_gmainloop GMainLoop *main_loop = g_main_loop_new(main_context, FALSE); nm_auto_unref_gmainloop GMainLoop *main_loop = g_main_loop_new(main_context, FALSE);
FwNftCallSyncData data = (FwNftCallSyncData){ FwNftCallSyncData data = (FwNftCallSyncData) {
.loop = main_loop, .loop = main_loop,
.error = error, .error = error,
}; };
@ -964,7 +964,7 @@ nm_firewall_config_new_shared(const char *ip_iface, in_addr_t addr, guint8 plen)
nm_assert(plen <= 32); nm_assert(plen <= 32);
self = g_slice_new(NMFirewallConfig); self = g_slice_new(NMFirewallConfig);
*self = (NMFirewallConfig){ *self = (NMFirewallConfig) {
.ip_iface = g_strdup(ip_iface), .ip_iface = g_strdup(ip_iface),
.addr = addr, .addr = addr,
.plen = plen, .plen = plen,

View file

@ -678,7 +678,7 @@ nm_l3_config_data_new(NMDedupMultiIndex *multi_idx, int ifindex, NMIPConfigSourc
|| (source >= NM_IP_CONFIG_SOURCE_KERNEL && source <= NM_IP_CONFIG_SOURCE_USER)); || (source >= NM_IP_CONFIG_SOURCE_KERNEL && source <= NM_IP_CONFIG_SOURCE_USER));
self = g_slice_new(NML3ConfigData); self = g_slice_new(NML3ConfigData);
*self = (NML3ConfigData){ *self = (NML3ConfigData) {
.ref_count = 1, .ref_count = 1,
.ifindex = ifindex, .ifindex = ifindex,
.multi_idx = nm_dedup_multi_index_ref(multi_idx), .multi_idx = nm_dedup_multi_index_ref(multi_idx),
@ -2555,7 +2555,7 @@ nm_l3_config_data_get_blacklisted_ip4_routes(const NML3ConfigData *self, gboolea
continue; continue;
} }
rx.r4 = (NMPlatformIP4Route){ rx.r4 = (NMPlatformIP4Route) {
.ifindex = self->ifindex, .ifindex = self->ifindex,
.rt_source = NM_IP_CONFIG_SOURCE_KERNEL, .rt_source = NM_IP_CONFIG_SOURCE_KERNEL,
.network = network_4, .network = network_4,
@ -2737,7 +2737,7 @@ nm_l3_config_data_add_dependent_device_routes(NML3ConfigData *self,
plen = addr_src->a6.plen; plen = addr_src->a6.plen;
} }
rx.r6 = (NMPlatformIP6Route){ rx.r6 = (NMPlatformIP6Route) {
.ifindex = self->ifindex, .ifindex = self->ifindex,
.rt_source = NM_IP_CONFIG_SOURCE_KERNEL, .rt_source = NM_IP_CONFIG_SOURCE_KERNEL,
.table_coerced = nm_platform_route_table_coerce(route_table), .table_coerced = nm_platform_route_table_coerce(route_table),
@ -2810,14 +2810,14 @@ _init_from_connection_ip(NML3ConfigData *self, int addr_family, NMConnection *co
NMPlatformIPXRoute r; NMPlatformIPXRoute r;
if (IS_IPv4) { if (IS_IPv4) {
r.r4 = (NMPlatformIP4Route){ r.r4 = (NMPlatformIP4Route) {
.rt_source = NM_IP_CONFIG_SOURCE_USER, .rt_source = NM_IP_CONFIG_SOURCE_USER,
.gateway = gateway_bin.addr4, .gateway = gateway_bin.addr4,
.table_any = TRUE, .table_any = TRUE,
.metric_any = TRUE, .metric_any = TRUE,
}; };
} else { } else {
r.r6 = (NMPlatformIP6Route){ r.r6 = (NMPlatformIP6Route) {
.rt_source = NM_IP_CONFIG_SOURCE_USER, .rt_source = NM_IP_CONFIG_SOURCE_USER,
.gateway = gateway_bin.addr6, .gateway = gateway_bin.addr6,
.table_any = TRUE, .table_any = TRUE,
@ -2840,7 +2840,7 @@ _init_from_connection_ip(NML3ConfigData *self, int addr_family, NMConnection *co
nm_ip_address_get_address_binary(s_addr, &addr_bin); nm_ip_address_get_address_binary(s_addr, &addr_bin);
if (IS_IPv4) { if (IS_IPv4) {
a.a4 = (NMPlatformIP4Address){ a.a4 = (NMPlatformIP4Address) {
.address = addr_bin.addr4, .address = addr_bin.addr4,
.peer_address = addr_bin.addr4, .peer_address = addr_bin.addr4,
.plen = nm_ip_address_get_prefix(s_addr), .plen = nm_ip_address_get_prefix(s_addr),
@ -2854,7 +2854,7 @@ _init_from_connection_ip(NML3ConfigData *self, int addr_family, NMConnection *co
nm_assert(a.a4.plen <= 32); nm_assert(a.a4.plen <= 32);
} else { } else {
a.a6 = (NMPlatformIP6Address){ a.a6 = (NMPlatformIP6Address) {
.address = addr_bin.addr6, .address = addr_bin.addr6,
.plen = nm_ip_address_get_prefix(s_addr), .plen = nm_ip_address_get_prefix(s_addr),
.lifetime = NM_PLATFORM_LIFETIME_PERMANENT, .lifetime = NM_PLATFORM_LIFETIME_PERMANENT,
@ -2899,7 +2899,7 @@ _init_from_connection_ip(NML3ConfigData *self, int addr_family, NMConnection *co
nm_ip_addr_clear_host_address(addr_family, &network_bin, &network_bin, plen); nm_ip_addr_clear_host_address(addr_family, &network_bin, &network_bin, plen);
if (IS_IPv4) { if (IS_IPv4) {
r.r4 = (NMPlatformIP4Route){ r.r4 = (NMPlatformIP4Route) {
.network = network_bin.addr4, .network = network_bin.addr4,
.plen = plen, .plen = plen,
.gateway = next_hop_bin.addr4, .gateway = next_hop_bin.addr4,
@ -2909,7 +2909,7 @@ _init_from_connection_ip(NML3ConfigData *self, int addr_family, NMConnection *co
}; };
nm_assert(r.r4.plen <= 32); nm_assert(r.r4.plen <= 32);
} else { } else {
r.r6 = (NMPlatformIP6Route){ r.r6 = (NMPlatformIP6Route) {
.network = network_bin.addr6, .network = network_bin.addr6,
.plen = plen, .plen = plen,
.gateway = next_hop_bin.addr6, .gateway = next_hop_bin.addr6,

View file

@ -191,7 +191,7 @@ _ipv4ll_emit_signal_notify(NML3IPv4LL *self)
self->notify_on_idle = FALSE; self->notify_on_idle = FALSE;
notify_data.notify_type = NM_L3_CONFIG_NOTIFY_TYPE_IPV4LL_EVENT; notify_data.notify_type = NM_L3_CONFIG_NOTIFY_TYPE_IPV4LL_EVENT;
notify_data.ipv4ll_event = (typeof(notify_data.ipv4ll_event)){ notify_data.ipv4ll_event = (typeof(notify_data.ipv4ll_event)) {
.ipv4ll = self, .ipv4ll = self,
}; };
_nm_l3cfg_emit_signal_notify(self->l3cfg, &notify_data); _nm_l3cfg_emit_signal_notify(self->l3cfg, &notify_data);
@ -231,7 +231,7 @@ _registration_update(NML3IPv4LL *self,
if (!reg) { if (!reg) {
reg = g_slice_new(NML3IPv4LLRegistration); reg = g_slice_new(NML3IPv4LLRegistration);
*reg = (NML3IPv4LLRegistration){ *reg = (NML3IPv4LLRegistration) {
.self = self, .self = self,
.timeout_msec = timeout_msec, .timeout_msec = timeout_msec,
}; };
@ -951,7 +951,7 @@ nm_l3_ipv4ll_new(NML3Cfg *l3cfg)
g_return_val_if_fail(NM_IS_L3CFG(l3cfg), NULL); g_return_val_if_fail(NM_IS_L3CFG(l3cfg), NULL);
self = g_slice_new(NML3IPv4LL); self = g_slice_new(NML3IPv4LL);
*self = (NML3IPv4LL){ *self = (NML3IPv4LL) {
.l3cfg = g_object_ref(l3cfg), .l3cfg = g_object_ref(l3cfg),
.ref_count = 1, .ref_count = 1,
.reg_lst_head = C_LIST_INIT(self->reg_lst_head), .reg_lst_head = C_LIST_INIT(self->reg_lst_head),

View file

@ -646,7 +646,7 @@ _nm_l3_ipv6ll_new(NML3Cfg *l3cfg,
NULL); NULL);
self = g_slice_new(NML3IPv6LL); self = g_slice_new(NML3IPv6LL);
*self = (NML3IPv6LL){ *self = (NML3IPv6LL) {
.l3cfg = g_object_ref(l3cfg), .l3cfg = g_object_ref(l3cfg),
.notify_fcn = notify_fcn, .notify_fcn = notify_fcn,
.user_data = user_data, .user_data = user_data,

View file

@ -676,7 +676,7 @@ _nm_l3cfg_emit_signal_notify_l3cd_changed(NML3Cfg *self,
NML3ConfigNotifyData notify_data; NML3ConfigNotifyData notify_data;
notify_data.notify_type = NM_L3_CONFIG_NOTIFY_TYPE_L3CD_CHANGED; notify_data.notify_type = NM_L3_CONFIG_NOTIFY_TYPE_L3CD_CHANGED;
notify_data.l3cd_changed = (typeof(notify_data.l3cd_changed)){ notify_data.l3cd_changed = (typeof(notify_data.l3cd_changed)) {
.l3cd_old = l3cd_old, .l3cd_old = l3cd_old,
.l3cd_new = l3cd_new, .l3cd_new = l3cd_new,
.commited = commited, .commited = commited,
@ -770,7 +770,7 @@ _nm_n_acd_data_probe_new(NML3Cfg *self, in_addr_t addr, guint32 timeout_msec, gp
if (r) if (r)
return NULL; return NULL;
n_acd_probe_config_set_ip(probe_config, (struct in_addr){addr}); n_acd_probe_config_set_ip(probe_config, (struct in_addr) {addr});
n_acd_probe_config_set_timeout(probe_config, timeout_msec); n_acd_probe_config_set_timeout(probe_config, timeout_msec);
r = n_acd_probe(self->priv.p->nacd, &probe, probe_config); r = n_acd_probe(self->priv.p->nacd, &probe, probe_config);
@ -855,7 +855,7 @@ _obj_state_data_new(const NMPObject *obj, const NMPObject *plobj)
ObjStateData *obj_state; ObjStateData *obj_state;
obj_state = g_slice_new(ObjStateData); obj_state = g_slice_new(ObjStateData);
*obj_state = (ObjStateData){ *obj_state = (ObjStateData) {
.obj = nmp_object_ref(obj), .obj = nmp_object_ref(obj),
.os_plobj = nmp_object_ref(plobj), .os_plobj = nmp_object_ref(plobj),
.os_was_in_platform = !!plobj, .os_was_in_platform = !!plobj,
@ -1581,7 +1581,7 @@ _nm_l3cfg_notify_platform_change_on_idle(NML3Cfg *self, guint32 obj_type_flags)
_load_link(self, FALSE); _load_link(self, FALSE);
notify_data.notify_type = NM_L3_CONFIG_NOTIFY_TYPE_PLATFORM_CHANGE_ON_IDLE; notify_data.notify_type = NM_L3_CONFIG_NOTIFY_TYPE_PLATFORM_CHANGE_ON_IDLE;
notify_data.platform_change_on_idle = (typeof(notify_data.platform_change_on_idle)){ notify_data.platform_change_on_idle = (typeof(notify_data.platform_change_on_idle)) {
.obj_type_flags = obj_type_flags, .obj_type_flags = obj_type_flags,
}; };
_nm_l3cfg_emit_signal_notify(self, &notify_data); _nm_l3cfg_emit_signal_notify(self, &notify_data);
@ -1625,7 +1625,7 @@ _nm_l3cfg_notify_platform_change(NML3Cfg *self,
} }
notify_data.notify_type = NM_L3_CONFIG_NOTIFY_TYPE_PLATFORM_CHANGE; notify_data.notify_type = NM_L3_CONFIG_NOTIFY_TYPE_PLATFORM_CHANGE;
notify_data.platform_change = (typeof(notify_data.platform_change)){ notify_data.platform_change = (typeof(notify_data.platform_change)) {
.obj = obj, .obj = obj,
.change_type = change_type, .change_type = change_type,
}; };
@ -2161,7 +2161,7 @@ _l3_acd_data_add(NML3Cfg *self,
} }
acd_data = g_slice_new(AcdData); acd_data = g_slice_new(AcdData);
*acd_data = (AcdData){ *acd_data = (AcdData) {
.info = .info =
{ {
.l3cfg = self, .l3cfg = self,
@ -2193,7 +2193,7 @@ _l3_acd_data_add(NML3Cfg *self,
} }
acd_track = acd_track =
(NML3AcdAddrTrackInfo *) &acd_data->info.track_infos[acd_data->info.n_track_infos++]; (NML3AcdAddrTrackInfo *) &acd_data->info.track_infos[acd_data->info.n_track_infos++];
*acd_track = (NML3AcdAddrTrackInfo){ *acd_track = (NML3AcdAddrTrackInfo) {
.l3cd = nm_l3_config_data_ref(l3cd), .l3cd = nm_l3_config_data_ref(l3cd),
.obj = nmp_object_ref(obj), .obj = nmp_object_ref(obj),
.tag = tag, .tag = tag,
@ -2348,7 +2348,7 @@ _nm_l3cfg_emit_signal_notify_acd_event(NML3Cfg *self, AcdData *acd_data)
nm_assert(acd_data->info.n_track_infos > 0); nm_assert(acd_data->info.n_track_infos > 0);
notify_data.notify_type = NM_L3_CONFIG_NOTIFY_TYPE_ACD_EVENT; notify_data.notify_type = NM_L3_CONFIG_NOTIFY_TYPE_ACD_EVENT;
notify_data.acd_event = (typeof(notify_data.acd_event)){ notify_data.acd_event = (typeof(notify_data.acd_event)) {
.info = acd_data->info, .info = acd_data->info,
}; };
@ -3601,7 +3601,7 @@ nm_l3cfg_add_config(NML3Cfg *self,
if (idx < 0) { if (idx < 0) {
l3_config_data = nm_g_array_append_new(self->priv.p->l3_config_datas, L3ConfigData); l3_config_data = nm_g_array_append_new(self->priv.p->l3_config_datas, L3ConfigData);
*l3_config_data = (L3ConfigData){ *l3_config_data = (L3ConfigData) {
.tag_confdata = tag, .tag_confdata = tag,
.l3cd = nm_l3_config_data_ref_and_seal(l3cd), .l3cd = nm_l3_config_data_ref_and_seal(l3cd),
.config_flags = config_flags, .config_flags = config_flags,
@ -4021,7 +4021,7 @@ _l3cfg_update_combined_config(NML3Cfg *self,
nm_platform_ip6_address_init_loopback(&ax.a6)); nm_platform_ip6_address_init_loopback(&ax.a6));
} }
rx.r4 = (NMPlatformIP4Route){ rx.r4 = (NMPlatformIP4Route) {
.ifindex = NM_LOOPBACK_IFINDEX, .ifindex = NM_LOOPBACK_IFINDEX,
.rt_source = NM_IP_CONFIG_SOURCE_KERNEL, .rt_source = NM_IP_CONFIG_SOURCE_KERNEL,
.network = NM_IPV4LO_ADDR1, .network = NM_IPV4LO_ADDR1,

View file

@ -1635,7 +1635,7 @@ _devcon_lookup_data(NMManager *self,
return NULL; return NULL;
data = g_slice_new(DevConData); data = g_slice_new(DevConData);
*data = (DevConData){ *data = (DevConData) {
.device = device, .device = device,
.sett_conn = sett_conn, .sett_conn = sett_conn,
.autoconnect = .autoconnect =
@ -3452,7 +3452,7 @@ get_existing_connection(NMManager *self, NMDevice *device, gboolean *out_generat
if (connection) { if (connection) {
NMConnection *con = nm_settings_connection_get_connection(connection_checked); NMConnection *con = nm_settings_connection_get_connection(connection_checked);
if (nm_utils_match_connection((NMConnection *[]){con, NULL}, if (nm_utils_match_connection((NMConnection *[]) {con, NULL},
connection, connection,
TRUE, TRUE,
nm_device_has_carrier(device), nm_device_has_carrier(device),
@ -5344,7 +5344,7 @@ find_ports(NMManager *manager,
} }
nm_assert(n_ports < n_all_connections); nm_assert(n_ports < n_all_connections);
ports[n_ports++] = (PortConnectionInfo){ ports[n_ports++] = (PortConnectionInfo) {
.connection = candidate, .connection = candidate,
.device = port_device, .device = port_device,
}; };
@ -8928,12 +8928,12 @@ nm_manager_init(NMManager *self)
priv->capabilities = g_array_new(FALSE, FALSE, sizeof(guint32)); priv->capabilities = g_array_new(FALSE, FALSE, sizeof(guint32));
priv->radio_states[NM_RFKILL_TYPE_WLAN] = (RfkillRadioState){ priv->radio_states[NM_RFKILL_TYPE_WLAN] = (RfkillRadioState) {
.user_enabled = TRUE, .user_enabled = TRUE,
.sw_enabled = FALSE, .sw_enabled = FALSE,
.hw_enabled = TRUE, .hw_enabled = TRUE,
}; };
priv->radio_states[NM_RFKILL_TYPE_WWAN] = (RfkillRadioState){ priv->radio_states[NM_RFKILL_TYPE_WWAN] = (RfkillRadioState) {
.user_enabled = TRUE, .user_enabled = TRUE,
.sw_enabled = FALSE, .sw_enabled = FALSE,
.hw_enabled = TRUE, .hw_enabled = TRUE,

View file

@ -274,7 +274,7 @@ _ecmp_track_init_merged_obj(EcmpTrackEcmpid *track_ecmpid, const NMPObject **out
const NMPlatformIP4Route *r = NMP_OBJECT_CAST_IP4_ROUTE(track_obj->obj); const NMPlatformIP4Route *r = NMP_OBJECT_CAST_IP4_ROUTE(track_obj->obj);
NMPlatformIP4RtNextHop *nh = (gpointer) &obj_new->_ip4_route.extra_nexthops[i - 1]; NMPlatformIP4RtNextHop *nh = (gpointer) &obj_new->_ip4_route.extra_nexthops[i - 1];
*nh = (NMPlatformIP4RtNextHop){ *nh = (NMPlatformIP4RtNextHop) {
.ifindex = r->ifindex, .ifindex = r->ifindex,
.gateway = r->gateway, .gateway = r->gateway,
.weight = r->weight, .weight = r->weight,
@ -620,7 +620,7 @@ nm_netns_shared_ip_reserve(NMNetns *self)
} }
handle = g_slice_new(NMNetnsSharedIPHandle); handle = g_slice_new(NMNetnsSharedIPHandle);
*handle = (NMNetnsSharedIPHandle){ *handle = (NMNetnsSharedIPHandle) {
.addr = addr, .addr = addr,
._ref_count = 1, ._ref_count = 1,
._self = self, ._self = self,
@ -717,7 +717,7 @@ nm_netns_ip_route_ecmp_register(NMNetns *self, NML3Cfg *l3cfg, const NMPObject *
track_ecmpid = g_hash_table_lookup(priv->ecmp_track_by_ecmpid, &obj); track_ecmpid = g_hash_table_lookup(priv->ecmp_track_by_ecmpid, &obj);
if (!track_ecmpid) { if (!track_ecmpid) {
track_ecmpid = g_slice_new(EcmpTrackEcmpid); track_ecmpid = g_slice_new(EcmpTrackEcmpid);
*track_ecmpid = (EcmpTrackEcmpid){ *track_ecmpid = (EcmpTrackEcmpid) {
.representative_obj = nmp_object_ref(obj), .representative_obj = nmp_object_ref(obj),
.merged_obj = NULL, .merged_obj = NULL,
.ecmpid_lst_head = C_LIST_INIT(track_ecmpid->ecmpid_lst_head), .ecmpid_lst_head = C_LIST_INIT(track_ecmpid->ecmpid_lst_head),
@ -728,7 +728,7 @@ nm_netns_ip_route_ecmp_register(NMNetns *self, NML3Cfg *l3cfg, const NMPObject *
track_ecmpid->needs_update = TRUE; track_ecmpid->needs_update = TRUE;
track_obj = g_slice_new(EcmpTrackObj); track_obj = g_slice_new(EcmpTrackObj);
*track_obj = (EcmpTrackObj){ *track_obj = (EcmpTrackObj) {
.obj = nmp_object_ref(obj), .obj = nmp_object_ref(obj),
.l3cfg = l3cfg, .l3cfg = l3cfg,
.parent_track_ecmpid = track_ecmpid, .parent_track_ecmpid = track_ecmpid,
@ -1031,7 +1031,7 @@ _watcher_handle_init(NMNetnsWatcherHandle *handle,
nm_assert(handle); nm_assert(handle);
nm_assert(NM_NETNS_WATCHER_TYPE_VALID(watcher_type)); nm_assert(NM_NETNS_WATCHER_TYPE_VALID(watcher_type));
*handle = (NMNetnsWatcherHandle){ *handle = (NMNetnsWatcherHandle) {
.watcher_type = watcher_type, .watcher_type = watcher_type,
.tag = tag, .tag = tag,
.watcher_tag_lst = C_LIST_INIT(handle->watcher_tag_lst), .watcher_tag_lst = C_LIST_INIT(handle->watcher_tag_lst),
@ -1194,7 +1194,7 @@ _watcher_register_handle(NMNetns *self, NMNetnsWatcherHandle *handle)
data = _watcher_ip_data_lookup_addr(self, &handle->watcher_data.ip_addr.addr); data = _watcher_ip_data_lookup_addr(self, &handle->watcher_data.ip_addr.addr);
if (!data) { if (!data) {
data = g_slice_new(WatcherDataIPAddr); data = g_slice_new(WatcherDataIPAddr);
*data = (WatcherDataIPAddr){ *data = (WatcherDataIPAddr) {
.addr = handle->watcher_data.ip_addr.addr, .addr = handle->watcher_data.ip_addr.addr,
.watcher_ip_addr_lst_head = C_LIST_INIT(data->watcher_ip_addr_lst_head), .watcher_ip_addr_lst_head = C_LIST_INIT(data->watcher_ip_addr_lst_head),
}; };
@ -1288,7 +1288,7 @@ nm_netns_watcher_add(NMNetns *self,
if (!watcher_by_tag) { if (!watcher_by_tag) {
watcher_by_tag = g_slice_new(WatcherByTag); watcher_by_tag = g_slice_new(WatcherByTag);
*watcher_by_tag = (WatcherByTag){ *watcher_by_tag = (WatcherByTag) {
.tag = tag, .tag = tag,
.watcher_by_tag_lst_head = C_LIST_INIT(watcher_by_tag->watcher_by_tag_lst_head), .watcher_by_tag_lst_head = C_LIST_INIT(watcher_by_tag->watcher_by_tag_lst_head),
}; };

View file

@ -365,7 +365,7 @@ nm_pacrunner_manager_add(NMPacrunnerManager *self, const char *iface, const NML3
priv = NM_PACRUNNER_MANAGER_GET_PRIVATE(self); priv = NM_PACRUNNER_MANAGER_GET_PRIVATE(self);
conf_id = g_slice_new(NMPacrunnerConfId); conf_id = g_slice_new(NMPacrunnerConfId);
*conf_id = (NMPacrunnerConfId){ *conf_id = (NMPacrunnerConfId) {
.log_id = ++priv->log_id_counter, .log_id = ++priv->log_id_counter,
.refcount = 1, .refcount = 1,
.self = g_object_ref(self), .self = g_object_ref(self),

View file

@ -824,7 +824,7 @@ build_device_hostname_infos(NMPolicy *self)
array = g_array_sized_new(FALSE, FALSE, sizeof(DeviceHostnameInfo), 4); array = g_array_sized_new(FALSE, FALSE, sizeof(DeviceHostnameInfo), 4);
info = nm_g_array_append_new(array, DeviceHostnameInfo); info = nm_g_array_append_new(array, DeviceHostnameInfo);
*info = (DeviceHostnameInfo){ *info = (DeviceHostnameInfo) {
.device = device, .device = device,
.priority = device_get_hostname_priority(device), .priority = device_get_hostname_priority(device),
.from_dhcp = .from_dhcp =

View file

@ -146,7 +146,7 @@ killswitch_new(struct udev_device *device, NMRfkillType rtype)
platform = TRUE; platform = TRUE;
ks = g_slice_new(Killswitch); ks = g_slice_new(Killswitch);
*ks = (Killswitch){ *ks = (Killswitch) {
.name = g_strdup(udev_device_get_sysname(device)), .name = g_strdup(udev_device_get_sysname(device)),
.seqnum = udev_device_get_seqnum(device), .seqnum = udev_device_get_seqnum(device),
.path = g_strdup(udev_device_get_syspath(device)), .path = g_strdup(udev_device_get_syspath(device)),

View file

@ -1000,7 +1000,7 @@ ip4_address_add(NMPlatform *platform,
{ {
NMPlatformIP4Address address; NMPlatformIP4Address address;
address = (NMPlatformIP4Address){ address = (NMPlatformIP4Address) {
.addr_source = NM_IP_CONFIG_SOURCE_KERNEL, .addr_source = NM_IP_CONFIG_SOURCE_KERNEL,
.ifindex = ifindex, .ifindex = ifindex,
.address = addr, .address = addr,

View file

@ -224,7 +224,7 @@ _nmtstp_platform_ip_addresses_assert(const char *filename,
else else
g_error("%s:%d: invalid IP address in argument: %s", filename, lineno, addrstr); g_error("%s:%d: invalid IP address in argument: %s", filename, lineno, addrstr);
addrs_bin[i] = (IPAddressesAssertData){ addrs_bin[i] = (IPAddressesAssertData) {
.addr_family = addr_family, .addr_family = addr_family,
.addr = a, .addr = a,
.found = FALSE, .found = FALSE,
@ -1117,7 +1117,7 @@ again:
link = nmtstp_link_gre_add(NULL, link = nmtstp_link_gre_add(NULL,
EX, EX,
test_ifname, test_ifname,
&((const NMPlatformLnkGre){ &((const NMPlatformLnkGre) {
.local = nmtst_inet4_from_string("192.168.233.204"), .local = nmtst_inet4_from_string("192.168.233.204"),
.remote = nmtst_inet4_from_string("172.168.10.25"), .remote = nmtst_inet4_from_string("172.168.10.25"),
.parent_ifindex = 0, .parent_ifindex = 0,
@ -1129,7 +1129,7 @@ again:
link = nmtstp_link_ipip_add(NULL, link = nmtstp_link_ipip_add(NULL,
EX, EX,
test_ifname, test_ifname,
&((const NMPlatformLnkIpIp){ &((const NMPlatformLnkIpIp) {
.local = nmtst_inet4_from_string("1.2.3.4"), .local = nmtst_inet4_from_string("1.2.3.4"),
.remote = nmtst_inet4_from_string("5.6.7.8"), .remote = nmtst_inet4_from_string("5.6.7.8"),
.parent_ifindex = 0, .parent_ifindex = 0,
@ -1140,7 +1140,7 @@ again:
link = nmtstp_link_ip6tnl_add(NULL, link = nmtstp_link_ip6tnl_add(NULL,
EX, EX,
test_ifname, test_ifname,
&((const NMPlatformLnkIp6Tnl){ &((const NMPlatformLnkIp6Tnl) {
.local = nmtst_inet6_from_string("fd01::15"), .local = nmtst_inet6_from_string("fd01::15"),
.remote = nmtst_inet6_from_string("fd01::16"), .remote = nmtst_inet6_from_string("fd01::16"),
.tclass = 20, .tclass = 20,
@ -1152,7 +1152,7 @@ again:
link = nmtstp_link_ip6gre_add(NULL, link = nmtstp_link_ip6gre_add(NULL,
EX, EX,
test_ifname, test_ifname,
&((const NMPlatformLnkIp6Tnl){ &((const NMPlatformLnkIp6Tnl) {
.local = nmtst_inet6_from_string("fd01::42"), .local = nmtst_inet6_from_string("fd01::42"),
.remote = nmtst_inet6_from_string("fd01::aaaa"), .remote = nmtst_inet6_from_string("fd01::aaaa"),
.tclass = 21, .tclass = 21,
@ -1163,7 +1163,7 @@ again:
link = nmtstp_link_sit_add(NULL, link = nmtstp_link_sit_add(NULL,
EX, EX,
test_ifname, test_ifname,
&((const NMPlatformLnkSit){ &((const NMPlatformLnkSit) {
.local = nmtst_inet4_from_string("192.168.200.1"), .local = nmtst_inet4_from_string("192.168.200.1"),
.remote = nmtst_inet4_from_string("172.25.100.14"), .remote = nmtst_inet4_from_string("172.25.100.14"),
.ttl = 0, .ttl = 0,
@ -1174,7 +1174,7 @@ again:
link = nmtstp_link_vti_add(NULL, link = nmtstp_link_vti_add(NULL,
EX, EX,
test_ifname, test_ifname,
&((const NMPlatformLnkVti){ &((const NMPlatformLnkVti) {
.local = nmtst_inet4_from_string("192.168.212.204"), .local = nmtst_inet4_from_string("192.168.212.204"),
.remote = nmtst_inet4_from_string("172.168.11.25"), .remote = nmtst_inet4_from_string("172.168.11.25"),
.ikey = 12, .ikey = 12,
@ -1184,7 +1184,7 @@ again:
link = nmtstp_link_vti6_add(NULL, link = nmtstp_link_vti6_add(NULL,
EX, EX,
test_ifname, test_ifname,
&((const NMPlatformLnkVti6){ &((const NMPlatformLnkVti6) {
.local = nmtst_inet6_from_string("fd01::1"), .local = nmtst_inet6_from_string("fd01::1"),
.remote = nmtst_inet6_from_string("fd02::2"), .remote = nmtst_inet6_from_string("fd02::2"),
.ikey = 13, .ikey = 13,
@ -1891,11 +1891,11 @@ nmtstp_ip4_address_add(NMPlatform *platform,
external_command, external_command,
TRUE, TRUE,
ifindex, ifindex,
&((NMIPAddr){ &((NMIPAddr) {
.addr4 = address, .addr4 = address,
}), }),
plen, plen,
&((NMIPAddr){ &((NMIPAddr) {
.addr4 = peer_address, .addr4 = peer_address,
}), }),
lifetime, lifetime,
@ -3592,7 +3592,7 @@ nmtstp_acd_defender_new(int ifindex, in_addr_t ip_addr, const NMEtherAddr *mac_a
g_assert_cmpint(r, ==, 0); g_assert_cmpint(r, ==, 0);
g_assert(probe_config); g_assert(probe_config);
n_acd_probe_config_set_ip(probe_config, (struct in_addr){ip_addr}); n_acd_probe_config_set_ip(probe_config, (struct in_addr) {ip_addr});
n_acd_probe_config_set_timeout(probe_config, 0); n_acd_probe_config_set_timeout(probe_config, 0);
r = n_acd_probe(nacd, &probe, probe_config); r = n_acd_probe(nacd, &probe, probe_config);
@ -3600,7 +3600,7 @@ nmtstp_acd_defender_new(int ifindex, in_addr_t ip_addr, const NMEtherAddr *mac_a
g_assert(probe); g_assert(probe);
defender = g_slice_new(NMTstpAcdDefender); defender = g_slice_new(NMTstpAcdDefender);
*defender = (NMTstpAcdDefender){ *defender = (NMTstpAcdDefender) {
.ifindex = ifindex, .ifindex = ifindex,
.ip_addr = ip_addr, .ip_addr = ip_addr,
.nacd = g_steal_pointer(&nacd), .nacd = g_steal_pointer(&nacd),

View file

@ -372,21 +372,21 @@ void _nmtstp_platform_ip_addresses_assert(const char *filename,
guint addrs_len, guint addrs_len,
const char *const *addrs); const char *const *addrs);
#define nmtstp_platform_ip_addresses_assert(self, \ #define nmtstp_platform_ip_addresses_assert(self, \
ifindex, \ ifindex, \
force_exact_4, \ force_exact_4, \
force_exact_6, \ force_exact_6, \
ignore_ll6, \ ignore_ll6, \
...) \ ...) \
_nmtstp_platform_ip_addresses_assert(__FILE__, \ _nmtstp_platform_ip_addresses_assert(__FILE__, \
__LINE__, \ __LINE__, \
(self), \ (self), \
(ifindex), \ (ifindex), \
(force_exact_4), \ (force_exact_4), \
(force_exact_6), \ (force_exact_6), \
(ignore_ll6), \ (ignore_ll6), \
NM_NARG(__VA_ARGS__), \ NM_NARG(__VA_ARGS__), \
((const char *const[]){"dummy", ##__VA_ARGS__, NULL}) \ ((const char *const[]) {"dummy", ##__VA_ARGS__, NULL}) \
+ 1) + 1)
/*****************************************************************************/ /*****************************************************************************/
@ -540,7 +540,7 @@ gboolean nmtstp_ensure_module(const char *module_name);
/*****************************************************************************/ /*****************************************************************************/
#define nmtst_object_new_mptcp_addr(...) \ #define nmtst_object_new_mptcp_addr(...) \
nmp_object_new(NMP_OBJECT_TYPE_MPTCP_ADDR, &((const NMPlatformMptcpAddr){__VA_ARGS__})) nmp_object_new(NMP_OBJECT_TYPE_MPTCP_ADDR, &((const NMPlatformMptcpAddr) {__VA_ARGS__}))
/*****************************************************************************/ /*****************************************************************************/

View file

@ -174,7 +174,7 @@ software_add(NMLinkType link_type, const char *name)
return NMTST_NM_ERR_SUCCESS(nm_platform_link_vlan_add(NM_PLATFORM_GET, return NMTST_NM_ERR_SUCCESS(nm_platform_link_vlan_add(NM_PLATFORM_GET,
name, name,
parent_ifindex, parent_ifindex,
&((NMPlatformLnkVlan){ &((NMPlatformLnkVlan) {
.id = VLAN_ID, .id = VLAN_ID,
.protocol = ETH_P_8021Q, .protocol = ETH_P_8021Q,
}), }),
@ -289,7 +289,7 @@ test_port(int controller, int port_type, SignalData *controller_changed)
prio_supported = (lnk->mode == 1); prio_supported = (lnk->mode == 1);
prio_has = nmtst_get_rand_bool() && prio_supported; prio_has = nmtst_get_rand_bool() && prio_supported;
bond_port = (NMPlatformLinkBondPort){ bond_port = (NMPlatformLinkBondPort) {
.queue_id = 5, .queue_id = 5,
.prio_has = prio_has, .prio_has = prio_has,
.prio = prio_has ? 6 : 0, .prio = prio_has ? 6 : 0,
@ -315,7 +315,7 @@ test_port(int controller, int port_type, SignalData *controller_changed)
lnk = nm_platform_link_get_lnk_bridge(NM_PLATFORM_GET, controller, NULL); lnk = nm_platform_link_get_lnk_bridge(NM_PLATFORM_GET, controller, NULL);
g_assert(lnk); g_assert(lnk);
bridge_port = (NMPlatformLinkBridgePort){ bridge_port = (NMPlatformLinkBridgePort) {
.path_cost = 100, .path_cost = 100,
.priority = 614, .priority = 614,
.hairpin = 0, .hairpin = 0,
@ -724,7 +724,7 @@ test_bridge_addr(void)
g_assert_cmpint(plink->l_address.len, ==, sizeof(addr)); g_assert_cmpint(plink->l_address.len, ==, sizeof(addr));
g_assert(!memcmp(plink->l_address.data, addr, sizeof(addr))); g_assert(!memcmp(plink->l_address.data, addr, sizeof(addr)));
info_data = (const NMPlatformLinkSetBridgeInfoData){ info_data = (const NMPlatformLinkSetBridgeInfoData) {
.vlan_default_pvid_val = nmtst_rand_select(0, 5, 42, 1048), .vlan_default_pvid_val = nmtst_rand_select(0, 5, 42, 1048),
.vlan_default_pvid_has = nmtst_get_rand_bool(), .vlan_default_pvid_has = nmtst_get_rand_bool(),
.vlan_filtering_val = nmtst_get_rand_bool(), .vlan_filtering_val = nmtst_get_rand_bool(),
@ -743,7 +743,7 @@ test_bridge_addr(void)
"/sys/class/net/" DEVICE_NAME "/bridge/vlan_filtering", "/sys/class/net/" DEVICE_NAME "/bridge/vlan_filtering",
info_data.vlan_filtering_val && info_data.vlan_filtering_has ? "1" : "0"); info_data.vlan_filtering_val && info_data.vlan_filtering_has ? "1" : "0");
info_data = (const NMPlatformLinkSetBridgeInfoData){ info_data = (const NMPlatformLinkSetBridgeInfoData) {
.vlan_default_pvid_val = 55, .vlan_default_pvid_val = 55,
.vlan_default_pvid_has = TRUE, .vlan_default_pvid_has = TRUE,
.vlan_filtering_val = !info_data.vlan_filtering_val, .vlan_filtering_val = !info_data.vlan_filtering_val,
@ -1275,7 +1275,7 @@ _test_wireguard_change(NMPlatform *platform, int ifindex, int test_mode)
peers = g_array_new(FALSE, TRUE, sizeof(NMPWireGuardPeer)); peers = g_array_new(FALSE, TRUE, sizeof(NMPWireGuardPeer));
lnk_wireguard = (NMPlatformLnkWireGuard){ lnk_wireguard = (NMPlatformLnkWireGuard) {
.listen_port = 50754, .listen_port = 50754,
.fwmark = 0x1102, .fwmark = 0x1102,
}; };
@ -1295,7 +1295,7 @@ _test_wireguard_change(NMPlatform *platform, int ifindex, int test_mode)
NMPWireGuardAllowedIP *allowed_ips; NMPWireGuardAllowedIP *allowed_ips;
if ((i % 2) == 1) { if ((i % 2) == 1) {
endpoint = (NMSockAddrUnion){ endpoint = (NMSockAddrUnion) {
.in = .in =
{ {
.sin_family = AF_INET, .sin_family = AF_INET,
@ -1305,7 +1305,7 @@ _test_wireguard_change(NMPlatform *platform, int ifindex, int test_mode)
}, },
}; };
} else { } else {
endpoint = (NMSockAddrUnion){ endpoint = (NMSockAddrUnion) {
.in6 = .in6 =
{ {
.sin6_family = AF_INET6, .sin6_family = AF_INET6,
@ -1337,7 +1337,7 @@ _test_wireguard_change(NMPlatform *platform, int ifindex, int test_mode)
} }
} }
peer = (NMPWireGuardPeer){ peer = (NMPWireGuardPeer) {
.persistent_keepalive_interval = 60 + i, .persistent_keepalive_interval = 60 + i,
.endpoint = endpoint, .endpoint = endpoint,
.allowed_ips = n_allowed_ips > 0 ? allowed_ips : NULL, .allowed_ips = n_allowed_ips > 0 ? allowed_ips : NULL,
@ -1803,7 +1803,7 @@ test_software_detect(gconstpointer user_data)
switch (test_data->test_mode) { switch (test_data->test_mode) {
case 0: case 0:
lnk_tun = (NMPlatformLnkTun){ lnk_tun = (NMPlatformLnkTun) {
.type = nmtst_get_rand_bool() ? IFF_TUN : IFF_TAP, .type = nmtst_get_rand_bool() ? IFF_TUN : IFF_TAP,
.owner = owner_valid ? getuid() : 0, .owner = owner_valid ? getuid() : 0,
.owner_valid = owner_valid, .owner_valid = owner_valid,
@ -2705,7 +2705,7 @@ test_link_set_properties(void)
NMPlatformLinkChangeFlags flags; NMPlatformLinkChangeFlags flags;
int ifindex; int ifindex;
props = (NMPlatformLinkProps){ props = (NMPlatformLinkProps) {
.tx_queue_length = 599, .tx_queue_length = 599,
.gso_max_size = 10001, .gso_max_size = 10001,
.gso_max_segments = 512, .gso_max_segments = 512,
@ -3817,7 +3817,7 @@ test_sysctl_set_async(void)
cancellable = g_cancellable_new(); cancellable = g_cancellable_new();
proc_writable = access(PATH, W_OK) == 0; proc_writable = access(PATH, W_OK) == 0;
data = (SetAsyncData){ data = (SetAsyncData) {
.loop = loop, .loop = loop,
.path = PATH, .path = PATH,
.expected_success = proc_writable, .expected_success = proc_writable,
@ -3826,7 +3826,7 @@ test_sysctl_set_async(void)
nm_platform_sysctl_set_async(PL, nm_platform_sysctl_set_async(PL,
NMP_SYSCTL_PATHID_ABSOLUTE(PATH), NMP_SYSCTL_PATHID_ABSOLUTE(PATH),
(const char *[]){"2", NULL}, (const char *[]) {"2", NULL},
sysctl_set_async_cb, sysctl_set_async_cb,
&data, &data,
cancellable); cancellable);
@ -3834,7 +3834,7 @@ test_sysctl_set_async(void)
if (!nmtst_main_loop_run(loop, 1000)) if (!nmtst_main_loop_run(loop, 1000))
g_assert_not_reached(); g_assert_not_reached();
data = (SetAsyncData){ data = (SetAsyncData) {
.loop = loop, .loop = loop,
.path = PATH, .path = PATH,
.expected_success = proc_writable, .expected_success = proc_writable,
@ -3843,7 +3843,7 @@ test_sysctl_set_async(void)
nm_platform_sysctl_set_async(PL, nm_platform_sysctl_set_async(PL,
NMP_SYSCTL_PATHID_ABSOLUTE(PATH), NMP_SYSCTL_PATHID_ABSOLUTE(PATH),
(const char *[]){"2", "0", "1", "0", "1", NULL}, (const char *[]) {"2", "0", "1", "0", "1", NULL},
sysctl_set_async_cb, sysctl_set_async_cb,
&data, &data,
cancellable); cancellable);
@ -3870,7 +3870,7 @@ test_sysctl_set_async_fail(void)
loop = g_main_loop_new(NULL, FALSE); loop = g_main_loop_new(NULL, FALSE);
cancellable = g_cancellable_new(); cancellable = g_cancellable_new();
data = (SetAsyncData){ data = (SetAsyncData) {
.loop = loop, .loop = loop,
.path = PATH, .path = PATH,
.expected_success = FALSE, .expected_success = FALSE,
@ -3878,7 +3878,7 @@ test_sysctl_set_async_fail(void)
nm_platform_sysctl_set_async(PL, nm_platform_sysctl_set_async(PL,
NMP_SYSCTL_PATHID_ABSOLUTE(PATH), NMP_SYSCTL_PATHID_ABSOLUTE(PATH),
(const char *[]){"2", NULL}, (const char *[]) {"2", NULL},
sysctl_set_async_cb, sysctl_set_async_cb,
&data, &data,
cancellable); cancellable);

View file

@ -638,7 +638,7 @@ test_ip4_route_options(gconstpointer test_data)
switch (TEST_IDX) { switch (TEST_IDX) {
case 1: case 1:
rts_add[rts_n++] = ((NMPlatformIP4Route){ rts_add[rts_n++] = ((NMPlatformIP4Route) {
.ifindex = IFINDEX, .ifindex = IFINDEX,
.rt_source = NM_IP_CONFIG_SOURCE_USER, .rt_source = NM_IP_CONFIG_SOURCE_USER,
.network = nmtst_inet4_from_string("172.16.1.0"), .network = nmtst_inet4_from_string("172.16.1.0"),
@ -658,7 +658,7 @@ test_ip4_route_options(gconstpointer test_data)
}); });
break; break;
case 2: case 2:
addr[addr_n++] = ((NMPlatformIP4Address){ addr[addr_n++] = ((NMPlatformIP4Address) {
.ifindex = IFINDEX, .ifindex = IFINDEX,
.address = nmtst_inet4_from_string("172.16.1.5"), .address = nmtst_inet4_from_string("172.16.1.5"),
.peer_address = nmtst_inet4_from_string("172.16.1.5"), .peer_address = nmtst_inet4_from_string("172.16.1.5"),
@ -667,7 +667,7 @@ test_ip4_route_options(gconstpointer test_data)
.preferred = NM_PLATFORM_LIFETIME_PERMANENT, .preferred = NM_PLATFORM_LIFETIME_PERMANENT,
.n_ifa_flags = 0, .n_ifa_flags = 0,
}); });
rts_add[rts_n++] = ((NMPlatformIP4Route){ rts_add[rts_n++] = ((NMPlatformIP4Route) {
.ifindex = IFINDEX, .ifindex = IFINDEX,
.rt_source = NM_IP_CONFIG_SOURCE_USER, .rt_source = NM_IP_CONFIG_SOURCE_USER,
.network = nmtst_inet4_from_string("172.17.1.0"), .network = nmtst_inet4_from_string("172.17.1.0"),
@ -676,7 +676,7 @@ test_ip4_route_options(gconstpointer test_data)
.metric = 20, .metric = 20,
.n_nexthops = 1, .n_nexthops = 1,
}); });
rts_add[rts_n++] = ((NMPlatformIP4Route){ rts_add[rts_n++] = ((NMPlatformIP4Route) {
.ifindex = IFINDEX, .ifindex = IFINDEX,
.rt_source = NM_IP_CONFIG_SOURCE_USER, .rt_source = NM_IP_CONFIG_SOURCE_USER,
.network = nmtst_inet4_from_string("172.19.1.0"), .network = nmtst_inet4_from_string("172.19.1.0"),
@ -801,7 +801,7 @@ test_ip6_route_options(gconstpointer test_data)
switch (TEST_IDX) { switch (TEST_IDX) {
case 1: case 1:
rts_add[rts_n++] = ((NMPlatformIP6Route){ rts_add[rts_n++] = ((NMPlatformIP6Route) {
.ifindex = IFINDEX, .ifindex = IFINDEX,
.rt_source = NM_IP_CONFIG_SOURCE_USER, .rt_source = NM_IP_CONFIG_SOURCE_USER,
.network = nmtst_inet6_from_string("2001:db8:a:b:0:0:0:0"), .network = nmtst_inet6_from_string("2001:db8:a:b:0:0:0:0"),
@ -817,7 +817,7 @@ test_ip6_route_options(gconstpointer test_data)
}); });
break; break;
case 2: case 2:
addr[addr_n++] = ((NMPlatformIP6Address){ addr[addr_n++] = ((NMPlatformIP6Address) {
.ifindex = IFINDEX, .ifindex = IFINDEX,
.address = nmtst_inet6_from_string("2000::2"), .address = nmtst_inet6_from_string("2000::2"),
.plen = 128, .plen = 128,
@ -826,7 +826,7 @@ test_ip6_route_options(gconstpointer test_data)
.preferred = NM_PLATFORM_LIFETIME_PERMANENT, .preferred = NM_PLATFORM_LIFETIME_PERMANENT,
.n_ifa_flags = 0, .n_ifa_flags = 0,
}); });
rts_add[rts_n++] = ((NMPlatformIP6Route){ rts_add[rts_n++] = ((NMPlatformIP6Route) {
.ifindex = IFINDEX, .ifindex = IFINDEX,
.rt_source = NM_IP_CONFIG_SOURCE_USER, .rt_source = NM_IP_CONFIG_SOURCE_USER,
.network = nmtst_inet6_from_string("1010::1"), .network = nmtst_inet6_from_string("1010::1"),
@ -837,7 +837,7 @@ test_ip6_route_options(gconstpointer test_data)
}); });
break; break;
case 3: case 3:
addr[addr_n++] = ((NMPlatformIP6Address){ addr[addr_n++] = ((NMPlatformIP6Address) {
.ifindex = IFINDEX, .ifindex = IFINDEX,
.address = nmtst_inet6_from_string("2001:db8:8086::5"), .address = nmtst_inet6_from_string("2001:db8:8086::5"),
.plen = 128, .plen = 128,
@ -846,7 +846,7 @@ test_ip6_route_options(gconstpointer test_data)
.preferred = NM_PLATFORM_LIFETIME_PERMANENT, .preferred = NM_PLATFORM_LIFETIME_PERMANENT,
.n_ifa_flags = 0, .n_ifa_flags = 0,
}); });
rts_add[rts_n++] = ((NMPlatformIP6Route){ rts_add[rts_n++] = ((NMPlatformIP6Route) {
.ifindex = IFINDEX, .ifindex = IFINDEX,
.rt_source = nmp_utils_ip_config_source_round_trip_rtprot(NM_IP_CONFIG_SOURCE_USER), .rt_source = nmp_utils_ip_config_source_round_trip_rtprot(NM_IP_CONFIG_SOURCE_USER),
.network = nmtst_inet6_from_string("2001:db8:8086::"), .network = nmtst_inet6_from_string("2001:db8:8086::"),
@ -854,7 +854,7 @@ test_ip6_route_options(gconstpointer test_data)
.metric = 10021, .metric = 10021,
.mss = 0, .mss = 0,
}); });
rts_add[rts_n++] = ((NMPlatformIP6Route){ rts_add[rts_n++] = ((NMPlatformIP6Route) {
.ifindex = IFINDEX, .ifindex = IFINDEX,
.rt_source = nmp_utils_ip_config_source_round_trip_rtprot(NM_IP_CONFIG_SOURCE_USER), .rt_source = nmp_utils_ip_config_source_round_trip_rtprot(NM_IP_CONFIG_SOURCE_USER),
.network = nmtst_inet6_from_string("2001:db8:abad:c0de::"), .network = nmtst_inet6_from_string("2001:db8:abad:c0de::"),
@ -1595,7 +1595,7 @@ test_rule(gconstpointer test_data)
#define RR(...) \ #define RR(...) \
nmp_object_new(NMP_OBJECT_TYPE_ROUTING_RULE, \ nmp_object_new(NMP_OBJECT_TYPE_ROUTING_RULE, \
(const NMPlatformObject *) &((NMPlatformRoutingRule){__VA_ARGS__})) (const NMPlatformObject *) &((NMPlatformRoutingRule) {__VA_ARGS__}))
objs = g_ptr_array_new_with_free_func((GDestroyNotify) nmp_object_unref); objs = g_ptr_array_new_with_free_func((GDestroyNotify) nmp_object_unref);
@ -1926,11 +1926,11 @@ test_blackhole(gconstpointer test_data)
rtn_type = nmtst_rand_select(RTN_BLACKHOLE, RTN_UNREACHABLE, RTN_PROHIBIT, RTN_THROW); rtn_type = nmtst_rand_select(RTN_BLACKHOLE, RTN_UNREACHABLE, RTN_PROHIBIT, RTN_THROW);
if (IS_IPv4) { if (IS_IPv4) {
rr.r4 = (const NMPlatformIP4Route){ rr.r4 = (const NMPlatformIP4Route) {
.type_coerced = nm_platform_route_type_coerce(rtn_type), .type_coerced = nm_platform_route_type_coerce(rtn_type),
}; };
} else { } else {
rr.r6 = (const NMPlatformIP6Route){ rr.r6 = (const NMPlatformIP6Route) {
.type_coerced = nm_platform_route_type_coerce(rtn_type), .type_coerced = nm_platform_route_type_coerce(rtn_type),
.metric = 1000, .metric = 1000,
}; };
@ -1987,7 +1987,7 @@ again:
if (p == -1) { if (p == -1) {
static gsize lock; static gsize lock;
const NMPlatformMptcpAddr mptcp_addr = (NMPlatformMptcpAddr){ const NMPlatformMptcpAddr mptcp_addr = (NMPlatformMptcpAddr) {
.id = 1, .id = 1,
.addr_family = AF_INET, .addr_family = AF_INET,
.addr.addr4 = nmtst_inet4_from_string("1.2.3.4"), .addr.addr4 = nmtst_inet4_from_string("1.2.3.4"),

View file

@ -16,7 +16,7 @@ qdisc_new(int ifindex, const char *kind, guint32 parent)
NMPObject *obj; NMPObject *obj;
obj = nmp_object_new(NMP_OBJECT_TYPE_QDISC, NULL); obj = nmp_object_new(NMP_OBJECT_TYPE_QDISC, NULL);
obj->qdisc = (NMPlatformQdisc){ obj->qdisc = (NMPlatformQdisc) {
.ifindex = ifindex, .ifindex = ifindex,
.kind = kind, .kind = kind,
.parent = parent, .parent = parent,

View file

@ -547,7 +547,7 @@ impl_ppp_manager_set_ip4_config(NMDBusObject *obj,
nm_l3_config_data_set_mtu(l3cd, mtu); nm_l3_config_data_set_mtu(l3cd, mtu);
address = (NMPlatformIP4Address){ address = (NMPlatformIP4Address) {
.plen = 32, .plen = 32,
}; };
@ -662,7 +662,7 @@ impl_ppp_manager_set_ip6_config(NMDBusObject *obj,
nm_l3_config_data_set_mtu(l3cd, mtu); nm_l3_config_data_set_mtu(l3cd, mtu);
address = (NMPlatformIP6Address){ address = (NMPlatformIP6Address) {
.plen = 64, .plen = 64,
.addr_source = NM_IP_CONFIG_SOURCE_PPP, .addr_source = NM_IP_CONFIG_SOURCE_PPP,
}; };

View file

@ -208,11 +208,11 @@ _set_state_failed(NMPppMgr *self, NMPppMgrState state, NMPppMgrState *out_old_st
self->ifindex = 0; self->ifindex = 0;
nm_clear_l3cd(&self->ip_data_4.l3cd); nm_clear_l3cd(&self->ip_data_4.l3cd);
nm_clear_l3cd(&self->ip_data_6.l3cd); nm_clear_l3cd(&self->ip_data_6.l3cd);
self->ip_data_4 = (NMPppMgrIPData){ self->ip_data_4 = (NMPppMgrIPData) {
.ip_received = FALSE, .ip_received = FALSE,
.ip_enabled = FALSE, .ip_enabled = FALSE,
}; };
self->ip_data_6 = (NMPppMgrIPData){ self->ip_data_6 = (NMPppMgrIPData) {
.ip_received = FALSE, .ip_received = FALSE,
.ip_enabled = FALSE, .ip_enabled = FALSE,
}; };
@ -563,7 +563,7 @@ nm_ppp_mgr_start(const NMPppMgrConfig *config, GError **error)
self = g_slice_new(NMPppMgr); self = g_slice_new(NMPppMgr);
*self = (NMPppMgr){ *self = (NMPppMgr) {
.config = *config, .config = *config,
.ppp_manager = ppp_manager, .ppp_manager = ppp_manager,
.idle_start = nm_g_idle_add_source(_idle_start_cb, self), .idle_start = nm_g_idle_add_source(_idle_start_cb, self),

View file

@ -164,14 +164,14 @@ nm_pppd_compat_get_ipcp_options(NMPppdCompatIPCPOptions *out_got, NMPppdCompatIP
nm_assert(out_got); nm_assert(out_got);
nm_assert(out_his); nm_assert(out_his);
*out_got = (NMPppdCompatIPCPOptions){ *out_got = (NMPppdCompatIPCPOptions) {
.ouraddr = got->ouraddr, .ouraddr = got->ouraddr,
.hisaddr = got->hisaddr, .hisaddr = got->hisaddr,
.dnsaddr = {got->dnsaddr[0], got->dnsaddr[1]}, .dnsaddr = {got->dnsaddr[0], got->dnsaddr[1]},
.winsaddr = {got->winsaddr[0], got->winsaddr[1]}, .winsaddr = {got->winsaddr[0], got->winsaddr[1]},
}; };
*out_his = (NMPppdCompatIPCPOptions){ *out_his = (NMPppdCompatIPCPOptions) {
.ouraddr = his->ouraddr, .ouraddr = his->ouraddr,
.hisaddr = his->hisaddr, .hisaddr = his->hisaddr,
.dnsaddr = {his->dnsaddr[0], his->dnsaddr[1]}, .dnsaddr = {his->dnsaddr[0], his->dnsaddr[1]},
@ -191,11 +191,11 @@ nm_pppd_compat_get_ipv6cp_options(NMPppdCompatIPV6CPOptions *out_got,
nm_assert(out_got); nm_assert(out_got);
nm_assert(out_his); nm_assert(out_his);
*out_got = (NMPppdCompatIPV6CPOptions){}; *out_got = (NMPppdCompatIPV6CPOptions) {};
memcpy(&out_got->ourid, &got->ourid, sizeof(guint64)); memcpy(&out_got->ourid, &got->ourid, sizeof(guint64));
memcpy(&out_got->hisid, &got->hisid, sizeof(guint64)); memcpy(&out_got->hisid, &got->hisid, sizeof(guint64));
*out_his = (NMPppdCompatIPV6CPOptions){}; *out_his = (NMPppdCompatIPV6CPOptions) {};
memcpy(&out_his->ourid, &his->ourid, sizeof(guint64)); memcpy(&out_his->ourid, &his->ourid, sizeof(guint64));
memcpy(&out_his->hisid, &his->hisid, sizeof(guint64)); memcpy(&out_his->hisid, &his->hisid, sizeof(guint64));
} }

View file

@ -142,7 +142,7 @@ _call_id_new(NMSecretAgent *self,
NMSecretAgentCallId *call_id; NMSecretAgentCallId *call_id;
call_id = g_slice_new(NMSecretAgentCallId); call_id = g_slice_new(NMSecretAgentCallId);
*call_id = (NMSecretAgentCallId){ *call_id = (NMSecretAgentCallId) {
.self = g_object_ref(self), .self = g_object_ref(self),
.path = g_strdup(path), .path = g_strdup(path),
.setting_name = g_strdup(setting_name), .setting_name = g_strdup(setting_name),

View file

@ -1721,7 +1721,7 @@ settings_connection_update(NMSettingsConnection *self,
goto error; goto error;
info = g_slice_new(UpdateInfo); info = g_slice_new(UpdateInfo);
*info = (UpdateInfo){ *info = (UpdateInfo) {
.is_update2 = is_update2, .is_update2 = is_update2,
.context = context, .context = context,
.agent_mgr = g_object_ref(priv->agent_mgr), .agent_mgr = g_object_ref(priv->agent_mgr),

View file

@ -110,7 +110,7 @@ nm_settings_plugin_create_connection_load_entries(const char *const *filenames,
entries = g_new(NMSettingsPluginConnectionLoadEntry, len); entries = g_new(NMSettingsPluginConnectionLoadEntry, len);
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
entries[i] = (NMSettingsPluginConnectionLoadEntry){ entries[i] = (NMSettingsPluginConnectionLoadEntry) {
.filename = filenames[i], .filename = filenames[i],
.error = NULL, .error = NULL,
.handled = FALSE, .handled = FALSE,

View file

@ -37,14 +37,14 @@ nm_sett_util_stat_mtime(const char *filename, gboolean do_lstat, struct timespec
} }
if (gettimeofday(&now_tv, NULL) == 0) { if (gettimeofday(&now_tv, NULL) == 0) {
*out_val = (struct timespec){ *out_val = (struct timespec) {
.tv_sec = now_tv.tv_sec, .tv_sec = now_tv.tv_sec,
.tv_nsec = now_tv.tv_usec * 1000u, .tv_nsec = now_tv.tv_usec * 1000u,
}; };
return out_val; return out_val;
} }
*out_val = (struct timespec){}; *out_val = (struct timespec) {};
return out_val; return out_val;
} }

View file

@ -81,7 +81,7 @@ typedef struct {
} NMSettUtilAllowFilenameData; } NMSettUtilAllowFilenameData;
#define NM_SETT_UTIL_ALLOW_FILENAME_DATA(_storages, _allowed_filename) \ #define NM_SETT_UTIL_ALLOW_FILENAME_DATA(_storages, _allowed_filename) \
(&((NMSettUtilAllowFilenameData){ \ (&((NMSettUtilAllowFilenameData) { \
.idx_by_filename = (_storages)->idx_by_filename, \ .idx_by_filename = (_storages)->idx_by_filename, \
.allowed_filename = (_allowed_filename), \ .allowed_filename = (_allowed_filename), \
})) }))

View file

@ -703,7 +703,7 @@ _startup_complete_notify_connection(NMSettings *self,
if (timeout_msec == 0) if (timeout_msec == 0)
return; return;
scd = g_slice_new(StartupCompleteData); scd = g_slice_new(StartupCompleteData);
*scd = (StartupCompleteData){ *scd = (StartupCompleteData) {
.sett_conn = g_object_ref(sett_conn), .sett_conn = g_object_ref(sett_conn),
.timeout_msec = timeout_msec, .timeout_msec = timeout_msec,
}; };

View file

@ -722,7 +722,7 @@ svFile_new(const char *name, int fd, const char *content)
nm_assert(fd >= -1); nm_assert(fd >= -1);
s = g_slice_new(shvarFile); s = g_slice_new(shvarFile);
*s = (shvarFile){ *s = (shvarFile) {
.fileName = g_strdup(name), .fileName = g_strdup(name),
.fd = fd, .fd = fd,
.lst_head = C_LIST_INIT(s->lst_head), .lst_head = C_LIST_INIT(s->lst_head),
@ -796,7 +796,7 @@ line_new_parse(const char *value, gsize len)
nm_assert(value); nm_assert(value);
line = g_slice_new(shvarLine); line = g_slice_new(shvarLine);
*line = (shvarLine){ *line = (shvarLine) {
.lst = C_LIST_INIT(line->lst), .lst = C_LIST_INIT(line->lst),
.dirty = TRUE, .dirty = TRUE,
}; };
@ -836,7 +836,7 @@ line_new_build(const char *key, const char *value)
value = svEscape(value, &value_escaped); value = svEscape(value, &value_escaped);
line = g_slice_new(shvarLine); line = g_slice_new(shvarLine);
new_key = g_strdup(key), *line = (shvarLine){ new_key = g_strdup(key), *line = (shvarLine) {
.lst = C_LIST_INIT(line->lst), .lst = C_LIST_INIT(line->lst),
.line = value_escaped ?: g_strdup(value), .line = value_escaped ?: g_strdup(value),
.key_with_prefix = new_key, .key_with_prefix = new_key,

View file

@ -330,7 +330,7 @@ load_eni_ifaces(NMSIfupdownPlugin *self)
storage = nm_settings_storage_new(NM_SETTINGS_PLUGIN(self), uuid, NULL); storage = nm_settings_storage_new(NM_SETTINGS_PLUGIN(self), uuid, NULL);
sd = g_slice_new(StorageData); sd = g_slice_new(StorageData);
*sd = (StorageData){ *sd = (StorageData) {
.connection = g_steal_pointer(&connection), .connection = g_steal_pointer(&connection),
.storage = g_steal_pointer(&storage), .storage = g_steal_pointer(&storage),
}; };

View file

@ -154,7 +154,7 @@ nm_supplicant_config_add_option_with_type(NMSupplicantConfig *self,
} }
opt = g_slice_new(ConfigOption); opt = g_slice_new(ConfigOption);
*opt = (ConfigOption){ *opt = (ConfigOption) {
.value = nm_memdup_nul(value, len), .value = nm_memdup_nul(value, len),
.len = len, .len = len,
.type = type, .type = type,

View file

@ -714,7 +714,7 @@ _bss_info_properties_changed(NMSupplicantInterface *self,
if (v_v) { if (v_v) {
arr_data = g_variant_get_fixed_array(v_v, &arr_len, 1); arr_data = g_variant_get_fixed_array(v_v, &arr_len, 1);
if (arr_len == ETH_ALEN && memcmp(arr_data, &nm_ether_addr_zero, ETH_ALEN) != 0 if (arr_len == ETH_ALEN && memcmp(arr_data, &nm_ether_addr_zero, ETH_ALEN) != 0
&& memcmp(arr_data, (char[ETH_ALEN]){0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, ETH_ALEN) && memcmp(arr_data, (char[ETH_ALEN]) {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, ETH_ALEN)
!= 0) { != 0) {
/* pass */ /* pass */
} else } else
@ -839,7 +839,7 @@ _bss_info_add(NMSupplicantInterface *self, const char *object_path)
} }
bss_info = g_slice_new(NMSupplicantBssInfo); bss_info = g_slice_new(NMSupplicantBssInfo);
*bss_info = (NMSupplicantBssInfo){ *bss_info = (NMSupplicantBssInfo) {
._self = self, ._self = self,
.bss_path = g_steal_pointer(&bss_path), .bss_path = g_steal_pointer(&bss_path),
._init_cancellable = g_cancellable_new(), ._init_cancellable = g_cancellable_new(),
@ -953,7 +953,7 @@ _peer_info_properties_changed(NMSupplicantInterface *self,
if (v_v) { if (v_v) {
arr_data = g_variant_get_fixed_array(v_v, &arr_len, 1); arr_data = g_variant_get_fixed_array(v_v, &arr_len, 1);
if (arr_len == ETH_ALEN && memcmp(arr_data, &nm_ether_addr_zero, ETH_ALEN) != 0 if (arr_len == ETH_ALEN && memcmp(arr_data, &nm_ether_addr_zero, ETH_ALEN) != 0
&& memcmp(arr_data, (char[ETH_ALEN]){0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, ETH_ALEN) && memcmp(arr_data, (char[ETH_ALEN]) {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, ETH_ALEN)
!= 0) { != 0) {
/* pass */ /* pass */
} else } else
@ -1037,7 +1037,7 @@ _peer_info_add(NMSupplicantInterface *self, const char *object_path)
} }
peer_info = g_slice_new(NMSupplicantPeerInfo); peer_info = g_slice_new(NMSupplicantPeerInfo);
*peer_info = (NMSupplicantPeerInfo){ *peer_info = (NMSupplicantPeerInfo) {
._self = self, ._self = self,
.peer_path = g_steal_pointer(&peer_path), .peer_path = g_steal_pointer(&peer_path),
._init_cancellable = g_cancellable_new(), ._init_cancellable = g_cancellable_new(),
@ -1831,7 +1831,7 @@ _wps_start(NMSupplicantInterface *self, const char *type, const char *bssid, con
} }
wps_data = g_slice_new(WpsData); wps_data = g_slice_new(WpsData);
*wps_data = (WpsData){ *wps_data = (WpsData) {
.self = self, .self = self,
.type = g_strdup(type), .type = g_strdup(type),
.bssid = g_strdup(bssid), .bssid = g_strdup(bssid),
@ -2381,7 +2381,7 @@ add_network(NMSupplicantInterface *self)
* For that we also have a shutdown_wait_obj so that on exit we still wait * For that we also have a shutdown_wait_obj so that on exit we still wait
* to handle the response. */ * to handle the response. */
add_network_data = g_slice_new(AddNetworkData); add_network_data = g_slice_new(AddNetworkData);
*add_network_data = (AddNetworkData){ *add_network_data = (AddNetworkData) {
.assoc_data = priv->assoc_data, .assoc_data = priv->assoc_data,
.name_owner = nm_ref_string_ref(priv->name_owner), .name_owner = nm_ref_string_ref(priv->name_owner),
.object_path = nm_ref_string_ref(priv->object_path), .object_path = nm_ref_string_ref(priv->object_path),
@ -2534,7 +2534,7 @@ nm_supplicant_interface_assoc(NMSupplicantInterface *self,
nm_supplicant_interface_disconnect(self); nm_supplicant_interface_disconnect(self);
assoc_data = g_slice_new(AssocData); assoc_data = g_slice_new(AssocData);
*assoc_data = (AssocData){ *assoc_data = (AssocData) {
.self = self, .self = self,
.cfg = g_object_ref(cfg), .cfg = g_object_ref(cfg),
.callback = callback, .callback = callback,
@ -2707,7 +2707,7 @@ nm_supplicant_interface_request_scan(NMSupplicantInterface *se
} }
data = g_slice_new(ScanRequestData); data = g_slice_new(ScanRequestData);
*data = (ScanRequestData){ *data = (ScanRequestData) {
.self = self, .self = self,
.callback = callback, .callback = callback,
.user_data = user_data, .user_data = user_data,

View file

@ -693,7 +693,7 @@ nm_supplicant_manager_create_interface(NMSupplicantManager *self
priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE(self); priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE(self);
handle = g_slice_new(NMSupplMgrCreateIfaceHandle); handle = g_slice_new(NMSupplMgrCreateIfaceHandle);
*handle = (NMSupplMgrCreateIfaceHandle){ *handle = (NMSupplMgrCreateIfaceHandle) {
.self = g_object_ref(self), .self = g_object_ref(self),
.callback = callback, .callback = callback,
.callback_user_data = user_data, .callback_user_data = user_data,

View file

@ -1027,7 +1027,7 @@ test_connection_match_ip6_routes(void)
} }
#define do_test_wildcard_match_eval(str, ...) \ #define do_test_wildcard_match_eval(str, ...) \
nm_wildcard_match_check(str, (const char *const[]){__VA_ARGS__}, NM_NARG(__VA_ARGS__)) nm_wildcard_match_check(str, (const char *const[]) {__VA_ARGS__}, NM_NARG(__VA_ARGS__))
#define do_test_wildcard_match(str, result, ...) \ #define do_test_wildcard_match(str, result, ...) \
g_assert(do_test_wildcard_match_eval(str, __VA_ARGS__) == result) g_assert(do_test_wildcard_match_eval(str, __VA_ARGS__) == result)
@ -1244,7 +1244,7 @@ _test_match_spec_device(const GSList *specs, const char *match_str)
{ {
if (match_str && g_str_has_prefix(match_str, MATCH_S390)) if (match_str && g_str_has_prefix(match_str, MATCH_S390))
return nm_match_spec_device(specs, return nm_match_spec_device(specs,
&((const NMMatchSpecDeviceData){ &((const NMMatchSpecDeviceData) {
.s390_subchannels = &match_str[NM_STRLEN(MATCH_S390)], .s390_subchannels = &match_str[NM_STRLEN(MATCH_S390)],
})); }));
if (match_str && g_str_has_prefix(match_str, MATCH_DRIVER)) { if (match_str && g_str_has_prefix(match_str, MATCH_DRIVER)) {
@ -1257,13 +1257,13 @@ _test_match_spec_device(const GSList *specs, const char *match_str)
t++; t++;
} }
return nm_match_spec_device(specs, return nm_match_spec_device(specs,
&((const NMMatchSpecDeviceData){ &((const NMMatchSpecDeviceData) {
.driver = s, .driver = s,
.driver_version = t, .driver_version = t,
})); }));
} }
return nm_match_spec_device(specs, return nm_match_spec_device(specs,
&((const NMMatchSpecDeviceData){ &((const NMMatchSpecDeviceData) {
.interface_name = match_str, .interface_name = match_str,
})); }));
} }
@ -1789,28 +1789,28 @@ test_nm_utils_strbuf_append(void)
} \ } \
G_STMT_END G_STMT_END
#define _strbuf_append_c(buf, len, ch) \ #define _strbuf_append_c(buf, len, ch) \
G_STMT_START \ G_STMT_START \
{ \ { \
char **_buf = (buf); \ char **_buf = (buf); \
gsize *_len = (len); \ gsize *_len = (len); \
char _ch = (ch); \ char _ch = (ch); \
\ \
switch (nmtst_get_rand_uint32() % 4) { \ switch (nmtst_get_rand_uint32() % 4) { \
case 0: \ case 0: \
nm_strbuf_append(_buf, _len, "%c", _ch); \ nm_strbuf_append(_buf, _len, "%c", _ch); \
break; \ break; \
case 1: \ case 1: \
nm_strbuf_append_str(_buf, _len, ((char[2]){_ch, 0})); \ nm_strbuf_append_str(_buf, _len, ((char[2]) {_ch, 0})); \
break; \ break; \
case 2: \ case 2: \
nm_strbuf_append_bin(_buf, _len, &_ch, 1); \ nm_strbuf_append_bin(_buf, _len, &_ch, 1); \
break; \ break; \
case 3: \ case 3: \
nm_strbuf_append_c(_buf, _len, _ch); \ nm_strbuf_append_c(_buf, _len, _ch); \
break; \ break; \
} \ } \
} \ } \
G_STMT_END G_STMT_END
for (buf_len = 0; buf_len < 10; buf_len++) { for (buf_len = 0; buf_len < 10; buf_len++) {

View file

@ -111,7 +111,7 @@ _test_fixture_1_teardown(TestFixture1 *f)
g_object_unref(f->platform); g_object_unref(f->platform);
nm_dedup_multi_index_unref(f->multiidx); nm_dedup_multi_index_unref(f->multiidx);
*f = (TestFixture1){ *f = (TestFixture1) {
.test_idx = 0, .test_idx = 0,
}; };
} }

View file

@ -1235,7 +1235,7 @@ _parent_device_l3cd_add_gateway_route(NML3ConfigData *l3cd,
return FALSE; return FALSE;
if (IS_IPv4) { if (IS_IPv4) {
route.r4 = (NMPlatformIP4Route){ route.r4 = (NMPlatformIP4Route) {
.ifindex = ifindex, .ifindex = ifindex,
.network = vpn_gw->addr4, .network = vpn_gw->addr4,
.plen = 32, .plen = 32,
@ -1244,7 +1244,7 @@ _parent_device_l3cd_add_gateway_route(NML3ConfigData *l3cd,
.metric_any = TRUE, .metric_any = TRUE,
}; };
} else { } else {
route.r6 = (NMPlatformIP6Route){ route.r6 = (NMPlatformIP6Route) {
.ifindex = ifindex, .ifindex = ifindex,
.network = vpn_gw->addr6, .network = vpn_gw->addr6,
.plen = 128, .plen = 128,
@ -1262,14 +1262,14 @@ _parent_device_l3cd_add_gateway_route(NML3ConfigData *l3cd,
* the parent device's gateway would get routed through the VPN and fail. * the parent device's gateway would get routed through the VPN and fail.
*/ */
if (IS_IPv4) { if (IS_IPv4) {
route.r4 = (NMPlatformIP4Route){ route.r4 = (NMPlatformIP4Route) {
.network = parent_gw.addr4, .network = parent_gw.addr4,
.plen = 32, .plen = 32,
.rt_source = NM_IP_CONFIG_SOURCE_VPN, .rt_source = NM_IP_CONFIG_SOURCE_VPN,
.metric_any = TRUE, .metric_any = TRUE,
}; };
} else { } else {
route.r6 = (NMPlatformIP6Route){ route.r6 = (NMPlatformIP6Route) {
.network = parent_gw.addr6, .network = parent_gw.addr6,
.plen = 128, .plen = 128,
.rt_source = NM_IP_CONFIG_SOURCE_VPN, .rt_source = NM_IP_CONFIG_SOURCE_VPN,
@ -1999,11 +1999,11 @@ _dbus_signal_ip_config_cb(NMVpnConnection *self, int addr_family, GVariant *dict
&priv->ip_data_x[IS_IPv4].gw_internal); &priv->ip_data_x[IS_IPv4].gw_internal);
if (IS_IPv4) { if (IS_IPv4) {
address.a4 = (NMPlatformIP4Address){ address.a4 = (NMPlatformIP4Address) {
.plen = 24, .plen = 24,
}; };
} else { } else {
address.a6 = (NMPlatformIP6Address){ address.a6 = (NMPlatformIP6Address) {
.plen = 128, .plen = 128,
}; };
} }
@ -2205,7 +2205,7 @@ _dbus_signal_ip_config_cb(NMVpnConnection *self, int addr_family, GVariant *dict
if (prefix > 128) if (prefix > 128)
continue; continue;
route.r6 = (NMPlatformIP6Route){ route.r6 = (NMPlatformIP6Route) {
.plen = prefix, .plen = prefix,
.table_any = TRUE, .table_any = TRUE,
.metric_any = TRUE, .metric_any = TRUE,
@ -2251,7 +2251,7 @@ _dbus_signal_ip_config_cb(NMVpnConnection *self, int addr_family, GVariant *dict
NMPlatformIPXRoute route; NMPlatformIPXRoute route;
if (IS_IPv4) { if (IS_IPv4) {
route.r4 = (NMPlatformIP4Route){ route.r4 = (NMPlatformIP4Route) {
.ifindex = ip_ifindex, .ifindex = ip_ifindex,
.rt_source = NM_IP_CONFIG_SOURCE_VPN, .rt_source = NM_IP_CONFIG_SOURCE_VPN,
.gateway = priv->ip_data_4.gw_internal.addr4, .gateway = priv->ip_data_4.gw_internal.addr4,
@ -2260,7 +2260,7 @@ _dbus_signal_ip_config_cb(NMVpnConnection *self, int addr_family, GVariant *dict
.mss = mss, .mss = mss,
}; };
} else { } else {
route.r6 = (NMPlatformIP6Route){ route.r6 = (NMPlatformIP6Route) {
.ifindex = ip_ifindex, .ifindex = ip_ifindex,
.rt_source = NM_IP_CONFIG_SOURCE_VPN, .rt_source = NM_IP_CONFIG_SOURCE_VPN,
.gateway = priv->ip_data_6.gw_internal.addr6, .gateway = priv->ip_data_6.gw_internal.addr6,

View file

@ -11,10 +11,10 @@
/*****************************************************************************/ /*****************************************************************************/
#define ETHT_DATA(xname) \ #define ETHT_DATA(xname) \
[NM_ETHTOOL_ID_##xname] = (&((const NMEthtoolData){ \ [NM_ETHTOOL_ID_##xname] = (&((const NMEthtoolData) { \
.optname = NM_ETHTOOL_OPTNAME_##xname, \ .optname = NM_ETHTOOL_OPTNAME_##xname, \
.id = NM_ETHTOOL_ID_##xname, \ .id = NM_ETHTOOL_ID_##xname, \
})) }))
const NMEthtoolData *const nm_ethtool_data[_NM_ETHTOOL_ID_NUM + 1] = { const NMEthtoolData *const nm_ethtool_data[_NM_ETHTOOL_ID_NUM + 1] = {

View file

@ -624,7 +624,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_connection_active = NML_DBUS_META
PROP_CONTROLLER, PROP_CONTROLLER,
"o", "o",
active_connection_update_prop_controller, active_connection_update_prop_controller,
.extra.property_vtable_o = &((const NMLDBusPropertVTableO){ .extra.property_vtable_o = &((const NMLDBusPropertVTableO) {
.get_o_type_fcn = (nm_device_get_type)})), .get_o_type_fcn = (nm_device_get_type)})),
NML_DBUS_META_PROPERTY_INIT_B("Default", NML_DBUS_META_PROPERTY_INIT_B("Default",
PROP_DEFAULT, PROP_DEFAULT,
@ -664,7 +664,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_connection_active = NML_DBUS_META
PROP_MASTER, PROP_MASTER,
"o", "o",
active_connection_update_prop_controller, active_connection_update_prop_controller,
.extra.property_vtable_o = &((const NMLDBusPropertVTableO){ .extra.property_vtable_o = &((const NMLDBusPropertVTableO) {
.get_o_type_fcn = (nm_device_get_type)})), .get_o_type_fcn = (nm_device_get_type)})),
NML_DBUS_META_PROPERTY_INIT_O("SpecificObject", NML_DBUS_META_PROPERTY_INIT_O("SpecificObject",
PROP_SPECIFIC_OBJECT_PATH, PROP_SPECIFIC_OBJECT_PATH,

View file

@ -419,7 +419,7 @@ nml_init_data_new_sync(GCancellable *cancellable, GMainLoop *main_loop, GError *
NMLInitData *init_data; NMLInitData *init_data;
init_data = g_slice_new(NMLInitData); init_data = g_slice_new(NMLInitData);
*init_data = (NMLInitData){ *init_data = (NMLInitData) {
.cancellable = nm_g_object_ref(cancellable), .cancellable = nm_g_object_ref(cancellable),
.is_sync = TRUE, .is_sync = TRUE,
.data.sync = .data.sync =
@ -437,7 +437,7 @@ nml_init_data_new_async(GCancellable *cancellable, GTask *task_take)
NMLInitData *init_data; NMLInitData *init_data;
init_data = g_slice_new(NMLInitData); init_data = g_slice_new(NMLInitData);
*init_data = (NMLInitData){ *init_data = (NMLInitData) {
.cancellable = nm_g_object_ref(cancellable), .cancellable = nm_g_object_ref(cancellable),
.is_sync = FALSE, .is_sync = FALSE,
.data.async = .data.async =
@ -1103,7 +1103,7 @@ nml_dbus_object_new(NMRefString *dbus_path_take)
nm_assert(NM_IS_REF_STRING(dbus_path_take)); nm_assert(NM_IS_REF_STRING(dbus_path_take));
dbobj = g_slice_new(NMLDBusObject); dbobj = g_slice_new(NMLDBusObject);
*dbobj = (NMLDBusObject){ *dbobj = (NMLDBusObject) {
.dbus_path = g_steal_pointer(&dbus_path_take), .dbus_path = g_steal_pointer(&dbus_path_take),
.ref_count = 1, .ref_count = 1,
.dbus_objects_lst = C_LIST_INIT(dbobj->dbus_objects_lst), .dbus_objects_lst = C_LIST_INIT(dbobj->dbus_objects_lst),
@ -1209,7 +1209,7 @@ nml_dbus_object_iface_data_get(NMLDBusObject *dbobj,
G_STRUCT_OFFSET(NMLDBusObjIfaceData, prop_datas) G_STRUCT_OFFSET(NMLDBusObjIfaceData, prop_datas)
+ (meta_iface ? (sizeof(NMLDBusObjPropData) * meta_iface->n_dbus_properties) : 0u)); + (meta_iface ? (sizeof(NMLDBusObjPropData) * meta_iface->n_dbus_properties) : 0u));
if (meta_iface) { if (meta_iface) {
*db_iface_data = (NMLDBusObjIfaceData){ *db_iface_data = (NMLDBusObjIfaceData) {
.dbus_iface.meta = meta_iface, .dbus_iface.meta = meta_iface,
.dbus_iface_is_wellknown = TRUE, .dbus_iface_is_wellknown = TRUE,
.changed_prop_lst_head = C_LIST_INIT(db_iface_data->changed_prop_lst_head), .changed_prop_lst_head = C_LIST_INIT(db_iface_data->changed_prop_lst_head),
@ -1217,7 +1217,7 @@ nml_dbus_object_iface_data_get(NMLDBusObject *dbobj,
}; };
db_prop_data = &db_iface_data->prop_datas[0]; db_prop_data = &db_iface_data->prop_datas[0];
for (i = 0; i < meta_iface->n_dbus_properties; i++, db_prop_data++) { for (i = 0; i < meta_iface->n_dbus_properties; i++, db_prop_data++) {
*db_prop_data = (NMLDBusObjPropData){ *db_prop_data = (NMLDBusObjPropData) {
.prop_data_value = NULL, .prop_data_value = NULL,
.changed_prop_lst = C_LIST_INIT(db_prop_data->changed_prop_lst), .changed_prop_lst = C_LIST_INIT(db_prop_data->changed_prop_lst),
}; };
@ -3912,7 +3912,7 @@ _request_wait_start(GTask *task_take,
} }
request_data = g_slice_new(RequestWaitData); request_data = g_slice_new(RequestWaitData);
*request_data = (RequestWaitData){ *request_data = (RequestWaitData) {
.task = g_steal_pointer(&task), .task = g_steal_pointer(&task),
.op_name = op_name, .op_name = op_name,
.gtype = gtype, .gtype = gtype,
@ -7077,7 +7077,7 @@ _init_release_all(NMClient *self)
nm_assert(c_list_is_empty(&priv->obj_changed_lst_head)); nm_assert(c_list_is_empty(&priv->obj_changed_lst_head));
dbus_objects_lst_heads = ((CList *[]){ dbus_objects_lst_heads = ((CList *[]) {
&priv->dbus_objects_lst_head_on_dbus, &priv->dbus_objects_lst_head_on_dbus,
&priv->dbus_objects_lst_head_with_nmobj_not_ready, &priv->dbus_objects_lst_head_with_nmobj_not_ready,
&priv->dbus_objects_lst_head_with_nmobj_ready, &priv->dbus_objects_lst_head_with_nmobj_ready,
@ -9149,7 +9149,7 @@ nm_client_wait_shutdown(NMClient *client,
} }
data = g_slice_new(WaitShutdownData); data = g_slice_new(WaitShutdownData);
*data = (WaitShutdownData){ *data = (WaitShutdownData) {
.cancellable = nm_g_object_ref(cancellable), .cancellable = nm_g_object_ref(cancellable),
.task = g_object_ref(task), .task = g_object_ref(task),
.result = -1, .result = -1,

View file

@ -610,7 +610,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device = NML_DBUS_META_IFACE_INIT
.prop_struct_offset = .prop_struct_offset =
G_STRUCT_OFFSET(NMDevicePrivate, property_ao[PROPERTY_AO_IDX_PORTS]), G_STRUCT_OFFSET(NMDevicePrivate, property_ao[PROPERTY_AO_IDX_PORTS]),
.extra.property_vtable_ao = .extra.property_vtable_ao =
&((const NMLDBusPropertVTableAO){.get_o_type_fcn = (nm_device_get_type)})), &((const NMLDBusPropertVTableAO) {.get_o_type_fcn = (nm_device_get_type)})),
NML_DBUS_META_PROPERTY_INIT_B("Real", PROP_REAL, NMDevicePrivate, real), NML_DBUS_META_PROPERTY_INIT_B("Real", PROP_REAL, NMDevicePrivate, real),
NML_DBUS_META_PROPERTY_INIT_IGNORE("State", "u"), NML_DBUS_META_PROPERTY_INIT_IGNORE("State", "u"),
NML_DBUS_META_PROPERTY_INIT_FCN("StateReason", NML_DBUS_META_PROPERTY_INIT_FCN("StateReason",
@ -3004,7 +3004,7 @@ nm_lldp_neighbor_new(void)
NMLldpNeighbor *neigh; NMLldpNeighbor *neigh;
neigh = g_slice_new(NMLldpNeighbor); neigh = g_slice_new(NMLldpNeighbor);
*neigh = (NMLldpNeighbor){ *neigh = (NMLldpNeighbor) {
.refcount = 1, .refcount = 1,
.attrs = g_hash_table_new_full(nm_str_hash, .attrs = g_hash_table_new_full(nm_str_hash,
g_str_equal, g_str_equal,

View file

@ -440,8 +440,8 @@ typedef struct {
v_obj_properties_idx, \ v_obj_properties_idx, \
.prop_struct_offset = \ .prop_struct_offset = \
NM_STRUCT_OFFSET_ENSURE_TYPE(NMLDBusPropertyO, v_container, v_field), \ NM_STRUCT_OFFSET_ENSURE_TYPE(NMLDBusPropertyO, v_container, v_field), \
.extra.property_vtable_o = \ .extra.property_vtable_o = &( \
&((const NMLDBusPropertVTableO){.get_o_type_fcn = (v_get_o_type_fcn), ##__VA_ARGS__})) (const NMLDBusPropertVTableO) {.get_o_type_fcn = (v_get_o_type_fcn), ##__VA_ARGS__}))
#define NML_DBUS_META_PROPERTY_INIT_AO_PROP(v_dbus_property_name, \ #define NML_DBUS_META_PROPERTY_INIT_AO_PROP(v_dbus_property_name, \
v_obj_properties_idx, \ v_obj_properties_idx, \
@ -456,7 +456,7 @@ typedef struct {
.prop_struct_offset = \ .prop_struct_offset = \
NM_STRUCT_OFFSET_ENSURE_TYPE(NMLDBusPropertyAO, v_container, v_field), \ NM_STRUCT_OFFSET_ENSURE_TYPE(NMLDBusPropertyAO, v_container, v_field), \
.extra.property_vtable_ao = &( \ .extra.property_vtable_ao = &( \
(const NMLDBusPropertVTableAO){.get_o_type_fcn = (v_get_o_type_fcn), ##__VA_ARGS__})) (const NMLDBusPropertVTableAO) {.get_o_type_fcn = (v_get_o_type_fcn), ##__VA_ARGS__}))
#define NML_DBUS_META_PROPERTY_INIT_FCN(v_dbus_property_name, \ #define NML_DBUS_META_PROPERTY_INIT_FCN(v_dbus_property_name, \
v_obj_properties_idx, \ v_obj_properties_idx, \
@ -559,12 +559,12 @@ struct _NMLDBusMetaIface {
#define NML_DBUS_META_IFACE_OBJ_PROPERTIES() \ #define NML_DBUS_META_IFACE_OBJ_PROPERTIES() \
.obj_properties = (const GParamSpec *const *) (obj_properties), \ .obj_properties = (const GParamSpec *const *) (obj_properties), \
.n_obj_properties = _PROPERTY_ENUMS_LAST, \ .n_obj_properties = _PROPERTY_ENUMS_LAST, \
.obj_properties_reverse_idx = ((guint8[_PROPERTY_ENUMS_LAST]){}) .obj_properties_reverse_idx = ((guint8[_PROPERTY_ENUMS_LAST]) {})
#define NML_DBUS_META_IFACE_DBUS_PROPERTIES(...) \ #define NML_DBUS_META_IFACE_DBUS_PROPERTIES(...) \
.dbus_properties = ((const NMLDBusMetaProperty[]){__VA_ARGS__}), \ .dbus_properties = ((const NMLDBusMetaProperty[]) {__VA_ARGS__}), \
.n_dbus_properties = \ .n_dbus_properties = \
(sizeof((const NMLDBusMetaProperty[]){__VA_ARGS__}) / sizeof(NMLDBusMetaProperty)) (sizeof((const NMLDBusMetaProperty[]) {__VA_ARGS__}) / sizeof(NMLDBusMetaProperty))
#define NML_DBUS_META_IFACE_INIT(v_dbus_iface_name, v_get_type_fcn, v_interface_prio, ...) \ #define NML_DBUS_META_IFACE_INIT(v_dbus_iface_name, v_get_type_fcn, v_interface_prio, ...) \
{.dbus_iface_name = "" v_dbus_iface_name "", \ {.dbus_iface_name = "" v_dbus_iface_name "", \
@ -640,7 +640,7 @@ void _nml_dbus_meta_class_init_with_properties_impl(GObjectClass
#define _nml_dbus_meta_class_init_with_properties(object_class, ...) \ #define _nml_dbus_meta_class_init_with_properties(object_class, ...) \
_nml_dbus_meta_class_init_with_properties_impl( \ _nml_dbus_meta_class_init_with_properties_impl( \
(object_class), \ (object_class), \
((const NMLDBusMetaIface *const[]){__VA_ARGS__, NULL})) ((const NMLDBusMetaIface *const[]) {__VA_ARGS__, NULL}))
/*****************************************************************************/ /*****************************************************************************/
@ -793,7 +793,7 @@ struct _NMObjectClass {
* variable here. */ \ * variable here. */ \
nm_assert(!_f.klass); \ nm_assert(!_f.klass); \
\ \
_f = (_NMObjectClassFieldInfo){ \ _f = (_NMObjectClassFieldInfo) { \
.parent = _klass->field_name, \ .parent = _klass->field_name, \
.klass = _klass, \ .klass = _klass, \
.offset = (_offset), \ .offset = (_offset), \

View file

@ -476,7 +476,7 @@ impl_get_secrets(NMSecretAgentOld *self, GVariant *parameters, GDBusMethodInvoca
_cancel_get_secret_request(self, info, "Request aborted due to new request"); _cancel_get_secret_request(self, info, "Request aborted due to new request");
info = g_slice_new(GetSecretsInfo); info = g_slice_new(GetSecretsInfo);
*info = (GetSecretsInfo){ *info = (GetSecretsInfo) {
.context = context, .context = context,
.connection_path = g_strdup(arg_connection_path), .connection_path = g_strdup(arg_connection_path),
.setting_name = g_strdup(arg_setting_name), .setting_name = g_strdup(arg_setting_name),

View file

@ -2285,7 +2285,7 @@ typedef struct {
const char *val; const char *val;
} ReadVpnDetailData; } ReadVpnDetailData;
#define READ_VPN_DETAIL_DATA(...) ((ReadVpnDetailData[]){__VA_ARGS__}) #define READ_VPN_DETAIL_DATA(...) ((ReadVpnDetailData[]) {__VA_ARGS__})
static gboolean static gboolean
_do_read_vpn_details_impl1(const char *file, _do_read_vpn_details_impl1(const char *file,

View file

@ -1099,7 +1099,7 @@ test_connection_invalid(void)
g_assert_cmpint(connections->len, ==, 3); g_assert_cmpint(connections->len, ==, 3);
n_found = nmtst_find_all_indexes(connections->pdata, n_found = nmtst_find_all_indexes(connections->pdata,
connections->len, connections->len,
(gpointer *) ((const char *[]){path0, path1, path2}), (gpointer *) ((const char *[]) {path0, path1, path2}),
3, 3,
_test_connection_invalid_find_connections, _test_connection_invalid_find_connections,
NULL, NULL,
@ -1134,7 +1134,7 @@ test_connection_invalid(void)
g_assert_cmpint(connections->len, ==, 4); g_assert_cmpint(connections->len, ==, 4);
n_found = nmtst_find_all_indexes(connections->pdata, n_found = nmtst_find_all_indexes(connections->pdata,
connections->len, connections->len,
(gpointer *) ((const char *[]){path0, path1, path2, path3}), (gpointer *) ((const char *[]) {path0, path1, path2, path3}),
4, 4,
_test_connection_invalid_find_connections, _test_connection_invalid_find_connections,
NULL, NULL,
@ -1166,7 +1166,7 @@ test_connection_invalid(void)
g_assert_cmpint(connections->len, ==, 4); g_assert_cmpint(connections->len, ==, 4);
n_found = nmtst_find_all_indexes(connections->pdata, n_found = nmtst_find_all_indexes(connections->pdata,
connections->len, connections->len,
(gpointer *) ((const char *[]){path0, path1, path2, path3}), (gpointer *) ((const char *[]) {path0, path1, path2, path3}),
4, 4,
_test_connection_invalid_find_connections, _test_connection_invalid_find_connections,
NULL, NULL,
@ -1202,7 +1202,7 @@ test_connection_invalid(void)
g_assert_cmpint(connections->len, ==, 4); g_assert_cmpint(connections->len, ==, 4);
n_found = nmtst_find_all_indexes(connections->pdata, n_found = nmtst_find_all_indexes(connections->pdata,
connections->len, connections->len,
(gpointer *) ((const char *[]){path0, path1, path2, path3}), (gpointer *) ((const char *[]) {path0, path1, path2, path3}),
4, 4,
_test_connection_invalid_find_connections, _test_connection_invalid_find_connections,
NULL, NULL,
@ -1232,7 +1232,7 @@ test_connection_invalid(void)
g_assert_cmpint(connections->len, ==, 4); g_assert_cmpint(connections->len, ==, 4);
n_found = nmtst_find_all_indexes(connections->pdata, n_found = nmtst_find_all_indexes(connections->pdata,
connections->len, connections->len,
(gpointer *) ((const char *[]){path0, path1, path2, path3}), (gpointer *) ((const char *[]) {path0, path1, path2, path3}),
4, 4,
_test_connection_invalid_find_connections, _test_connection_invalid_find_connections,
NULL, NULL,
@ -1279,7 +1279,7 @@ test_connection_invalid(void)
g_assert_cmpint(connections->len, ==, 4); g_assert_cmpint(connections->len, ==, 4);
n_found = nmtst_find_all_indexes(connections->pdata, n_found = nmtst_find_all_indexes(connections->pdata,
connections->len, connections->len,
(gpointer *) ((const char *[]){path0, path1, path2, path3}), (gpointer *) ((const char *[]) {path0, path1, path2, path3}),
4, 4,
_test_connection_invalid_find_connections, _test_connection_invalid_find_connections,
NULL, NULL,
@ -1326,7 +1326,7 @@ test_connection_invalid(void)
g_assert_cmpint(connections->len, ==, 4); g_assert_cmpint(connections->len, ==, 4);
n_found = nmtst_find_all_indexes(connections->pdata, n_found = nmtst_find_all_indexes(connections->pdata,
connections->len, connections->len,
(gpointer *) ((const char *[]){path0, path1, path2, path3}), (gpointer *) ((const char *[]) {path0, path1, path2, path3}),
4, 4,
_test_connection_invalid_find_connections, _test_connection_invalid_find_connections,
NULL, NULL,

View file

@ -344,7 +344,7 @@ test_cleanup(TestSecretAgentData *sadata, gconstpointer test_data)
g_free(sadata->ifname); g_free(sadata->ifname);
g_free(sadata->con_id); g_free(sadata->con_id);
*sadata = (TestSecretAgentData){}; *sadata = (TestSecretAgentData) {};
nmtst_context_busy_watcher_wait(&watcher_data); nmtst_context_busy_watcher_wait(&watcher_data);

View file

@ -314,7 +314,7 @@ add_device_common(NMTstcServiceInfo *sinfo,
loop = g_main_loop_new(nm_client_get_main_context(client), FALSE); loop = g_main_loop_new(nm_client_get_main_context(client), FALSE);
info = (AddDeviceInfo){ info = (AddDeviceInfo) {
.ifname = ifname, .ifname = ifname,
.loop = loop, .loop = loop,
}; };

View file

@ -89,7 +89,7 @@ _nm_connection_get_private_from_qdata(NMConnection *connection)
priv = g_object_get_qdata((GObject *) connection, key); priv = g_object_get_qdata((GObject *) connection, key);
if (G_UNLIKELY(!priv)) { if (G_UNLIKELY(!priv)) {
priv = g_slice_new(NMConnectionPrivate); priv = g_slice_new(NMConnectionPrivate);
*priv = (NMConnectionPrivate){ *priv = (NMConnectionPrivate) {
.self = connection, .self = connection,
}; };
g_object_set_qdata_full((GObject *) connection, key, priv, _nm_connection_private_free); g_object_set_qdata_full((GObject *) connection, key, priv, _nm_connection_private_free);

View file

@ -132,7 +132,7 @@ _nm_printf(5, 6) static void _read_handle_warn(KeyfileReaderInfo *info,
info, info,
kf_key, kf_key,
cur_property); cur_property);
handler_data.warn = (NMKeyfileHandlerDataWarn){ handler_data.warn = (NMKeyfileHandlerDataWarn) {
.severity = severity, .severity = severity,
.message = NULL, .message = NULL,
.fmt = fmt, .fmt = fmt,
@ -186,7 +186,7 @@ _nm_printf(6, 7) static void _write_handle_warn(KeyfileWriterInfo *info,
cur_property, cur_property,
setting, setting,
kf_key); kf_key);
handler_data.warn = (NMKeyfileHandlerDataWarn){ handler_data.warn = (NMKeyfileHandlerDataWarn) {
.severity = severity, .severity = severity,
.message = NULL, .message = NULL,
.fmt = fmt, .fmt = fmt,
@ -915,7 +915,7 @@ _build_list_create(GKeyFile *keyfile,
if (G_UNLIKELY(!build_list)) if (G_UNLIKELY(!build_list))
build_list = g_new(BuildListData, n_keys - i_keys); build_list = g_new(BuildListData, n_keys - i_keys);
build_list[build_list_len++] = (BuildListData){ build_list[build_list_len++] = (BuildListData) {
.s_key = s_key, .s_key = s_key,
.key_idx = key_idx, .key_idx = key_idx,
.key_type = key_type, .key_type = key_type,
@ -2882,7 +2882,7 @@ cert_writer(KeyfileWriterInfo *info, NMSetting *setting, const char *key, const
vtable->setting_key, vtable->setting_key,
setting, setting,
key); key);
handler_data.write_cert = (NMKeyfileHandlerDataWriteCert){ handler_data.write_cert = (NMKeyfileHandlerDataWriteCert) {
.vtable = vtable, .vtable = vtable,
}; };
@ -2944,11 +2944,11 @@ struct _ParseInfoProperty {
}; };
#define PARSE_INFO_PROPERTY(_property_name, ...) \ #define PARSE_INFO_PROPERTY(_property_name, ...) \
(&((const ParseInfoProperty){.property_name = _property_name, __VA_ARGS__})) (&((const ParseInfoProperty) {.property_name = _property_name, __VA_ARGS__}))
#define PARSE_INFO_PROPERTIES(...) \ #define PARSE_INFO_PROPERTIES(...) \
.properties = ((const ParseInfoProperty *const[]){ \ .properties = ((const ParseInfoProperty *const[]) { \
__VA_ARGS__ NULL, \ __VA_ARGS__ NULL, \
}) })
typedef struct { typedef struct {
@ -2956,7 +2956,7 @@ typedef struct {
} ParseInfoSetting; } ParseInfoSetting;
#define PARSE_INFO_SETTING(setting_type, ...) \ #define PARSE_INFO_SETTING(setting_type, ...) \
[setting_type] = (&((const ParseInfoSetting){__VA_ARGS__})) [setting_type] = (&((const ParseInfoSetting) {__VA_ARGS__}))
static const ParseInfoSetting *const parse_infos[_NM_META_SETTING_TYPE_NUM] = { static const ParseInfoSetting *const parse_infos[_NM_META_SETTING_TYPE_NUM] = {
PARSE_INFO_SETTING( PARSE_INFO_SETTING(
@ -3950,7 +3950,7 @@ nm_keyfile_read(GKeyFile *keyfile,
connection = nm_simple_connection_new(); connection = nm_simple_connection_new();
info = (KeyfileReaderInfo){ info = (KeyfileReaderInfo) {
.connection = connection, .connection = connection,
.keyfile = keyfile, .keyfile = keyfile,
.base_dir = base_dir, .base_dir = base_dir,
@ -4084,7 +4084,7 @@ write_setting_value(KeyfileWriterInfo *info,
NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST)) NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST))
return; return;
value = (GValue){0}; value = (GValue) {0};
g_value_init(&value, G_PARAM_SPEC_VALUE_TYPE(property_info->param_spec)); g_value_init(&value, G_PARAM_SPEC_VALUE_TYPE(property_info->param_spec));
g_object_get_property(G_OBJECT(setting), property_info->param_spec->name, &value); g_object_get_property(G_OBJECT(setting), property_info->param_spec->name, &value);
@ -4304,7 +4304,7 @@ nm_keyfile_write(NMConnection *connection,
keyfile = g_key_file_new(); keyfile = g_key_file_new();
info = (KeyfileWriterInfo){ info = (KeyfileWriterInfo) {
.connection = connection, .connection = connection,
.keyfile = keyfile, .keyfile = keyfile,
.error = NULL, .error = NULL,

View file

@ -831,7 +831,7 @@ again:
for (i = 0; i < _NM_META_SETTING_TYPE_NUM; i++) { for (i = 0; i < _NM_META_SETTING_TYPE_NUM; i++) {
const NMMetaSettingInfo *m = &nm_meta_setting_infos[i]; const NMMetaSettingInfo *m = &nm_meta_setting_infos[i];
static_array[i] = (LookupData){ static_array[i] = (LookupData) {
.gtype = m->get_setting_gtype(), .gtype = m->get_setting_gtype(),
.setting_info = m, .setting_info = m,
}; };

View file

@ -151,7 +151,7 @@ nm_bridge_vlan_new(guint16 vid_start, guint16 vid_end)
g_return_val_if_fail(vid_start <= vid_end, NULL); g_return_val_if_fail(vid_start <= vid_end, NULL);
vlan = g_slice_new(NMBridgeVlan); vlan = g_slice_new(NMBridgeVlan);
*vlan = (NMBridgeVlan){ *vlan = (NMBridgeVlan) {
.refcount = 1, .refcount = 1,
.vid_start = vid_start, .vid_start = vid_start,
.vid_end = vid_end, .vid_end = vid_end,

View file

@ -139,7 +139,7 @@ _permission_set_stale(Permission *permission, PermType ptype, char *item_take)
/* we don't inspect (clear) permission before setting. It takes a /* we don't inspect (clear) permission before setting. It takes a
* stale instance. */ * stale instance. */
*permission = (Permission){ *permission = (Permission) {
.ptype = ptype, .ptype = ptype,
.item = item_take, .item = item_take,
}; };

View file

@ -175,7 +175,7 @@ nm_ip_address_new(int family, const char *addr, guint prefix, GError **error)
return NULL; return NULL;
address = g_slice_new(NMIPAddress); address = g_slice_new(NMIPAddress);
*address = (NMIPAddress){ *address = (NMIPAddress) {
.refcount = 1, .refcount = 1,
.family = family, .family = family,
.address = canonicalize_ip_binary(family, &addr_bin, FALSE), .address = canonicalize_ip_binary(family, &addr_bin, FALSE),
@ -210,7 +210,7 @@ nm_ip_address_new_binary(int family, gconstpointer addr, guint prefix, GError **
return NULL; return NULL;
address = g_slice_new(NMIPAddress); address = g_slice_new(NMIPAddress);
*address = (NMIPAddress){ *address = (NMIPAddress) {
.refcount = 1, .refcount = 1,
.family = family, .family = family,
.address = nm_inet_ntop_dup(family, addr), .address = nm_inet_ntop_dup(family, addr),
@ -637,7 +637,7 @@ nm_ip_route_new(int family,
return NULL; return NULL;
route = g_slice_new(NMIPRoute); route = g_slice_new(NMIPRoute);
*route = (NMIPRoute){ *route = (NMIPRoute) {
.refcount = 1, .refcount = 1,
.family = family, .family = family,
.dest = canonicalize_ip_binary(family, &dest_bin, FALSE), .dest = canonicalize_ip_binary(family, &dest_bin, FALSE),
@ -683,7 +683,7 @@ nm_ip_route_new_binary(int family,
return NULL; return NULL;
route = g_slice_new0(NMIPRoute); route = g_slice_new0(NMIPRoute);
*route = (NMIPRoute){ *route = (NMIPRoute) {
.refcount = 1, .refcount = 1,
.family = family, .family = family,
.dest = canonicalize_ip_binary(family, dest, FALSE), .dest = canonicalize_ip_binary(family, dest, FALSE),
@ -1655,7 +1655,7 @@ nm_ip_routing_rule_new(int addr_family)
g_return_val_if_fail(NM_IN_SET(addr_family, AF_INET, AF_INET6), NULL); g_return_val_if_fail(NM_IN_SET(addr_family, AF_INET, AF_INET6), NULL);
self = g_slice_new(NMIPRoutingRule); self = g_slice_new(NMIPRoutingRule);
*self = (NMIPRoutingRule){ *self = (NMIPRoutingRule) {
.ref_count = 1, .ref_count = 1,
.is_v4 = (addr_family == AF_INET), .is_v4 = (addr_family == AF_INET),
.action = FR_ACT_TO_TBL, .action = FR_ACT_TO_TBL,
@ -1685,7 +1685,7 @@ nm_ip_routing_rule_new_clone(const NMIPRoutingRule *rule)
g_return_val_if_fail(NM_IS_IP_ROUTING_RULE(rule, TRUE), NULL); g_return_val_if_fail(NM_IS_IP_ROUTING_RULE(rule, TRUE), NULL);
self = g_slice_new(NMIPRoutingRule); self = g_slice_new(NMIPRoutingRule);
*self = (NMIPRoutingRule){ *self = (NMIPRoutingRule) {
.ref_count = 1, .ref_count = 1,
.sealed = FALSE, .sealed = FALSE,
.is_v4 = rule->is_v4, .is_v4 = rule->is_v4,

View file

@ -482,7 +482,7 @@ void _nm_setting_class_commit(NMSettingClass *setting_class,
&_g; \ &_g; \
}) })
#define NM_SETT_INFO_SETT_DETAIL(...) (&((const NMSettInfoSettDetail){__VA_ARGS__})) #define NM_SETT_INFO_SETT_DETAIL(...) (&((const NMSettInfoSettDetail) {__VA_ARGS__}))
#define NM_SETT_INFO_PROPERT_TYPE_DBUS_INIT(_dbus_type, ...) {.dbus_type = _dbus_type, __VA_ARGS__} #define NM_SETT_INFO_PROPERT_TYPE_DBUS_INIT(_dbus_type, ...) {.dbus_type = _dbus_type, __VA_ARGS__}
@ -504,7 +504,7 @@ void _nm_setting_class_commit(NMSettingClass *setting_class,
#define NM_SETT_INFO_PROPERT_TYPE_GPROP(_dbus_type, ...) \ #define NM_SETT_INFO_PROPERT_TYPE_GPROP(_dbus_type, ...) \
NM_SETT_INFO_PROPERT_TYPE(NM_SETT_INFO_PROPERT_TYPE_GPROP_INIT(_dbus_type, __VA_ARGS__)) NM_SETT_INFO_PROPERT_TYPE(NM_SETT_INFO_PROPERT_TYPE_GPROP_INIT(_dbus_type, __VA_ARGS__))
#define NM_SETT_INFO_PROPERTY(...) (&((const NMSettInfoProperty){__VA_ARGS__})) #define NM_SETT_INFO_PROPERTY(...) (&((const NMSettInfoProperty) {__VA_ARGS__}))
gboolean _nm_properties_override_assert(const NMSettInfoProperty *prop_info); gboolean _nm_properties_override_assert(const NMSettInfoProperty *prop_info);

View file

@ -103,7 +103,7 @@ nm_sriov_vf_new(guint index)
NMSriovVF *vf; NMSriovVF *vf;
vf = g_slice_new(NMSriovVF); vf = g_slice_new(NMSriovVF);
*vf = (NMSriovVF){ *vf = (NMSriovVF) {
.refcount = 1, .refcount = 1,
.index = index, .index = index,
.attributes = g_hash_table_new_full(nm_str_hash, .attributes = g_hash_table_new_full(nm_str_hash,
@ -223,7 +223,7 @@ vf_add_vlan(NMSriovVF *vf, guint vlan_id, guint qos, NMSriovVFVlanProtocol proto
VFVlan *vlan; VFVlan *vlan;
vlan = g_slice_new(VFVlan); vlan = g_slice_new(VFVlan);
*vlan = (VFVlan){ *vlan = (VFVlan) {
.id = vlan_id, .id = vlan_id,
.qos = qos, .qos = qos,
.protocol = protocol, .protocol = protocol,

View file

@ -130,7 +130,7 @@ priority_map_new(guint32 from, guint32 to)
NMVlanQosMapping *mapping; NMVlanQosMapping *mapping;
mapping = g_new(NMVlanQosMapping, 1); mapping = g_new(NMVlanQosMapping, 1);
*mapping = (NMVlanQosMapping){ *mapping = (NMVlanQosMapping) {
.from = from, .from = from,
.to = to, .to = to,
}; };

View file

@ -810,7 +810,7 @@ nm_setting_wired_add_s390_option(NMSettingWired *setting, const char *key, const
&priv->s390_options.arr[dst_idx], &priv->s390_options.arr[dst_idx],
(priv->s390_options.len - dst_idx) * sizeof(NMUtilsNamedValue)); (priv->s390_options.len - dst_idx) * sizeof(NMUtilsNamedValue));
} }
priv->s390_options.arr[dst_idx] = (NMUtilsNamedValue){ priv->s390_options.arr[dst_idx] = (NMUtilsNamedValue) {
.name = g_strdup(key), .name = g_strdup(key),
.value_str = g_strdup(value), .value_str = g_strdup(value),
}; };
@ -1253,7 +1253,7 @@ set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *ps
nm_assert(priv->s390_options.len < priv->s390_options.n_alloc); nm_assert(priv->s390_options.len < priv->s390_options.n_alloc);
priv->s390_options.arr[priv->s390_options.len] = (NMUtilsNamedValue){ priv->s390_options.arr[priv->s390_options.len] = (NMUtilsNamedValue) {
.name = g_strdup(key), .name = g_strdup(key),
.value_str = g_strdup(val), .value_str = g_strdup(val),
}; };

View file

@ -77,7 +77,7 @@ nm_wireguard_peer_new(void)
NMWireGuardPeer *self; NMWireGuardPeer *self;
self = g_slice_new(NMWireGuardPeer); self = g_slice_new(NMWireGuardPeer);
*self = (NMWireGuardPeer){ *self = (NMWireGuardPeer) {
.refcount = 1, .refcount = 1,
.preshared_key_flags = NM_SETTING_SECRET_FLAG_NOT_REQUIRED, .preshared_key_flags = NM_SETTING_SECRET_FLAG_NOT_REQUIRED,
}; };
@ -104,7 +104,7 @@ nm_wireguard_peer_new_clone(const NMWireGuardPeer *self, gboolean with_secrets)
g_return_val_if_fail(NM_IS_WIREGUARD_PEER(self, TRUE), NULL); g_return_val_if_fail(NM_IS_WIREGUARD_PEER(self, TRUE), NULL);
new = g_slice_new(NMWireGuardPeer); new = g_slice_new(NMWireGuardPeer);
*new = (NMWireGuardPeer){ *new = (NMWireGuardPeer) {
.refcount = 1, .refcount = 1,
.public_key = g_strdup(self->public_key), .public_key = g_strdup(self->public_key),
.public_key_valid = self->public_key_valid, .public_key_valid = self->public_key_valid,
@ -1310,7 +1310,7 @@ _peers_set(NMSettingWireGuardPrivate *priv,
if (!pd_same_key) if (!pd_same_key)
pd_same_key = g_slice_new(PeerData); pd_same_key = g_slice_new(PeerData);
*pd_same_key = (PeerData){ *pd_same_key = (PeerData) {
.peer = peer, .peer = peer,
.public_key = public_key, .public_key = public_key,
.idx = priv->peers_arr->len, .idx = priv->peers_arr->len,

View file

@ -446,7 +446,7 @@ _nm_setting_class_commit(NMSettingClass *setting_class,
const NMSettInfoProperty *property_info = &sett_info->property_infos[j]; const NMSettInfoProperty *property_info = &sett_info->property_infos[j];
if (property_info->param_spec) { if (property_info->param_spec) {
*(lookup_by_iter++) = (NMSettInfoPropertLookupByParamSpec){ *(lookup_by_iter++) = (NMSettInfoPropertLookupByParamSpec) {
.param_spec_as_uint = (uintptr_t) ((gpointer) property_info->param_spec), .param_spec_as_uint = (uintptr_t) ((gpointer) property_info->param_spec),
.property_info = property_info, .property_info = property_info,
}; };
@ -4346,7 +4346,7 @@ nm_range_new(guint64 start, guint64 end)
g_return_val_if_fail(start <= end, NULL); g_return_val_if_fail(start <= end, NULL);
range = g_slice_new(NMRange); range = g_slice_new(NMRange);
*range = (NMRange){ *range = (NMRange) {
.refcount = 1, .refcount = 1,
.start = start, .start = start,
.end = end, .end = end,

Some files were not shown because too many files have changed in this diff Show more