[libcamera-devel] [PATCH v4 03/15] libcamera: pipeline: Use existing variable definitions

Kieran Bingham kieran.bingham at ideasonboard.com
Wed Oct 21 17:41:36 CEST 2020


Prevent variable shadowing by removing the redeclaration of variables
with the same name (and type) where the existing variable can be reused.

Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
 src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 +-
 src/libcamera/pipeline/simple/simple.cpp           | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index 7f8deb38bd22..dd62dfc743da 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -1008,7 +1008,7 @@ int PipelineHandlerRPi::queueAllBuffers(Camera *camera)
 			 */
 			unsigned int i;
 			for (i = 0; i < data->dropFrameCount_; i++) {
-				int ret = stream->queueBuffer(nullptr);
+				ret = stream->queueBuffer(nullptr);
 				if (ret)
 					return ret;
 			}
diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
index 477377301ee9..d63f97015c78 100644
--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -612,8 +612,8 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)
 	useConverter_ = config->needConversion();
 
 	if (useConverter_) {
-		int ret = converter_->configure(pipeConfig.pixelFormat,
-						pipeConfig.captureSize, &cfg);
+		ret = converter_->configure(pipeConfig.pixelFormat,
+					    pipeConfig.captureSize, &cfg);
 		if (ret < 0) {
 			LOG(SimplePipeline, Error)
 				<< "Unable to configure converter";
-- 
2.25.1



More information about the libcamera-devel mailing list