Skip to content

Commit

Permalink
add clang-format version print
Browse files Browse the repository at this point in the history
  • Loading branch information
tanneberger committed Dec 18, 2024
1 parent a639c31 commit 86b4176
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 22 deletions.
1 change: 1 addition & 0 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ jobs:
- uses: actions/checkout@v4
- name: Analyze
run: |
clang-format --version
clang-format --dry-run --Werror -style=file $(find ./ -name '*.cc' -print)
clang-format --dry-run --Werror -style=file $(find ./ -name '*.hh' -print)
12 changes: 6 additions & 6 deletions include/reactor-cpp/connection.hh
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ public:
};
}

auto acquire_tag(const Tag& tag, std::unique_lock<std::mutex>& lock, const std::function<bool(void)>& abort_waiting)
-> bool override {
auto acquire_tag(const Tag& tag, std::unique_lock<std::mutex>& lock,
const std::function<bool(void)>& abort_waiting) -> bool override {
reactor_assert(lock.owns_lock());
log_.debug() << "downstream tries to acquire tag " << tag;

Expand Down Expand Up @@ -210,8 +210,8 @@ public:
};
}

auto acquire_tag(const Tag& tag, std::unique_lock<std::mutex>& lock, const std::function<bool(void)>& abort_waiting)
-> bool override {
auto acquire_tag(const Tag& tag, std::unique_lock<std::mutex>& lock,
const std::function<bool(void)>& abort_waiting) -> bool override {
// Since this is a delayed connection, we can go back in time and need to
// acquire the latest upstream tag that can create an event at the given
// tag. We also need to consider that given a delay d and a tag g=(t, n),
Expand Down Expand Up @@ -240,8 +240,8 @@ public:
};
}

auto acquire_tag(const Tag& tag, std::unique_lock<std::mutex>& lock, const std::function<bool(void)>& abort_waiting)
-> bool override {
auto acquire_tag(const Tag& tag, std::unique_lock<std::mutex>& lock,
const std::function<bool(void)>& abort_waiting) -> bool override {
this->log_.debug() << "downstream tries to acquire tag " << tag;
return PhysicalTimeBarrier::acquire_tag(tag, lock, this->environment()->scheduler(), abort_waiting);
}
Expand Down
4 changes: 2 additions & 2 deletions include/reactor-cpp/multiport.hh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected:

public:
explicit BaseMultiport(std::string name)
: multiport_name_(std::move(name)){};
: multiport_name_(std::move(name)) {};
~BaseMultiport() = default;
[[nodiscard]] auto name() const -> std::string { return multiport_name_; }
};
Expand All @@ -73,7 +73,7 @@ public:
using const_iterator = typename std::vector<T>::const_iterator;

explicit Multiport(const std::string& name) noexcept
: BaseMultiport(name){};
: BaseMultiport(name) {};
~Multiport() noexcept = default;

auto operator==(const Multiport& other) const noexcept -> bool {
Expand Down
4 changes: 2 additions & 2 deletions include/reactor-cpp/mutations/bank.hh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ public:
, desired_size_(other.desired_size_)
, size_before_application_(other.size_before_application_)
, reactor_(other.reactor_)
, create_lambda_(other.create_lambda_){};
, create_lambda_(other.create_lambda_) {};
MutationChangeBankSize(MutationChangeBankSize&& other) noexcept
: bank_(other.bank_)
, desired_size_(other.desired_size_)
, size_before_application_(other.size_before_application_)
, reactor_(other.reactor_)
, create_lambda_(other.create_lambda_){};
, create_lambda_(other.create_lambda_) {};
explicit MutationChangeBankSize(std::vector<T>* bank, Reactor* reactor, std::size_t size,
std::function<T(Reactor* parent_reactor, std::size_t index)> create_lambda);
~MutationChangeBankSize() override = default;
Expand Down
4 changes: 2 additions & 2 deletions include/reactor-cpp/time_barrier.hh
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public:
// The caller must hold a lock on the scheduler mutex
auto try_acquire_tag(const Tag& tag) { return tag <= released_time_; }

auto acquire_tag(const Tag& tag, std::unique_lock<std::mutex>& lock, const std::function<bool(void)>& abort_waiting)
-> bool {
auto acquire_tag(const Tag& tag, std::unique_lock<std::mutex>& lock,
const std::function<bool(void)>& abort_waiting) -> bool {
if (try_acquire_tag(tag)) {
return true;
}
Expand Down
20 changes: 10 additions & 10 deletions include/reactor-cpp/value_ptr.hh
Original file line number Diff line number Diff line change
Expand Up @@ -517,23 +517,23 @@ public:
// Comparison operators

template <class T, class U, bool is_trivial>
auto operator==(const MutableValuePtr<T, is_trivial>& ptr1, const MutableValuePtr<U, is_trivial>& ptr2) noexcept
-> bool {
auto operator==(const MutableValuePtr<T, is_trivial>& ptr1,
const MutableValuePtr<U, is_trivial>& ptr2) noexcept -> bool {
return ptr1.get() == ptr2.get();
}
template <class T, class U, bool is_trivial>
auto operator==(const ImmutableValuePtr<T, is_trivial>& ptr1, const ImmutableValuePtr<U, is_trivial>& ptr2) noexcept
-> bool {
auto operator==(const ImmutableValuePtr<T, is_trivial>& ptr1,
const ImmutableValuePtr<U, is_trivial>& ptr2) noexcept -> bool {
return ptr1.get() == ptr2.get();
}
template <class T, class U, bool is_trivial>
auto operator==(const ImmutableValuePtr<T, is_trivial>& ptr1, const MutableValuePtr<U, is_trivial>& ptr2) noexcept
-> bool {
auto operator==(const ImmutableValuePtr<T, is_trivial>& ptr1,
const MutableValuePtr<U, is_trivial>& ptr2) noexcept -> bool {
return ptr1.get() == ptr2.get();
}
template <class T, class U, bool is_trivial>
auto operator==(const MutableValuePtr<T, is_trivial>& ptr1, const ImmutableValuePtr<U, is_trivial>& ptr2) noexcept
-> bool {
auto operator==(const MutableValuePtr<T, is_trivial>& ptr1,
const ImmutableValuePtr<U, is_trivial>& ptr2) noexcept -> bool {
return ptr1.get() == ptr2.get();
}
template <class T, bool is_trivial>
Expand All @@ -554,8 +554,8 @@ auto operator==(std::nullptr_t, const ImmutableValuePtr<T, is_trivial>& ptr1) no
}

template <class T, class U, bool is_trivial>
auto operator!=(const MutableValuePtr<T, is_trivial>& ptr1, const MutableValuePtr<U, is_trivial>& ptr2) noexcept
-> bool {
auto operator!=(const MutableValuePtr<T, is_trivial>& ptr1,
const MutableValuePtr<U, is_trivial>& ptr2) noexcept -> bool {
return ptr1.get() != ptr2.get();
}

Expand Down

0 comments on commit 86b4176

Please sign in to comment.