1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

fix: Formatting with clang-format

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
This commit is contained in:
Steffen Vogel 2024-10-31 11:52:20 +01:00
parent 00e80c54b9
commit f1a025bb20
12 changed files with 32 additions and 28 deletions

View file

@ -22,7 +22,8 @@ public:
private:
IpDevice() = delete;
IpDevice(const std::filesystem::path valid_path) //! Dont allow unvalidated paths
IpDevice(
const std::filesystem::path valid_path) //! Dont allow unvalidated paths
: PlatformDevice(valid_path){};
public:

View file

@ -20,7 +20,7 @@ namespace kernel {
namespace devices {
#define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f)
#define PCI_FUNC(devfn) ((devfn) & 0x07)
#define PCI_FUNC(devfn) ((devfn)&0x07)
class Id {
public:

View file

@ -45,7 +45,7 @@ struct Task {
#if PERIODIC_TASK_IMPL == TIMERFD
int fd; // The timerfd_create(2) file descriptior.
#elif PERIODIC_TASK_IMPL == RDTSC
struct Tsc tsc; // Initialized by tsc_init().
struct Tsc tsc; // Initialized by tsc_init().
#endif
// Create a new task with the given rate.

View file

@ -8,10 +8,10 @@
#pragma once
#include <filesystem>
#include <list>
#include <string>
#include <vector>
#include <filesystem>
#include <cassert>
#include <cstdint>
@ -53,7 +53,7 @@
#ifdef ALIGN
#undef ALIGN
#endif
#define ALIGN(x, a) ALIGN_MASK(x, (uintptr_t)(a) - 1)
#define ALIGN(x, a) ALIGN_MASK(x, (uintptr_t)(a)-1)
#define ALIGN_MASK(x, m) (((uintptr_t)(x) + (m)) & ~(m))
#define IS_ALIGNED(x, a) (ALIGN(x, a) == (uintptr_t)x)
@ -65,13 +65,13 @@
} while (0)
// Round-up integer division
#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define CEIL(x, y) (((x) + (y)-1) / (y))
// Get nearest up-rounded power of 2
#define LOG2_CEIL(x) (1 << (villas::utils::log2i((x) - 1) + 1))
#define LOG2_CEIL(x) (1 << (villas::utils::log2i((x)-1) + 1))
// Check if the number is a power of 2
#define IS_POW2(x) (((x) != 0) && !((x) & ((x) - 1)))
#define IS_POW2(x) (((x) != 0) && !((x) & ((x)-1)))
// Calculate the number of elements in an array.
#define ARRAY_LEN(a) (sizeof(a) / sizeof(a)[0])
@ -213,7 +213,8 @@ template <class... Ts> struct overloaded : Ts... {
template <class... Ts> overloaded(Ts...) -> overloaded<Ts...>;
void write_to_file(std::string data, const std::filesystem::path file);
std::vector<std::string> read_names_in_directory(const std::filesystem::path &directory);
std::vector<std::string>
read_names_in_directory(const std::filesystem::path &directory);
namespace base64 {

View file

@ -110,7 +110,7 @@ std::vector<byte> decode(const std::string &input) {
decoded.push_back((temp >> 16) & 0x000000FF);
decoded.push_back((temp >> 8) & 0x000000FF);
decoded.push_back((temp) & 0x000000FF);
decoded.push_back((temp)&0x000000FF);
}
return decoded;

View file

@ -372,7 +372,7 @@ std::vector<std::string>
read_names_in_directory(const std::filesystem::path &directory) {
std::vector<std::string> names;
for (auto const &dir_entry : std::filesystem::directory_iterator{directory}) {
names.push_back(dir_entry.path().filename());
names.push_back(dir_entry.path().filename());
}
return names;
}

View file

@ -19,7 +19,8 @@ namespace fpga {
namespace ip {
#define I2C_SWTICH_ADDR 0x70
#define I2C_SWITCH_CHANNEL_MAP {0x20, 0x80, 0x02, 0x08, 0x10, 0x40, 0x01, 0x04}
#define I2C_SWITCH_CHANNEL_MAP \
{ 0x20, 0x80, 0x02, 0x08, 0x10, 0x40, 0x01, 0x04 }
#define I2C_IOEXT_ADDR 0x20
#define I2C_IOEXT_REG_DIR 0x03
#define I2C_IOEXT_REG_OUT 0x01
@ -46,7 +47,7 @@ public:
public:
Switch(I2c *i2c, uint8_t address, Logger logger = villas::Log::get("i2c"))
: i2c(i2c), address(address), channel(0), readOnce(false), switchLock(),
logger(logger) {};
logger(logger){};
Switch(const Switch &other) = delete;
Switch &operator=(const Switch &other) = delete;
void setChannel(uint8_t channel);

View file

@ -89,7 +89,7 @@ protected:
BufferedSampleFormatter(const size_t bufSamples, const size_t bufSampleSize)
: buf(bufSamples * bufSampleSize + 1), // Leave room for a final `\0'
bufSamples(bufSamples), bufSampleSize(bufSampleSize),
currentBufLoc(0) {};
currentBufLoc(0){};
BufferedSampleFormatter() = delete;
BufferedSampleFormatter(const BufferedSampleFormatter &) = delete;
virtual char *nextBufPos() { return &buf[(currentBufLoc++) * bufSampleSize]; }
@ -98,7 +98,7 @@ protected:
class BufferedSampleFormatterShort : public BufferedSampleFormatter {
public:
BufferedSampleFormatterShort(size_t bufSizeInSamples)
: BufferedSampleFormatter(bufSizeInSamples, formatStringSize) {};
: BufferedSampleFormatter(bufSizeInSamples, formatStringSize){};
virtual void format(float value) override {
size_t chars;
@ -119,7 +119,7 @@ class BufferedSampleFormatterLong : public BufferedSampleFormatter {
public:
BufferedSampleFormatterLong(size_t bufSizeInSamples)
: BufferedSampleFormatter(bufSizeInSamples, formatStringSize),
sampleCnt(0) {};
sampleCnt(0){};
virtual void format(float value) override {
if (std::snprintf(nextBufPos(), formatStringSize + 1, formatString,

View file

@ -20,7 +20,8 @@
#include <villas/signal_list.hpp>
#ifndef CONFIG_GOOSE_DEFAULT_DST_ADDRESS
#define CONFIG_GOOSE_DEFAULT_DST_ADDRESS {0x01, 0x0c, 0xcd, 0x01, 0x00, 0x01}
#define CONFIG_GOOSE_DEFAULT_DST_ADDRESS \
{ 0x01, 0x0c, 0xcd, 0x01, 0x00, 0x01 }
#endif
namespace villas {

View file

@ -58,7 +58,7 @@ protected:
: node(n), id(id), rate(rate), warmup(warmup), cooldown(cooldown),
values(values), count(count), sent(0), received(0), missed(0),
count_warmup(count_warmup), sent_warmup(0), received_warmup(0),
missed_warmup(0), filename(filename) {};
missed_warmup(0), filename(filename){};
int start();
int stop();
@ -96,7 +96,7 @@ public:
: Node(id, name), task(CLOCK_MONOTONIC), formatter(nullptr),
stream(nullptr), shutdown(false) {}
virtual ~TestRTT() {};
virtual ~TestRTT(){};
virtual int prepare();

View file

@ -134,7 +134,7 @@ int HookList::process(struct Sample *smps[], unsigned cnt) {
stop:
SWAP(smps[processed], smps[current]);
processed++;
skip: {}
skip : {}
}
return processed;

View file

@ -93,15 +93,15 @@ void *polled_consumer(void *ctx) {
ParameterizedTestParameters(queue_signalled, simple) {
static struct param params[] = {
{QueueSignalledMode::AUTO, 0, false},
{QueueSignalledMode::PTHREAD, 0, false},
{QueueSignalledMode::PTHREAD, 0, false},
{QueueSignalledMode::PTHREAD, (int)QueueSignalledFlags::PROCESS_SHARED,
false},
{QueueSignalledMode::POLLING, 0, false},
{QueueSignalledMode::AUTO, 0, false},
{QueueSignalledMode::PTHREAD, 0, false},
{QueueSignalledMode::PTHREAD, 0, false},
{QueueSignalledMode::PTHREAD, (int)QueueSignalledFlags::PROCESS_SHARED,
false},
{QueueSignalledMode::POLLING, 0, false},
#if defined(__linux__) && defined(HAS_EVENTFD)
{QueueSignalledMode::EVENTFD, 0, false},
{QueueSignalledMode::EVENTFD, 0, true}
{QueueSignalledMode::EVENTFD, 0, false},
{QueueSignalledMode::EVENTFD, 0, true}
#endif
};