Skip to content

Commit 8a4b37c

Browse files
committed
clang-tidy 19 fixes
1 parent 862b256 commit 8a4b37c

File tree

9 files changed

+18
-13
lines changed

9 files changed

+18
-13
lines changed

.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Checks: >-
1212
performance-*,
1313
portability-*,
1414
readability-*,
15+
-boost-use-ranges,
1516
-clang-analyzer-core.uninitialized.Assign,
1617
-cppcoreguidelines-avoid-const-or-ref-data-members,
1718
-cppcoreguidelines-use-default-member-init,

include/libcyphal/common/cavl/cavl.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ class Node // NOSONAR cpp:S1448
8181
using DerivedType = Derived;
8282

8383
// Tree nodes cannot be copied for obvious reasons.
84-
Node(const Node&) = delete;
84+
Node(const Node&) = delete; // NOLINT bugprone-crtp-constructor-accessibility
8585
auto operator=(const Node&) -> Node& = delete;
8686

8787
// Tree nodes can be moved. We update the pointers in the adjacent nodes to keep the tree valid,
8888
// as well as root node pointer if needed (see `moveFrom`). This operation is constant time.
89-
Node(Node&& other) noexcept
89+
Node(Node&& other) noexcept // NOLINT bugprone-crtp-constructor-accessibility
9090
{
9191
moveFrom(other);
9292
}
@@ -102,7 +102,7 @@ class Node // NOSONAR cpp:S1448
102102
}
103103

104104
protected:
105-
Node() = default;
105+
Node() = default; // NOLINT bugprone-crtp-constructor-accessibility
106106
~Node() = default;
107107

108108
/// Accessors for advanced tree introspection. Not needed for typical usage.

include/libcyphal/transport/udp/delegate.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ class UdpardMemory final : public ScatteredBuffer::IStorage
167167
while ((nullptr != frag) && (dst_offset < length_bytes))
168168
{
169169
CETL_DEBUG_ASSERT(nullptr != frag->view.data, "");
170-
// Next nolint-s are unavoidable: we need offset from the beginning of the buffer.
170+
// Next nolint-s are unavoidable: we need to offset from the beginning of the buffer.
171171
// No Sonar `cpp:S5356` & `cpp:S5357` b/c we integrate here with libcanard raw C buffers.
172-
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
173172
const auto* const offset_data =
173+
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
174174
static_cast<const cetl::byte*>(frag->view.data) + view_offset; // NOSONAR cpp:S5356 cpp:S5357
175175
const PayloadFragment frag_span{offset_data,
176176
std::min(frag->view.size - view_offset, length_bytes - dst_offset)};

test/unittest/common/cavl/.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Checks: >-
1111
misc-*,
1212
portability-*,
1313
readability-*,
14+
-boost-use-ranges,
1415
-hicpp-function-size,
1516
-hicpp-no-array-decay,
1617
-google-readability-todo,

test/unittest/presentation/test_presentation.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ TEST_F(TestPresentation, makeServer_custom)
499499

500500
Presentation presentation{mr_, scheduler_, transport_mock_};
501501

502-
auto maybe_server = presentation.makeServer<Service>([](const auto&, auto) {});
502+
auto maybe_server = presentation.makeServer<Service>([](const auto&, const auto&) {});
503503
ASSERT_THAT(maybe_server, VariantWith<ServiceServer<Service>>(_));
504504

505505
EXPECT_CALL(req_rx_session_mock, deinit()).Times(1);
@@ -526,7 +526,10 @@ TEST_F(TestPresentation, makeServer_raw)
526526

527527
Presentation presentation{mr_, scheduler_, transport_mock_};
528528

529-
auto maybe_server = presentation.makeServer(rx_params.service_id, rx_params.extent_bytes, [](const auto&, auto) {});
529+
auto maybe_server = presentation.makeServer( //
530+
rx_params.service_id,
531+
rx_params.extent_bytes,
532+
[](const auto&, const auto&) {});
530533
ASSERT_THAT(maybe_server, VariantWith<RawServiceServer>(_));
531534

532535
EXPECT_CALL(req_rx_session_mock, deinit()).Times(1);

test/unittest/transport/can/test_can_msg_tx_session.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ TEST_F(TestCanMsgTxSession, send_empty_payload)
190190
return IMedia::PushResult::Success{false /* is_accepted */};
191191
});
192192
EXPECT_CALL(media_mock_, registerPushCallback(_)) //
193-
.WillOnce(Invoke([](auto) { return libcyphal::IExecutor::Callback::Any{}; }));
193+
.WillOnce(Invoke([](const auto&) { return libcyphal::IExecutor::Callback::Any{}; }));
194194

195195
metadata.deadline = now() + timeout;
196196
auto failure = session->send(metadata, empty_payload);

test/unittest/transport/can/test_can_svc_tx_sessions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ TEST_F(TestCanSvcTxSessions, send_request)
195195
return IMedia::PushResult::Success{true /* is_accepted */};
196196
});
197197
EXPECT_CALL(media_mock_, registerPushCallback(_)) //
198-
.WillOnce(Invoke([](auto) { return libcyphal::IExecutor::Callback::Any{}; }));
198+
.WillOnce(Invoke([](const auto&) { return libcyphal::IExecutor::Callback::Any{}; }));
199199

200200
metadata.deadline = now() + timeout;
201201
const auto failure = session->send(metadata, empty_payload);
@@ -247,7 +247,7 @@ TEST_F(TestCanSvcTxSessions, send_request_with_argument_error)
247247
return IMedia::PushResult::Success{true /* is_accepted */};
248248
});
249249
EXPECT_CALL(media_mock_, registerPushCallback(_)) //
250-
.WillOnce(Invoke([](auto) { return libcyphal::IExecutor::Callback::Any{}; }));
250+
.WillOnce(Invoke([](const auto&) { return libcyphal::IExecutor::Callback::Any{}; }));
251251

252252
metadata.deadline = now() + timeout;
253253
const auto failure = session->send(metadata, empty_payload);

test/unittest/transport/udp/test_udp_msg_tx_session.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ TEST_F(TestUdpMsgTxSession, send_empty_payload)
269269
EXPECT_CALL(tx_socket_mock_, send(_, _, _, _))
270270
.WillOnce(Return(ITxSocket::SendResult::Success{false /* is_accepted */}));
271271
EXPECT_CALL(tx_socket_mock_, registerCallback(_)) //
272-
.WillOnce(Invoke([](auto) { return libcyphal::IExecutor::Callback::Any{}; }));
272+
.WillOnce(Invoke([](const auto&) { return libcyphal::IExecutor::Callback::Any{}; }));
273273

274274
metadata.deadline = now() + 1s;
275275
auto failure = session->send(metadata, empty_payload);

test/unittest/transport/udp/test_udp_svc_tx_sessions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ TEST_F(TestUdpSvcTxSessions, send_empty_payload_request)
286286
EXPECT_CALL(tx_socket_mock_, send(_, _, _, _))
287287
.WillOnce(Return(ITxSocket::SendResult::Success{false /* is_accepted */}));
288288
EXPECT_CALL(tx_socket_mock_, registerCallback(_)) //
289-
.WillOnce(Invoke([](auto) { return libcyphal::IExecutor::Callback::Any{}; }));
289+
.WillOnce(Invoke([](const auto&) { return libcyphal::IExecutor::Callback::Any{}; }));
290290

291291
metadata.deadline = now() + 1s;
292292
auto failure = session->send(metadata, empty_payload);
@@ -349,7 +349,7 @@ TEST_F(TestUdpSvcTxSessions, send_empty_payload_responce)
349349
EXPECT_CALL(tx_socket_mock_, send(_, _, _, _))
350350
.WillOnce(Return(ITxSocket::SendResult::Success{false /* is_accepted */}));
351351
EXPECT_CALL(tx_socket_mock_, registerCallback(_)) //
352-
.WillOnce(Invoke([](auto) { return libcyphal::IExecutor::Callback::Any{}; }));
352+
.WillOnce(Invoke([](const auto&) { return libcyphal::IExecutor::Callback::Any{}; }));
353353

354354
metadata.tx_meta.deadline = now() + 1s;
355355
auto failure = session->send(metadata, empty_payload);

0 commit comments

Comments
 (0)