From 8d22064082aa2c8b451a6a4cc1ea6078aa1d1ce7 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 26 Sep 2024 12:29:28 +0300 Subject: libcamera: Replace last users of math.h As described in the coding style document, libcamera favours over . Replace the last few occurrences of the latter with the former and adapt the code accordingly. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Naushir Patuck --- src/libcamera/pipeline/ipu3/cio2.cpp | 4 ++-- src/libcamera/sensor/camera_sensor.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp index 81a7a8ab..74a5d93f 100644 --- a/src/libcamera/pipeline/ipu3/cio2.cpp +++ b/src/libcamera/pipeline/ipu3/cio2.cpp @@ -7,8 +7,8 @@ #include "cio2.h" +#include #include -#include #include @@ -304,7 +304,7 @@ V4L2SubdeviceFormat CIO2Device::getSensorFormat(const std::vector * comparing it with a single precision digit is enough. */ ratio = static_cast(ratio * 10) / 10.0; - float ratioDiff = fabsf(ratio - desiredRatio); + float ratioDiff = std::abs(ratio - desiredRatio); unsigned int area = sz.width * sz.height; unsigned int areaDiff = area - desiredArea; diff --git a/src/libcamera/sensor/camera_sensor.cpp b/src/libcamera/sensor/camera_sensor.cpp index 4a990bb9..1b224f19 100644 --- a/src/libcamera/sensor/camera_sensor.cpp +++ b/src/libcamera/sensor/camera_sensor.cpp @@ -8,9 +8,9 @@ #include "libcamera/internal/camera_sensor.h" #include +#include #include #include -#include #include #include @@ -719,7 +719,7 @@ V4L2SubdeviceFormat CameraSensor::getFormat(const std::vector &mbu continue; float ratio = static_cast(sz.width) / sz.height; - float ratioDiff = fabsf(ratio - desiredRatio); + float ratioDiff = std::abs(ratio - desiredRatio); unsigned int area = sz.width * sz.height; unsigned int areaDiff = area - desiredArea; -- cgit v1.2.1