diff --git a/common/include/villas/kernel/pci.hpp b/common/include/villas/kernel/pci.hpp index 3f8eba971..2002ba7a2 100644 --- a/common/include/villas/kernel/pci.hpp +++ b/common/include/villas/kernel/pci.hpp @@ -20,7 +20,7 @@ namespace kernel { namespace pci { #define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) -#define PCI_FUNC(devfn) ((devfn)&0x07) +#define PCI_FUNC(devfn) ((devfn) & 0x07) class Id { public: diff --git a/common/include/villas/task.hpp b/common/include/villas/task.hpp index 3ef65461e..bf88a0c3a 100644 --- a/common/include/villas/task.hpp +++ b/common/include/villas/task.hpp @@ -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. diff --git a/common/include/villas/utils.hpp b/common/include/villas/utils.hpp index 7392c8456..6ca28736d 100644 --- a/common/include/villas/utils.hpp +++ b/common/include/villas/utils.hpp @@ -204,7 +204,9 @@ bool isContainer(); bool isPrivileged(); // helper type for std::visit -template struct overloaded : Ts... { using Ts::operator()...; }; +template struct overloaded : Ts... { + using Ts::operator()...; +}; // explicit deduction guide (not needed as of C++20) template overloaded(Ts...) -> overloaded; diff --git a/common/lib/base64.cpp b/common/lib/base64.cpp index bcd3e58ec..ac3c8536f 100644 --- a/common/lib/base64.cpp +++ b/common/lib/base64.cpp @@ -110,7 +110,7 @@ std::vector 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; diff --git a/common/lib/hist.cpp b/common/lib/hist.cpp index 668973afa..d2ad73df9 100644 --- a/common/lib/hist.cpp +++ b/common/lib/hist.cpp @@ -101,8 +101,8 @@ void Hist::print(Logger logger, bool details, std::string prefix) const { if (total > 0) { Hist::cnt_t missed = total - higher - lower; - logger->info("{}Counted values: {} ({} between {} and {})", prefix, total, missed, - low, high); + logger->info("{}Counted values: {} ({} between {} and {})", prefix, total, + missed, low, high); logger->info("{}Highest: {:g}", prefix, highest); logger->info("{}Lowest: {:g}", prefix, lowest); logger->info("{}Mu: {:g}", prefix, getMean()); diff --git a/fpga/lib/utils.cpp b/fpga/lib/utils.cpp index cc0d3986f..723947183 100644 --- a/fpga/lib/utils.cpp +++ b/fpga/lib/utils.cpp @@ -322,7 +322,6 @@ std::shared_ptr fpga::setupFpgaCard(const std::string &configFile, fpgaName); } - return card; } diff --git a/include/villas/nodes/test_rtt.hpp b/include/villas/nodes/test_rtt.hpp index 067c41014..c3e58f461 100644 --- a/include/villas/nodes/test_rtt.hpp +++ b/include/villas/nodes/test_rtt.hpp @@ -37,7 +37,7 @@ protected: public: Case(TestRTT *n, int id, int rate, int values, int limit, - const std::string & filename) + const std::string &filename) : node(n), id(id), rate(rate), values(values), limit(limit), filename(filename){}; @@ -65,7 +65,8 @@ protected: public: TestRTT(const uuid_t &id = {}, const std::string &name = "") - : Node(id, name), task(CLOCK_MONOTONIC), formatter(nullptr), stream(nullptr), cooldown(0), counter(-1) {} + : Node(id, name), task(CLOCK_MONOTONIC), formatter(nullptr), + stream(nullptr), cooldown(0), counter(-1) {} virtual ~TestRTT(){}; diff --git a/include/villas/super_node.hpp b/include/villas/super_node.hpp index fe1e57a3b..ca73c1486 100644 --- a/include/villas/super_node.hpp +++ b/include/villas/super_node.hpp @@ -127,9 +127,7 @@ public: const uuid_t &getUuid() const { return uuid; } - struct timespec getStartTime() const { - return started; - } + struct timespec getStartTime() const { return started; } #ifdef WITH_API Api *getApi() { return &api; } diff --git a/lib/api/response.cpp b/lib/api/response.cpp index 4bb44e809..62914191e 100644 --- a/lib/api/response.cpp +++ b/lib/api/response.cpp @@ -13,13 +13,12 @@ using namespace villas::node::api; Response::Response(Session *s, int c, const std::string &ct, const Buffer &b) : session(s), logger(logging.get("api:response")), buffer(b), code(c), - contentType(ct), headers{ - {"Server:", HTTP_USER_AGENT}, - {"Access-Control-Allow-Origin:", "*"}, - {"Access-Control-Allow-Methods:", - "GET, POST, OPTIONS"}, - {"Access-Control-Allow-Headers:", "Content-Type"}, - {"Access-Control-Max-Age:", "86400"}} {} + contentType(ct), + headers{{"Server:", HTTP_USER_AGENT}, + {"Access-Control-Allow-Origin:", "*"}, + {"Access-Control-Allow-Methods:", "GET, POST, OPTIONS"}, + {"Access-Control-Allow-Headers:", "Content-Type"}, + {"Access-Control-Max-Age:", "86400"}} {} int Response::writeBody(struct lws *wsi) { int ret; diff --git a/lib/formats/protobuf.cpp b/lib/formats/protobuf.cpp index f6007a8ba..5000fbb9c 100644 --- a/lib/formats/protobuf.cpp +++ b/lib/formats/protobuf.cpp @@ -235,9 +235,8 @@ int ProtobufFormat::sscan(const char *buf, size_t len, size_t *rbytes, // Register format static char n[] = "protobuf"; static char d[] = "Google Protobuf"; -static FormatPlugin +static FormatPlugin< + ProtobufFormat, n, d, + (int)SampleFlags::HAS_TS_ORIGIN | (int)SampleFlags::HAS_SEQUENCE | + (int)SampleFlags::HAS_DATA | (int)SampleFlags::NEW_FRAME> p; diff --git a/lib/formats/villas_human.cpp b/lib/formats/villas_human.cpp index 1ae588161..f0190b1f5 100644 --- a/lib/formats/villas_human.cpp +++ b/lib/formats/villas_human.cpp @@ -204,6 +204,7 @@ static char d[] = "VILLAS human readable format"; static LineFormatPlugin< VILLASHumanFormat, n, d, (int)SampleFlags::HAS_TS_ORIGIN | (int)SampleFlags::HAS_SEQUENCE | - (int)SampleFlags::HAS_DATA | (int)SampleFlags::NEW_FRAME | (int)SampleFlags::HAS_OFFSET, + (int)SampleFlags::HAS_DATA | (int)SampleFlags::NEW_FRAME | + (int)SampleFlags::HAS_OFFSET, '\n'> p; diff --git a/lib/hook_list.cpp b/lib/hook_list.cpp index 2eadc93c9..c0f31bb1c 100644 --- a/lib/hook_list.cpp +++ b/lib/hook_list.cpp @@ -134,7 +134,7 @@ int HookList::process(struct Sample *smps[], unsigned cnt) { stop: SWAP(smps[processed], smps[current]); processed++; - skip : {} + skip: {} } return processed; diff --git a/lib/node_compat.cpp b/lib/node_compat.cpp index 2537ea145..589fde594 100644 --- a/lib/node_compat.cpp +++ b/lib/node_compat.cpp @@ -60,7 +60,7 @@ NodeCompat::~NodeCompat() { int ret __attribute__((unused)); ret = _vt->destroy ? _vt->destroy(this) : 0; - delete[](char *) _vd; + delete[] (char *)_vd; } int NodeCompat::prepare() { diff --git a/lib/nodes/iec61850.cpp b/lib/nodes/iec61850.cpp index 680185325..4a70ae554 100644 --- a/lib/nodes/iec61850.cpp +++ b/lib/nodes/iec61850.cpp @@ -5,12 +5,12 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include -#include #include #include +#include +#include + #include #include #include diff --git a/lib/nodes/iec61850_sv.cpp b/lib/nodes/iec61850_sv.cpp index 9dc3cc6c6..a4f98ef9d 100644 --- a/lib/nodes/iec61850_sv.cpp +++ b/lib/nodes/iec61850_sv.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "villas/sample.hpp" #include #include #include @@ -16,6 +15,9 @@ #include #include #include +#include +#include +#include #include #define CONFIG_SV_DEFAULT_APPID 0x4000 diff --git a/lib/nodes/opal.cpp b/lib/nodes/opal.cpp index 956d5ba65..a60ea7725 100644 --- a/lib/nodes/opal.cpp +++ b/lib/nodes/opal.cpp @@ -7,10 +7,10 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include #include #include #include -#include #include #include diff --git a/lib/nodes/test_rtt.cpp b/lib/nodes/test_rtt.cpp index 7ec133e55..f7798a4aa 100644 --- a/lib/nodes/test_rtt.cpp +++ b/lib/nodes/test_rtt.cpp @@ -23,7 +23,7 @@ using namespace villas::utils; int TestRTT::Case::start() { node->logger->info( - "Starting case #{}/{}: filename={}, rate={}, values={}, limit={}", id+1, + "Starting case #{}/{}: filename={}, rate={}, values={}, limit={}", id + 1, node->cases.size(), filename_formatted, rate, values, limit); // Open file @@ -47,7 +47,7 @@ int TestRTT::Case::stop() { if (ret) throw SystemError("Failed to close file"); - node->logger->info("Stopping case #{}/{}", id+1, node->cases.size()); + node->logger->info("Stopping case #{}/{}", id + 1, node->cases.size()); return 0; } diff --git a/lib/sample.cpp b/lib/sample.cpp index 9632c1a85..c8d81f9ba 100644 --- a/lib/sample.cpp +++ b/lib/sample.cpp @@ -76,7 +76,7 @@ void villas::node::sample_free(struct Sample *s) { if (p) pool_put(p, s); else - delete[](char *) s; + delete[] (char *)s; } int villas::node::sample_alloc_many(struct Pool *p, struct Sample *smps[], diff --git a/lib/signal.cpp b/lib/signal.cpp index 172bf5b11..875c2b33a 100644 --- a/lib/signal.cpp +++ b/lib/signal.cpp @@ -7,9 +7,9 @@ #include #include -#include #include #include +#include using namespace villas; using namespace villas::node;