From patchwork Mon Aug 3 14:18:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 9138 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 1D0FEBD87A for ; Mon, 3 Aug 2020 14:15:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A0AAE605A9; Mon, 3 Aug 2020 16:15:07 +0200 (CEST) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3FC3760536 for ; Mon, 3 Aug 2020 16:15:06 +0200 (CEST) X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 6BF0040011; Mon, 3 Aug 2020 14:15:03 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Mon, 3 Aug 2020 16:18:37 +0200 Message-Id: <20200803141837.398158-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: ipu3: Fix compilation issues with gcc5 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" GCC5 does not provide prototypes for the math library functions in the std:: namespace. Remove the namespace specifier to fix build errors reported by that compiler version. Fixes: 968ab9bad0ed ("libcamera: ipu3: imgu: Calculate ImgU pipe configuration") Signed-off-by: Jacopo Mondi --- Laurent, can you test with gcc and confirm this fixes the issue ? --- src/libcamera/pipeline/ipu3/imgu.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.27.0 diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp index b7593ceb3672..671a798e69d0 100644 --- a/src/libcamera/pipeline/ipu3/imgu.cpp +++ b/src/libcamera/pipeline/ipu3/imgu.cpp @@ -94,7 +94,7 @@ float findScaleFactor(float sf, const std::vector &range, float bestDiff = std::numeric_limits::max(); unsigned int index = 0; for (unsigned int i = 0; i < range.size(); ++i) { - float diff = std::abs(sf - range[i]); + float diff = abs(sf - range[i]); if (diff < bestDiff) { bestDiff = diff; index = i; @@ -112,7 +112,7 @@ bool isSameRatio(const Size &in, const Size &out) float inRatio = static_cast(in.width) / in.height; float outRatio = static_cast(out.width) / out.height; - if (std::abs(inRatio - outRatio) > 0.1) + if (abs(inRatio - outRatio) > 0.1) return false; return true; @@ -136,7 +136,7 @@ void calculateBDSHeight(ImgUDevice::Pipe *pipe, const Size &iif, const Size &gdc while (ifHeight >= minIFHeight && ifHeight / bdsSF >= minBDSHeight) { bdsHeight = ifHeight / bdsSF; - if (std::fmod(bdsHeight, 1.0) == 0) { + if (fmod(bdsHeight, 1.0) == 0) { unsigned int bdsIntHeight = static_cast(bdsHeight); if (!(bdsIntHeight % BDS_ALIGN_H)) { @@ -152,7 +152,7 @@ void calculateBDSHeight(ImgUDevice::Pipe *pipe, const Size &iif, const Size &gdc while (ifHeight <= iif.height && ifHeight / bdsSF >= minBDSHeight) { bdsHeight = ifHeight / bdsSF; - if (std::fmod(bdsHeight, 1.0) == 0) { + if (fmod(bdsHeight, 1.0) == 0) { unsigned int bdsIntHeight = static_cast(bdsHeight); if (!(bdsIntHeight % BDS_ALIGN_H)) { @@ -176,7 +176,7 @@ void calculateBDSHeight(ImgUDevice::Pipe *pipe, const Size &iif, const Size &gdc while (ifHeight > minIFHeight && ifHeight / bdsSF >= minBDSHeight) { bdsHeight = ifHeight / bdsSF; - if (std::fmod(ifHeight, 1.0) == 0 && std::fmod(bdsHeight, 1.0) == 0) { + if (fmod(ifHeight, 1.0) == 0 && fmod(bdsHeight, 1.0) == 0) { unsigned int bdsIntHeight = static_cast(bdsHeight); if (!(ifHeight % IF_ALIGN_H) && @@ -199,7 +199,7 @@ void calculateBDS(ImgUDevice::Pipe *pipe, const Size &iif, const Size &gdc, floa while (sf <= BDS_SF_MAX && sf >= BDS_SF_MIN) { float bdsWidth = static_cast(iif.width) / sf; - if (std::fmod(bdsWidth, 1.0) == 0) { + if (fmod(bdsWidth, 1.0) == 0) { unsigned int bdsIntWidth = static_cast(bdsWidth); if (!(bdsIntWidth % BDS_ALIGN_W) && bdsWidth >= minBDSWidth) calculateBDSHeight(pipe, iif, gdc, bdsIntWidth, sf); @@ -212,7 +212,7 @@ void calculateBDS(ImgUDevice::Pipe *pipe, const Size &iif, const Size &gdc, floa while (sf <= BDS_SF_MAX && sf >= BDS_SF_MIN) { float bdsWidth = static_cast(iif.width) / sf; - if (std::fmod(bdsWidth, 1.0) == 0) { + if (fmod(bdsWidth, 1.0) == 0) { unsigned int bdsIntWidth = static_cast(bdsWidth); if (!(bdsIntWidth % BDS_ALIGN_W) && bdsWidth >= minBDSWidth) calculateBDSHeight(pipe, iif, gdc, bdsIntWidth, sf);