From patchwork Wed Oct 21 15:41:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10188 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id AE025BDB13 for ; Wed, 21 Oct 2020 15:42:04 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7AF9760E12; Wed, 21 Oct 2020 17:42:04 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="NvGLY0Mo"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 06E7060E81 for ; Wed, 21 Oct 2020 17:41:57 +0200 (CEST) Received: from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A5D0792; Wed, 21 Oct 2020 17:41:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1603294916; bh=cjtTz+AHW3Sk5fLAVkX/mYl+cI/e1cATkJKNjY7Znxo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NvGLY0MoSwncIbv4EwuU14TEpKB1ZxQ9W+uaY0XT/jXwG8pkLon0b7bZHYNET3OT9 oWXlKNPV7AgTxGYk56AejeTUCjuNOJ2/BgD8brO72P55QadwiIvJzmar+sJdVUHsw8 TuUcBc8z6CMdcFlKyBpj4+E11yv/hBwsWa4ivhUc= From: Kieran Bingham To: libcamera devel Date: Wed, 21 Oct 2020 16:41:44 +0100 Message-Id: <20201021154148.511505-12-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201021154148.511505-1-kieran.bingham@ideasonboard.com> References: <20201021154148.511505-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 11/15] v4l2: camera: Prevent shadowing within V4L2Camera::Buffer X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Rename the internal member variables to use the post-fixed '_' member variable naming style. This in turn ensures variable shadowing does not occur on the constructor. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/v4l2/v4l2_camera.h | 6 +++--- src/v4l2/v4l2_camera_proxy.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/v4l2/v4l2_camera.h b/src/v4l2/v4l2_camera.h index a6c35a2eb578..d238046250e3 100644 --- a/src/v4l2/v4l2_camera.h +++ b/src/v4l2/v4l2_camera.h @@ -26,12 +26,12 @@ class V4L2Camera public: struct Buffer { Buffer(unsigned int index, const FrameMetadata &data) - : index(index), data(data) + : index_(index), data_(data) { } - unsigned int index; - FrameMetadata data; + unsigned int index_; + FrameMetadata data_; }; V4L2Camera(std::shared_ptr camera); diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp index 7803d37ecf4f..f8bfe595e90e 100644 --- a/src/v4l2/v4l2_camera_proxy.cpp +++ b/src/v4l2/v4l2_camera_proxy.cpp @@ -206,8 +206,8 @@ void V4L2CameraProxy::updateBuffers() { std::vector completedBuffers = vcam_->completedBuffers(); for (const V4L2Camera::Buffer &buffer : completedBuffers) { - const FrameMetadata &fmd = buffer.data; - struct v4l2_buffer &buf = buffers_[buffer.index]; + const FrameMetadata &fmd = buffer.data_; + struct v4l2_buffer &buf = buffers_[buffer.index_]; switch (fmd.status) { case FrameMetadata::FrameSuccess: