From 6d0bf44c3209caeac3a38488c0d2eb0bf25624d7 Mon Sep 17 00:00:00 2001 From: Milan Zamazal Date: Mon, 2 Sep 2024 17:42:08 +0200 Subject: libcamera: libcamera: Formatting improvements The LSP autoformatter doesn't like some of the current formatting, let's make it happier. Note that not all of its suggestions were accepted because readability is preferred and adjusting .clang-format may not be easy or possible. Signed-off-by: Milan Zamazal Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- src/libcamera/controls.cpp | 2 +- src/libcamera/ipa_data_serializer.cpp | 3 +-- src/libcamera/ipa_module.cpp | 4 ++-- src/libcamera/orientation.cpp | 12 ++++++++---- src/libcamera/process.cpp | 5 ++--- src/libcamera/sensor/camera_sensor.cpp | 6 +++--- src/libcamera/shared_mem_object.cpp | 4 ++-- src/libcamera/stream.cpp | 3 +-- 8 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp index 67400797..dba74404 100644 --- a/src/libcamera/controls.cpp +++ b/src/libcamera/controls.cpp @@ -8,8 +8,8 @@ #include #include -#include #include +#include #include #include diff --git a/src/libcamera/ipa_data_serializer.cpp b/src/libcamera/ipa_data_serializer.cpp index f6dd7e6f..2189a246 100644 --- a/src/libcamera/ipa_data_serializer.cpp +++ b/src/libcamera/ipa_data_serializer.cpp @@ -539,7 +539,6 @@ IPADataSerializer::serialize(const SharedFD &data, if (data.isValid()) fdVec.push_back(data); - return { dataVec, fdVec }; } @@ -606,7 +605,7 @@ IPADataSerializer::deserialize(std::vector::const_i FrameBuffer::Plane ret; ret.fd = IPADataSerializer::deserialize(dataBegin, dataBegin + 4, - fdsBegin, fdsBegin + 1); + fdsBegin, fdsBegin + 1); ret.offset = readPOD(dataBegin, 4, dataEnd); ret.length = readPOD(dataBegin, 8, dataEnd); diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp index 86d88a86..9ca74be6 100644 --- a/src/libcamera/ipa_module.cpp +++ b/src/libcamera/ipa_module.cpp @@ -50,8 +50,8 @@ typename std::remove_extent_t *elfPointer(Span elf, if (size > elf.size() || size < objSize) return nullptr; - return reinterpret_cast *> - (reinterpret_cast(elf.data()) + offset); + return reinterpret_cast *>( + reinterpret_cast(elf.data()) + offset); } template diff --git a/src/libcamera/orientation.cpp b/src/libcamera/orientation.cpp index bf960249..7d7d21ae 100644 --- a/src/libcamera/orientation.cpp +++ b/src/libcamera/orientation.cpp @@ -101,10 +101,14 @@ std::ostream &operator<<(std::ostream &out, const Orientation &orientation) { constexpr std::array orientationNames = { "", /* Orientation starts counting from 1. */ - "Rotate0", "Rotate0Mirror", - "Rotate180", "Rotate180Mirror", - "Rotate90Mirror", "Rotate270", - "Rotate270Mirror", "Rotate90", + "Rotate0", + "Rotate0Mirror", + "Rotate180", + "Rotate180Mirror", + "Rotate90Mirror", + "Rotate270", + "Rotate270Mirror", + "Rotate90", }; out << orientationNames[static_cast(orientation)]; diff --git a/src/libcamera/process.cpp b/src/libcamera/process.cpp index c0f4d49f..bc9833f4 100644 --- a/src/libcamera/process.cpp +++ b/src/libcamera/process.cpp @@ -188,7 +188,6 @@ const struct sigaction &ProcessManager::oldsa() const return oldsa_; } - /** * \class Process * \brief Process object @@ -270,8 +269,8 @@ int Process::start(const std::string &path, unsigned int len = args.size(); argv[0] = path.c_str(); for (unsigned int i = 0; i < len; i++) - argv[i+1] = args[i].c_str(); - argv[len+1] = nullptr; + argv[i + 1] = args[i].c_str(); + argv[len + 1] = nullptr; execv(path.c_str(), (char **)argv); diff --git a/src/libcamera/sensor/camera_sensor.cpp b/src/libcamera/sensor/camera_sensor.cpp index 1382081a..4a990bb9 100644 --- a/src/libcamera/sensor/camera_sensor.cpp +++ b/src/libcamera/sensor/camera_sensor.cpp @@ -6,7 +6,6 @@ */ #include "libcamera/internal/camera_sensor.h" -#include "libcamera/internal/media_device.h" #include #include @@ -14,15 +13,16 @@ #include #include +#include + #include #include #include -#include - #include "libcamera/internal/bayer_format.h" #include "libcamera/internal/camera_lens.h" #include "libcamera/internal/camera_sensor_properties.h" +#include "libcamera/internal/media_device.h" #include "libcamera/internal/sysfs.h" /** diff --git a/src/libcamera/shared_mem_object.cpp b/src/libcamera/shared_mem_object.cpp index 65b53919..d9b61d37 100644 --- a/src/libcamera/shared_mem_object.cpp +++ b/src/libcamera/shared_mem_object.cpp @@ -57,8 +57,8 @@ SharedMem::SharedMem() = default; */ SharedMem::SharedMem(const std::string &name, std::size_t size) { - UniqueFD memfd = MemFd::create(name.c_str(), size, MemFd::Seal::Shrink | - MemFd::Seal::Grow); + UniqueFD memfd = MemFd::create(name.c_str(), size, + MemFd::Seal::Shrink | MemFd::Seal::Grow); if (!memfd.isValid()) return; diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp index 33018ec1..1f75dbbc 100644 --- a/src/libcamera/stream.cpp +++ b/src/libcamera/stream.cpp @@ -14,11 +14,10 @@ #include #include -#include - #include #include +#include /** * \file stream.h -- cgit v1.2.1