{"id":17705,"url":"https://patchwork.libcamera.org/api/1.1/patches/17705/?format=json","web_url":"https://patchwork.libcamera.org/patch/17705/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20221027224135.348115-7-nicholas@rothemail.net>","date":"2022-10-27T22:41:31","name":"[libcamera-devel,v4,06/10] ipa: raspberry: replace abs() with std::abs()","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"f0522321abad622dafc19e4f4c345c32312cbeb1","submitter":{"id":97,"url":"https://patchwork.libcamera.org/api/1.1/people/97/?format=json","name":"Nicolas Dufresne via libcamera-devel","email":"libcamera-devel@lists.libcamera.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17705/mbox/","series":[{"id":3581,"url":"https://patchwork.libcamera.org/api/1.1/series/3581/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3581","date":"2022-10-27T22:41:26","name":"[libcamera-devel,v4,01/10] ipa: workaround libcxx duration limitation","version":4,"mbox":"https://patchwork.libcamera.org/series/3581/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17705/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17705/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 A3D05C3285\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 Oct 2022 22:41:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4C1CA62FB5;\n\tFri, 28 Oct 2022 00:41:50 +0200 (CEST)","from mail-oa1-x32.google.com (mail-oa1-x32.google.com\n\t[IPv6:2001:4860:4864:20::32])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C744F62FAB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 Oct 2022 00:41:44 +0200 (CEST)","by mail-oa1-x32.google.com with SMTP id\n\t586e51a60fabf-1322d768ba7so4314628fac.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Oct 2022 15:41:44 -0700 (PDT)","from nroth-pc.attlocal.net\n\t([2600:1700:20:20c0:6a4b:7aa7:dda2:75cb])\n\tby smtp.gmail.com with ESMTPSA id\n\tr20-20020a056830419400b006619533d1ddsm976825otu.76.2022.10.27.15.41.43\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 27 Oct 2022 15:41:43 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1666910510;\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=JK+/lwHM4LsoYMVGdK/EciTAzWE7gSm5GKPJSGHl64N51FeoU+F1DMBEL2tlvSo/R\n\t2nq2Hx9ISOwsdcVd82Xxdia5TW0fsTo87Qmuuor5hIeGx4WgSQvle5hpwmZPq+7XYk\n\t9KMj8w9bBb6+GU+pcJEfPxy+0F3c38t02CTe1DmglbyZVzKni5zxbHvnD0TfHXco0O\n\tGfjIvozYOMRR22nzZds6u7wRizRBUr90X7cupv6oLjl4kObRcVmcZEkXkuVTn3vSaq\n\tC+FmHN1GJir/avXeA58v/MNztA05yVIh2CBM1uf7iYhuAZYqtk9VApFm2CMEl3gXHC\n\thJccRL5WCAWsQ==","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=0MhM2v8TAfRmtn2vOniLGNGEMvY38mode8Q3Hlg6qinP2mvKAujcHfUTak/TqGytz5\n\tab+aLikr3lfH9iUUsrcI4nvloOdQiq3GcJyUqrqbHG3PvfByRNblJo79/2ylMIBHplax\n\t3TV7pXfNf4aIViGeCPtux1n4U7qkCPLi2g2AGGetid/f+uDtKe6uMblc4zq89puuRXXX\n\t1ik4/xKS0ZlWsDkZY9MzdJwRnaYWvx+/2MoAiN9zd1OPi0WsfnMen9QRb3NKqjyFGTW8\n\tWIZdhEZFxnY7iiQ/Kr550tTYjj+3Osh759MzEYKR+ZsrwB4QCDiHh4KpXMQdPuMqmk/+\n\tSkHw=="],"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=\"0MhM2v8T\"; \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=eTa/1Mm20rSylivaLRP0EbxfAgDxafJjbAeCLeFqkjfQpgeWG7v9swm3Q6iE0qFl1r\n\tsO0xsru1MwfJevIgFUPI4zPPaC0sa+5lU9vG5vgHNcUMTt/dMuYILIE4yTWQvubb+0mR\n\tzafeNlvGe9CdfbexSyI7Ny6W9oqwpOvNQhDl+VRxm/nNPAjrtZgUPiGxIrmPkfsbYbh1\n\tEtuJP+vNGHhCU8vKe305w+SyZDI3KdAs+T2KoUelSh0FuBetOlooesWyBVVIqJnSDgut\n\tsgbExfCBgOWK+6clW1bXseSAVcvlLUaN+8AbnUA4Nb49zJ9NCpQLdGjYRi9eKL6AVcyR\n\tyCuQ==","X-Gm-Message-State":"ACrzQf2kDZ2+7mR0SA+YH1J7N3oYQ3FX6b8xLKekJmLand5tgZHZSZn1\n\tsxU89Tnd9u/8wJ2alxj0uGM5lR3RiwPAteie","X-Google-Smtp-Source":"AMsMyM76cmhi7yJSt28cZlYREOVbq0joiiSzhjw0qGOsIJxwD41vfqWSf65r5sQp+riItjcrE3VeLg==","X-Received":"by 2002:a05:6870:630f:b0:132:8af2:c8f2 with SMTP id\n\ts15-20020a056870630f00b001328af2c8f2mr7183365oao.284.1666910504054; \n\tThu, 27 Oct 2022 15:41:44 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 27 Oct 2022 17:41:31 -0500","Message-Id":"<20221027224135.348115-7-nicholas@rothemail.net>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20221027224135.348115-1-nicholas@rothemail.net>","References":"<20221027224135.348115-1-nicholas@rothemail.net>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 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","v4","06/10"]}