From patchwork Thu Sep 26 10:06:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 21382 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 48EC2C3257 for ; Thu, 26 Sep 2024 10:06:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E6C6263512; Thu, 26 Sep 2024 12:06:46 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="BO+zaK63"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5BD4063502 for ; Thu, 26 Sep 2024 12:06:44 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3C86D169; Thu, 26 Sep 2024 12:05:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1727345116; bh=N6/1+pl6re+RDtfEJoaxQmGZZ72ipCsVNesaobraqZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BO+zaK63FQqB/h/ZiPBTxg9h6VhwdS8RFywqlmpG6FAv3V3M8/BoE8K0FWFyR6Bkb RKQIcKsjk8pJDA2TekmqDZLqocqgA1N9JwrQVmSQFEbW+3ssOrIPP7V3WOiFefznqd DBCWjesaNya3yY/r9p1IS/a/Mvh3kwKd+W6av4ak= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , David Plowman Subject: [PATCH 2/2] libcamera: Replace last users of math.c Date: Thu, 26 Sep 2024 13:06:40 +0300 Message-ID: <20240926100640.3504-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240926100640.3504-1-laurent.pinchart@ideasonboard.com> References: <20240926100640.3504-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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(-) diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp index 81a7a8ab01b8..74a5d93f88ae 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 4a990bb994b9..1b224f1989fe 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;