diff options
author | ypostolov <ypostolov@luxoft.com> | 2020-01-09 19:59:59 +0200 |
---|---|---|
committer | yurii <ypostolov> | 2020-03-26 15:02:49 +0200 |
commit | e8050e0a2957cab5592f774435458cbf597c28dc (patch) | |
tree | 30a13c215dde5173238bed74772a3ec07ea7e549 | |
parent | 43fb0dd1e058b6fe23f8935f608798ed5010fe5a (diff) | |
download | sdl_core-e8050e0a2957cab5592f774435458cbf597c28dc.tar.gz |
fix cppcheck issues in component connection_handler
6 files changed, 8 insertions, 4 deletions
diff --git a/src/components/connection_handler/src/connection.cc b/src/components/connection_handler/src/connection.cc index 304be9ddb0..3ac6ed94b8 100644 --- a/src/components/connection_handler/src/connection.cc +++ b/src/components/connection_handler/src/connection.cc @@ -112,7 +112,7 @@ Connection::~Connection() { << static_cast<int>(session_it->first) << " from Session/Connection Map in Connection Destructor"); connection_handler_->RemoveSession(session_it->first); - session_it++; + ++session_it; } session_map_.clear(); @@ -317,7 +317,7 @@ uint8_t Connection::RemoveSecondaryServices( removed_services_list.push_back(service_it->service_type); service_it = service_list.erase(service_it); } else { - service_it++; + ++service_it; } } diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc index c8b4268bf0..1ae0bdf74d 100644 --- a/src/components/connection_handler/src/connection_handler_impl.cc +++ b/src/components/connection_handler/src/connection_handler_impl.cc @@ -219,7 +219,7 @@ namespace { struct DeviceFinder { explicit DeviceFinder(const std::string& device_uid) : device_uid_(device_uid) {} - bool operator()(const DeviceMap::value_type& device) { + bool operator()(const DeviceMap::value_type& device) const { return device_uid_ == device.second.mac_address(); } @@ -1145,7 +1145,7 @@ const uint8_t ConnectionHandlerImpl::GetSessionIdFromSecondaryTransport( transport_manager::ConnectionUID secondary_transport_id) const { sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_); SessionConnectionMap::const_iterator it = session_connection_map_.begin(); - for (; session_connection_map_.end() != it; it++) { + for (; session_connection_map_.end() != it; ++it) { SessionTransports st = it->second; if (st.secondary_transport == secondary_transport_id) { return it->first; diff --git a/src/components/connection_handler/test/connection_handler_impl_test.cc b/src/components/connection_handler/test/connection_handler_impl_test.cc index 855225c460..f1f2157ae8 100644 --- a/src/components/connection_handler/test/connection_handler_impl_test.cc +++ b/src/components/connection_handler/test/connection_handler_impl_test.cc @@ -66,6 +66,7 @@ using ::testing::SaveArg; using ::testing::SaveArgPointee; // custom action to call a member function with 3 arguments +// cppcheck-suppress syntaxError ACTION_P5(InvokeMemberFuncWithArg3, ptr, memberFunc, a, b, c) { (ptr->*memberFunc)(a, b, c); } diff --git a/src/components/connection_handler/test/connection_test.cc b/src/components/connection_handler/test/connection_test.cc index dd86831225..65168f582a 100644 --- a/src/components/connection_handler/test/connection_test.cc +++ b/src/components/connection_handler/test/connection_test.cc @@ -172,6 +172,7 @@ class ConnectionTest : public ::testing::Test { static const transport_manager::ConnectionUID kSecondaryConnectionHandle = 2; }; +// cppcheck-suppress syntaxError TEST_F(ConnectionTest, Session_TryGetProtocolVersionWithoutSession) { uint8_t protocol_version; EXPECT_FALSE(connection_->ProtocolVersion(session_id, protocol_version)); diff --git a/src/components/connection_handler/test/device_test.cc b/src/components/connection_handler/test/device_test.cc index 555bd8ed2a..3c3617a13d 100644 --- a/src/components/connection_handler/test/device_test.cc +++ b/src/components/connection_handler/test/device_test.cc @@ -39,6 +39,7 @@ namespace components { namespace connection_handler_test { using namespace connection_handler; +// cppcheck-suppress syntaxError TEST(ConnectionDevice, CompareDevicesWithDifferentMacAddresses) { DeviceHandle device_handle = 0; diff --git a/src/components/connection_handler/test/heart_beat_monitor_test.cc b/src/components/connection_handler/test/heart_beat_monitor_test.cc index d736255134..f5abef76c1 100644 --- a/src/components/connection_handler/test/heart_beat_monitor_test.cc +++ b/src/components/connection_handler/test/heart_beat_monitor_test.cc @@ -83,6 +83,7 @@ class HeartBeatMonitorTest : public testing::Test { } }; +// cppcheck-suppress syntaxError ACTION_P2(RemoveSession, conn, session_id) { conn->RemoveSession(session_id); } |