diff --git a/ecal/core/src/readwrite/shm/ecal_writer_shm.cpp b/ecal/core/src/readwrite/shm/ecal_writer_shm.cpp index 7af067b220..6e0ea78b79 100644 --- a/ecal/core/src/readwrite/shm/ecal_writer_shm.cpp +++ b/ecal/core/src/readwrite/shm/ecal_writer_shm.cpp @@ -32,7 +32,7 @@ namespace eCAL { const std::string CDataWriterSHM::m_memfile_base_name = "ecal_"; - CDataWriterSHM::CDataWriterSHM(const std::string& host_name_, const std::string& topic_name_, const std::string& topic_id_, const CPublisher::SHMConfig& shm_config_) : + CDataWriterSHM::CDataWriterSHM(const std::string& /*host_name_*/, const std::string& topic_name_, const std::string& /*topic_id_*/, const CPublisher::SHMConfig& shm_config_) : m_config(shm_config_) { m_topic_name = topic_name_; @@ -69,7 +69,7 @@ namespace eCAL } // prepare memfile attributes - SSyncMemoryFileAttr memory_file_attr; + SSyncMemoryFileAttr memory_file_attr = {}; memory_file_attr.min_size = m_config.memfile_min_size_bytes; memory_file_attr.reserve = m_config.memfile_reserve_percent; memory_file_attr.timeout_open_ms = PUB_MEMFILE_OPEN_TO; diff --git a/ecal/tests/cpp/pubsub_test/src/pubsub_test.cpp b/ecal/tests/cpp/pubsub_test/src/pubsub_test.cpp index e169dd9c38..a41669fa86 100644 --- a/ecal/tests/cpp/pubsub_test/src/pubsub_test.cpp +++ b/ecal/tests/cpp/pubsub_test/src/pubsub_test.cpp @@ -509,7 +509,7 @@ TEST(core_cpp_pubsub, DynamicCreate) TEST(core_cpp_pubsub, ZeroPayloadMessageSHM) { // default send string - std::string send_s; + const std::string send_s; // initialize eCAL API eCAL::Initialize(0, nullptr, "pubsub_test"); @@ -649,7 +649,7 @@ TEST(core_cpp_pubsub, MultipleSendsSHM) // let's match them eCAL::Process::SleepMS(2 * CMN_REGISTRATION_REFRESH); long long timestamp = 1; - for (const auto elem : send_vector) + for (const auto& elem : send_vector) { pub.Send(elem, timestamp); eCAL::Process::SleepMS(DATA_FLOW_TIME); @@ -671,9 +671,9 @@ TEST(core_cpp_pubsub, MultipleSendsSHM) TEST(core_cpp_pubsub, MultipleSendsUDP) { // default send string - std::vector send_vector{ "this", "is", "a", "", "testtest" }; + const std::vector send_vector{ "this", "is", "a", "", "testtest" }; std::string last_received_msg; - long long last_received_timestamp; + long long last_received_timestamp(0); // initialize eCAL API eCAL::Initialize(0, nullptr, "pubsub_test"); @@ -705,7 +705,7 @@ TEST(core_cpp_pubsub, MultipleSendsUDP) // let's match them eCAL::Process::SleepMS(2 * CMN_REGISTRATION_REFRESH); long long timestamp = 1; - for (const auto elem : send_vector) + for (const auto& elem : send_vector) { pub.Send(elem, timestamp); eCAL::Process::SleepMS(DATA_FLOW_TIME);