Skip to content

Commit 6d220f4

Browse files
committed
Make the code compatible with c++17 and disable clang-tidy warning
1 parent 6507d42 commit 6d220f4

2 files changed

Lines changed: 17 additions & 15 deletions

File tree

.clang-tidy

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
---
2-
Checks: >
3-
clang-analyzer-*,
4-
-clang-analyzer-optin.cplusplus.VirtualCall,
5-
clang-diagnostic-*,
6-
google-*,
7-
misc-*,
8-
-misc-non-private-member-variables-in-classes,
9-
readability-*,
10-
-readability-identifier-length,
11-
-readability-magic-numbers,
2+
Checks: [
3+
clang-analyzer-*,
4+
-clang-analyzer-optin.cplusplus.VirtualCall,
5+
clang-diagnostic-*,
6+
google-*,
7+
misc-*,
8+
-misc-non-private-member-variables-in-classes,
9+
readability-*,
10+
-readability-container-contains, # Removed for compatiblity with C++17 which is used in ROS Humble
11+
-readability-identifier-length,
12+
-readability-magic-numbers,
13+
]
1214

1315
CheckOptions:
1416
misc-include-cleaner.IgnoreHeaders: bits/chrono.h
@@ -23,13 +25,13 @@ CheckOptions:
2325
readability-identifier-naming.StaticConstantCase: lower_case
2426
readability-identifier-naming.StaticVariableCase: lower_case
2527
readability-identifier-naming.MacroDefinitionCase: UPPER_CASE
26-
readability-identifier-naming.MacroDefinitionIgnoredRegexp: '^[A-Z]+(_[A-Z]+)*_$'
28+
readability-identifier-naming.MacroDefinitionIgnoredRegexp: "^[A-Z]+(_[A-Z]+)*_$"
2729
readability-identifier-naming.PrivateMemberCase: lower_case
2830
readability-identifier-naming.ProtectedMemberCase: lower_case
2931
readability-identifier-naming.PublicMemberCase: lower_case
3032
readability-identifier-naming.PrivateMemberSuffix: _
3133
readability-identifier-naming.ProtectedMemberSuffix: _
32-
readability-identifier-naming.PublicMemberSuffix: ''
34+
readability-identifier-naming.PublicMemberSuffix: ""
3335
readability-identifier-naming.NamespaceCase: lower_case
3436
readability-identifier-naming.ParameterCase: lower_case
3537
readability-identifier-naming.TypeAliasCase: CamelCase

src/web_video_server.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ bool WebVideoServer::handle_stream(
204204
const char * end)
205205
{
206206
const std::string type = request.get_query_param_value_or_default("type", default_stream_type_);
207-
if (streamer_factories_.contains(type)) {
207+
if (streamer_factories_.find(type) != streamer_factories_.end()) {
208208
const std::shared_ptr<StreamerInterface> streamer = streamer_factories_[type]->create_streamer(
209209
request, connection, weak_from_this());
210210
streamer->start();
@@ -223,7 +223,7 @@ bool WebVideoServer::handle_snapshot(
223223
const char * end)
224224
{
225225
const std::string type = request.get_query_param_value_or_default("type", default_snapshot_type_);
226-
if (snapshot_streamer_factories_.contains(type)) {
226+
if (snapshot_streamer_factories_.find(type) != snapshot_streamer_factories_.end()) {
227227
const std::shared_ptr<StreamerInterface> streamer =
228228
snapshot_streamer_factories_[type]->create_streamer(
229229
request, connection, weak_from_this());
@@ -243,7 +243,7 @@ bool WebVideoServer::handle_stream_viewer(
243243
const char * end)
244244
{
245245
const std::string type = request.get_query_param_value_or_default("type", default_stream_type_);
246-
if (streamer_factories_.contains(type)) {
246+
if (streamer_factories_.find(type) != streamer_factories_.end()) {
247247
const std::string topic = request.get_query_param_value_or_default("topic", "");
248248

249249
async_web_server_cpp::HttpReply::builder(async_web_server_cpp::HttpReply::ok)

0 commit comments

Comments
 (0)