From 563a18513514f8eeb2d83849bbcbd110e4888b8c Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 30 Oct 2023 17:21:58 +0100 Subject: [PATCH] all: use nm_g_array_first_p() instead of nm_g_array_index_p(,,0) where applicable --- src/libnm-core-impl/nm-setting.c | 4 ++-- src/nmtui/nmt-8021x-fields.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libnm-core-impl/nm-setting.c b/src/libnm-core-impl/nm-setting.c index 276dfd3475..efbdc3f5da 100644 --- a/src/libnm-core-impl/nm-setting.c +++ b/src/libnm-core-impl/nm-setting.c @@ -355,7 +355,7 @@ _nm_setting_class_commit(NMSettingClass *setting_class, guint k; nm_assert(!_nm_sett_info_property_find_in_array( - nm_g_array_index_p(properties_override, NMSettInfoProperty, 0), + nm_g_array_first_p(properties_override, NMSettInfoProperty), i, p->name)); for (k = 0; k < n_property_specs; k++) { @@ -374,7 +374,7 @@ _nm_setting_class_commit(NMSettingClass *setting_class, NMSettInfoProperty *p; if (_nm_sett_info_property_find_in_array( - nm_g_array_index_p(properties_override, NMSettInfoProperty, 0), + nm_g_array_first_p(properties_override, NMSettInfoProperty), override_len, name)) continue; diff --git a/src/nmtui/nmt-8021x-fields.c b/src/nmtui/nmt-8021x-fields.c index 3a2185cfbb..a323be62d7 100644 --- a/src/nmtui/nmt-8021x-fields.c +++ b/src/nmtui/nmt-8021x-fields.c @@ -552,7 +552,7 @@ nmt_8021x_fields_constructed(GObject *object) entry.id = (char *) eap_method_descs[i].id; g_array_append_val(entries, entry); } - priv->authentication = nmt_newt_popup_new(nm_g_array_index_p(entries, NmtNewtPopupEntry, 0)); + priv->authentication = nmt_newt_popup_new(nm_g_array_first_p(entries, NmtNewtPopupEntry)); nmt_editor_grid_append(grid, "Authentication", NMT_NEWT_WIDGET(priv->authentication), NULL); widget = nmt_newt_stack_new();