Skip to content

Commit 1520743

Browse files
committed
fix: Formatting with clang-format
Signed-off-by: Steffen Vogel <[email protected]>
1 parent 914ea0b commit 1520743

File tree

12 files changed

+32
-28
lines changed

12 files changed

+32
-28
lines changed

common/include/villas/kernel/devices/ip_device.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ class IpDevice : public PlatformDevice {
2222

2323
private:
2424
IpDevice() = delete;
25-
IpDevice(const std::filesystem::path valid_path) //! Dont allow unvalidated paths
25+
IpDevice(
26+
const std::filesystem::path valid_path) //! Dont allow unvalidated paths
2627
: PlatformDevice(valid_path){};
2728

2829
public:

common/include/villas/kernel/devices/pci_device.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace kernel {
2020
namespace devices {
2121

2222
#define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f)
23-
#define PCI_FUNC(devfn) ((devfn) & 0x07)
23+
#define PCI_FUNC(devfn) ((devfn)&0x07)
2424

2525
class Id {
2626
public:

common/include/villas/task.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct Task {
4545
#if PERIODIC_TASK_IMPL == TIMERFD
4646
int fd; // The timerfd_create(2) file descriptior.
4747
#elif PERIODIC_TASK_IMPL == RDTSC
48-
struct Tsc tsc; // Initialized by tsc_init().
48+
struct Tsc tsc; // Initialized by tsc_init().
4949
#endif
5050

5151
// Create a new task with the given rate.

common/include/villas/utils.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
#pragma once
1010

11+
#include <filesystem>
1112
#include <list>
1213
#include <string>
1314
#include <vector>
14-
#include <filesystem>
1515

1616
#include <cassert>
1717
#include <cstdint>
@@ -53,7 +53,7 @@
5353
#ifdef ALIGN
5454
#undef ALIGN
5555
#endif
56-
#define ALIGN(x, a) ALIGN_MASK(x, (uintptr_t)(a) - 1)
56+
#define ALIGN(x, a) ALIGN_MASK(x, (uintptr_t)(a)-1)
5757
#define ALIGN_MASK(x, m) (((uintptr_t)(x) + (m)) & ~(m))
5858
#define IS_ALIGNED(x, a) (ALIGN(x, a) == (uintptr_t)x)
5959

@@ -65,13 +65,13 @@
6565
} while (0)
6666

6767
// Round-up integer division
68-
#define CEIL(x, y) (((x) + (y) - 1) / (y))
68+
#define CEIL(x, y) (((x) + (y)-1) / (y))
6969

7070
// Get nearest up-rounded power of 2
71-
#define LOG2_CEIL(x) (1 << (villas::utils::log2i((x) - 1) + 1))
71+
#define LOG2_CEIL(x) (1 << (villas::utils::log2i((x)-1) + 1))
7272

7373
// Check if the number is a power of 2
74-
#define IS_POW2(x) (((x) != 0) && !((x) & ((x) - 1)))
74+
#define IS_POW2(x) (((x) != 0) && !((x) & ((x)-1)))
7575

7676
// Calculate the number of elements in an array.
7777
#define ARRAY_LEN(a) (sizeof(a) / sizeof(a)[0])
@@ -213,7 +213,8 @@ template <class... Ts> struct overloaded : Ts... {
213213
template <class... Ts> overloaded(Ts...) -> overloaded<Ts...>;
214214

215215
void write_to_file(std::string data, const std::filesystem::path file);
216-
std::vector<std::string> read_names_in_directory(const std::filesystem::path &directory);
216+
std::vector<std::string>
217+
read_names_in_directory(const std::filesystem::path &directory);
217218

218219
namespace base64 {
219220

common/lib/base64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ std::vector<byte> decode(const std::string &input) {
110110

111111
decoded.push_back((temp >> 16) & 0x000000FF);
112112
decoded.push_back((temp >> 8) & 0x000000FF);
113-
decoded.push_back((temp) & 0x000000FF);
113+
decoded.push_back((temp)&0x000000FF);
114114
}
115115

116116
return decoded;

common/lib/utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ std::vector<std::string>
372372
read_names_in_directory(const std::filesystem::path &directory) {
373373
std::vector<std::string> names;
374374
for (auto const &dir_entry : std::filesystem::directory_iterator{directory}) {
375-
names.push_back(dir_entry.path().filename());
375+
names.push_back(dir_entry.path().filename());
376376
}
377377
return names;
378378
}

fpga/include/villas/fpga/ips/i2c.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ namespace fpga {
1919
namespace ip {
2020

2121
#define I2C_SWTICH_ADDR 0x70
22-
#define I2C_SWITCH_CHANNEL_MAP {0x20, 0x80, 0x02, 0x08, 0x10, 0x40, 0x01, 0x04}
22+
#define I2C_SWITCH_CHANNEL_MAP \
23+
{ 0x20, 0x80, 0x02, 0x08, 0x10, 0x40, 0x01, 0x04 }
2324
#define I2C_IOEXT_ADDR 0x20
2425
#define I2C_IOEXT_REG_DIR 0x03
2526
#define I2C_IOEXT_REG_OUT 0x01
@@ -46,7 +47,7 @@ class I2c : public Node {
4647
public:
4748
Switch(I2c *i2c, uint8_t address, Logger logger = villas::Log::get("i2c"))
4849
: i2c(i2c), address(address), channel(0), readOnce(false), switchLock(),
49-
logger(logger) {};
50+
logger(logger){};
5051
Switch(const Switch &other) = delete;
5152
Switch &operator=(const Switch &other) = delete;
5253
void setChannel(uint8_t channel);

fpga/include/villas/fpga/utils.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class BufferedSampleFormatter {
8989
BufferedSampleFormatter(const size_t bufSamples, const size_t bufSampleSize)
9090
: buf(bufSamples * bufSampleSize + 1), // Leave room for a final `\0'
9191
bufSamples(bufSamples), bufSampleSize(bufSampleSize),
92-
currentBufLoc(0) {};
92+
currentBufLoc(0){};
9393
BufferedSampleFormatter() = delete;
9494
BufferedSampleFormatter(const BufferedSampleFormatter &) = delete;
9595
virtual char *nextBufPos() { return &buf[(currentBufLoc++) * bufSampleSize]; }
@@ -98,7 +98,7 @@ class BufferedSampleFormatter {
9898
class BufferedSampleFormatterShort : public BufferedSampleFormatter {
9999
public:
100100
BufferedSampleFormatterShort(size_t bufSizeInSamples)
101-
: BufferedSampleFormatter(bufSizeInSamples, formatStringSize) {};
101+
: BufferedSampleFormatter(bufSizeInSamples, formatStringSize){};
102102

103103
virtual void format(float value) override {
104104
size_t chars;
@@ -119,7 +119,7 @@ class BufferedSampleFormatterLong : public BufferedSampleFormatter {
119119
public:
120120
BufferedSampleFormatterLong(size_t bufSizeInSamples)
121121
: BufferedSampleFormatter(bufSizeInSamples, formatStringSize),
122-
sampleCnt(0) {};
122+
sampleCnt(0){};
123123

124124
virtual void format(float value) override {
125125
if (std::snprintf(nextBufPos(), formatStringSize + 1, formatString,

include/villas/nodes/iec61850.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
#include <villas/signal_list.hpp>
2121

2222
#ifndef CONFIG_GOOSE_DEFAULT_DST_ADDRESS
23-
#define CONFIG_GOOSE_DEFAULT_DST_ADDRESS {0x01, 0x0c, 0xcd, 0x01, 0x00, 0x01}
23+
#define CONFIG_GOOSE_DEFAULT_DST_ADDRESS \
24+
{ 0x01, 0x0c, 0xcd, 0x01, 0x00, 0x01 }
2425
#endif
2526

2627
namespace villas {

include/villas/nodes/test_rtt.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class TestRTT : public Node {
5858
: node(n), id(id), rate(rate), warmup(warmup), cooldown(cooldown),
5959
values(values), count(count), sent(0), received(0), missed(0),
6060
count_warmup(count_warmup), sent_warmup(0), received_warmup(0),
61-
missed_warmup(0), filename(filename) {};
61+
missed_warmup(0), filename(filename){};
6262

6363
int start();
6464
int stop();
@@ -96,7 +96,7 @@ class TestRTT : public Node {
9696
: Node(id, name), task(CLOCK_MONOTONIC), formatter(nullptr),
9797
stream(nullptr), shutdown(false) {}
9898

99-
virtual ~TestRTT() {};
99+
virtual ~TestRTT(){};
100100

101101
virtual int prepare();
102102

0 commit comments

Comments
 (0)