From patchwork Fri Aug 30 13:18:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21102 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 7B9A0C32DC for ; Fri, 30 Aug 2024 13:20:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C826F634E8; Fri, 30 Aug 2024 15:20:08 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="Eicq6ZwD"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 37CE6634EC for ; Fri, 30 Aug 2024 15:19:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725023992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mzDEvzxLzdzULr9Rz+qruecDBpWub0vf7IZevbck83E=; b=Eicq6ZwDxLgq/375AEyU3MvU/3NNlSB01dRxipY4GU67EYvRopTaPTzg1ootjCKFOLWKnk +nQDfxGnXfKGSROmAdx6AtmTmw+PrHWnZr95pdNN8Abt5FTXz5GIBKyUr/EP0uZfBW2uLI NhDNeWnsFamu3MdM3cqCgASgQAUHslo= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-505-ntidmhr8N4yTIaZS8WmTyQ-1; Fri, 30 Aug 2024 09:19:50 -0400 X-MC-Unique: ntidmhr8N4yTIaZS8WmTyQ-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2AC211955F6A for ; Fri, 30 Aug 2024 13:19:50 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A61F719560AE; Fri, 30 Aug 2024 13:19:48 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH 19/19] libcamera: includes: Formatting improvements Date: Fri, 30 Aug 2024 15:18:56 +0200 Message-ID: <20240830131904.1090330-20-mzamazal@redhat.com> In-Reply-To: <20240830131904.1090330-1-mzamazal@redhat.com> References: <20240830131904.1090330-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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" The LSP autoformatter doesn't like some of the current formatting, let's make it happy. Signed-off-by: Milan Zamazal --- include/libcamera/base/log.h | 22 +++++----- include/libcamera/base/span.h | 40 +++++++++---------- include/libcamera/base/utils.h | 2 +- include/libcamera/internal/camera_manager.h | 4 +- .../libcamera/internal/ipa_data_serializer.h | 7 ++-- 5 files changed, 38 insertions(+), 37 deletions(-) diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h index 62093012..38b0ab01 100644 --- a/include/libcamera/base/log.h +++ b/include/libcamera/base/log.h @@ -43,17 +43,17 @@ private: LogSeverity severity_; }; -#define LOG_DECLARE_CATEGORY(name) \ -extern const LogCategory &_LOG_CATEGORY(name)(); - -#define LOG_DEFINE_CATEGORY(name) \ -LOG_DECLARE_CATEGORY(name) \ -const LogCategory &_LOG_CATEGORY(name)() \ -{ \ - /* The instance will be deleted by the Logger destructor. */ \ - static LogCategory *category = LogCategory::create(#name); \ - return *category; \ -} +#define LOG_DECLARE_CATEGORY(name) \ + extern const LogCategory &_LOG_CATEGORY(name)(); + +#define LOG_DEFINE_CATEGORY(name) \ + LOG_DECLARE_CATEGORY(name) \ + const LogCategory &_LOG_CATEGORY(name)() \ + { \ + /* The instance will be deleted by the Logger destructor. */ \ + static LogCategory *category = LogCategory::create(#name); \ + return *category; \ + } class LogMessage { diff --git a/include/libcamera/base/span.h b/include/libcamera/base/span.h index 92cce4f0..86201aa2 100644 --- a/include/libcamera/base/span.h +++ b/include/libcamera/base/span.h @@ -125,7 +125,7 @@ public: constexpr Span(element_type (&arr)[N], std::enable_if_t (*)[], element_type (*)[]>::value && - N == Extent, + N == Extent, std::nullptr_t> = nullptr) noexcept : data_(arr) { @@ -135,7 +135,7 @@ public: constexpr Span(std::array &arr, std::enable_if_t (*)[], element_type (*)[]>::value && - N == Extent, + N == Extent, std::nullptr_t> = nullptr) noexcept : data_(arr.data()) { @@ -145,7 +145,7 @@ public: constexpr Span(const std::array &arr, std::enable_if_t (*)[], element_type (*)[]>::value && - N == Extent, + N == Extent, std::nullptr_t> = nullptr) noexcept : data_(arr.data()) { @@ -154,10 +154,10 @@ public: template explicit constexpr Span(Container &cont, std::enable_if_t::value && - !details::is_array::value && - !std::is_array::value && - std::is_convertible (*)[], - element_type (*)[]>::value, + !details::is_array::value && + !std::is_array::value && + std::is_convertible (*)[], + element_type (*)[]>::value, std::nullptr_t> = nullptr) : data_(utils::data(cont)) { @@ -166,10 +166,10 @@ public: template explicit constexpr Span(const Container &cont, std::enable_if_t::value && - !details::is_array::value && - !std::is_array::value && - std::is_convertible (*)[], - element_type (*)[]>::value, + !details::is_array::value && + !std::is_array::value && + std::is_convertible (*)[], + element_type (*)[]>::value, std::nullptr_t> = nullptr) : data_(utils::data(cont)) { @@ -179,7 +179,7 @@ public: template explicit constexpr Span(const Span &s, std::enable_if_t::value && - N == Extent, + N == Extent, std::nullptr_t> = nullptr) noexcept : data_(s.data()) { @@ -316,10 +316,10 @@ public: template constexpr Span(Container &cont, std::enable_if_t::value && - !details::is_array::value && - !std::is_array::value && - std::is_convertible (*)[], - element_type (*)[]>::value, + !details::is_array::value && + !std::is_array::value && + std::is_convertible (*)[], + element_type (*)[]>::value, std::nullptr_t> = nullptr) : data_(utils::data(cont)), size_(utils::size(cont)) { @@ -328,10 +328,10 @@ public: template constexpr Span(const Container &cont, std::enable_if_t::value && - !details::is_array::value && - !std::is_array::value && - std::is_convertible (*)[], - element_type (*)[]>::value, + !details::is_array::value && + !std::is_array::value && + std::is_convertible (*)[], + element_type (*)[]>::value, std::nullptr_t> = nullptr) : data_(utils::data(cont)), size_(utils::size(cont)) { diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h index 98c683a7..a9b27d0f 100644 --- a/include/libcamera/base/utils.h +++ b/include/libcamera/base/utils.h @@ -12,8 +12,8 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/include/libcamera/internal/camera_manager.h b/include/libcamera/internal/camera_manager.h index 0150ca61..95ddf4cf 100644 --- a/include/libcamera/internal/camera_manager.h +++ b/include/libcamera/internal/camera_manager.h @@ -7,8 +7,6 @@ #pragma once -#include - #include #include #include @@ -18,6 +16,8 @@ #include #include +#include + #include "libcamera/internal/process.h" namespace libcamera { diff --git a/include/libcamera/internal/ipa_data_serializer.h b/include/libcamera/internal/ipa_data_serializer.h index 13470a89..66d9a19f 100644 --- a/include/libcamera/internal/ipa_data_serializer.h +++ b/include/libcamera/internal/ipa_data_serializer.h @@ -18,6 +18,7 @@ #include #include #include + #include #include "libcamera/internal/control_serializer.h" @@ -161,7 +162,7 @@ public: std::vector::const_iterator fdIter = fdsBegin; for (uint32_t i = 0; i < vecLen; i++) { uint32_t sizeofData = readPOD(dataIter, 0, dataEnd); - uint32_t sizeofFds = readPOD(dataIter, 4, dataEnd); + uint32_t sizeofFds = readPOD(dataIter, 4, dataEnd); dataIter += 8; ret[i] = IPADataSerializer::deserialize(dataIter, @@ -268,7 +269,7 @@ public: std::vector::const_iterator fdIter = fdsBegin; for (uint32_t i = 0; i < mapLen; i++) { uint32_t sizeofData = readPOD(dataIter, 0, dataEnd); - uint32_t sizeofFds = readPOD(dataIter, 4, dataEnd); + uint32_t sizeofFds = readPOD(dataIter, 4, dataEnd); dataIter += 8; K key = IPADataSerializer::deserialize(dataIter, @@ -280,7 +281,7 @@ public: dataIter += sizeofData; fdIter += sizeofFds; sizeofData = readPOD(dataIter, 0, dataEnd); - sizeofFds = readPOD(dataIter, 4, dataEnd); + sizeofFds = readPOD(dataIter, 4, dataEnd); dataIter += 8; const V value = IPADataSerializer::deserialize(dataIter,