Skip to content

Commit

Permalink
Declare available_samples as const
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkretz committed Jul 21, 2023
1 parent cb38f23 commit c4923d4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/blocklib/core/unit-test/tag_monitors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct TagSource : public node<TagSource<T, UseProcessOne>> {
std::int64_t n_samples_produced{ 0 };

constexpr std::make_signed_t<std::size_t>
available_samples(const TagSource &) noexcept {
available_samples(const TagSource &) const noexcept {
if constexpr (UseProcessOne == ProcessFunction::USE_PROCESS_ONE) {
// '-1' -> DONE, produced enough samples
return n_samples_max == n_samples_produced ? -1 : n_samples_max - n_samples_produced;
Expand Down
2 changes: 1 addition & 1 deletion test/qa_data_sink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct Source : public node<Source<T>> {
}

constexpr std::make_signed_t<std::size_t>
available_samples(const Source &) noexcept {
available_samples(const Source &) const noexcept {
// TODO unify with other test sources
// split into chunks so that we have a single tag at index 0 (or none)
auto ret = static_cast<std::make_signed_t<std::size_t>>(n_samples_max - n_samples_produced);
Expand Down
2 changes: 1 addition & 1 deletion test/qa_scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class count_source : public fg::node<count_source<T, N>, fg::OUT<T, 0, std::nume
count_source(tracer &trace, std::string_view name_) : _tracer{ trace } { this->name = name_; }

constexpr std::make_signed_t<std::size_t>
available_samples(const count_source & /*d*/) noexcept {
available_samples(const count_source & /*d*/) const noexcept {
const auto ret = static_cast<std::make_signed_t<std::size_t>>(N - _count);
return ret > 0 ? ret : -1; // '-1' -> DONE, produced enough samples
}
Expand Down
2 changes: 1 addition & 1 deletion test/qa_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ struct Source : public node<Source<T>> {
}

constexpr std::make_signed_t<std::size_t>
available_samples(const Source & /*self*/) noexcept {
available_samples(const Source & /*self*/) const noexcept {
const auto ret = static_cast<std::make_signed_t<std::size_t>>(n_samples_max - n_samples_produced);
return ret > 0 ? ret : -1; // '-1' -> DONE, produced enough samples
}
Expand Down

0 comments on commit c4923d4

Please sign in to comment.