From patchwork Tue Oct 13 15:12:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10046 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 AC15EBEEDF for ; Tue, 13 Oct 2020 15:12:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CA29660E5A; Tue, 13 Oct 2020 17:12:47 +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="IF3V+zvL"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A327060CE6 for ; Tue, 13 Oct 2020 17:12:46 +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 125A1B87; Tue, 13 Oct 2020 17:12:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1602601966; bh=PnMHPgdX8+M4oNXE3u3Otv3gz4X+tg3WmgnP2t0QeW0=; h=From:To:Cc:Subject:Date:From; b=IF3V+zvLvwA9X1p/sK9o/+Rh/pW9LBhWJxtHU+Jnrvb3rjqVbTvUub1Q80pR76xk/ dQrzzBoDEaGXU278NfPoiawlrisSGVgJ45e+IrD6+EaEUDZVwsxgyH5Fn9kAJoAopk mkgTWPwD50olGKLmWmWG4JoK53QAKHZs59vj3b3M= From: Kieran Bingham To: libcamera devel Date: Tue, 13 Oct 2020 16:12:31 +0100 Message-Id: <20201013151241.3557005-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [RFC? PATCH 00/10] Shadowed Variables 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" Here's some patches I've had kicking around for too long, so I've cleaned them up to get out and discuss (or integrate where possible). During development, I hit an awkward issue with a variable being aliased in the constructor, which caused horrendous pain debugging. We can warn on shadowed variables to prevent this occuring, and this series introduces that. I hope most of this series isn't too contentious, however there is a change to the src/android/metadata/camera_metadata.c which is directly imported, and I didn't want to modify that. We'd have to remember that change if we re-import that code again (Of course the compiler would tell us). We can't disable the warning just on that file or import. Kieran Bingham (10): cam: options: Rename optional arg to prevent aliasing qcam: main_window: Re-use existing variable libcamera: thread: Prevent aliasing of signal name libcamera: pipeline: Prevent variable aliasing libcamera: pipeline: Use existing variable definitions libcamera: v4l2_videodevice: Prevent aliasing of V4L2BufferCache members test: v4l2_videodevice: Prevent variable aliasing of format ipa: raspberrypi: Re-use iterator variable android: metadata: Prevent variable aliasing meson: Enable shadowed variable warning include/libcamera/internal/v4l2_videodevice.h | 4 ++-- meson.build | 1 + src/android/metadata/camera_metadata.c | 2 +- src/cam/options.cpp | 10 +++++----- src/ipa/raspberrypi/controller/rpi/alsc.cpp | 2 +- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 8 ++++---- src/libcamera/pipeline/raspberrypi/rpi_stream.cpp | 2 +- src/libcamera/pipeline/simple/converter.cpp | 8 ++++---- src/libcamera/pipeline/simple/simple.cpp | 8 ++++---- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 4 ++-- src/libcamera/thread.cpp | 8 ++++---- src/libcamera/v4l2_videodevice.cpp | 14 +++++++------- src/qcam/main_window.cpp | 2 +- test/v4l2_videodevice/formats.cpp | 6 +++--- 14 files changed, 40 insertions(+), 39 deletions(-)