[{"id":25548,"web_url":"https://patchwork.libcamera.org/comment/25548/","msgid":"<Y1aY0EoKu7epU7Uf@pendragon.ideasonboard.com>","date":"2022-10-24T13:53:20","subject":"Re: [libcamera-devel] [PATCH 06/11] Replaces abs() with std::abs(), \n\twhich supports double-precision in clang.","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Nicholas,\n\nThank you for the patch.\n\nOn Mon, Oct 24, 2022 at 12:55:38AM -0500, Nicholas Roth via libcamera-devel wrote:\n> From: Nicholas Roth <nicholas@rothemail.net>\n\nApart from the commit message issue raised by Kieran, the code change\nlooks good to me. I expect to merge the patch from v3.\n\n> ---\n>  src/ipa/raspberrypi/controller/pwl.cpp | 5 +++--\n>  1 file changed, 3 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/ipa/raspberrypi/controller/pwl.cpp b/src/ipa/raspberrypi/controller/pwl.cpp\n> index 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/*","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 97096BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 24 Oct 2022 13:53:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6054E62F1A;\n\tMon, 24 Oct 2022 15:53:47 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 318E062EC6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 Oct 2022 15:53:46 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BB7998BF;\n\tMon, 24 Oct 2022 15:53:45 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1666619627;\n\tbh=fp4dS9L3EveFpKfbtxlF9L7e4v+OhEEBiDHZxdOh3cs=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=AsMsXD/GYNE5LxpbP+0sQ5QVemKKWKk7qtEquvxFP1qa61V4pLvVr4hT3wYmTiiK3\n\tFxxr0XKQfRMYsJBnxNsUTHDKKLOeRvgSHMIcGjTcfy9f3feidm5eWbQLBJWkrUafFN\n\tS1whE+MAPrHtKPRpFZdOUStWTYd3pjAhzLFFiGas4DdU9mqlmiO0gBo+rlDn5X8MNh\n\tJ5hU02UrD/z6htpNSg1tDIj+lFWmlvn9j26c4wkITUd24LzDZ4gMlqFFL1rIHPxIUl\n\ttJsKVuAjhq5+egbDYvX4Ti0lc3EcO7towLquMFjOmH5TjU+dqMbMcrTBeSVVdoclUu\n\tepIuGJfOvZE+A==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1666619626;\n\tbh=fp4dS9L3EveFpKfbtxlF9L7e4v+OhEEBiDHZxdOh3cs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=WuDx+AyI8LCBTdjHSzsgrp+4+FMTbTAWu1I80E8hzyWakJGUkbkmQ6+rchxCo5WjC\n\tit6k/ljSNgzQucdEkNeZfY2ADO7uaxnKv4D3sgTsmfHk64JcBOkoTaMFhVjZCnstkn\n\tegMMfi+9XcQqHb4oZAU8OrTX4xfpcnZtIAYgdCGk="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"WuDx+AyI\"; dkim-atps=neutral","Date":"Mon, 24 Oct 2022 16:53:20 +0300","To":"Nicholas Roth via libcamera-devel <libcamera-devel@lists.libcamera.org>","Message-ID":"<Y1aY0EoKu7epU7Uf@pendragon.ideasonboard.com>","References":"<20221024055543.116040-1-nicholas@rothemail.net>\n\t<20221024055543.116040-7-nicholas@rothemail.net>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20221024055543.116040-7-nicholas@rothemail.net>","Subject":"Re: [libcamera-devel] [PATCH 06/11] Replaces abs() with std::abs(), \n\twhich supports double-precision in clang.","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"nicholas@rothemail.net","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]