From patchwork Tue Oct 6 09:07:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 9966 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 4A48ABEEE0 for ; Tue, 6 Oct 2020 09:07:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 706AA6035A; Tue, 6 Oct 2020 11:07:37 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="fTuZch0D"; dkim-atps=neutral Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D28D96035A for ; Tue, 6 Oct 2020 11:07:35 +0200 (CEST) Received: by mail-wm1-x32e.google.com with SMTP id l11so2124629wmh.2 for ; Tue, 06 Oct 2020 02:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PP7OPwHeV1v3XuIVe104KTrxEfSqUbuIwA3UmJpwTVE=; b=fTuZch0D2kjfnHx8+Wce8s65YQ1UL02eKA7g7xQmYISMQaYGLlIC4vpDonXX1iQguK ipZFzltXS0mOT2dVlAXCWO+ulP/uI/o7AOn3mVpFroO+EOTBbYR4K6S5us3Tl+JAK8B4 3KIfTsOwDe/bDIlRRPZSdx94M73HQwGB0yuBfGDApLDNOqq48G7u6dxTHY9e8v2QtEu7 8vmKtpU3FdLWyHqaYZXLclyj8owiSg/GEKwKnvNzu8FCdgmQq5ZUTlNOIgEa3rtan5xj aJocsvjcWtIFXVuvnbVSiEvqV2USN7I4S5GOBydMfznG4RIybGABYtabnK3No7I/YGCr chkg== 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=PP7OPwHeV1v3XuIVe104KTrxEfSqUbuIwA3UmJpwTVE=; b=IUMs3wefRdqSTo2iAkI/0AjUDttsXlylBzyfqzKHdginjmtRjOHKdtfde4WmSP7nRG ovx5qiRrgJ3wTK5sZKEjqTOhU6ZcSC7gpXNr6Z5qkU8wtHkke3YCy3FXaWhxepCe0Kc7 U00f0CaZ4oxUVjr2H30DT8Y9LlqMGFMaWPmRLOSVZ+Mdti8tNbUz3g/1apVUYV70TUhq ACVgtF1gdaSZTCJL3cMjXY9x9MZx8by2ugU1mVrzyJXR8S+KBLeVmVCSvblpW8DnClhh bX5ruebpXqbKAsPZKeYnCBaOqjmItCjOqRu6oiOb6GQzhj8qUmbicl9AGqICYLW9VFpv gRSw== X-Gm-Message-State: AOAM533P2YEMeorH2DIxPfeyXLi7GWRFFbqhiIzu4bzGDBdEA+IPYhGQ ILwAKbzrBjpd5KKqGlvcMRiBxaxVKGT8lg== X-Google-Smtp-Source: ABdhPJx3hIb+LhFNwaUsP7+XJxJR/7xxoCEL7dgq+6oyJ0Omh8aKp1nWYj7U7Hlv0iYaIOzSV+eukg== X-Received: by 2002:a1c:c28a:: with SMTP id s132mr3874539wmf.13.1601975255025; Tue, 06 Oct 2020 02:07:35 -0700 (PDT) Received: from naushir-VirtualBox.pitowers.org ([2a00:1098:3142:14:a00:27ff:fe4d:f6a2]) by smtp.gmail.com with ESMTPSA id j14sm3579355wrr.66.2020.10.06.02.07.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2020 02:07:34 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Tue, 6 Oct 2020 10:07:31 +0100 Message-Id: <20201006090731.185060-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] pipeline: ipa: raspberrypi: Switch to use C++17 features where possible 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 the recent change to use C++17, the following code changes can be made: - Use C++17 [[fallthough]] attribute instead of /* Fall through */. - Swap boost::any to std::any. Signed-off-by: Naushir Patuck Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/controller/metadata.hpp | 9 ++++----- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ipa/raspberrypi/controller/metadata.hpp b/src/ipa/raspberrypi/controller/metadata.hpp index f3a8dfab..4f44ffc6 100644 --- a/src/ipa/raspberrypi/controller/metadata.hpp +++ b/src/ipa/raspberrypi/controller/metadata.hpp @@ -8,13 +8,12 @@ // A simple class for carrying arbitrary metadata, for example about an image. +#include #include #include #include #include -#include - namespace RPiController { class Metadata @@ -31,7 +30,7 @@ public: auto it = data_.find(tag); if (it == data_.end()) return -1; - value = boost::any_cast(it->second); + value = std::any_cast(it->second); return 0; } void Clear() @@ -53,7 +52,7 @@ public: auto it = data_.find(tag); if (it == data_.end()) return nullptr; - return boost::any_cast(&it->second); + return std::any_cast(&it->second); } template void SetLocked(std::string const &tag, T const &value) @@ -69,7 +68,7 @@ public: private: mutable std::mutex mutex_; - std::map data_; + std::map data_; }; typedef std::shared_ptr MetadataPtr; diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 1052bdce..26dbd257 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -1494,7 +1494,7 @@ void RPiCameraData::handleState() * No break here, we want to try running the pipeline again. * The fallthrough clause below suppresses compiler warnings. */ - /* Fall through */ + [[fallthrough]]; case State::Idle: tryRunPipeline();