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>
This commit is contained in:
parent
61a1d1694c
commit
6d0bf44c32
8 changed files with 20 additions and 19 deletions
|
@ -8,8 +8,8 @@
|
||||||
#include <libcamera/controls.h>
|
#include <libcamera/controls.h>
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <libcamera/base/log.h>
|
#include <libcamera/base/log.h>
|
||||||
#include <libcamera/base/utils.h>
|
#include <libcamera/base/utils.h>
|
||||||
|
|
|
@ -539,7 +539,6 @@ IPADataSerializer<SharedFD>::serialize(const SharedFD &data,
|
||||||
if (data.isValid())
|
if (data.isValid())
|
||||||
fdVec.push_back(data);
|
fdVec.push_back(data);
|
||||||
|
|
||||||
|
|
||||||
return { dataVec, fdVec };
|
return { dataVec, fdVec };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -606,7 +605,7 @@ IPADataSerializer<FrameBuffer::Plane>::deserialize(std::vector<uint8_t>::const_i
|
||||||
FrameBuffer::Plane ret;
|
FrameBuffer::Plane ret;
|
||||||
|
|
||||||
ret.fd = IPADataSerializer<SharedFD>::deserialize(dataBegin, dataBegin + 4,
|
ret.fd = IPADataSerializer<SharedFD>::deserialize(dataBegin, dataBegin + 4,
|
||||||
fdsBegin, fdsBegin + 1);
|
fdsBegin, fdsBegin + 1);
|
||||||
ret.offset = readPOD<uint32_t>(dataBegin, 4, dataEnd);
|
ret.offset = readPOD<uint32_t>(dataBegin, 4, dataEnd);
|
||||||
ret.length = readPOD<uint32_t>(dataBegin, 8, dataEnd);
|
ret.length = readPOD<uint32_t>(dataBegin, 8, dataEnd);
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,8 @@ typename std::remove_extent_t<T> *elfPointer(Span<const uint8_t> elf,
|
||||||
if (size > elf.size() || size < objSize)
|
if (size > elf.size() || size < objSize)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
return reinterpret_cast<typename std::remove_extent_t<T> *>
|
return reinterpret_cast<typename std::remove_extent_t<T> *>(
|
||||||
(reinterpret_cast<const char *>(elf.data()) + offset);
|
reinterpret_cast<const char *>(elf.data()) + offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
@ -101,10 +101,14 @@ std::ostream &operator<<(std::ostream &out, const Orientation &orientation)
|
||||||
{
|
{
|
||||||
constexpr std::array<const char *, 9> orientationNames = {
|
constexpr std::array<const char *, 9> orientationNames = {
|
||||||
"", /* Orientation starts counting from 1. */
|
"", /* Orientation starts counting from 1. */
|
||||||
"Rotate0", "Rotate0Mirror",
|
"Rotate0",
|
||||||
"Rotate180", "Rotate180Mirror",
|
"Rotate0Mirror",
|
||||||
"Rotate90Mirror", "Rotate270",
|
"Rotate180",
|
||||||
"Rotate270Mirror", "Rotate90",
|
"Rotate180Mirror",
|
||||||
|
"Rotate90Mirror",
|
||||||
|
"Rotate270",
|
||||||
|
"Rotate270Mirror",
|
||||||
|
"Rotate90",
|
||||||
};
|
};
|
||||||
|
|
||||||
out << orientationNames[static_cast<unsigned int>(orientation)];
|
out << orientationNames[static_cast<unsigned int>(orientation)];
|
||||||
|
|
|
@ -188,7 +188,6 @@ const struct sigaction &ProcessManager::oldsa() const
|
||||||
return oldsa_;
|
return oldsa_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class Process
|
* \class Process
|
||||||
* \brief Process object
|
* \brief Process object
|
||||||
|
@ -270,8 +269,8 @@ int Process::start(const std::string &path,
|
||||||
unsigned int len = args.size();
|
unsigned int len = args.size();
|
||||||
argv[0] = path.c_str();
|
argv[0] = path.c_str();
|
||||||
for (unsigned int i = 0; i < len; i++)
|
for (unsigned int i = 0; i < len; i++)
|
||||||
argv[i+1] = args[i].c_str();
|
argv[i + 1] = args[i].c_str();
|
||||||
argv[len+1] = nullptr;
|
argv[len + 1] = nullptr;
|
||||||
|
|
||||||
execv(path.c_str(), (char **)argv);
|
execv(path.c_str(), (char **)argv);
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "libcamera/internal/camera_sensor.h"
|
#include "libcamera/internal/camera_sensor.h"
|
||||||
#include "libcamera/internal/media_device.h"
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
|
@ -14,15 +13,16 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <libcamera/base/utils.h>
|
||||||
|
|
||||||
#include <libcamera/camera.h>
|
#include <libcamera/camera.h>
|
||||||
#include <libcamera/orientation.h>
|
#include <libcamera/orientation.h>
|
||||||
#include <libcamera/property_ids.h>
|
#include <libcamera/property_ids.h>
|
||||||
|
|
||||||
#include <libcamera/base/utils.h>
|
|
||||||
|
|
||||||
#include "libcamera/internal/bayer_format.h"
|
#include "libcamera/internal/bayer_format.h"
|
||||||
#include "libcamera/internal/camera_lens.h"
|
#include "libcamera/internal/camera_lens.h"
|
||||||
#include "libcamera/internal/camera_sensor_properties.h"
|
#include "libcamera/internal/camera_sensor_properties.h"
|
||||||
|
#include "libcamera/internal/media_device.h"
|
||||||
#include "libcamera/internal/sysfs.h"
|
#include "libcamera/internal/sysfs.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -57,8 +57,8 @@ SharedMem::SharedMem() = default;
|
||||||
*/
|
*/
|
||||||
SharedMem::SharedMem(const std::string &name, std::size_t size)
|
SharedMem::SharedMem(const std::string &name, std::size_t size)
|
||||||
{
|
{
|
||||||
UniqueFD memfd = MemFd::create(name.c_str(), size, MemFd::Seal::Shrink |
|
UniqueFD memfd = MemFd::create(name.c_str(), size,
|
||||||
MemFd::Seal::Grow);
|
MemFd::Seal::Shrink | MemFd::Seal::Grow);
|
||||||
if (!memfd.isValid())
|
if (!memfd.isValid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -14,11 +14,10 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <libcamera/request.h>
|
|
||||||
|
|
||||||
#include <libcamera/base/log.h>
|
#include <libcamera/base/log.h>
|
||||||
#include <libcamera/base/utils.h>
|
#include <libcamera/base/utils.h>
|
||||||
|
|
||||||
|
#include <libcamera/request.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file stream.h
|
* \file stream.h
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue