Patch Detail
Show a patch.
GET /api/1.1/patches/9371/?format=api
{ "id": 9371, "url": "https://patchwork.libcamera.org/api/1.1/patches/9371/?format=api", "web_url": "https://patchwork.libcamera.org/patch/9371/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/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": "<20200822200037.20892-6-laurent.pinchart@ideasonboard.com>", "date": "2020-08-22T20:00:37", "name": "[libcamera-devel,5/5] ipa: raspberrypi: Replace void cast with [[maybe_unused]]", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "e32668a0e6083f8f523e3c340e418178b7a4af08", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": { "id": 14, "url": "https://patchwork.libcamera.org/api/1.1/users/14/?format=api", "username": "pinchartl", "first_name": "Laurent", "last_name": "Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/patch/9371/mbox/", "series": [ { "id": 1235, "url": "https://patchwork.libcamera.org/api/1.1/series/1235/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1235", "date": "2020-08-22T20:00:32", "name": "libcamera: Switch to C++17", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1235/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/9371/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/9371/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 4160EBD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 22 Aug 2020 20:01:07 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 11A9062113;\n\tSat, 22 Aug 2020 22:01:07 +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 9425762758\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 22 Aug 2020 22:01:02 +0200 (CEST)", "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 13AB829E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 22 Aug 2020 22:01:02 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"fbOyAt96\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1598126462;\n\tbh=ATzgUPvlZS3LwLn5S05NCzfu0Y55E4Q5lYTWezzpEoI=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=fbOyAt96e3S6T6L/m/Q8tfkl+5fFMFhaEFG3eBhO4zWjhvRZ2R93bHrD+JyGcCr4S\n\t+sW9t+nI3f7cK81PzbuxDVjdbI9nfBFS9dmj3tEO523mcC956tKKb6mpLUEKC2gXpU\n\tjJ3KVWl1aXrzQz8OOoM4PnjD2ZKn/IdTGWpOC2cw=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sat, 22 Aug 2020 23:00:37 +0300", "Message-Id": "<20200822200037.20892-6-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20200822200037.20892-1-laurent.pinchart@ideasonboard.com>", "References": "<20200822200037.20892-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH 5/5] ipa: raspberrypi: Replace void cast\n\twith [[maybe_unused]]", "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>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The standard way in C++17 to specify that a function or function\nargument may be unused it to specify the [[maybe_unused]] attribute.\nReplace manual void casts to silence compiler warnings.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/raspberrypi/controller/algorithm.cpp | 16 ++++++----------\n src/ipa/raspberrypi/controller/rpi/alsc.cpp | 8 +++-----\n src/ipa/raspberrypi/controller/rpi/contrast.cpp | 4 ++--\n src/ipa/raspberrypi/controller/rpi/noise.cpp | 5 ++---\n src/ipa/raspberrypi/controller/rpi/sharpen.cpp | 5 ++---\n 5 files changed, 15 insertions(+), 23 deletions(-)", "diff": "diff --git a/src/ipa/raspberrypi/controller/algorithm.cpp b/src/ipa/raspberrypi/controller/algorithm.cpp\nindex 55cb2012e63b..1b80e29602f4 100644\n--- a/src/ipa/raspberrypi/controller/algorithm.cpp\n+++ b/src/ipa/raspberrypi/controller/algorithm.cpp\n@@ -9,28 +9,24 @@\n \n using namespace RPi;\n \n-void Algorithm::Read(boost::property_tree::ptree const ¶ms)\n+void Algorithm::Read([[maybe_unused]] boost::property_tree::ptree const ¶ms)\n {\n-\t(void)params;\n }\n \n void Algorithm::Initialise() {}\n \n-void Algorithm::SwitchMode(CameraMode const &camera_mode, Metadata *metadata)\n+void Algorithm::SwitchMode([[maybe_unused]] CameraMode const &camera_mode,\n+\t\t\t [[maybe_unused]] Metadata *metadata)\n {\n-\t(void)camera_mode;\n-\t(void)metadata;\n }\n \n-void Algorithm::Prepare(Metadata *image_metadata)\n+void Algorithm::Prepare([[maybe_unused]] Metadata *image_metadata)\n {\n-\t(void)image_metadata;\n }\n \n-void Algorithm::Process(StatisticsPtr &stats, Metadata *image_metadata)\n+void Algorithm::Process([[maybe_unused]] StatisticsPtr &stats,\n+\t\t\t[[maybe_unused]] Metadata *image_metadata)\n {\n-\t(void)stats;\n-\t(void)image_metadata;\n }\n \n // For registering algorithms with the system:\ndiff --git a/src/ipa/raspberrypi/controller/rpi/alsc.cpp b/src/ipa/raspberrypi/controller/rpi/alsc.cpp\nindex 9df713a37a69..0d0e0b0c8fc4 100644\n--- a/src/ipa/raspberrypi/controller/rpi/alsc.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/alsc.cpp\n@@ -200,10 +200,9 @@ static bool compare_modes(CameraMode const &cm0, CameraMode const &cm1)\n \t top_diff > threshold_y || bottom_diff > threshold_y;\n }\n \n-void Alsc::SwitchMode(CameraMode const &camera_mode, Metadata *metadata)\n+void Alsc::SwitchMode(CameraMode const &camera_mode,\n+\t\t [[maybe_unused]] Metadata *metadata)\n {\n-\t(void)metadata;\n-\n \t// We're going to start over with the tables if there's any \"significant\"\n \t// change.\n \tbool reset_tables = first_time_ || compare_modes(camera_mode_, camera_mode);\n@@ -490,7 +489,7 @@ void compensate_lambdas_for_cal(double const cal_table[XY],\n \t\tnew_lambdas[i] /= min_new_lambda;\n }\n \n-static void print_cal_table(double const C[XY])\n+[[maybe_unused]] static void print_cal_table(double const C[XY])\n {\n \tprintf(\"table: [\\n\");\n \tfor (int j = 0; j < Y; j++) {\n@@ -710,7 +709,6 @@ void Alsc::doAlsc()\n \tresample_cal_table(cal_table_tmp, camera_mode_, cal_table_b);\n \t// You could print out the cal tables for this image here, if you're\n \t// tuning the algorithm...\n-\t(void)print_cal_table;\n \t// Apply any calibration to the statistics, so the adaptive algorithm\n \t// makes only the extra adjustments.\n \tapply_cal_table(cal_table_r, Cr);\ndiff --git a/src/ipa/raspberrypi/controller/rpi/contrast.cpp b/src/ipa/raspberrypi/controller/rpi/contrast.cpp\nindex e4967990c577..c8d9ab6184f5 100644\n--- a/src/ipa/raspberrypi/controller/rpi/contrast.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/contrast.cpp\n@@ -137,9 +137,9 @@ Pwl apply_manual_contrast(Pwl const &gamma_curve, double brightness,\n \treturn new_gamma_curve;\n }\n \n-void Contrast::Process(StatisticsPtr &stats, Metadata *image_metadata)\n+void Contrast::Process(StatisticsPtr &stats,\n+\t\t [[maybe_unused]] Metadata *image_metadata)\n {\n-\t(void)image_metadata;\n \tdouble brightness = brightness_, contrast = contrast_;\n \tHistogram histogram(stats->hist[0].g_hist, NUM_HISTOGRAM_BINS);\n \t// We look at the histogram and adjust the gamma curve in the following\ndiff --git a/src/ipa/raspberrypi/controller/rpi/noise.cpp b/src/ipa/raspberrypi/controller/rpi/noise.cpp\nindex 2cafde3ab951..1b84ecb0b22c 100644\n--- a/src/ipa/raspberrypi/controller/rpi/noise.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/noise.cpp\n@@ -27,10 +27,9 @@ char const *Noise::Name() const\n \treturn NAME;\n }\n \n-void Noise::SwitchMode(CameraMode const &camera_mode, Metadata *metadata)\n+void Noise::SwitchMode(CameraMode const &camera_mode,\n+\t\t [[maybe_unused]] Metadata *metadata)\n {\n-\t(void)metadata;\n-\n \t// For example, we would expect a 2x2 binned mode to have a \"noise\n \t// factor\" of sqrt(2x2) = 2. (can't be less than one, right?)\n \tmode_factor_ = std::max(1.0, camera_mode.noise_factor);\ndiff --git a/src/ipa/raspberrypi/controller/rpi/sharpen.cpp b/src/ipa/raspberrypi/controller/rpi/sharpen.cpp\nindex 2b701db5367c..356c10588d01 100644\n--- a/src/ipa/raspberrypi/controller/rpi/sharpen.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/sharpen.cpp\n@@ -26,10 +26,9 @@ char const *Sharpen::Name() const\n \treturn NAME;\n }\n \n-void Sharpen::SwitchMode(CameraMode const &camera_mode, Metadata *metadata)\n+void Sharpen::SwitchMode(CameraMode const &camera_mode,\n+\t\t\t [[maybe_unused]] Metadata *metadata)\n {\n-\t(void)metadata;\n-\n \t// can't be less than one, right?\n \tmode_factor_ = std::max(1.0, camera_mode.noise_factor);\n }\n", "prefixes": [ "libcamera-devel", "5/5" ] }