diff --git a/common/include/villas/utils.hpp b/common/include/villas/utils.hpp index 6ca28736d..a65fb6cba 100644 --- a/common/include/villas/utils.hpp +++ b/common/include/villas/utils.hpp @@ -52,7 +52,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) @@ -64,13 +64,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]) diff --git a/common/lib/kernel/devices/pci_device.cpp b/common/lib/kernel/devices/pci_device.cpp index 8d700ebfc..ef8a8b5d0 100644 --- a/common/lib/kernel/devices/pci_device.cpp +++ b/common/lib/kernel/devices/pci_device.cpp @@ -445,7 +445,7 @@ int PciDevice::getIommuGroup() const { } std::fstream PciDevice::openSysFs(const std::string &subPath, - std::ios_base::openmode mode) const { + std::ios_base::openmode mode) const { std::fstream file; auto sysFsFilename = diff --git a/fpga/include/villas/fpga/ips/i2c.hpp b/fpga/include/villas/fpga/ips/i2c.hpp index 072a72157..3c3ce2cff 100644 --- a/fpga/include/villas/fpga/ips/i2c.hpp +++ b/fpga/include/villas/fpga/ips/i2c.hpp @@ -19,8 +19,7 @@ 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 @@ -47,7 +46,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); diff --git a/fpga/include/villas/fpga/utils.hpp b/fpga/include/villas/fpga/utils.hpp index 42f3afbb5..b078936fb 100644 --- a/fpga/include/villas/fpga/utils.hpp +++ b/fpga/include/villas/fpga/utils.hpp @@ -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, diff --git a/fpga/lib/pcie_card.cpp b/fpga/lib/pcie_card.cpp index 7fc6ceb0a..a43632f97 100644 --- a/fpga/lib/pcie_card.cpp +++ b/fpga/lib/pcie_card.cpp @@ -13,8 +13,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/include/villas/nodes/iec61850.hpp b/include/villas/nodes/iec61850.hpp index bbb1afc0f..85c008c2f 100644 --- a/include/villas/nodes/iec61850.hpp +++ b/include/villas/nodes/iec61850.hpp @@ -20,8 +20,7 @@ #include #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 { diff --git a/include/villas/nodes/test_rtt.hpp b/include/villas/nodes/test_rtt.hpp index c33db2d8c..fd5c55d4d 100644 --- a/include/villas/nodes/test_rtt.hpp +++ b/include/villas/nodes/test_rtt.hpp @@ -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(); diff --git a/lib/hooks/dp.cpp b/lib/hooks/dp.cpp index 0d835d597..f41b85b25 100644 --- a/lib/hooks/dp.cpp +++ b/lib/hooks/dp.cpp @@ -96,8 +96,8 @@ protected: public: DPHook(Path *p, Node *n, int fl, int prio, bool en = true) : Hook(p, n, fl, prio, en), signal_name(nullptr), signal_index(0), - inverse(0), f0(50.0), timestep(50e-6), time(), steps(0), - coeffs(), fharmonics(), fharmonics_len(0) {} + inverse(0), f0(50.0), timestep(50e-6), time(), steps(0), coeffs(), + fharmonics(), fharmonics_len(0) {} virtual ~DPHook() { // Release memory diff --git a/lib/nodes/ethercat.cpp b/lib/nodes/ethercat.cpp index 3ccebe843..11dbba864 100644 --- a/lib/nodes/ethercat.cpp +++ b/lib/nodes/ethercat.cpp @@ -11,8 +11,8 @@ #include #include -#include #include +#include #include using namespace villas; diff --git a/tests/unit/queue_signalled.cpp b/tests/unit/queue_signalled.cpp index 3f440e523..ca831eb63 100644 --- a/tests/unit/queue_signalled.cpp +++ b/tests/unit/queue_signalled.cpp @@ -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 };