From patchwork Thu Oct 15 22:37:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10069 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 59415BEEE1 for ; Thu, 15 Oct 2020 22:38:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 25F17610B6; Fri, 16 Oct 2020 00:38:03 +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="PykETNe3"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9F2F960F23 for ; Fri, 16 Oct 2020 00:37:58 +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 186CFA42; Fri, 16 Oct 2020 00:37:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1602801478; bh=lEYqiJu9Sp8Dx7iDZU/u0JSJSg82Bc5v9e9XOg6YxVU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PykETNe3kpp9Di/HRY0l/Xp4xablFROe89qEvuSGtrl/5gO3ub3X6WDA9wdXUdxXN xbREgkwu6L0N+GUmOzyOUdAJmPEvweAjq1PsstcYI2QA9UAwQa4+2k0eRX+BIp6mY0 u3INljgSfHM2SMMYgc6SlzodUvrYKW2GDSdMG0HI= From: Kieran Bingham To: libcamera devel Date: Thu, 15 Oct 2020 23:37:47 +0100 Message-Id: <20201015223750.58563-9-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201015223750.58563-1-kieran.bingham@ideasonboard.com> References: <20201015223750.58563-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 08/11] test: v4l2_videodevice: Prevent variable aliasing of format 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" Rename the scoped usage of the variable format while iterating the formats as it aliases the outer scoped format which is used for specific testing. Signed-off-by: Kieran Bingham Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- test/v4l2_videodevice/formats.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/v4l2_videodevice/formats.cpp b/test/v4l2_videodevice/formats.cpp index 043732dcaba1..e3283cf92bff 100644 --- a/test/v4l2_videodevice/formats.cpp +++ b/test/v4l2_videodevice/formats.cpp @@ -55,10 +55,10 @@ protected: { V4L2_PIX_FMT_Y16_BE, "Y16 -BE" } }; - for (const auto &format : formats) { - if (V4L2PixelFormat(format.first).toString() != format.second) { + for (const auto &fmt : formats) { + if (V4L2PixelFormat(fmt.first).toString() != fmt.second) { cerr << "Failed to convert V4L2PixelFormat" - << utils::hex(format.first) << "to string" + << utils::hex(fmt.first) << "to string" << endl; return TestFail; }