{"id":10046,"url":"https://patchwork.libcamera.org/api/1.1/covers/10046/?format=json","web_url":"https://patchwork.libcamera.org/cover/10046/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20201013151241.3557005-1-kieran.bingham@ideasonboard.com>","date":"2020-10-13T15:12:31","name":"[libcamera-devel,RFC?,00/10] Shadowed Variables","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/1.1/people/4/?format=json","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/cover/10046/mbox/","series":[{"id":1374,"url":"https://patchwork.libcamera.org/api/1.1/series/1374/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1374","date":"2020-10-13T15:12:31","name":"Shadowed Variables","version":1,"mbox":"https://patchwork.libcamera.org/series/1374/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/10046/comments/","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 AC15EBEEDF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 13 Oct 2020 15:12:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CA29660E5A;\n\tTue, 13 Oct 2020 17:12:47 +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 A327060CE6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 Oct 2020 17:12:46 +0200 (CEST)","from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net\n\t[86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 125A1B87;\n\tTue, 13 Oct 2020 17:12:46 +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=\"IF3V+zvL\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1602601966;\n\tbh=PnMHPgdX8+M4oNXE3u3Otv3gz4X+tg3WmgnP2t0QeW0=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=IF3V+zvLvwA9X1p/sK9o/+Rh/pW9LBhWJxtHU+Jnrvb3rjqVbTvUub1Q80pR76xk/\n\tdQrzzBoDEaGXU278NfPoiawlrisSGVgJ45e+IrD6+EaEUDZVwsxgyH5Fn9kAJoAopk\n\tmkgTWPwD50olGKLmWmWG4JoK53QAKHZs59vj3b3M=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"libcamera devel <libcamera-devel@lists.libcamera.org>","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":"<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>","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>"},"content":"Here's some patches I've had kicking around for too long, so I've\ncleaned them up to get out and discuss (or integrate where possible).\n\nDuring development, I hit an awkward issue with a variable being aliased\nin the constructor, which caused horrendous pain debugging.\n\nWe can warn on shadowed variables to prevent this occuring, and this\nseries introduces that.\n\nI hope most of this series isn't too contentious, however there is a\nchange to the src/android/metadata/camera_metadata.c which is directly\nimported, and I didn't want to modify that. We'd have to remember that\nchange if we re-import that code again (Of course the compiler would\ntell us). We can't disable the warning just on that file or import.\n\n\nKieran Bingham (10):\n  cam: options: Rename optional arg to prevent aliasing\n  qcam: main_window: Re-use existing variable\n  libcamera: thread: Prevent aliasing of signal name\n  libcamera: pipeline: Prevent variable aliasing\n  libcamera: pipeline: Use existing variable definitions\n  libcamera: v4l2_videodevice: Prevent aliasing of V4L2BufferCache\n    members\n  test: v4l2_videodevice: Prevent variable aliasing of format\n  ipa: raspberrypi: Re-use iterator variable\n  android: metadata: Prevent variable aliasing\n  meson: Enable shadowed variable warning\n\n include/libcamera/internal/v4l2_videodevice.h      |  4 ++--\n meson.build                                        |  1 +\n src/android/metadata/camera_metadata.c             |  2 +-\n src/cam/options.cpp                                | 10 +++++-----\n src/ipa/raspberrypi/controller/rpi/alsc.cpp        |  2 +-\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp |  8 ++++----\n src/libcamera/pipeline/raspberrypi/rpi_stream.cpp  |  2 +-\n src/libcamera/pipeline/simple/converter.cpp        |  8 ++++----\n src/libcamera/pipeline/simple/simple.cpp           |  8 ++++----\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp       |  4 ++--\n src/libcamera/thread.cpp                           |  8 ++++----\n src/libcamera/v4l2_videodevice.cpp                 | 14 +++++++-------\n src/qcam/main_window.cpp                           |  2 +-\n test/v4l2_videodevice/formats.cpp                  |  6 +++---\n 14 files changed, 40 insertions(+), 39 deletions(-)"}