Skip to content

Commit 06068e3

Browse files
authored
Merge branch 'master' into node-gateway
Signed-off-by: al3xa23 <140614263+al3xa23@users.noreply.github.com>
2 parents 86aec5e + a960050 commit 06068e3

File tree

103 files changed

+375
-398
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+375
-398
lines changed

.clang-tidy

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-FileCopyrightText: 2025 Institute for Automation of Complex Power Systems, RWTH Aachen University
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
Checks: >
5+
-*,
6+
modernize-use-override,
7+
WarningsAsErrors: '*'
8+
HeaderFilterRegex: villas/.*
9+
FormatStyle: file

.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ test:python:
164164
- pytest --verbose .
165165
- black --line-length=90 --extend-exclude=".*(\\.pyi|_pb2.py)$" --check .
166166
- flake8 --max-line-length=90 --extend-exclude="*.pyi,*_pb2.py" .
167-
- mypy --explicit-package-bases villas/
167+
- mypy --namespace-packages --explicit-package-bases .
168168
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
169169
needs:
170170
- job: "build:source: [fedora]"
@@ -267,7 +267,7 @@ pkg:nix:arx:
267267
nix bundle
268268
--print-build-logs
269269
--out-link bundle-arx
270-
--bundler github:NixOS/bundlers#toArx
270+
--bundler github:nix-community/nix-bundle
271271
".#villas-node-${SYSTEM}"
272272

273273
- mkdir -p artifacts

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,14 @@ include(FindSymbol)
5252
include(CMakeDependentOption)
5353

5454
add_definitions(-D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE)
55-
add_compile_options(-Wall -Wno-unknown-pragmas -fdiagnostics-color=auto)
55+
add_compile_options(
56+
-Wall
57+
-Wno-unknown-pragmas
58+
-Wno-unknown-warning-option
59+
-Wno-vla-cxx-extension
60+
-Wno-unused-command-line-argument
61+
-fdiagnostics-color=auto
62+
)
5663

5764
# Check OS
5865
check_include_file("sys/eventfd.h" HAS_EVENTFD)

clients/shmem/villas-shmem.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Shmem : public Tool {
3434
protected:
3535
std::atomic<bool> stop;
3636

37-
void usage() {
37+
void usage() override {
3838
std::cout
3939
<< "Usage: villas-test-shmem WNAME VECTORIZE" << std::endl
4040
<< " WNAME name of the shared memory object for the output queue"
@@ -47,9 +47,9 @@ class Shmem : public Tool {
4747
printCopyright();
4848
}
4949

50-
void handler(int, siginfo_t *, void *) { stop = true; }
50+
void handler(int, siginfo_t *, void *) override { stop = true; }
5151

52-
int main() {
52+
int main() override {
5353
int ret, readcnt, writecnt, avail;
5454

5555
struct ShmemInterface shm;

common/include/villas/cpuset.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ class CpuSet {
8080
return full ^ *this;
8181
}
8282

83-
bool operator==(const CpuSet &rhs) { return CPU_EQUAL_S(sz, setp, rhs.setp); }
83+
friend bool operator==(const CpuSet &lhs, const CpuSet &rhs) {
84+
return CPU_EQUAL_S(lhs.sz, lhs.setp, rhs.setp);
85+
}
8486

8587
CpuSet &operator&=(const CpuSet &rhs) {
8688
CPU_AND_S(sz, setp, setp, rhs.setp);

common/include/villas/dsp/window_cosine.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class CosineWindow : public Window<T> {
2727

2828
T correctionFactor;
2929

30-
virtual T filter(T in, size_type i) const { return in * coefficients[i]; }
30+
T filter(T in, size_type i) const override { return in * coefficients[i]; }
3131

3232
public:
3333
CosineWindow(double a0, double a1, double a2, double a3, double a4,

common/include/villas/exceptions.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class ConfigError : public std::runtime_error {
9090
}
9191

9292
public:
93-
~ConfigError() {
93+
~ConfigError() override {
9494
if (msg)
9595
free(msg);
9696
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Interface for device drivers. OS/platform independend.
1+
/* Interface for device drivers. OS/platform independent.
22
* Implemented for Linux/Unix drivers in linux_driver.hpp
33
*
44
* Author: Pascal Bauer <pascal.bauer@rwth-aachen.de>
@@ -24,6 +24,7 @@ class Driver {
2424
virtual std::string name() const = 0;
2525
virtual void override(const Device &device) const = 0;
2626
virtual void unbind(const Device &device) const = 0;
27+
virtual ~Driver() = default;
2728
};
2829

2930
} // namespace devices

common/include/villas/kernel/vfio_device.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ class Device {
9898
std::vector<struct vfio_region_info> regions;
9999
std::vector<void *> mappings;
100100

101-
// libpci handle of the device
102-
const kernel::devices::PciDevice *pci_device;
103-
104101
Logger log;
105102
};
106103

common/include/villas/memory.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@ template <typename DerivedAllocator> class BaseAllocator {
135135
derivedAlloc = nullptr;
136136
}
137137

138-
virtual std::unique_ptr<MemoryBlock, MemoryBlock::deallocator_fn>
138+
virtual ~BaseAllocator() = default;
139139

140+
virtual std::unique_ptr<MemoryBlock, MemoryBlock::deallocator_fn>
140141
allocateBlock(size_t size) = 0;
141142

142143
template <typename T> MemoryAccessor<T> allocate(size_t num) {
@@ -217,8 +218,8 @@ class LinearAllocator : public BaseAllocator<LinearAllocator> {
217218

218219
std::string getName() const;
219220

220-
virtual std::unique_ptr<MemoryBlock, MemoryBlock::deallocator_fn>
221-
allocateBlock(size_t size);
221+
std::unique_ptr<MemoryBlock, MemoryBlock::deallocator_fn>
222+
allocateBlock(size_t size) override;
222223

223224
private:
224225
static constexpr size_t alignBytes = sizeof(uintptr_t);
@@ -247,7 +248,7 @@ class HostRam {
247248
std::string getName() const { return "HostRamAlloc"; }
248249

249250
std::unique_ptr<MemoryBlock, MemoryBlock::deallocator_fn>
250-
allocateBlock(size_t size);
251+
allocateBlock(size_t size) override;
251252
};
252253

253254
static HostRamAllocator &getAllocator() {
@@ -264,7 +265,7 @@ class HostDmaRam {
264265
public:
265266
HostDmaRamAllocator(int num);
266267

267-
virtual ~HostDmaRamAllocator();
268+
~HostDmaRamAllocator() override;
268269

269270
std::string getName() const { return getUdmaBufName(num); }
270271

0 commit comments

Comments
 (0)