{"id":17718,"url":"https://patchwork.libcamera.org/api/patches/17718/?format=json","web_url":"https://patchwork.libcamera.org/patch/17718/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20221028031726.4849-7-nicholas@rothemail.net>","date":"2022-10-28T03:17:22","name":"[libcamera-devel,v5,06/10] ipa: raspberry: replace abs() with std::abs()","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"f0522321abad622dafc19e4f4c345c32312cbeb1","submitter":{"id":97,"url":"https://patchwork.libcamera.org/api/people/97/?format=json","name":"Nicolas Dufresne via libcamera-devel","email":"libcamera-devel@lists.libcamera.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17718/mbox/","series":[{"id":3583,"url":"https://patchwork.libcamera.org/api/series/3583/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3583","date":"2022-10-28T03:17:17","name":"[libcamera-devel,v5,01/10] ipa: workaround libcxx duration limitation","version":5,"mbox":"https://patchwork.libcamera.org/series/3583/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17718/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17718/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 13B32C3285\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 28 Oct 2022 03:17:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C6CCD62FC4;\n\tFri, 28 Oct 2022 05:17:42 +0200 (CEST)","from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com\n\t[IPv6:2001:4860:4864:20::2d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8E77562FB5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 Oct 2022 05:17:35 +0200 (CEST)","by mail-oa1-x2d.google.com with SMTP id\n\t586e51a60fabf-12c8312131fso4995354fac.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Oct 2022 20:17:35 -0700 (PDT)","from nroth-pc.attlocal.net\n\t([2600:1700:20:20c0:293a:90ce:6463:244d])\n\tby smtp.gmail.com with ESMTPSA id\n\tfp19-20020a056870659300b0013626c1a5f6sm1527738oab.10.2022.10.27.20.17.33\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 27 Oct 2022 20:17:33 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1666927062;\n\tbh=3SsAYU1JMVdyMQ/zKyB1Y/Gfebk17k1NLKqdg6/vOfI=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=0fjSDZMjtJPrmfYnHp2l+NJu2KE+r8pldLg1aaBcSAE8Dr/PeaxrLifbIPrLvSq34\n\t+LFk3APlGYjliwXGYjpF4ZaSmvOYqLMMPq/w4MeBo4j72W1N2KgTDyx7Z5nmXQ6PSX\n\trghwmfjMcY2Tn980c+mK+ayNgBu+IZbgzlkiZQo4qpjBADofrgXLtwByinGBbEyEHO\n\tyozwdN3mKsbFRRpZ4w17uRQE/KNH9BANiPoNwbuaYG5oueCdmAIkJi1e/P/rDfQHAy\n\tLZhCdZ+6AqZIIsaQWjCMYBQBsE4ECi5V9scTtB/1nhJmcjMfXI/YrBmN6uZPTkZoUM\n\tFnZnkPQ+PngFg==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=rothemail-net.20210112.gappssmtp.com; s=20210112;\n\th=content-transfer-encoding:mime-version:reply-to:references\n\t:in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject\n\t:date:message-id:reply-to;\n\tbh=RPptAfrtD7k2o7VEK6frv0lekwlYg6ZLNrxS93bfFPA=;\n\tb=JwNSZccGijEqrToI0s2uAb523FPaK7YRYZjHoqvCozsBau94Xg5o0uuFhh9UR4ROeV\n\tkkaAfBtMGXNUOX+pOUnsExe1ipi8HNvzmNFIGBKBexo48T9LAJz8mCUWLpQgNDvZt/7S\n\tVvim4NlDCG6vuUDkyCIdZXpOuNXpt/cI5eo4anfA54LuMQZWY81H4W2devg8YAG84BEd\n\teKoyIM7c5d1q/V2EzUAmp9h+cGB2HgPKWhIoj/fQcRng22uRFVaBJb0UP6c9UO9X0CYC\n\t5WMXf82EYe5/19QCD5p03/PVhk/2Kzqkr7RUjBC5LZYedD9l3wXTNxm2JLy1Mfs4hdRl\n\tYjoQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=rothemail-net.20210112.gappssmtp.com\n\theader.i=@rothemail-net.20210112.gappssmtp.com header.b=\"JwNSZccG\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:reply-to:references\n\t:in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state\n\t:from:to:cc:subject:date:message-id:reply-to;\n\tbh=RPptAfrtD7k2o7VEK6frv0lekwlYg6ZLNrxS93bfFPA=;\n\tb=mW9M60h5/H+kJeY7iE7X4O9NjuE3OY451Q0hSZHRui56G8bjKM54UIfwYULfdLHdcT\n\t2d+w7qRkrBlVBp8NZWVfab+THNRAyiCfA/13rrrFKIVPq8MDQXcmL7JWnqxN77uIwXDv\n\tgKejnZHLavZhGOBy9Wtm3rIKVfMvv48EI4ypxmhhM2hA3/lwWthNab7rFkAT2ecKLfCQ\n\t48gFgq3p9r/AaHJTvKfLYSFP35GEDhgY/zhh6aQf2sHGAHO6KBkRAe+nNS7bZib+McyF\n\tDGZFjirnE+A1CRCESMkT+xdP+8xQWoTE3yQsF6WXQP2xoRASAu0tPYxBuy2OtxIDgzQg\n\taiKw==","X-Gm-Message-State":"ACrzQf1YuXkUzzqDlo+vl83FyXN3W3X/eoQttm1XkFG3sU+HBKOEoWMx\n\t8CiOTgXfdElmttCn8Os3+GhnFRjN8QGZc3Rl+fM=","X-Google-Smtp-Source":"AMsMyM5Ck4hasarzQ77XKMryQZzln96CcKyMmKPhrvhIInxcMTlRBoEBmmVeQJmElcdpz8/ktK/kiw==","X-Received":"by 2002:a05:6870:f21b:b0:13a:ffec:f7ba with SMTP id\n\tt27-20020a056870f21b00b0013affecf7bamr7969090oao.218.1666927053860; \n\tThu, 27 Oct 2022 20:17:33 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 27 Oct 2022 22:17:22 -0500","Message-Id":"<20221028031726.4849-7-nicholas@rothemail.net>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20221028031726.4849-1-nicholas@rothemail.net>","References":"<20221027224135.348115-1-nicholas@rothemail.net>\n\t<20221028031726.4849-1-nicholas@rothemail.net>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v5 06/10] ipa: raspberry: replace abs()\n\twith std::abs()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Nicholas Roth via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"libcamera-devel@lists.libcamera.org","Cc":"nicholas@rothemail.net","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"From: Nicholas Roth <nicholas@rothemail.net>\n\npwl.cpp uses abs() instead of std::abs(), which causes unexpected\nbehavior in the Clang compiler used for Android. Replace with\nC++-standard absolute value function std::abs(), which supports\ndouble-precision absolute values in a standard way.\n\nSigned-off-by: Nicholas Roth <nicholas@rothemail.net>\n---\n src/ipa/raspberrypi/controller/pwl.cpp | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)","diff":"diff --git a/src/ipa/raspberrypi/controller/pwl.cpp b/src/ipa/raspberrypi/controller/pwl.cpp\nindex c59f5fa1..70c2e24b 100644\n--- a/src/ipa/raspberrypi/controller/pwl.cpp\n+++ b/src/ipa/raspberrypi/controller/pwl.cpp\n@@ -6,6 +6,7 @@\n  */\n \n #include <cassert>\n+#include <cmath>\n #include <stdexcept>\n \n #include \"pwl.h\"\n@@ -168,7 +169,7 @@ Pwl Pwl::compose(Pwl const &other, const double eps) const\n \twhile (thisSpan != (int)points_.size() - 1) {\n \t\tdouble dx = points_[thisSpan + 1].x - points_[thisSpan].x,\n \t\t       dy = points_[thisSpan + 1].y - points_[thisSpan].y;\n-\t\tif (abs(dy) > eps &&\n+\t\tif (std::abs(dy) > eps &&\n \t\t    otherSpan + 1 < (int)other.points_.size() &&\n \t\t    points_[thisSpan + 1].y >=\n \t\t\t    other.points_[otherSpan + 1].x + eps) {\n@@ -181,7 +182,7 @@ Pwl Pwl::compose(Pwl const &other, const double eps) const\n \t\t\t\t points_[thisSpan].y) *\n \t\t\t\t\tdx / dy;\n \t\t\tthisY = other.points_[++otherSpan].x;\n-\t\t} else if (abs(dy) > eps && otherSpan > 0 &&\n+\t\t} else if (std::abs(dy) > eps && otherSpan > 0 &&\n \t\t\t   points_[thisSpan + 1].y <=\n \t\t\t\t   other.points_[otherSpan - 1].x - eps) {\n \t\t\t/*\n","prefixes":["libcamera-devel","v5","06/10"]}