From patchwork Fri Aug 30 15:27:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21122 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 040DEC32DD for ; Fri, 30 Aug 2024 15:28:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 575AC634F3; Fri, 30 Aug 2024 17:28:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="dmvYCGXE"; 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 98E72634DF for ; Fri, 30 Aug 2024 17:28:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031684; 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=dmvYCGXE0ITc6DsITfug+g2hg/+orKbTAZZ5d/w2yrSx+rnPAr58HWkWIfVsfX7e3DpqPP EUzbKJuvx0MxfqFUE8+6h0fxSN/wcI0L4TkK06zhvo7ELDzhmf2dn6DRZGhcBTAOG+9Ckq 2nDIkh4PtTTIUF2l7KBPe5VRthMqxOo= Received: from mx-prod-mc-04.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-615-V4ETeMlkNiKtN_gORVwDIA-1; Fri, 30 Aug 2024 11:28:03 -0400 X-MC-Unique: V4ETeMlkNiKtN_gORVwDIA-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B480519560BF for ; Fri, 30 Aug 2024 15:28:02 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6E4171955F43; Fri, 30 Aug 2024 15:28:01 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 20/20] libcamera: includes: Formatting improvements Date: Fri, 30 Aug 2024 17:27:17 +0200 Message-ID: <20240830152721.1420313-21-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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,