Patch Detail
Show a patch.
GET /api/patches/20942/?format=api
{ "id": 20942, "url": "https://patchwork.libcamera.org/api/patches/20942/?format=api", "web_url": "https://patchwork.libcamera.org/patch/20942/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20240815093715.165305-1-dev@lankhorst.se>", "date": "2024-08-15T09:37:15", "name": "ipa/rpi/controller: Use fabs for calculating absolute values", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "613b59c6c89ecec18a3e502f00ea2d7b2004dbe6", "submitter": { "id": 166, "url": "https://patchwork.libcamera.org/api/people/166/?format=api", "name": "Maarten Lankhorst", "email": "dev@lankhorst.se" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/20942/mbox/", "series": [ { "id": 4523, "url": "https://patchwork.libcamera.org/api/series/4523/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4523", "date": "2024-08-15T09:37:15", "name": "ipa/rpi/controller: Use fabs for calculating absolute values", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4523/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/20942/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/20942/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 AF792C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 15 Aug 2024 09:37:27 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 781A6633BD;\n\tThu, 15 Aug 2024 11:37:26 +0200 (CEST)", "from mblankhorst.nl (lankhorst.se\n\t[IPv6:2a02:2308:0:7ec:e79c:4e97:b6c4:f0ae])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1718E63393\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Aug 2024 11:37:25 +0200 (CEST)" ], "From": "Maarten Lankhorst <dev@lankhorst.se>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Maarten Lankhorst <dev@lankhorst.se>", "Subject": "[PATCH] ipa/rpi/controller: Use fabs for calculating absolute values", "Date": "Thu, 15 Aug 2024 11:37:15 +0200", "Message-ID": "<20240815093715.165305-1-dev@lankhorst.se>", "X-Mailer": "git-send-email 2.45.2", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "I was getting the following error in clang:\n../src/ipa/rpi/controller/rpi/awb.cpp:508:6: error: using integer absolute value function 'abs' when argument is of floating point type [-Werror,-Wabsolute-value]\n if (abs(denominator) > eps) {\n ^\n../src/ipa/rpi/controller/rpi/awb.cpp:508:6: note: use function 'std::abs' instead\n if (abs(denominator) > eps) {\n ^~~\n std::abs\n\nSigned-off-by: Maarten Lankhorst <dev@lankhorst.se>\n---\n src/ipa/rpi/controller/rpi/awb.cpp | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)", "diff": "diff --git a/src/ipa/rpi/controller/rpi/awb.cpp b/src/ipa/rpi/controller/rpi/awb.cpp\nindex f45525bc..c5750c84 100644\n--- a/src/ipa/rpi/controller/rpi/awb.cpp\n+++ b/src/ipa/rpi/controller/rpi/awb.cpp\n@@ -505,7 +505,7 @@ static double interpolateQuadatric(ipa::Pwl::Point const &a, ipa::Pwl::Point con\n \tconst double eps = 1e-3;\n \tipa::Pwl::Point ca = c - a, ba = b - a;\n \tdouble denominator = 2 * (ba.y() * ca.x() - ca.y() * ba.x());\n-\tif (abs(denominator) > eps) {\n+\tif (fabs(denominator) > eps) {\n \t\tdouble numerator = ba.y() * ca.x() * ca.x() - ca.y() * ba.x() * ba.x();\n \t\tdouble result = numerator / denominator + a.x();\n \t\treturn std::max(a.x(), std::min(c.x(), result));\n", "prefixes": [] }