summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Zamazal <mzamazal@redhat.com>2024-09-02 17:42:08 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-09-02 22:34:37 +0300
commit6d0bf44c3209caeac3a38488c0d2eb0bf25624d7 (patch)
tree0506a139d9121d75efece5d37b8ba4bd3e22390a
parent61a1d1694c06e8fb9c21048597e781879647b112 (diff)
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 <mzamazal@redhat.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--src/libcamera/controls.cpp2
-rw-r--r--src/libcamera/ipa_data_serializer.cpp3
-rw-r--r--src/libcamera/ipa_module.cpp4
-rw-r--r--src/libcamera/orientation.cpp12
-rw-r--r--src/libcamera/process.cpp5
-rw-r--r--src/libcamera/sensor/camera_sensor.cpp6
-rw-r--r--src/libcamera/shared_mem_object.cpp4
-rw-r--r--src/libcamera/stream.cpp3
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 <libcamera/controls.h>
#include <sstream>
-#include <string>
#include <string.h>
+#include <string>
#include <libcamera/base/log.h>
#include <libcamera/base/utils.h>
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<SharedFD>::serialize(const SharedFD &data,
if (data.isValid())
fdVec.push_back(data);
-
return { dataVec, fdVec };
}
@@ -606,7 +605,7 @@ IPADataSerializer<FrameBuffer::Plane>::deserialize(std::vector<uint8_t>::const_i
FrameBuffer::Plane ret;
ret.fd = IPADataSerializer<SharedFD>::deserialize(dataBegin, dataBegin + 4,
- fdsBegin, fdsBegin + 1);
+ fdsBegin, fdsBegin + 1);
ret.offset = readPOD<uint32_t>(dataBegin, 4, dataEnd);
ret.length = readPOD<uint32_t>(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<T> *elfPointer(Span<const uint8_t> elf,
if (size > elf.size() || size < objSize)
return nullptr;
- return reinterpret_cast<typename std::remove_extent_t<T> *>
- (reinterpret_cast<const char *>(elf.data()) + offset);
+ return reinterpret_cast<typename std::remove_extent_t<T> *>(
+ reinterpret_cast<const char *>(elf.data()) + offset);
}
template<typename T>
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<const char *, 9> 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<unsigned int>(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 <algorithm>
#include <float.h>
@@ -14,15 +13,16 @@
#include <math.h>
#include <string.h>
+#include <libcamera/base/utils.h>
+
#include <libcamera/camera.h>
#include <libcamera/orientation.h>
#include <libcamera/property_ids.h>
-#include <libcamera/base/utils.h>
-
#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 <string>
#include <vector>
-#include <libcamera/request.h>
-
#include <libcamera/base/log.h>
#include <libcamera/base/utils.h>
+#include <libcamera/request.h>
/**
* \file stream.h