[{"id":24729,"web_url":"https://patchwork.libcamera.org/comment/24729/","msgid":"<166120427823.3484129.10869803038929997159@Monstersaurus>","date":"2022-08-22T21:37:58","subject":"Re: [libcamera-devel] [PATCH 1/2] libcamera: control: define an\n\texplicit default ControlInfo constructor","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Christian,\n\nQuoting Christian Rauch via libcamera-devel (2022-08-21 13:43:42)\n> The default ControlInfo constructor allowed to partially initialised the\n> min/max/def values. Add an explicit default constructor in order to enforce\n> that either all or none of the min/max/def values are defined.\n> \n\nI think this would break bisection, so would have to have the follow up\n2/2 patch merged all in one commit.\n\n\n> Signed-off-by: Christian Rauch <Rauch.Christian@gmx.de>\n> ---\n>  include/libcamera/controls.h | 7 ++++---\n>  1 file changed, 4 insertions(+), 3 deletions(-)\n> \n> diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\n> index ebc168fc..214ad7f3 100644\n> --- a/include/libcamera/controls.h\n> +++ b/include/libcamera/controls.h\n> @@ -268,9 +268,10 @@ private:\n>  class ControlInfo\n>  {\n>  public:\n> -       explicit ControlInfo(const ControlValue &min = 0,\n> -                            const ControlValue &max = 0,\n> -                            const ControlValue &def = 0);\n> +       explicit ControlInfo() = default;\n> +       explicit ControlInfo(const ControlValue &min,\n> +                            const ControlValue &max,\n> +                            const ControlValue &def);\n\nI think I agree it can be better to be explicit, but I'm weary that\nskimming the next patch - some times there isn't a reasonable default.\n\nThat makes me fear we'd need to <optional> the default ... and I start\nfearing how templated things might get ...\n\nNow to the next patch...\n--\nKieran\n\n>         explicit ControlInfo(Span<const ControlValue> values,\n>                              const ControlValue &def = {});\n>         explicit ControlInfo(std::set<bool> values, bool def);\n> --\n> 2.34.1\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 13A66BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 22 Aug 2022 21:38:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6C0EB61FC0;\n\tMon, 22 Aug 2022 23:38:02 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2388161FBB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 22 Aug 2022 23:38:01 +0200 (CEST)","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 A96EA3F1;\n\tMon, 22 Aug 2022 23:38:00 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1661204282;\n\tbh=M1IwusjB/JBs8Pv4B6wd3mOwds1FhYm23B0l9c49RpI=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=lKKYgaWOmiCO6znlAhS0tz2dYQiZgzqCu2O4Z5TcrODIHUNpA+tY/NEc+aBK5VxQo\n\t7bdhi6VcTUoqEnJtYLifRFmtovuGq7U9MQ+31K9/RXwAwW+7LNcuwcgn/l+Jc4lMxU\n\tIJXmuRS1MVF3/AS8jsJmi2zBrpfZXQ2z8Cuuu5LqlWRA2/DWTqE0lQXXe7k+/67io2\n\tyxoRshCLdKU6ecWf6x+84CR1RzYt8sjLEFfv6rFCse19bGZNw+X9B+x6Wd7Id+WfND\n\tIdiQZKD5B0eJmuaZzu7EgtaeFsiwGl1oEaVSmxMtT+ZbzF1ZnEBcpe2IX259JMl/gp\n\tr7Cwcv7WrHlMg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1661204280;\n\tbh=M1IwusjB/JBs8Pv4B6wd3mOwds1FhYm23B0l9c49RpI=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=D3pPdHO7eCyBxORPYLRbN0b76+3N1A0t1tLkKHb7mDQCfw+EPkiuxFfo9HkE607Fe\n\t6Q4xv6vOAEYzICIvn9yXlBieSiDqc5LsGlh4O8hQxOI16ik/a8N4h79xcEbWTZc1sq\n\tZ3ihsH6Z5MWNGxCJJh/CAyvsX3Y1RGQkEViBacyg="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"D3pPdHO7\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220821124343.487963-1-Rauch.Christian@gmx.de>","References":"<20220821124343.487963-1-Rauch.Christian@gmx.de>","To":"Christian Rauch <Rauch.Christian@gmx.de>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 22 Aug 2022 22:37:58 +0100","Message-ID":"<166120427823.3484129.10869803038929997159@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH 1/2] libcamera: control: define an\n\texplicit default ControlInfo constructor","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":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]