[{"id":21921,"web_url":"https://patchwork.libcamera.org/comment/21921/","msgid":"<32ce7304-aa12-350d-648d-297287e12a59@ideasonboard.com>","date":"2022-01-03T02:06:45","subject":"Re: [libcamera-devel] [PATCH] libcamera: controls: Use ASSERT()\n\tinstead of assert()","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Laurent,\n\nThank you for the patch\n\nOn 12/30/21 3:52 AM, Laurent Pinchart wrote:\n> The ASSERT() macro integrates with the logging infrastructure, use it to\n> replace assert().\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n> ---\n>   src/libcamera/controls.cpp | 2 +-\n>   1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\n> index 0d8c0a5c39c9..03ac6345247c 100644\n> --- a/src/libcamera/controls.cpp\n> +++ b/src/libcamera/controls.cpp\n> @@ -527,7 +527,7 @@ ControlInfo::ControlInfo(Span<const ControlValue> values,\n>   ControlInfo::ControlInfo(std::set<bool> values, bool def)\n>   \t: min_(false), max_(true), def_(def), values_({ false, true })\n>   {\n> -\tassert(values.count(def) && values.size() == 2);\n> +\tASSERT(values.count(def) && values.size() == 2);\n>   }\n>   \n>   /**\n>\n> base-commit: 030e6f389e2d0fa3f10a47634f3609378ccaf70e\n> prerequisite-patch-id: 2c7bab8c8f15090cf10a19aaed62e33de1264351\n> prerequisite-patch-id: 10478d16a049f895236c9b7bafcbe6d3a9b69ef9\n> prerequisite-patch-id: f6f3784841cc8648c6b6cfdd12b7903751856f75\n> prerequisite-patch-id: 41c39d0df627b7c1856cc8bc4d099f408983d6cd\n> prerequisite-patch-id: 80397d3462f248e4ca0e9f3bcb2d793178b03142\n> prerequisite-patch-id: 490c8f45203ef4d2281bddf2b36855ed99e1b2a4\n> prerequisite-patch-id: 06537d8dd2471934bca5772ddb6556a85a32ee9c\n> prerequisite-patch-id: e1c7842e5c488f6d3790a9c45b69974d8624dce4\n> prerequisite-patch-id: 55a68f42975a115ab642766965a5e6c8f2c07026\n> prerequisite-patch-id: 8601bcfa3c7da8d9984ac08e182610b5b52cbba9\n> prerequisite-patch-id: 8bb54baf7b5a46c0d14606c2f1020e943633954e\n> prerequisite-patch-id: f9b1926bdaa91bb4879b8e28f6849df8d6a9ae64\n> prerequisite-patch-id: 2c928f3693350ad60bff02897240e379ab8fab1a","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 E84A9BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  3 Jan 2022 02:06:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 312E260219;\n\tMon,  3 Jan 2022 03:06:56 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A574560219\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  3 Jan 2022 03:06:54 +0100 (CET)","from [IPv6:2401:4900:1f3e:193e:9a73:f356:8c6a:a1aa] (unknown\n\t[IPv6:2401:4900:1f3e:193e:9a73:f356:8c6a:a1aa])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 792E6CC;\n\tMon,  3 Jan 2022 03:06:53 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Co4eOBTH\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1641175614;\n\tbh=HzWeKq7+4jkhnbaFRUUXG+YxLBSSWoRM8hq5RNSWzSg=;\n\th=Subject:To:References:From:Date:In-Reply-To:From;\n\tb=Co4eOBTH1vmYZ/rxyN+4yjnjgzHHBhfV5Lat8y3Poa1lPNDCD1F8p0XNhkbOZNuyi\n\tH8U1mt1Va36XscLjVvF9jqMfQow54o7YSRNgUS3CsFfp2zmzKc9V2WuSvjII6mgiMT\n\tlNzmv4QoNGtQnB+bYCwOqAqC3JDWP4vkTC8aIraw=","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20211229222258.12691-1-laurent.pinchart@ideasonboard.com>","From":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<32ce7304-aa12-350d-648d-297287e12a59@ideasonboard.com>","Date":"Mon, 3 Jan 2022 07:36:45 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.10.2","MIME-Version":"1.0","In-Reply-To":"<20211229222258.12691-1-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH] libcamera: controls: Use ASSERT()\n\tinstead of assert()","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>"}},{"id":21926,"web_url":"https://patchwork.libcamera.org/comment/21926/","msgid":"<164121648531.3986460.7112024533873899641@Monstersaurus>","date":"2022-01-03T13:28:05","subject":"Re: [libcamera-devel] [PATCH] libcamera: controls: Use ASSERT()\n\tinstead of assert()","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2021-12-29 22:22:58)\n> The ASSERT() macro integrates with the logging infrastructure, use it to\n> replace assert().\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  src/libcamera/controls.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\n> index 0d8c0a5c39c9..03ac6345247c 100644\n> --- a/src/libcamera/controls.cpp\n> +++ b/src/libcamera/controls.cpp\n> @@ -527,7 +527,7 @@ ControlInfo::ControlInfo(Span<const ControlValue> values,\n>  ControlInfo::ControlInfo(std::set<bool> values, bool def)\n>         : min_(false), max_(true), def_(def), values_({ false, true })\n>  {\n> -       assert(values.count(def) && values.size() == 2);\n> +       ASSERT(values.count(def) && values.size() == 2);\n>  }\n>  \n>  /**\n> \n> base-commit: 030e6f389e2d0fa3f10a47634f3609378ccaf70e\n> prerequisite-patch-id: 2c7bab8c8f15090cf10a19aaed62e33de1264351\n> prerequisite-patch-id: 10478d16a049f895236c9b7bafcbe6d3a9b69ef9\n> prerequisite-patch-id: f6f3784841cc8648c6b6cfdd12b7903751856f75\n> prerequisite-patch-id: 41c39d0df627b7c1856cc8bc4d099f408983d6cd\n> prerequisite-patch-id: 80397d3462f248e4ca0e9f3bcb2d793178b03142\n> prerequisite-patch-id: 490c8f45203ef4d2281bddf2b36855ed99e1b2a4\n> prerequisite-patch-id: 06537d8dd2471934bca5772ddb6556a85a32ee9c\n> prerequisite-patch-id: e1c7842e5c488f6d3790a9c45b69974d8624dce4\n> prerequisite-patch-id: 55a68f42975a115ab642766965a5e6c8f2c07026\n> prerequisite-patch-id: 8601bcfa3c7da8d9984ac08e182610b5b52cbba9\n> prerequisite-patch-id: 8bb54baf7b5a46c0d14606c2f1020e943633954e\n> prerequisite-patch-id: f9b1926bdaa91bb4879b8e28f6849df8d6a9ae64\n> prerequisite-patch-id: 2c928f3693350ad60bff02897240e379ab8fab1a\n> -- \n> Regards,\n> \n> Laurent Pinchart\n>","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 C3E50BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  3 Jan 2022 13:28:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1BE39608E9;\n\tMon,  3 Jan 2022 14:28:09 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B350C604F4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  3 Jan 2022 14:28:07 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 48F3CCC;\n\tMon,  3 Jan 2022 14:28:07 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"h6Abbgm/\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1641216487;\n\tbh=UhRqbsge1u1Hp9GtgcrTW0F3KRvYP4mT9vkH8RzPduI=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=h6Abbgm/KGuJKsFng7309K16dbuXdCMrrI6kwuzZpqP/NAk5lhQe6OrMoTkaZj/mg\n\tQxUy+R7LB4UB1H/pZmy11Hr2f88qhhjcXkV+35rxrfYzfyI3maOvrItJ/aU7Mh81sy\n\tOTONbZ64fIL1lprXpg/Rv0Fp99h5sIZqbgQTkuIw=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20211229222258.12691-1-laurent.pinchart@ideasonboard.com>","References":"<20211229222258.12691-1-laurent.pinchart@ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 03 Jan 2022 13:28:05 +0000","Message-ID":"<164121648531.3986460.7112024533873899641@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH] libcamera: controls: Use ASSERT()\n\tinstead of assert()","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>"}}]