Skip to content

Commit 9c629c3

Browse files
committed
clang-tidy suggestions
1 parent f6fda7d commit 9c629c3

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/sample.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,7 @@ void lsl::sample::serialize(eos::portable_iarchive &ar, const uint32_t archive_v
356356
template <typename T> void test_pattern(T *data, uint32_t num_channels, int offset) {
357357
for (std::size_t k = 0; k < num_channels; k++) {
358358
std::size_t val = k + static_cast<std::size_t>(offset);
359-
if (std::is_integral<T>::value)
360-
val %= static_cast<std::size_t>(std::numeric_limits<T>::max());
359+
if (std::is_integral_v<T>) val %= static_cast<std::size_t>(std::numeric_limits<T>::max());
361360
data[k] = (k % 2 == 0) ? static_cast<T>(val) : -static_cast<T>(val);
362361
}
363362
}

src/stream_outlet_impl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ stream_outlet_impl::~stream_outlet_impl() {
128128
LOG_F(ERROR, "Detaching io_threads for %s", name);
129129
for (auto &thread : io_threads_) thread->detach();
130130
return;
131+
default: break;
131132
}
132133

133134
std::this_thread::sleep_for(std::chrono::milliseconds(25));

src/tcp_server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ void tcp_server::close_inflight_sessions() {
255255
asio::error_code ec;
256256
auto &sock = session->socket();
257257
if (sock.is_open()) {
258-
sock.shutdown(sock.shutdown_both, ec);
258+
sock.shutdown(tcp_socket::shutdown_both, ec);
259259
sock.close(ec);
260260
if (ec) LOG_F(WARNING, "Error during shutdown_and_close: %s", ec.message().c_str());
261261
}

src/time_receiver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ void time_receiver::handle_receive_outcome(err_t err, std::size_t len) {
173173
((t1 - t0) + (t2 - t3)) /
174174
2; // averaged clock offset (other clock - my clock) with rtt bias averaged out
175175
// store it
176-
estimates_.push_back(std::make_pair(rtt, offset));
177-
estimate_times_.push_back(
178-
std::make_pair((t3 + t0) / 2.0, (t2 + t1) / 2.0)); // local_time, remote_time
176+
estimates_.emplace_back(rtt, offset);
177+
// local_time, remote_time
178+
estimate_times_.emplace_back((t3 + t0) / 2.0, (t2 + t1) / 2.0);
179179
}
180180
}
181181
} catch (std::exception &e) {

0 commit comments

Comments
 (0)