Skip to content

Commit 3f06fd0

Browse files
committed
fix(style): Format code with clang-format
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
1 parent 060fa37 commit 3f06fd0

File tree

14 files changed

+36
-37
lines changed

14 files changed

+36
-37
lines changed

clients/opal-rt/rtlab-asyncip/models/send_receive/include/msg_format.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@
2828

2929
// Initialize a message with default values
3030
#define MSG_INIT(len, seq) \
31-
(struct msg) { \
32-
.version = MSG_VERSION, .type = MSG_TYPE_DATA, .length = len, \
33-
.sequence = seq, .id = 0 \
34-
}
31+
(struct msg){.version = MSG_VERSION, \
32+
.type = MSG_TYPE_DATA, \
33+
.length = len, \
34+
.sequence = seq, \
35+
.id = 0}
3536

3637
// The timestamp of a message in struct timespec format
3738
#define MSG_TS(msg) \

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace devices {
1919

2020
class Device {
2121
public:
22-
virtual ~Device(){};
22+
virtual ~Device() {};
2323

2424
virtual std::optional<std::unique_ptr<Driver>> driver() const = 0;
2525
virtual std::optional<int> iommu_group() const = 0;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class PlatformDevice : public Device {
3434
PlatformDevice(const fs::path path, const fs::path probe_path,
3535
const fs::path override_path)
3636
: m_path(path), m_probe_path(probe_path),
37-
m_override_path(override_path){};
37+
m_override_path(override_path) {};
3838

3939
// Implement device interface
4040
std::optional<std::unique_ptr<Driver>> driver() const override;

common/include/villas/utils.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
#ifdef ALIGN
5353
#undef ALIGN
5454
#endif
55-
#define ALIGN(x, a) ALIGN_MASK(x, (uintptr_t)(a)-1)
55+
#define ALIGN(x, a) ALIGN_MASK(x, (uintptr_t)(a) - 1)
5656
#define ALIGN_MASK(x, m) (((uintptr_t)(x) + (m)) & ~(m))
5757
#define IS_ALIGNED(x, a) (ALIGN(x, a) == (uintptr_t)x)
5858

@@ -64,13 +64,13 @@
6464
} while (0)
6565

6666
// Round-up integer division
67-
#define CEIL(x, y) (((x) + (y)-1) / (y))
67+
#define CEIL(x, y) (((x) + (y) - 1) / (y))
6868

6969
// Get nearest up-rounded power of 2
70-
#define LOG2_CEIL(x) (1 << (villas::utils::log2i((x)-1) + 1))
70+
#define LOG2_CEIL(x) (1 << (villas::utils::log2i((x) - 1) + 1))
7171

7272
// Check if the number is a power of 2
73-
#define IS_POW2(x) (((x) != 0) && !((x) & ((x)-1)))
73+
#define IS_POW2(x) (((x) != 0) && !((x) & ((x) - 1)))
7474

7575
// Calculate the number of elements in an array.
7676
#define ARRAY_LEN(a) (sizeof(a) / sizeof(a)[0])

common/lib/kernel/devices/device_connection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace devices {
1818

1919
DeviceConnection::DeviceConnection(
2020
std::shared_ptr<kernel::vfio::Device> vfio_device)
21-
: logger(villas::Log::get("DeviceConnection")), vfio_device(vfio_device){};
21+
: logger(villas::Log::get("DeviceConnection")), vfio_device(vfio_device) {};
2222

2323
DeviceConnection DeviceConnection::from(
2424
const villas::kernel::devices::Device &device,

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

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

2222
#define I2C_SWTICH_ADDR 0x70
23-
#define I2C_SWITCH_CHANNEL_MAP \
24-
{ 0x20, 0x80, 0x02, 0x08, 0x10, 0x40, 0x01, 0x04 }
23+
#define I2C_SWITCH_CHANNEL_MAP {0x20, 0x80, 0x02, 0x08, 0x10, 0x40, 0x01, 0x04}
2524
#define I2C_IOEXT_ADDR 0x20
2625
#define I2C_IOEXT_REG_DIR 0x03
2726
#define I2C_IOEXT_REG_OUT 0x01
@@ -48,7 +47,7 @@ class I2c : public Node {
4847
public:
4948
Switch(I2c *i2c, uint8_t address, Logger logger = villas::Log::get("i2c"))
5049
: i2c(i2c), address(address), channel(0), readOnce(false), switchLock(),
51-
logger(logger){};
50+
logger(logger) {};
5251
Switch(const Switch &other) = delete;
5352
Switch &operator=(const Switch &other) = delete;
5453
void setChannel(uint8_t channel);

fpga/include/villas/fpga/platform_card.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class PlatformCard : public Card {
2525
public:
2626
PlatformCard(std::shared_ptr<kernel::vfio::Container> vfioContainer);
2727

28-
~PlatformCard(){};
28+
~PlatformCard() {};
2929

3030
std::vector<CoreConnection> core_connections;
3131

fpga/include/villas/fpga/utils.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class BufferedSampleFormatter {
9090
BufferedSampleFormatter(const size_t bufSamples, const size_t bufSampleSize)
9191
: buf(bufSamples * bufSampleSize + 1), // Leave room for a final `\0'
9292
bufSamples(bufSamples), bufSampleSize(bufSampleSize),
93-
currentBufLoc(0){};
93+
currentBufLoc(0) {};
9494
BufferedSampleFormatter() = delete;
9595
BufferedSampleFormatter(const BufferedSampleFormatter &) = delete;
9696
virtual char *nextBufPos() { return &buf[(currentBufLoc++) * bufSampleSize]; }
@@ -99,7 +99,7 @@ class BufferedSampleFormatter {
9999
class BufferedSampleFormatterShort : public BufferedSampleFormatter {
100100
public:
101101
BufferedSampleFormatterShort(size_t bufSizeInSamples)
102-
: BufferedSampleFormatter(bufSizeInSamples, formatStringSize){};
102+
: BufferedSampleFormatter(bufSizeInSamples, formatStringSize) {};
103103

104104
virtual void format(float value) override {
105105
size_t chars;
@@ -120,7 +120,7 @@ class BufferedSampleFormatterLong : public BufferedSampleFormatter {
120120
public:
121121
BufferedSampleFormatterLong(size_t bufSizeInSamples)
122122
: BufferedSampleFormatter(bufSizeInSamples, formatStringSize),
123-
sampleCnt(0){};
123+
sampleCnt(0) {};
124124

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

fpga/lib/core_connection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ CoreConnection::CoreConnection(
2020
std::shared_ptr<villas::fpga::ip::Core> ip,
2121
villas::kernel::devices::DeviceConnection device_connection)
2222
: logger(villas::Log::get("CoreConnection")), ip(ip),
23-
device_connection(device_connection){};
23+
device_connection(device_connection) {};
2424

2525
CoreConnection
2626
CoreConnection::from(std::shared_ptr<villas::fpga::ip::Core> ip,

fpga/src/villas-fpga-pipe.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ int main(int argc, char *argv[]) {
7878
for (auto aurora : aurora_channels)
7979
aurora->dump();
8080

81-
// Configure Crossbar switch
81+
// Configure Crossbar switch
8282
#if 1
8383
aurora_channels[3]->connect(aurora_channels[3]->getDefaultMasterPort(),
8484
dma->getDefaultSlavePort());

0 commit comments

Comments
 (0)