Skip to content

Commit

Permalink
clang-tidy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
tstenner committed Mar 9, 2024
1 parent 6c0e410 commit 1ea1784
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,7 @@ void lsl::sample::serialize(eos::portable_iarchive &ar, const uint32_t archive_v
template <typename T> void test_pattern(T *data, uint32_t num_channels, int offset) {
for (std::size_t k = 0; k < num_channels; k++) {
std::size_t val = k + static_cast<std::size_t>(offset);
if (std::is_integral<T>::value)
val %= static_cast<std::size_t>(std::numeric_limits<T>::max());
if (std::is_integral_v<T>) val %= static_cast<std::size_t>(std::numeric_limits<T>::max());
data[k] = (k % 2 == 0) ? static_cast<T>(val) : -static_cast<T>(val);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/stream_outlet_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ stream_outlet_impl::~stream_outlet_impl() {
LOG_F(ERROR, "Detaching io_threads for %s", name);
for (auto &thread : io_threads_) thread->detach();
return;
default: break;
}

std::this_thread::sleep_for(std::chrono::milliseconds(25));
Expand Down
2 changes: 1 addition & 1 deletion src/tcp_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void tcp_server::close_inflight_sessions() {
asio::error_code ec;
auto &sock = session->socket();
if (sock.is_open()) {
sock.shutdown(sock.shutdown_both, ec);
sock.shutdown(tcp_socket::shutdown_both, ec);
sock.close(ec);
if (ec) LOG_F(WARNING, "Error during shutdown_and_close: %s", ec.message().c_str());
}
Expand Down
6 changes: 3 additions & 3 deletions src/time_receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ void time_receiver::handle_receive_outcome(err_t err, std::size_t len) {
((t1 - t0) + (t2 - t3)) /
2; // averaged clock offset (other clock - my clock) with rtt bias averaged out
// store it
estimates_.push_back(std::make_pair(rtt, offset));
estimate_times_.push_back(
std::make_pair((t3 + t0) / 2.0, (t2 + t1) / 2.0)); // local_time, remote_time
estimates_.emplace_back(rtt, offset);
// local_time, remote_time
estimate_times_.emplace_back((t3 + t0) / 2.0, (t2 + t1) / 2.0);
}
}
} catch (std::exception &e) {
Expand Down

0 comments on commit 1ea1784

Please # to comment.