Conversation
| { | ||
| // After switchting to c++17, this can be replaced by an inline constexpr | ||
| static const eCAL_Logging_Filter log_level_default = log_level_info | log_level_warning | log_level_error | log_level_fatal; | ||
| static const eCAL_Logging_Filter log_filter_default = log_level_info | log_level_warning | log_level_error | log_level_fatal; |
There was a problem hiding this comment.
warning: variable 'log_filter_default' defined in a header file; variable definitions in header files can lead to ODR violations [misc-definitions-in-headers]
static const eCAL_Logging_Filter log_filter_default = log_level_info | log_level_warning | log_level_error | log_level_fatal;
^| { | ||
| // After switchting to c++17, this can be replaced by an inline constexpr | ||
| static const eCAL_Logging_Filter log_level_default = log_level_info | log_level_warning | log_level_error | log_level_fatal; | ||
| static const eCAL_Logging_Filter log_filter_default = log_level_info | log_level_warning | log_level_error | log_level_fatal; |
There was a problem hiding this comment.
warning: 'log_filter_default' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace]
| static const eCAL_Logging_Filter log_filter_default = log_level_info | log_level_warning | log_level_error | log_level_fatal; | |
| const eCAL_Logging_Filter log_filter_default = log_level_info | log_level_warning | log_level_error | log_level_fatal; |
| }; | ||
|
|
||
| typedef char eCAL_Logging_Filter; //!< This type is to be used as a bitmask for the activated logging levels No newline at end of file | ||
| typedef unsigned char eCAL_Logging_Filter; //!< This type is to be used as a bitmask for the activated logging levels No newline at end of file |
There was a problem hiding this comment.
warning: use 'using' instead of 'typedef' [modernize-use-using]
| typedef unsigned char eCAL_Logging_Filter; //!< This type is to be used as a bitmask for the activated logging levels | |
| using eCAL_Logging_Filter = unsigned char; //!< This type is to be used as a bitmask for the activated logging levels |
| * @param config_ Optional configuration parameters. | ||
| **/ | ||
| CMsgPublisher(const std::string& topic_name_, const struct SDataTypeInformation& data_type_info_, const Publisher::Configuration& config_ = {}) : CPublisher(topic_name_, data_type_info_, config_) | ||
| CMsgPublisher(const std::string& topic_name_, const struct SDataTypeInformation& data_type_info_, const Publisher::Configuration& config_ = GetPublisherConfiguration()) : CPublisher(topic_name_, data_type_info_, config_) |
There was a problem hiding this comment.
warning: constructor does not initialize these fields: m_buffer [cppcoreguidelines-pro-type-member-init]
CMsgPublisher(const std::string& topic_name_, const struct SDataTypeInformation& data_type_info_, const Publisher::Configuration& config_ = GetPublisherConfiguration()) : CPublisher(topic_name_, data_type_info_, config_)
^| * @param config_ Optional configuration parameters. | ||
| **/ | ||
| explicit CMsgPublisher(const std::string& topic_name_, const Publisher::Configuration& config_ = {}) : CMsgPublisher(topic_name_, GetDataTypeInformation(), config_) | ||
| explicit CMsgPublisher(const std::string& topic_name_, const Publisher::Configuration& config_ = GetPublisherConfiguration()) : CMsgPublisher(topic_name_, GetDataTypeInformation(), config_) |
There was a problem hiding this comment.
warning: constructor does not initialize these fields: m_buffer [cppcoreguidelines-pro-type-member-init]
explicit CMsgPublisher(const std::string& topic_name_, const Publisher::Configuration& config_ = GetPublisherConfiguration()) : CMsgPublisher(topic_name_, GetDataTypeInformation(), config_)
^| // LAYER | ||
| //////////////// | ||
| CTCPReaderLayer::CTCPReaderLayer() : m_initialized(false) {} | ||
| CTCPReaderLayer::CTCPReaderLayer() |
There was a problem hiding this comment.
warning: constructor does not initialize these fields: m_attributes [cppcoreguidelines-pro-type-member-init]
ecal/core/src/readwrite/tcp/ecal_reader_tcp.h:85:
- eCAL::eCALReader::TCPLayer::SAttributes m_attributes;
+ eCAL::eCALReader::TCPLayer::SAttributes m_attributes{};| // LAYER | ||
| //////////////// | ||
| class CUDPReaderLayer : public CReaderLayer<CUDPReaderLayer> | ||
| class CUDPReaderLayer : public CReaderLayer<CUDPReaderLayer, eCAL::eCALReader::UDP::SAttributes> |
There was a problem hiding this comment.
warning: class 'CUDPReaderLayer' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions]
class CUDPReaderLayer : public CReaderLayer<CUDPReaderLayer, eCAL::eCALReader::UDP::SAttributes>
^| #endif | ||
|
|
||
| // start cyclic registration thread | ||
| m_reg_sample_snd_thread = std::make_shared<CCallbackThread>(std::bind(&CRegistrationProvider::RegisterSendThread, this)); |
There was a problem hiding this comment.
warning: misleading indentation: statement is indented too deeply [readability-misleading-indentation]
m_reg_sample_snd_thread = std::make_shared<CCallbackThread>(std::bind(&CRegistrationProvider::RegisterSendThread, this));
^Additional context
ecal/core/src/registration/ecal_registration_provider.cpp:70: did you mean this line to be inside this 'if'
if (m_attributes.shm_enabled)
^| #include <memory> | ||
| #include <mutex> | ||
|
|
||
| #include "util/ecal_thread.h" |
There was a problem hiding this comment.
warning: duplicate include [readability-duplicate-include]
ecal/core/src/registration/ecal_registration_provider.h:38:
-
- #include "util/ecal_thread.h"
|
|
||
| for (const auto& registration_sample : expired_samples) | ||
| { | ||
| Sample unregistration_sample = CreateUnregisterSample(registration_sample.second); |
There was a problem hiding this comment.
warning: variable 'unregistration_sample' of type 'Sample' can be declared 'const' [misc-const-correctness]
| Sample unregistration_sample = CreateUnregisterSample(registration_sample.second); | |
| Sample const unregistration_sample = CreateUnregisterSample(registration_sample.second); |
| } | ||
|
|
||
| CMemoryFileBroadcast::CMemoryFileBroadcast(): m_created(false), m_max_queue_size(0), m_broadcast_memfile(std::make_unique<eCAL::CMemoryFile>()), m_event_queue(), m_last_timestamp(0) | ||
| CMemoryFileBroadcast::CMemoryFileBroadcast(): m_created(false), m_broadcast_memfile(std::make_unique<eCAL::CMemoryFile>()), m_event_queue(), m_last_timestamp(0) |
There was a problem hiding this comment.
warning: initializer for member 'm_event_queue' is redundant [readability-redundant-member-init]
| CMemoryFileBroadcast::CMemoryFileBroadcast(): m_created(false), m_broadcast_memfile(std::make_unique<eCAL::CMemoryFile>()), m_event_queue(), m_last_timestamp(0) | |
| CMemoryFileBroadcast::CMemoryFileBroadcast(): m_created(false), m_broadcast_memfile(std::make_unique<eCAL::CMemoryFile>()), , m_last_timestamp(0) |
| using namespace eCAL; | ||
|
|
||
| eCAL::CRegistrationReceiverUDP::CRegistrationReceiverUDP(RegistrationApplySampleCallbackT apply_sample_callback) | ||
| eCAL::CRegistrationReceiverUDP::CRegistrationReceiverUDP(RegistrationApplySampleCallbackT apply_sample_callback, const Registration::UDP::SReceiverAttributes& attr_) |
There was a problem hiding this comment.
warning: the parameter 'apply_sample_callback' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
| eCAL::CRegistrationReceiverUDP::CRegistrationReceiverUDP(RegistrationApplySampleCallbackT apply_sample_callback, const Registration::UDP::SReceiverAttributes& attr_) | |
| eCAL::CRegistrationReceiverUDP::CRegistrationReceiverUDP(const RegistrationApplySampleCallbackT& apply_sample_callback, const Registration::UDP::SReceiverAttributes& attr_) |
ecal/core/src/registration/udp/ecal_registration_receiver_udp.h:40:
- CRegistrationReceiverUDP(RegistrationApplySampleCallbackT apply_sample_callback, const Registration::UDP::SReceiverAttributes& attr_);
+ CRegistrationReceiverUDP(const RegistrationApplySampleCallbackT& apply_sample_callback, const Registration::UDP::SReceiverAttributes& attr_);| bool operator==(eCAL::Types::IpAddressV4 lhs, const std::string& ip_string_) { return lhs.Get() == ip_string_; }; | ||
| bool operator==(const std::string& ip_string_, eCAL::Types::IpAddressV4 rhs) { return rhs == ip_string_; }; | ||
| bool IpAddressV4::operator==(const eCAL::Types::IpAddressV4& rhs) const { return m_ip_address == rhs.Get(); } | ||
| bool operator==(eCAL::Types::IpAddressV4 lhs, const char* ip_string_) { return lhs.Get() == std::string(ip_string_); } |
There was a problem hiding this comment.
warning: the parameter 'lhs' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
| bool operator==(eCAL::Types::IpAddressV4 lhs, const char* ip_string_) { return lhs.Get() == std::string(ip_string_); } | |
| bool operator==(const eCAL::Types::IpAddressV4& lhs, const char* ip_string_) { return lhs.Get() == std::string(ip_string_); } |
ecal/core/include/ecal/types/ecal_custom_data_types.h:56:
- ECAL_API friend bool operator==(eCAL::Types::IpAddressV4 lhs, const char* ip_string_);
+ ECAL_API friend bool operator==(const eCAL::Types::IpAddressV4& lhs, const char* ip_string_);| bool operator==(const std::string& ip_string_, eCAL::Types::IpAddressV4 rhs) { return rhs == ip_string_; }; | ||
| bool IpAddressV4::operator==(const eCAL::Types::IpAddressV4& rhs) const { return m_ip_address == rhs.Get(); } | ||
| bool operator==(eCAL::Types::IpAddressV4 lhs, const char* ip_string_) { return lhs.Get() == std::string(ip_string_); } | ||
| bool operator==(const char* ip_string_, eCAL::Types::IpAddressV4 rhs) { return rhs == ip_string_; } |
There was a problem hiding this comment.
warning: parameter 'rhs' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param]
ecal/core/src/types/ecal_custom_data_types.cpp:29:
- #include <ecal_def.h>
+ #include <utility>
+ #include <ecal_def.h>| bool operator==(const char* ip_string_, eCAL::Types::IpAddressV4 rhs) { return rhs == ip_string_; } | |
| bool operator==(const char* ip_string_, eCAL::Types::IpAddressV4 rhs) { return std::move(rhs) == ip_string_; } |
| bool IpAddressV4::operator==(const eCAL::Types::IpAddressV4& rhs) const { return m_ip_address == rhs.Get(); } | ||
| bool operator==(eCAL::Types::IpAddressV4 lhs, const char* ip_string_) { return lhs.Get() == std::string(ip_string_); } | ||
| bool operator==(const char* ip_string_, eCAL::Types::IpAddressV4 rhs) { return rhs == ip_string_; } | ||
| bool operator==(eCAL::Types::IpAddressV4 lhs, const std::string& ip_string_) { return lhs.Get() == ip_string_; } |
There was a problem hiding this comment.
warning: the parameter 'lhs' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
| bool operator==(eCAL::Types::IpAddressV4 lhs, const std::string& ip_string_) { return lhs.Get() == ip_string_; } | |
| bool operator==(const eCAL::Types::IpAddressV4& lhs, const std::string& ip_string_) { return lhs.Get() == ip_string_; } |
ecal/core/include/ecal/types/ecal_custom_data_types.h:58:
- ECAL_API friend bool operator==(eCAL::Types::IpAddressV4 lhs, const std::string& ip_string_);
+ ECAL_API friend bool operator==(const eCAL::Types::IpAddressV4& lhs, const std::string& ip_string_);| #include "serialization/ecal_struct_sample_registration.h" | ||
|
|
||
| eCAL::Registration::Sample pub_foo_process_a_unregister; | ||
| eCAL::Registration::Sample pub_foo_process_a_register_1; |
There was a problem hiding this comment.
warning: variable 'pub_foo_process_a_register_1' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
eCAL::Registration::Sample pub_foo_process_a_register_1;
^|
|
||
| eCAL::Registration::Sample pub_foo_process_a_unregister; | ||
| eCAL::Registration::Sample pub_foo_process_a_register_1; | ||
| eCAL::Registration::Sample pub_foo_process_a_register_2; |
There was a problem hiding this comment.
warning: variable 'pub_foo_process_a_register_2' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
eCAL::Registration::Sample pub_foo_process_a_register_2;
^| eCAL::Registration::Sample pub_foo_process_a_register_1; | ||
| eCAL::Registration::Sample pub_foo_process_a_register_2; | ||
|
|
||
| eCAL::Registration::Sample sub_foo_process_a_unregister; |
There was a problem hiding this comment.
warning: variable 'sub_foo_process_a_unregister' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
eCAL::Registration::Sample sub_foo_process_a_unregister;
^| eCAL::Registration::Sample pub_foo_process_a_register_2; | ||
|
|
||
| eCAL::Registration::Sample sub_foo_process_a_unregister; | ||
| eCAL::Registration::Sample sub_foo_process_a_register_1; |
There was a problem hiding this comment.
warning: variable 'sub_foo_process_a_register_1' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
eCAL::Registration::Sample sub_foo_process_a_register_1;
^|
|
||
| eCAL::Registration::Sample sub_foo_process_a_unregister; | ||
| eCAL::Registration::Sample sub_foo_process_a_register_1; | ||
| eCAL::Registration::Sample sub_foo_process_a_register_2; |
There was a problem hiding this comment.
warning: variable 'sub_foo_process_a_register_2' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
eCAL::Registration::Sample sub_foo_process_a_register_2;
^| eCAL::Registration::Sample sub_foo_process_a_register_1; | ||
| eCAL::Registration::Sample sub_foo_process_a_register_2; | ||
|
|
||
| eCAL::Registration::Sample sub_foo_process_b_unregister; |
There was a problem hiding this comment.
warning: variable 'sub_foo_process_b_unregister' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
eCAL::Registration::Sample sub_foo_process_b_unregister;
^| eCAL::Registration::Sample sub_foo_process_a_register_2; | ||
|
|
||
| eCAL::Registration::Sample sub_foo_process_b_unregister; | ||
| eCAL::Registration::Sample sub_foo_process_b_register_1; |
There was a problem hiding this comment.
warning: variable 'sub_foo_process_b_register_1' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
eCAL::Registration::Sample sub_foo_process_b_register_1;
^|
|
||
| eCAL::Registration::Sample sub_foo_process_b_unregister; | ||
| eCAL::Registration::Sample sub_foo_process_b_register_1; | ||
| eCAL::Registration::Sample sub_foo_process_b_register_2; |
There was a problem hiding this comment.
warning: variable 'sub_foo_process_b_register_2' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
eCAL::Registration::Sample sub_foo_process_b_register_2;
^| } | ||
|
|
||
| private: | ||
| static duration current_time; |
There was a problem hiding this comment.
warning: variable 'current_time' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
static duration current_time;
^| }; | ||
|
|
||
| // Initialize the static member | ||
| TestingClock::duration TestingClock::current_time{ 0 }; |
There was a problem hiding this comment.
warning: variable 'current_time' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
TestingClock::duration TestingClock::current_time{ 0 };
^
Description
sync-with-eclipse-ecal-2024-10-18