[{"id":13366,"web_url":"https://patchwork.libcamera.org/comment/13366/","msgid":"<20201021155604.GE3942@pendragon.ideasonboard.com>","date":"2020-10-21T15:56:04","subject":"Re: [libcamera-devel] [PATCH v4 11/15] v4l2: camera: Prevent\n\tshadowing within V4L2Camera::Buffer","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch.\n\nOn Wed, Oct 21, 2020 at 04:41:44PM +0100, Kieran Bingham wrote:\n> Rename the internal member variables to use the post-fixed '_' member\n> variable naming style. This in turn ensures variable shadowing does not\n> occur on the constructor.\n\ns/on the constructor/in the member initializer list of the constructor/\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  src/v4l2/v4l2_camera.h         | 6 +++---\n>  src/v4l2/v4l2_camera_proxy.cpp | 4 ++--\n>  2 files changed, 5 insertions(+), 5 deletions(-)\n> \n> diff --git a/src/v4l2/v4l2_camera.h b/src/v4l2/v4l2_camera.h\n> index a6c35a2eb578..d238046250e3 100644\n> --- a/src/v4l2/v4l2_camera.h\n> +++ b/src/v4l2/v4l2_camera.h\n> @@ -26,12 +26,12 @@ class V4L2Camera\n>  public:\n>  \tstruct Buffer {\n>  \t\tBuffer(unsigned int index, const FrameMetadata &data)\n> -\t\t\t: index(index), data(data)\n> +\t\t\t: index_(index), data_(data)\n>  \t\t{\n>  \t\t}\n>  \n> -\t\tunsigned int index;\n> -\t\tFrameMetadata data;\n> +\t\tunsigned int index_;\n> +\t\tFrameMetadata data_;\n>  \t};\n>  \n>  \tV4L2Camera(std::shared_ptr<Camera> camera);\n> diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\n> index 7803d37ecf4f..f8bfe595e90e 100644\n> --- a/src/v4l2/v4l2_camera_proxy.cpp\n> +++ b/src/v4l2/v4l2_camera_proxy.cpp\n> @@ -206,8 +206,8 @@ void V4L2CameraProxy::updateBuffers()\n>  {\n>  \tstd::vector<V4L2Camera::Buffer> completedBuffers = vcam_->completedBuffers();\n>  \tfor (const V4L2Camera::Buffer &buffer : completedBuffers) {\n> -\t\tconst FrameMetadata &fmd = buffer.data;\n> -\t\tstruct v4l2_buffer &buf = buffers_[buffer.index];\n> +\t\tconst FrameMetadata &fmd = buffer.data_;\n> +\t\tstruct v4l2_buffer &buf = buffers_[buffer.index_];\n>  \n>  \t\tswitch (fmd.status) {\n>  \t\tcase FrameMetadata::FrameSuccess:","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 8B412C3D3C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 21 Oct 2020 15:56:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5AB0A60C21;\n\tWed, 21 Oct 2020 17:56:51 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2BB7660986\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 21 Oct 2020 17:56:50 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B728292;\n\tWed, 21 Oct 2020 17:56:49 +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=\"hgEyZjoY\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1603295809;\n\tbh=075SpAu+urBxfESmo2FZ8UHDEquSC1QchjcFqE7gHUs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=hgEyZjoYQozK5COzvXYbW4gyxWHx4ptpyKub1gkw2Y96lTJyP6vco68udw9j2v8MT\n\tT98yXJKNr+ouYBuWdkvvjvvXI28MU9GuUXZXDLH8lvuzWxqnhsazux3wpmbm4SEGYl\n\tN2IsbwnQ6flC5dGw4CEL/bhO6nhhlnwg5UXbrjR4=","Date":"Wed, 21 Oct 2020 18:56:04 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<20201021155604.GE3942@pendragon.ideasonboard.com>","References":"<20201021154148.511505-1-kieran.bingham@ideasonboard.com>\n\t<20201021154148.511505-12-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201021154148.511505-12-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v4 11/15] v4l2: camera: Prevent\n\tshadowing within V4L2Camera::Buffer","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","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>"}}]