summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-10-27 14:36:56 +0200
committerThomas Haller <thaller@redhat.com>2023-11-15 09:32:21 +0100
commitbee14cf47c7e50a8ed579639b4a864e8bdfc9dca (patch)
treec511bff78bdf8b21aa6c426021b22b5f6253b031
parentb4dd83975eeb1cc9f1f8644a261a4d25c3c4eaa1 (diff)
all: use NM_MAX() instead of MAX()
-rw-r--r--src/core/devices/nm-device-ethernet.c2
-rw-r--r--src/core/ndisc/nm-fake-ndisc.c2
-rw-r--r--src/core/ndisc/nm-lndp-ndisc.c2
-rw-r--r--src/core/nm-core-utils.c4
-rw-r--r--src/core/nm-policy.c2
-rw-r--r--src/core/supplicant/nm-supplicant-interface.c2
-rw-r--r--src/libnm-core-impl/nm-utils.c2
-rw-r--r--src/libnm-core-impl/nm-vpn-plugin-info.c4
-rw-r--r--src/libnm-glib-aux/nm-shared-utils.c4
-rw-r--r--src/libnm-platform/nm-platform.c4
-rw-r--r--src/libnmt-newt/nmt-newt-button-box.c4
-rw-r--r--src/libnmt-newt/nmt-newt-section.c2
-rw-r--r--src/libnmt-newt/nmt-newt-utils.c2
-rw-r--r--src/nm-online/nm-online.c2
-rw-r--r--src/nmtui/nmt-connect-connection-list.c2
-rw-r--r--src/nmtui/nmt-editor-grid.c8
-rw-r--r--src/nmtui/nmt-route-table.c4
-rw-r--r--src/nmtui/nmtui-connect.c4
18 files changed, 28 insertions, 28 deletions
diff --git a/src/core/devices/nm-device-ethernet.c b/src/core/devices/nm-device-ethernet.c
index 5d58b69d67..e82d0350d5 100644
--- a/src/core/devices/nm-device-ethernet.c
+++ b/src/core/devices/nm-device-ethernet.c
@@ -1431,7 +1431,7 @@ act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
mtu = nm_setting_ppp_get_mtu(s_ppp);
mru = nm_setting_ppp_get_mru(s_ppp);
- mxu = MAX(mru, mtu);
+ mxu = NM_MAX(mru, mtu);
if (mxu) {
_LOGD(LOGD_PPP,
"set MTU to %u (PPP interface MRU %u, MTU %u)",
diff --git a/src/core/ndisc/nm-fake-ndisc.c b/src/core/ndisc/nm-fake-ndisc.c
index f305e7713f..f0b6dcf6ae 100644
--- a/src/core/ndisc/nm-fake-ndisc.c
+++ b/src/core/ndisc/nm-fake-ndisc.c
@@ -239,7 +239,7 @@ receive_ra(gpointer user_data)
priv->receive_ra_id = 0;
/* preserve the "most managed" level on updates. */
- dhcp_level = MAX(rdata->public.dhcp_level, ra->dhcp_level);
+ dhcp_level = NM_MAX(rdata->public.dhcp_level, ra->dhcp_level);
if (rdata->public.dhcp_level != dhcp_level) {
rdata->public.dhcp_level = dhcp_level;
diff --git a/src/core/ndisc/nm-lndp-ndisc.c b/src/core/ndisc/nm-lndp-ndisc.c
index 63dde5a5b8..932366ff50 100644
--- a/src/core/ndisc/nm-lndp-ndisc.c
+++ b/src/core/ndisc/nm-lndp-ndisc.c
@@ -161,7 +161,7 @@ receive_ra(struct ndp *ndp, struct ndp_msg *msg, gpointer user_data)
* let's keep the "most managed" level. */
G_STATIC_ASSERT_EXPR(NM_NDISC_DHCP_LEVEL_MANAGED > NM_NDISC_DHCP_LEVEL_OTHERCONF);
G_STATIC_ASSERT_EXPR(NM_NDISC_DHCP_LEVEL_OTHERCONF > NM_NDISC_DHCP_LEVEL_NONE);
- dhcp_level = MAX(dhcp_level, rdata->public.dhcp_level);
+ dhcp_level = NM_MAX(dhcp_level, rdata->public.dhcp_level);
if (dhcp_level != rdata->public.dhcp_level) {
rdata->public.dhcp_level = dhcp_level;
diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c
index c62c8f47d5..9d3bb9582e 100644
--- a/src/core/nm-core-utils.c
+++ b/src/core/nm-core-utils.c
@@ -4256,8 +4256,8 @@ read_device_factory_paths_sort_fcn(gconstpointer a, gconstpointer b)
const struct plugin_info *db = b;
time_t ta, tb;
- ta = MAX(da->st.st_mtime, da->st.st_ctime);
- tb = MAX(db->st.st_mtime, db->st.st_ctime);
+ ta = NM_MAX(da->st.st_mtime, da->st.st_ctime);
+ tb = NM_MAX(db->st.st_mtime, db->st.st_ctime);
if (ta < tb)
return 1;
diff --git a/src/core/nm-policy.c b/src/core/nm-policy.c
index 2873847df3..feea97b114 100644
--- a/src/core/nm-policy.c
+++ b/src/core/nm-policy.c
@@ -1766,7 +1766,7 @@ _connection_autoconnect_retries_set(NMPolicy *self,
nm_assert(retry_time != 0);
priv->reset_connections_retries_idle_source = nm_g_timeout_add_seconds_source(
- MAX(0, retry_time - nm_utils_get_monotonic_timestamp_sec()),
+ NM_MAX(0, retry_time - nm_utils_get_monotonic_timestamp_sec()),
reset_connections_retries,
self);
}
diff --git a/src/core/supplicant/nm-supplicant-interface.c b/src/core/supplicant/nm-supplicant-interface.c
index 46a7bc46e0..eb7a40a548 100644
--- a/src/core/supplicant/nm-supplicant-interface.c
+++ b/src/core/supplicant/nm-supplicant-interface.c
@@ -1380,7 +1380,7 @@ _get_capability(NMSupplicantInterfacePrivate *priv, NMSupplCapType type)
case NM_SUPPL_CAP_TYPE_AP:
iface_value = NM_SUPPL_CAP_MASK_GET(priv->iface_capabilities, type);
value = NM_SUPPL_CAP_MASK_GET(priv->global_capabilities, type);
- value = MAX(iface_value, value);
+ value = NM_MAX(iface_value, value);
break;
case NM_SUPPL_CAP_TYPE_FT:
value = NM_SUPPL_CAP_MASK_GET(priv->global_capabilities, type);
diff --git a/src/libnm-core-impl/nm-utils.c b/src/libnm-core-impl/nm-utils.c
index c4fb62b875..c476d18661 100644
--- a/src/libnm-core-impl/nm-utils.c
+++ b/src/libnm-core-impl/nm-utils.c
@@ -1518,7 +1518,7 @@ nm_utils_ip4_routes_to_variant(GPtrArray *routes)
array[1] = nm_ip_route_get_prefix(route);
nm_ip_route_get_next_hop_binary(route, &array[2]);
/* The old routes format uses "0" for default, not "-1" */
- array[3] = MAX(0, nm_ip_route_get_metric(route));
+ array[3] = NM_MAX(0, nm_ip_route_get_metric(route));
g_variant_builder_add(&builder, "@au", nm_g_variant_new_au(array, 4));
}
diff --git a/src/libnm-core-impl/nm-vpn-plugin-info.c b/src/libnm-core-impl/nm-vpn-plugin-info.c
index aaeefe5ed1..588df91726 100644
--- a/src/libnm-core-impl/nm-vpn-plugin-info.c
+++ b/src/libnm-core-impl/nm-vpn-plugin-info.c
@@ -181,8 +181,8 @@ _sort_files(LoadDirInfo *a, LoadDirInfo *b)
{
time_t ta, tb;
- ta = MAX(a->stat.st_mtime, a->stat.st_ctime);
- tb = MAX(b->stat.st_mtime, b->stat.st_ctime);
+ ta = NM_MAX(a->stat.st_mtime, a->stat.st_ctime);
+ tb = NM_MAX(b->stat.st_mtime, b->stat.st_ctime);
if (ta < tb)
return 1;
if (ta > tb)
diff --git a/src/libnm-glib-aux/nm-shared-utils.c b/src/libnm-glib-aux/nm-shared-utils.c
index 34f5ce4185..99bb8d6e18 100644
--- a/src/libnm-glib-aux/nm-shared-utils.c
+++ b/src/libnm-glib-aux/nm-shared-utils.c
@@ -6962,10 +6962,10 @@ _poll_done_cb(GObject *source, GAsyncResult *result, gpointer user_data)
else
wait_ms = 0;
if (poll_task_data->sleep_timeout_ms > 0)
- wait_ms = MAX(wait_ms, poll_task_data->sleep_timeout_ms);
+ wait_ms = NM_MAX(wait_ms, poll_task_data->sleep_timeout_ms);
poll_task_data->source_next_poll =
- nm_g_source_attach(nm_g_timeout_source_new(MAX(1, wait_ms),
+ nm_g_source_attach(nm_g_timeout_source_new(NM_MAX(1, wait_ms),
G_PRIORITY_DEFAULT,
_poll_start_cb,
poll_task_data,
diff --git a/src/libnm-platform/nm-platform.c b/src/libnm-platform/nm-platform.c
index 7ac1ba2007..a4751113da 100644
--- a/src/libnm-platform/nm-platform.c
+++ b/src/libnm-platform/nm-platform.c
@@ -8651,7 +8651,7 @@ nm_platform_ip4_route_hash_update(const NMPlatformIP4Route *obj,
obj->ifindex,
nm_platform_ip4_route_get_n_nexthops(obj),
obj->gateway,
- (guint8) MAX(obj->weight, 1u));
+ (guint8) NM_MAX(obj->weight, 1u));
}
}
break;
@@ -8666,7 +8666,7 @@ nm_platform_ip4_route_hash_update(const NMPlatformIP4Route *obj,
obj->metric,
nm_platform_ip4_route_get_n_nexthops(obj),
obj->gateway,
- (guint8) MAX(obj->weight, 1u),
+ (guint8) NM_MAX(obj->weight, 1u),
nmp_utils_ip_config_source_round_trip_rtprot(obj->rt_source),
_ip_route_scope_inv_get_normalized(obj),
obj->tos,
diff --git a/src/libnmt-newt/nmt-newt-button-box.c b/src/libnmt-newt/nmt-newt-button-box.c
index f3c8b27e3b..de17d5a873 100644
--- a/src/libnmt-newt/nmt-newt-button-box.c
+++ b/src/libnmt-newt/nmt-newt-button-box.c
@@ -218,12 +218,12 @@ size_request_buttons(NmtNewtButtonBox *bbox, GPtrArray *buttons, int *width, int
*width += child_width;
if (i > 0)
*width += 1;
- *height = MAX(*height, child_height);
+ *height = NM_MAX(*height, child_height);
} else {
*height += child_height;
if (i > 0)
*height += 1;
- *width = MAX(*width, child_width);
+ *width = NM_MAX(*width, child_width);
}
}
}
diff --git a/src/libnmt-newt/nmt-newt-section.c b/src/libnmt-newt/nmt-newt-section.c
index eb551273a3..e0c404f0e3 100644
--- a/src/libnmt-newt/nmt-newt-section.c
+++ b/src/libnmt-newt/nmt-newt-section.c
@@ -249,7 +249,7 @@ nmt_newt_section_size_request(NmtNewtWidget *widget, int *width, int *height)
nmt_newt_widget_size_request(priv->header, &priv->hwidth_req, &priv->hheight_req);
nmt_newt_widget_size_request(priv->body, &priv->bwidth_req, &priv->bheight_req);
- *width = MAX(priv->hwidth_req, priv->bwidth_req) + 2;
+ *width = NM_MAX(priv->hwidth_req, priv->bwidth_req) + 2;
if (priv->open)
*height = priv->hheight_req + priv->bheight_req + (priv->show_border ? 1 : 0);
else
diff --git a/src/libnmt-newt/nmt-newt-utils.c b/src/libnmt-newt/nmt-newt-utils.c
index 14825fab0a..e021981cc2 100644
--- a/src/libnmt-newt/nmt-newt-utils.c
+++ b/src/libnmt-newt/nmt-newt-utils.c
@@ -65,7 +65,7 @@ nmt_newt_dialog_g_log_handler(const char *log_domain,
*/
newtGetScreenSize(&screen_width, &screen_height);
- text = newtTextboxReflowed(-1, -1, full_message, MAX(70, screen_width - 10), 0, 0, 0);
+ text = newtTextboxReflowed(-1, -1, full_message, NM_MAX(70, screen_width - 10), 0, 0, 0);
g_free(full_message);
ok = newtButton(-1, -1, "OK");
diff --git a/src/nm-online/nm-online.c b/src/nm-online/nm-online.c
index bba3cd5cc6..b1de621e67 100644
--- a/src/nm-online/nm-online.c
+++ b/src/nm-online/nm-online.c
@@ -76,7 +76,7 @@ _print_progress(gboolean wait_startup, int progress_next_step_i, gint64 remainin
g_print("\r%s", _("Connecting"));
for (i = 0; i < PROGRESS_STEPS; i++)
putchar(i < j ? '.' : ' ');
- g_print(" %4lds", (long) (MAX(0, remaining_ms + 999) / 1000));
+ g_print(" %4lds", (long) (NM_MAX(0, remaining_ms + 999) / 1000));
if (retval != EXIT_NONE) {
const char *result;
diff --git a/src/nmtui/nmt-connect-connection-list.c b/src/nmtui/nmt-connect-connection-list.c
index 5d771b618e..329494cc1b 100644
--- a/src/nmtui/nmt-connect-connection-list.c
+++ b/src/nmtui/nmt-connect-connection-list.c
@@ -480,7 +480,7 @@ nmt_connect_connection_list_rebuild(NmtConnectConnectionList *list)
for (citer = nmtdev->conns; citer; citer = citer->next) {
nmtconn = citer->data;
- max_width = MAX(max_width, nmt_newt_text_width(nmtconn->name));
+ max_width = NM_MAX(max_width, nmt_newt_text_width(nmtconn->name));
}
}
diff --git a/src/nmtui/nmt-editor-grid.c b/src/nmtui/nmt-editor-grid.c
index 9b76e3fe22..bdcc02e259 100644
--- a/src/nmtui/nmt-editor-grid.c
+++ b/src/nmtui/nmt-editor-grid.c
@@ -326,10 +326,10 @@ nmt_editor_grid_size_request(NmtNewtWidget *widget, int *width, int *height)
if (rows[i].label) {
nmt_newt_widget_size_request(rows[i].label, &lwidth, &lheight);
lwidth += priv->indent;
- state->col_widths[0] = MAX(state->col_widths[0], lwidth);
+ state->col_widths[0] = NM_MAX(state->col_widths[0], lwidth);
nmt_newt_widget_size_request(rows[i].widget, &wwidth, &wheight);
- state->col_widths[1] = MAX(state->col_widths[1], wwidth);
+ state->col_widths[1] = NM_MAX(state->col_widths[1], wwidth);
priv->row_heights[i] = wheight;
add_padding = TRUE;
@@ -340,8 +340,8 @@ nmt_editor_grid_size_request(NmtNewtWidget *widget, int *width, int *height)
if (rows[i].extra) {
nmt_newt_widget_size_request(rows[i].extra, &ewidth, &eheight);
- state->col_widths[2] = MAX(state->col_widths[2], ewidth);
- priv->row_heights[i] = MAX(priv->row_heights[i], eheight);
+ state->col_widths[2] = NM_MAX(state->col_widths[2], ewidth);
+ priv->row_heights[i] = NM_MAX(priv->row_heights[i], eheight);
}
*height += priv->row_heights[i];
diff --git a/src/nmtui/nmt-route-table.c b/src/nmtui/nmt-route-table.c
index 4dc28d7ca5..04c37f3a37 100644
--- a/src/nmtui/nmt-route-table.c
+++ b/src/nmtui/nmt-route-table.c
@@ -185,8 +185,8 @@ nmt_route_table_init(NmtRouteTable *table)
metric_width = nmt_newt_text_width(text);
nmt_newt_grid_add(NMT_NEWT_GRID(header), metric_label, 2, 0);
- priv->ip_entry_width = MAX(20, MAX(dest_prefix_width, next_hop_width));
- priv->metric_entry_width = MAX(7, metric_width);
+ priv->ip_entry_width = NM_MAX(20, NM_MAX(dest_prefix_width, next_hop_width));
+ priv->metric_entry_width = NM_MAX(7, metric_width);
nmt_newt_widget_set_padding(dest_prefix_label,
0,
diff --git a/src/nmtui/nmtui-connect.c b/src/nmtui/nmtui-connect.c
index 0dfbf6ac20..4f90adf324 100644
--- a/src/nmtui/nmtui-connect.c
+++ b/src/nmtui/nmtui-connect.c
@@ -326,8 +326,8 @@ listbox_active_changed(GObject *object, GParamSpec *pspec, gpointer button)
deactivate = _("Deactivate");
deactivate_width = nmt_newt_text_width(deactivate);
- activate_padding = MAX(0, deactivate_width - activate_width);
- deactivate_padding = MAX(0, activate_width - deactivate_width);
+ activate_padding = NM_MAX(0, deactivate_width - activate_width);
+ deactivate_padding = NM_MAX(0, activate_width - deactivate_width);
}
has_selection = nmt_connect_connection_list_get_selection(list, NULL, NULL, NULL, &ac);