From patchwork Mon Oct 24 05:55:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne via libcamera-devel X-Patchwork-Id: 17681 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 D1A53BD16B for ; Mon, 24 Oct 2022 05:56:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4ACDD62F07; Mon, 24 Oct 2022 07:56:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666590961; bh=breCCh63FsMp5+MEBP3jhEKp5No/51/koZTax1ibB2Y=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=hUVw9SomDfsqoP1xIJH3tEvdiogSEnFQ5qHbyulTDfjD5ZfEXYl2wGMj4aGTWFpEP 8aax29EC5korTwUZ3LFKIIoYDuuNWZz9S6yI6i6q7QKOxWTxJ6LU/HMi5oRXV3yz1p Lyih8CgnSwY543dHvRjqUTwKaHoUI0YpwQy67Bd2cmKlZOLk9cpDvvk5uOgASMQ1Ks NE8HJUqv7Xh6H5v1S1gjoOdcJLJ8gXW3o7riF+Mg4IGr1EYRKSSvNRCDdDWeNaFvJg 46rPbNQWkQGWQT8NonDjCLHqfZ9jJ1ANX6vj9waSsu6WTLc1ggUB3NM3sAAil/AMsS RSPGsLRO2BScw== Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6406862EFD for ; Mon, 24 Oct 2022 07:55:58 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=rothemail-net.20210112.gappssmtp.com header.i=@rothemail-net.20210112.gappssmtp.com header.b="hW1L/Pmd"; dkim-atps=neutral Received: by mail-ot1-x32e.google.com with SMTP id r8-20020a056830120800b00661a0a236efso5375895otp.4 for ; Sun, 23 Oct 2022 22:55:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothemail-net.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=pZ84C5K1watUpfIy+91HbdonC6HclrfVdxoyKumcppg=; b=hW1L/Pmd33kK+sG5rgXEY3NkqxeYlH+8gWSOBjQZz7XZjswhJ1at1JE7PBhYxUNOqE XKATQVtYR1EbPPIHKpa4W4yZnw7EDbpRvKUSSx0oFetY8CMc4AVRCrVSDtbWPfDL9ZqQ lReoeVPCXE6K6u50MFLHmmCUjE1XWQXvTat3ubIo/M8+IQDuUgVVfqHsZerMNVg4G0BP l3dLbSp2W5UyQz83Y8wDYLl7bqxlybWOeiEpapveKS6QcCE7tmXCipFsLoeuSwLBurT4 gp1U3geN6OWhquqjnJ7U4hSojMCIT/epjVx3uuzuCzE1D/xbc3a1GDB1/DdXql77ZWb9 we5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=pZ84C5K1watUpfIy+91HbdonC6HclrfVdxoyKumcppg=; b=d6IaY0r1bcMm+bkiVoSmEsBYs/nssN3K0IxEPtniEU+xhvrUFP634GL8HUTWLIfdiV FRYYhQRl6RXjJKTpNNxoX7uaUeJM+vNmkNBRIgXjU+OlKa3PqA1ibZ4wv3qv0QJCdQfl qWhPPGrLV6ZUdlaWz7WKWdTXqZob4L/rlM5CTGN0zha4BKI+Ua8BSkW5evfYJoivLus4 oZ8TwVijrFMm8jkpd+HwcAvqTxC5w6ayuuHXhMuUXz8WcufSWmlPr1AQg7Y5MHdtWE79 oHoOHc8BONBTVDtR6ou8SkwBXRJk40EYypRqgo8sNlO9hiuuCrQhsKqczFvIKnOV/Qu9 9aWA== X-Gm-Message-State: ACrzQf0PrEoN2pGrdUGKNQ1dTEUYMnMVnoNSE089a+7maIS798wn1/uW S2uwR/Vf0dawN4lbVPrTZIn8T9wNoMhizftb X-Google-Smtp-Source: AMsMyM6oJEtfCCb+fxuWHMKRuD73NqV5QxZBNbE6bHL9E+4kfFqEuJ7t8+Fjyzy59NpH3rDpzTn9+A== X-Received: by 2002:a9d:bd7:0:b0:661:a864:3d9a with SMTP id 81-20020a9d0bd7000000b00661a8643d9amr15830208oth.20.1666590956839; Sun, 23 Oct 2022 22:55:56 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:7bc3:aed3:676f:10a0]) by smtp.gmail.com with ESMTPSA id x15-20020a9d628f000000b0066193df8edasm3980278otk.34.2022.10.23.22.55.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 22:55:56 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 24 Oct 2022 00:55:38 -0500 Message-Id: <20221024055543.116040-7-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221024055543.116040-1-nicholas@rothemail.net> References: <20221024055543.116040-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 06/11] Replaces abs() with std::abs(), which supports double-precision in clang. 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: , X-Patchwork-Original-From: Nicholas Roth via libcamera-devel From: Nicolas Dufresne via libcamera-devel Reply-To: libcamera-devel@lists.libcamera.org Cc: nicholas@rothemail.net Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Nicholas Roth --- src/ipa/raspberrypi/controller/pwl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ipa/raspberrypi/controller/pwl.cpp b/src/ipa/raspberrypi/controller/pwl.cpp index c59f5fa1..70c2e24b 100644 --- a/src/ipa/raspberrypi/controller/pwl.cpp +++ b/src/ipa/raspberrypi/controller/pwl.cpp @@ -6,6 +6,7 @@ */ #include +#include #include #include "pwl.h" @@ -168,7 +169,7 @@ Pwl Pwl::compose(Pwl const &other, const double eps) const while (thisSpan != (int)points_.size() - 1) { double dx = points_[thisSpan + 1].x - points_[thisSpan].x, dy = points_[thisSpan + 1].y - points_[thisSpan].y; - if (abs(dy) > eps && + if (std::abs(dy) > eps && otherSpan + 1 < (int)other.points_.size() && points_[thisSpan + 1].y >= other.points_[otherSpan + 1].x + eps) { @@ -181,7 +182,7 @@ Pwl Pwl::compose(Pwl const &other, const double eps) const points_[thisSpan].y) * dx / dy; thisY = other.points_[++otherSpan].x; - } else if (abs(dy) > eps && otherSpan > 0 && + } else if (std::abs(dy) > eps && otherSpan > 0 && points_[thisSpan + 1].y <= other.points_[otherSpan - 1].x - eps) { /*