From patchwork Thu Oct 15 22:37:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10061 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 3D619BE905 for ; Thu, 15 Oct 2020 22:37:58 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1B5A761056; Fri, 16 Oct 2020 00:37:57 +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="twdM7i5Y"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 683E2600F2 for ; Fri, 16 Oct 2020 00:37:55 +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 CA7BD556; Fri, 16 Oct 2020 00:37:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1602801475; bh=hDA+NquDKQjHyvZ7jM3ZDrnSe4kU1AELVIJBHvrL6pg=; h=From:To:Cc:Subject:Date:From; b=twdM7i5Y0uMn/Q4O6vetaMpsqEvw3bk6D7U3moFnnXyx2WDWg0XPPrcLfRVGvlr2z jQyVdOhYXG1W3dsXy8w+c8zrExIpBW89t9s7of8qSEqpuUnkjBqbWgvqO9ty89Brdr i/CWQT5AA0lggPIiZwkXlCu3PPb9z6PS34toAnPQ= From: Kieran Bingham To: libcamera devel Date: Thu, 15 Oct 2020 23:37:39 +0100 Message-Id: <20201015223750.58563-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 00/11] 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" 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. Kieran Bingham (11): cam: options: Rename optional arg to prevent aliasing qcam: main_window: Explicitly name raw buffer libcamera: thread: Prevent aliasing of signal name libcamera: pipeline: Prevent variable aliasing libcamera: pipeline: Use existing variable definitions libcamera: pipeline: rpi_stream: Explicitly name requestBuffer libcamera: v4l2_videodevice: Prevent aliasing of V4L2BufferCache members test: v4l2_videodevice: Prevent variable aliasing of format ipa: raspberrypi: Re-use iterator variable android: metadata: Disable -Wshadow meson: Enable shadowed variable warning include/libcamera/internal/v4l2_videodevice.h | 4 ++-- meson.build | 1 + src/android/meson.build | 1 + src/cam/options.cpp | 10 +++++----- src/ipa/raspberrypi/controller/rpi/alsc.cpp | 6 +++--- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 8 ++++---- src/libcamera/pipeline/raspberrypi/rpi_stream.cpp | 8 ++++---- 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 | 12 ++++++------ src/qcam/main_window.cpp | 8 ++++---- test/v4l2_videodevice/formats.cpp | 6 +++--- 14 files changed, 47 insertions(+), 45 deletions(-)