{"id":10051,"url":"https://patchwork.libcamera.org/api/1.1/patches/10051/?format=json","web_url":"https://patchwork.libcamera.org/patch/10051/","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-6-kieran.bingham@ideasonboard.com>","date":"2020-10-13T15:12:36","name":"[libcamera-devel,05/10] libcamera: pipeline: Use existing variable definitions","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"e5a94ff610ddf261f47670128a135981161c3e58","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/1.1/people/4/?format=json","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/10051/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/patches/10051/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/10051/checks/","tags":{},"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 379B9BEEE1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 13 Oct 2020 15:12:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0472560E80;\n\tTue, 13 Oct 2020 17:12:54 +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 3519160D4B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 Oct 2020 17:12:48 +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 C2026145A;\n\tTue, 13 Oct 2020 17:12:47 +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=\"PSbKKvnz\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1602601967;\n\tbh=35VaZ733h0F7aXuhpf3Gu/W8zFekCjx+HoXGDhHTUTQ=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=PSbKKvnzsLlgWpTMAqSo0xB7kDVesVGTLflIDgAWSzzfyn3uvWZMeCkfpYZIAGeLr\n\tr/jWGEM0pujvGZsEfseDdVRBndDGLy1Hg+prLmdqdHaRKamtmOqRxw5oM7lLGoBdDV\n\tjhQY+Qz31eflGoxyec1WeXdlxlnEtc/ZcaC3sJgk=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"libcamera devel <libcamera-devel@lists.libcamera.org>","Date":"Tue, 13 Oct 2020 16:12:36 +0100","Message-Id":"<20201013151241.3557005-6-kieran.bingham@ideasonboard.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20201013151241.3557005-1-kieran.bingham@ideasonboard.com>","References":"<20201013151241.3557005-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 05/10] libcamera: pipeline: Use existing\n\tvariable definitions","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":"Prevent variable aliasing by removing the redeclaration of variables\nwith the same name (and type) where the existing variable can be reused.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 +-\n src/libcamera/pipeline/raspberrypi/rpi_stream.cpp  | 2 +-\n src/libcamera/pipeline/simple/simple.cpp           | 4 ++--\n 3 files changed, 4 insertions(+), 4 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 85e0a1f26ab6..2d70d984a276 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1008,7 +1008,7 @@ int PipelineHandlerRPi::queueAllBuffers(Camera *camera)\n \t\t\t */\n \t\t\tunsigned int i;\n \t\t\tfor (i = 0; i < data->dropFrameCount_; i++) {\n-\t\t\t\tint ret = stream->queueBuffer(nullptr);\n+\t\t\t\tret = stream->queueBuffer(nullptr);\n \t\t\t\tif (ret)\n \t\t\t\t\treturn ret;\n \t\t\t}\ndiff --git a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp\nindex 1a42cc17bcba..17e38924d653 100644\n--- a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp\n@@ -163,7 +163,7 @@ void Stream::returnBuffer(FrameBuffer *buffer)\n \t * If so, do it now as availableBuffers_ will not be empty.\n \t */\n \twhile (!requestBuffers_.empty()) {\n-\t\tFrameBuffer *buffer = requestBuffers_.front();\n+\t\tbuffer = requestBuffers_.front();\n \n \t\tif (!buffer) {\n \t\t\t/*\ndiff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex 999c44515023..33daa2fb1b7b 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -612,8 +612,8 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n \tuseConverter_ = config->needConversion();\n \n \tif (useConverter_) {\n-\t\tint ret = converter_->configure(pipeConfig.pixelFormat,\n-\t\t\t\t\t\tpipeConfig.captureSize, &cfg);\n+\t\tret = converter_->configure(pipeConfig.pixelFormat,\n+\t\t\t\t\t    pipeConfig.captureSize, &cfg);\n \t\tif (ret < 0) {\n \t\t\tLOG(SimplePipeline, Error)\n \t\t\t\t<< \"Unable to configure converter\";\n","prefixes":["libcamera-devel","05/10"]}