From patchwork Thu Jul 28 11:13:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 16859 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 E9E18BE173 for ; Thu, 28 Jul 2022 11:13:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4EBB863312; Thu, 28 Jul 2022 13:13:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1659006788; bh=wHogU+HkQWOhak1vnOQFlwh/9EJm4+vAk38LrYeJ28M=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=fDPe0N5GzFdJw/XLNLQgemW4uV9VfKJG65HzxpRfqf+nJy4ZLMzN1ntwN+jM8Wcb+ lc32ktD09iAxgcfsMRNk0MftPN+pyRZx8tZc5zjZ2vYp4fe0eODQZMPNbZF4h1T2ab 01JvoKr9lPU/Id5tVG/XV8RTmXnZvHkkYvOmOv3uZSYndnZF/W2B6dTzWk8pPvIaO0 GEhyktxxtYfYxpivexBnVInd7104K6HknbXiwiq0ezpZgtl0ZJ5Qkl0/VE94V+4MjK SibPG+xgdD9+IBl71qxTClXCIpHJmvaZaU3i3x3WDxxEEFF/jRk0V7Kmjy4uBwoKBH jOwWNiZJ+cXaw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 32AF66330D for ; Thu, 28 Jul 2022 13:13:07 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="W/cELXeN"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7D46556D for ; Thu, 28 Jul 2022 13:13:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1659006786; bh=wHogU+HkQWOhak1vnOQFlwh/9EJm4+vAk38LrYeJ28M=; h=From:To:Subject:Date:From; b=W/cELXeNUL+xC7TXlHtT+hqojji+mRwNnBhzYSwvytQgSUD0r9TPOQpqGu7BH7jVS r5ucIMG8JKDtQLcpQn9RmAm6DE9k4LrTqpllL3LTavhsd+ACKrYFtdyGzjV5Iu+FAV sgi4gcHTmHedIq3r8PIUz1zPpFzkUwZEMz+udAqo= To: libcamera-devel@lists.libcamera.org Date: Thu, 28 Jul 2022 14:13:03 +0300 Message-Id: <20220728111303.15241-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: Drop unnecessary typename keyword used with std::enable_if_t 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: , X-Patchwork-Original-From: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Usage of the std::enable_if_t type doesn't need to be prefixed by typename. Drop the unnecessary keyword. Reported-by: Jacopo Mondi Signed-off-by: Laurent Pinchart Reviewed-by: Umang Jain Reviewed-by: Jacopo Mondi --- include/libcamera/base/bound_method.h | 2 +- include/libcamera/base/flags.h | 8 ++-- include/libcamera/base/object.h | 2 +- include/libcamera/base/signal.h | 8 ++-- include/libcamera/controls.h | 38 +++++++++---------- .../libcamera/internal/ipa_data_serializer.h | 2 +- include/libcamera/internal/yaml_parser.h | 4 +- src/libcamera/yaml_parser.cpp | 2 +- 8 files changed, 33 insertions(+), 33 deletions(-) base-commit: c13f86704b129636bb6d84f8b8ca37826ded3238 diff --git a/include/libcamera/base/bound_method.h b/include/libcamera/base/bound_method.h index e73a4d98ddae..c0275249f389 100644 --- a/include/libcamera/base/bound_method.h +++ b/include/libcamera/base/bound_method.h @@ -72,7 +72,7 @@ public: } virtual ~BoundMethodBase() = default; - template::value> * = nullptr> + template::value> * = nullptr> bool match(T *obj) { return obj == obj_; } bool match(Object *object) { return object == object_; } diff --git a/include/libcamera/base/flags.h b/include/libcamera/base/flags.h index bff3b93c85a1..a1b404bdf23b 100644 --- a/include/libcamera/base/flags.h +++ b/include/libcamera/base/flags.h @@ -147,7 +147,7 @@ struct flags_enable_operators { }; template -typename std::enable_if_t::enable, Flags> +std::enable_if_t::enable, Flags> operator|(E lhs, E rhs) { using type = std::underlying_type_t; @@ -155,7 +155,7 @@ operator|(E lhs, E rhs) } template -typename std::enable_if_t::enable, Flags> +std::enable_if_t::enable, Flags> operator&(E lhs, E rhs) { using type = std::underlying_type_t; @@ -163,7 +163,7 @@ operator&(E lhs, E rhs) } template -typename std::enable_if_t::enable, Flags> +std::enable_if_t::enable, Flags> operator^(E lhs, E rhs) { using type = std::underlying_type_t; @@ -171,7 +171,7 @@ operator^(E lhs, E rhs) } template -typename std::enable_if_t::enable, Flags> +std::enable_if_t::enable, Flags> operator~(E rhs) { using type = std::underlying_type_t; diff --git a/include/libcamera/base/object.h b/include/libcamera/base/object.h index eef1a2c98ef9..933336361155 100644 --- a/include/libcamera/base/object.h +++ b/include/libcamera/base/object.h @@ -32,7 +32,7 @@ public: void postMessage(std::unique_ptr msg); template::value> * = nullptr> + std::enable_if_t::value> * = nullptr> R invokeMethod(R (T::*func)(FuncArgs...), ConnectionType type, Args&&... args) { diff --git a/include/libcamera/base/signal.h b/include/libcamera/base/signal.h index 91000d0d6349..efb591bc5073 100644 --- a/include/libcamera/base/signal.h +++ b/include/libcamera/base/signal.h @@ -44,7 +44,7 @@ public: } #ifndef __DOXYGEN__ - template::value> * = nullptr> + template::value> * = nullptr> void connect(T *obj, R (T::*func)(Args...), ConnectionType type = ConnectionTypeAuto) { @@ -52,7 +52,7 @@ public: SignalBase::connect(new BoundMethodMember(obj, object, func, type)); } - template::value> * = nullptr> + template::value> * = nullptr> #else template #endif @@ -63,7 +63,7 @@ public: #ifndef __DOXYGEN__ template::value> * = nullptr> + std::enable_if_t::value> * = nullptr> void connect(T *obj, Func func, ConnectionType type = ConnectionTypeAuto) { Object *object = static_cast(obj); @@ -71,7 +71,7 @@ public: } template::value> * = nullptr> + std::enable_if_t::value> * = nullptr> #else template #endif diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index 7920abbad2eb..b1b52acba0fd 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -99,10 +99,10 @@ public: ControlValue(); #ifndef __DOXYGEN__ - template::value && - details::control_type::value && - !std::is_same>::value, - std::nullptr_t> = nullptr> + template::value && + details::control_type::value && + !std::is_same>::value, + std::nullptr_t> = nullptr> ControlValue(const T &value) : type_(ControlTypeNone), numElements_(0) { @@ -110,9 +110,9 @@ public: &value, 1, sizeof(T)); } - template::value || - std::is_same>::value, - std::nullptr_t> = nullptr> + template::value || + std::is_same>::value, + std::nullptr_t> = nullptr> #else template #endif @@ -144,9 +144,9 @@ public: } #ifndef __DOXYGEN__ - template::value && - !std::is_same>::value, - std::nullptr_t> = nullptr> + template::value && + !std::is_same>::value, + std::nullptr_t> = nullptr> T get() const { assert(type_ == details::control_type>::value); @@ -155,9 +155,9 @@ public: return *reinterpret_cast(data().data()); } - template::value || - std::is_same>::value, - std::nullptr_t> = nullptr> + template::value || + std::is_same>::value, + std::nullptr_t> = nullptr> #else template #endif @@ -172,18 +172,18 @@ public: } #ifndef __DOXYGEN__ - template::value && - !std::is_same>::value, - std::nullptr_t> = nullptr> + template::value && + !std::is_same>::value, + std::nullptr_t> = nullptr> void set(const T &value) { set(details::control_type>::value, false, reinterpret_cast(&value), 1, sizeof(T)); } - template::value || - std::is_same>::value, - std::nullptr_t> = nullptr> + template::value || + std::is_same>::value, + std::nullptr_t> = nullptr> #else template #endif diff --git a/include/libcamera/internal/ipa_data_serializer.h b/include/libcamera/internal/ipa_data_serializer.h index a87449c9be48..30bdaebcd830 100644 --- a/include/libcamera/internal/ipa_data_serializer.h +++ b/include/libcamera/internal/ipa_data_serializer.h @@ -32,7 +32,7 @@ LOG_DECLARE_CATEGORY(IPADataSerializer) namespace { template> * = nullptr> + std::enable_if_t> * = nullptr> void appendPOD(std::vector &vec, T val) { constexpr size_t byteWidth = sizeof(val); diff --git a/include/libcamera/internal/yaml_parser.h b/include/libcamera/internal/yaml_parser.h index 78c359f749bf..5ba777d364fa 100644 --- a/include/libcamera/internal/yaml_parser.h +++ b/include/libcamera/internal/yaml_parser.h @@ -163,7 +163,7 @@ public: #ifndef __DOXYGEN__ template || std::is_same_v || std::is_same_v || @@ -185,7 +185,7 @@ public: #ifndef __DOXYGEN__ template || std::is_same_v || std::is_same_v || diff --git a/src/libcamera/yaml_parser.cpp b/src/libcamera/yaml_parser.cpp index 440e35c47cab..84cb57d6de83 100644 --- a/src/libcamera/yaml_parser.cpp +++ b/src/libcamera/yaml_parser.cpp @@ -307,7 +307,7 @@ std::optional YamlObject::get() const #ifndef __DOXYGEN__ template || std::is_same_v || std::is_same_v ||