From 7e5babf57f1fbc8131465f1377aaa36fa1a2615d Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 1 May 2024 18:14:17 +0200 Subject: [PATCH] core: replace MIN() by type-sage std::min() in divelist.cpp Signed-off-by: Berthold Stoeger --- core/divelist.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/divelist.cpp b/core/divelist.cpp index 4ec6acfb5..e841242e8 100644 --- a/core/divelist.cpp +++ b/core/divelist.cpp @@ -90,8 +90,8 @@ static int get_sample_o2(const struct dive *dive, const struct divecomputer *dc, po2f = sample->o2sensor[0].mbar; // then use data from the first o2 sensor po2 = (po2f + po2i) / 2; } else if (sample->setpoint.mbar > 0) { - po2 = MIN((int) sample->setpoint.mbar, - depth_to_mbar(sample->depth.mm, dive)); + po2 = std::min((int) sample->setpoint.mbar, + depth_to_mbar(sample->depth.mm, dive)); } else { double amb_presure = depth_to_bar(sample->depth.mm, dive); double pamb_pressure = depth_to_bar(psample->depth.mm , dive); @@ -133,11 +133,11 @@ static int calculate_otu(const struct dive *dive) po2f = sample->o2sensor[0].mbar; // ... use data from the first o2 sensor } else { if (sample->setpoint.mbar > 0) { - po2f = MIN((int) sample->setpoint.mbar, - depth_to_mbar(sample->depth.mm, dive)); + po2f = std::min((int) sample->setpoint.mbar, + depth_to_mbar(sample->depth.mm, dive)); if (psample->setpoint.mbar > 0) - po2i = MIN((int) psample->setpoint.mbar, - depth_to_mbar(psample->depth.mm, dive)); + po2i = std::min((int) psample->setpoint.mbar, + depth_to_mbar(psample->depth.mm, dive)); else po2i = po2f; } else { // For OC and rebreather without o2 sensor/setpoint