[{"id":22787,"web_url":"https://patchwork.libcamera.org/comment/22787/","msgid":"<165090244525.3782398.3546978035111487969@Monstersaurus>","date":"2022-04-25T16:00:45","subject":"Re: [libcamera-devel] [PATCH 2/2] Explicit cast to int","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Utkarsh Tiwari via libcamera-devel (2022-04-21 18:25:49)\n> After introduction of float values to options the conversion of unsigned int to int or vice versa is regarded as the same rank as conversion to and from float. Fix this by using an explicit cast\n\nAs discussed on IRC, this patch probably needs to be first. Adjust the\ncommit message to say \"In order to be able to use float values...\" or\nsuch.\n\nAlso - please wrap the message, and make sure you add your\nSigned-off-by: tag.\n\n--\nKieran\n\n\n> ---\n>  src/cam/stream_options.cpp | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/cam/stream_options.cpp b/src/cam/stream_options.cpp\n> index 150bd27c..83d216b7 100644\n> --- a/src/cam/stream_options.cpp\n> +++ b/src/cam/stream_options.cpp\n> @@ -90,8 +90,8 @@ int StreamKeyValueParser::updateConfiguration(CameraConfiguration *config,\n>                 StreamConfiguration &cfg = config->at(i++);\n>  \n>                 if (opts.isSet(\"width\") && opts.isSet(\"height\")) {\n> -                       cfg.size.width = opts[\"width\"];\n> -                       cfg.size.height = opts[\"height\"];\n> +                       cfg.size.width = static_cast<int>(opts[\"width\"]);\n> +                       cfg.size.height = static_cast<int>(opts[\"height\"]);\n>                 }\n>  \n>                 if (opts.isSet(\"pixelformat\"))\n> -- \n> 2.25.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 3A9DFC0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 25 Apr 2022 16:00:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9926A6563A;\n\tMon, 25 Apr 2022 18:00:49 +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 02817604A9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 Apr 2022 18:00:47 +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 85BF6496;\n\tMon, 25 Apr 2022 18:00:47 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1650902449;\n\tbh=wf83tynY+N/z5ZAcT0DclRaA5GWh6DP4WjCle0gOkRY=;\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=iwr4oq4NP9vee7gvjQW2We554TN3TGeK6E/V+IacBAXTyDtKl4IAXsoknYaX3/T8a\n\tJF3OcC8knGbpTggYNx92eP/2GnkFL7yAby2Fj6+sJND9j6MqGgWb6+eeotAZpHCj1d\n\t42xmN+Ks3XtOUNC2S1/WUjreAD6U8+YtXEO0wwiYfovNQRn8Rp6TyJ4+YLH6o7BS1c\n\ttM9fpHpM4nB8Q82uGswqCxJ6aXogjpQAETDA9bnO76ozzq9tlkqeBmf3YWJBoiK/S4\n\tDUJbOyS7sYizMz/Xk8Q5NQ3IwcbbPY+02zrLlrlF8EiKZfTCewznQYUBq9SOIUnvmY\n\tVguXmkUfSv7FA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1650902447;\n\tbh=wf83tynY+N/z5ZAcT0DclRaA5GWh6DP4WjCle0gOkRY=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=EdJlNTSeW0HtupM2Gtb8g7CGr73Epp5/R3FeaBxe7N/uLK8Wd/IwjCVErvdU2QyQp\n\tDvl39jSZjPqMsyEAvYSLQLmtGA7D15JN+VVp76hMqEMdwFxNrMLxopnDB4Ru7ou0Wp\n\t42ilcV1ykY5M8S42QdfYlWfPet17MUbY023/6XnI="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"EdJlNTSe\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220421172549.138360-2-utkarsh02t@gmail.com>","References":"<20220421172549.138360-1-utkarsh02t@gmail.com>\n\t<20220421172549.138360-2-utkarsh02t@gmail.com>","To":"Utkarsh Tiwari <utkarsh02t@gmail.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 25 Apr 2022 17:00:45 +0100","Message-ID":"<165090244525.3782398.3546978035111487969@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH 2/2] Explicit cast to int","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>"}}]