From patchwork Wed Mar 3 23:21:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 11485 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 ECAAEBD80C for ; Wed, 3 Mar 2021 23:21:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7563B68A98; Thu, 4 Mar 2021 00:21:32 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rH33Y9GX"; dkim-atps=neutral Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D67A360106 for ; Thu, 4 Mar 2021 00:21:30 +0100 (CET) Received: by mail-pg1-x52d.google.com with SMTP id o10so17540686pgg.4 for ; Wed, 03 Mar 2021 15:21:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3Y7hZpJfic5WJeW+qYvFVpQcSGEmO4maj8Yedtqu+8g=; b=rH33Y9GXqxDBLJqKbSEHAvTEArryEVYdO0xPJ6EQxyorrO8G5jQbmy/CMrDYEZxrro rlW3HZCwNfhQEEHofdslrpK1rqpkP3BBDpYIGIOetixRsa86bxUd0SXQ+2WeqDHBxESL +ClIyIJLBdsIuyJwfsYfz2BpFn8GZcd6ixtFj1wWe6jrat//o78FBYYwtaqaXv9h5WxD Q8+BxxIEwSgEwY3/WpaihOS0oUQXlfLQhkgPVR/YKI3a5FezBg5qXXvpAlPJEwe8498i 1o1BCL5cFMR4qO7Sqn0WKW+Wc8QrEsmVOsof1D9EbwTAu7VO4rLQ0k+zaIV+xTYq1dGJ AweQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3Y7hZpJfic5WJeW+qYvFVpQcSGEmO4maj8Yedtqu+8g=; b=bW5cDWE1LBCTC+dMR9XmwVxWBqXSAZWrIMmfBTckyQTR9H9szdyz/K+zzG+Fx3tMEW 5UiquU9cF8U0UK1MM26pvMvwg8nbFyhcR/h1Is4qxzmYzr2i1KxHxET2H1aCumhFVqg3 xei/j7spyxQXTinW30G6H6uos1Vmx9QSqPopjijL90GrMPyH2J47P4MwwdORJ4fzPvpy mG7U13XjyVkwA7UW/JOq2UibJkhduyWd4VYI1C+wbwqKWYWFGOQWvJYXtkA0iCx/VJNv 9kikRllR5VtNKDvD5KKDSHzfjUnepHkmwxkRAh/XPBeOgHUdl8Oyw0QAMa80WX4QynCz HNkw== X-Gm-Message-State: AOAM533y9rgt7EBpvPk0DgFacgM3b6olrfVl2V89YvKr8DV0nVBN9IGe uo6p5dj6MT99CBNHknzZ8A9WBgO8GP2v0g== X-Google-Smtp-Source: ABdhPJzDUUwpn3tTKiOX4wBs7T8kr7mee5S06aUO+IRwiRodGXoYpZMBFZmumV+BMi1Mrx6z/knjGw== X-Received: by 2002:a62:c301:0:b029:1ed:c3d5:54d6 with SMTP id v1-20020a62c3010000b02901edc3d554d6mr1354547pfg.18.1614813688981; Wed, 03 Mar 2021 15:21:28 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9200:a0f0::b3bf]) by smtp.gmail.com with ESMTPSA id a199sm16696397pfa.49.2021.03.03.15.21.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 15:21:28 -0800 (PST) From: Khem Raj To: libcamera-devel@lists.libcamera.org Date: Wed, 3 Mar 2021 15:21:26 -0800 Message-Id: <20210303232126.3369069-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] uvcvideo: Use auto variable to avoid range loop warnings 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" With c++17 loop range bases are defined where copy is obvious since iterator returns a copy and not reference, gcc11 will emit a warning about this uvcvideo.cpp:432:33: error: loop variable 'name' of type 'const string&' {aka 'const std::__cxx11::basic_string&'} binds to a temporary constructed from type 'const char* const' [-Werror=range-loop-construct] | 432 | for (const std::string &name : { "idVendor", "idProduct" }) { | | ^~~~ Therefore making it explicit is better Signed-off-by: Khem Raj Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp index 031f96e2..ef23ece7 100644 --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp @@ -429,7 +429,7 @@ std::string PipelineHandlerUVC::generateId(const UVCCameraData *data) /* Creata a device ID from the USB devices vendor and product ID. */ std::string deviceId; - for (const std::string &name : { "idVendor", "idProduct" }) { + for (const auto name : { "idVendor", "idProduct" }) { std::ifstream file(path + "/../" + name); if (!file.is_open())