mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
Fix formatting
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
parent
36220d3308
commit
7f857f392c
19 changed files with 37 additions and 36 deletions
|
@ -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:
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -204,7 +204,9 @@ bool isContainer();
|
|||
bool isPrivileged();
|
||||
|
||||
// helper type for std::visit
|
||||
template <class... Ts> struct overloaded : Ts... { using Ts::operator()...; };
|
||||
template <class... Ts> struct overloaded : Ts... {
|
||||
using Ts::operator()...;
|
||||
};
|
||||
|
||||
// explicit deduction guide (not needed as of C++20)
|
||||
template <class... Ts> overloaded(Ts...) -> overloaded<Ts...>;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -322,7 +322,6 @@ std::shared_ptr<fpga::Card> fpga::setupFpgaCard(const std::string &configFile,
|
|||
fpgaName);
|
||||
}
|
||||
|
||||
|
||||
return card;
|
||||
}
|
||||
|
||||
|
|
|
@ -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(){};
|
||||
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<ProtobufFormat, n, d,
|
||||
(int)SampleFlags::HAS_TS_ORIGIN |
|
||||
(int)SampleFlags::HAS_SEQUENCE |
|
||||
(int)SampleFlags::HAS_DATA |
|
||||
(int)SampleFlags::NEW_FRAME>
|
||||
static FormatPlugin<
|
||||
ProtobufFormat, n, d,
|
||||
(int)SampleFlags::HAS_TS_ORIGIN | (int)SampleFlags::HAS_SEQUENCE |
|
||||
(int)SampleFlags::HAS_DATA | (int)SampleFlags::NEW_FRAME>
|
||||
p;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -134,7 +134,7 @@ int HookList::process(struct Sample *smps[], unsigned cnt) {
|
|||
stop:
|
||||
SWAP(smps[processed], smps[current]);
|
||||
processed++;
|
||||
skip : {}
|
||||
skip: {}
|
||||
}
|
||||
|
||||
return processed;
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <cstring>
|
||||
#include <libiec61850/goose_receiver.h>
|
||||
#include <libiec61850/sv_subscriber.h>
|
||||
#include <pthread.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <libiec61850/goose_receiver.h>
|
||||
#include <libiec61850/sv_subscriber.h>
|
||||
|
||||
#include <villas/exceptions.hpp>
|
||||
#include <villas/node_compat.hpp>
|
||||
#include <villas/nodes/iec61850_sv.hpp>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "villas/sample.hpp"
|
||||
#include <cstring>
|
||||
#include <libiec61850/sv_publisher.h>
|
||||
#include <libiec61850/sv_subscriber.h>
|
||||
|
@ -16,6 +15,9 @@
|
|||
#include <villas/exceptions.hpp>
|
||||
#include <villas/node_compat.hpp>
|
||||
#include <villas/nodes/iec61850_sv.hpp>
|
||||
#include <villas/sample.hpp>
|
||||
#include <villas/signal_data.hpp>
|
||||
#include <villas/signal_type.hpp>
|
||||
#include <villas/utils.hpp>
|
||||
|
||||
#define CONFIG_SV_DEFAULT_APPID 0x4000
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <cstdlib>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <cstdlib>
|
||||
|
||||
#include <villas/exceptions.hpp>
|
||||
#include <villas/node_compat.hpp>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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[],
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
|
||||
#include <villas/exceptions.hpp>
|
||||
#include <villas/signal.hpp>
|
||||
#include <villas/utils.hpp>
|
||||
#include <villas/signal_data.hpp>
|
||||
#include <villas/signal_type.hpp>
|
||||
#include <villas/utils.hpp>
|
||||
|
||||
using namespace villas;
|
||||
using namespace villas::node;
|
||||
|
|
Loading…
Add table
Reference in a new issue