-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sync-with-eclipse-ecal-2024-07-17 #73
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 20 out of 33. Check the log or trigger a new build to see more.
std::string ecal_ini_file_path{}; | ||
|
||
private: | ||
ECAL_API void Init(std::vector<std::string>& args_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'eCAL::Configuration::Init' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]
ECAL_API void Init(std::vector<std::string>& args_);
^
Additional context
ecal/core/src/config/ecal_config_initializer.cpp:229: the definition seen here
void Configuration::Init(std::vector<std::string>& arguments_)
^
ecal/core/include/ecal/config/configuration.h:77: differing parameters are named here: ('args_'), in definition: ('arguments_')
ECAL_API void Init(std::vector<std::string>& args_);
^
@@ -26,13 +26,15 @@ | |||
|
|||
#include <ecal/ecal.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'ecal/ecal.h' file not found [clang-diagnostic-error]
#include <ecal/ecal.h>
^
class ProtobufDynamicJSONDeserializer | ||
{ | ||
public: | ||
std::string Deserialize(const void* buffer_, size_t size_, const SDataTypeInformation& datatype_info_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'Deserialize' can be made static [readability-convert-member-functions-to-static]
std::string Deserialize(const void* buffer_, size_t size_, const SDataTypeInformation& datatype_info_) | |
static std::string Deserialize(const void* buffer_, size_t size_, const SDataTypeInformation& datatype_info_) |
m_msg_callback = callback_; | ||
return true; | ||
} | ||
std::string binary_input; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'binary_input' is not initialized [cppcoreguidelines-init-variables]
std::string binary_input; | |
std::string binary_input = 0; |
} | ||
std::string binary_input; | ||
binary_input.assign(static_cast<const char*>(buffer_), static_cast<size_t>(size_)); | ||
std::string json_output; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'json_output' is not initialized [cppcoreguidelines-init-variables]
std::string json_output; | |
std::string json_output = 0; |
@@ -33,6 +34,7 @@ namespace eCAL | |||
std::atomic<int> g_globals_ctx_ref_cnt; | |||
|
|||
std::string g_default_ini_file(ECAL_DEFAULT_CFG); | |||
Configuration g_ecal_configuration{}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'g_ecal_configuration' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
Configuration g_ecal_configuration{};
^
{ | ||
return g_globals_ctx; | ||
g_globals_ctx = new CGlobals; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: assigning newly created 'gsl::owner<>' to non-owner 'CGlobals *' [cppcoreguidelines-owning-memory]
g_globals_ctx = new CGlobals;
^
#endif | ||
|
||
// declaration of globally accessible variables | ||
extern CGlobals* g_globals_ctx; | ||
extern std::atomic<int> g_globals_ctx_ref_cnt; | ||
|
||
extern std::string g_default_ini_file; | ||
extern Configuration g_ecal_configuration; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'g_ecal_configuration' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
extern Configuration g_ecal_configuration;
^
Configuration::Configuration() : | ||
share_topic_type(eCAL::Config::IsTopicTypeSharingEnabled()), | ||
share_topic_description(eCAL::Config::IsTopicDescriptionSharingEnabled()) | ||
Configuration::Configuration() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: share_topic_type, share_topic_description [cppcoreguidelines-pro-type-member-init]
ecal/core/include/ecal/config/publisher.h:142:
- bool share_topic_type; //!< share topic type via registration
- bool share_topic_description; //!< share topic description via registration
+ bool share_topic_type{}; //!< share topic type via registration
+ bool share_topic_description{}; //!< share topic description via registration
@@ -258,6 +169,12 @@ namespace eCAL | |||
m_sample_list.samples.clear(); | |||
} | |||
|
|||
void CRegistrationProvider::SendSampleList() | |||
{ | |||
std::lock_guard<std::mutex> lock(m_sample_list_mtx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'lock' of type 'std::lock_guardstd::mutex' can be declared 'const' [misc-const-correctness]
std::lock_guard<std::mutex> lock(m_sample_list_mtx); | |
std::lock_guard<std::mutex> const lock(m_sample_list_mtx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
|
||
std::shared_ptr<UDP::CSampleSender> m_reg_sample_snd; | ||
std::shared_ptr<CCallbackThread> m_reg_sample_snd_thread; | ||
static std::atomic<bool> m_created; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'm_created' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
static std::atomic<bool> m_created;
^
|
||
int main(int argc, char **argv) | ||
{ | ||
int run(0), runs(1000); | ||
int run(0), runs(10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: multiple declarations in a single statement reduces readability [readability-isolate-declaration]
int run(0), runs(10); | |
int run(0); | |
int runs(10); |
|
||
// Transport layer options | ||
const bool drop_out_of_order_messages = true; | ||
std::string ip_address = "238.200.100.2"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ip_address' of type 'std::string' (aka 'basic_string') can be declared 'const' [misc-const-correctness]
std::string ip_address = "238.200.100.2"; | |
std::string const ip_address = "238.200.100.2"; |
// test copy method for config structure | ||
eCAL::Configuration config1(0, nullptr); | ||
eCAL::Configuration config2(0, nullptr); | ||
std::string testValue = std::string("234.0.3.2"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'testValue' of type 'std::string' (aka 'basic_string') can be declared 'const' [misc-const-correctness]
std::string testValue = std::string("234.0.3.2"); | |
std::string const testValue = std::string("234.0.3.2"); |
const std::string reg_to_value = "6000"; | ||
const std::string reg_rf_value = "1000"; | ||
|
||
arguments.push_back("test_config_cmd_parser"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use emplace_back instead of push_back [modernize-use-emplace]
arguments.push_back("test_config_cmd_parser"); | |
arguments.emplace_back("test_config_cmd_parser"); |
} | ||
|
||
private: | ||
static duration current_time; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 };
^
auto max_lines(10); | ||
auto receive_lambda = [&received, &max_lines](const char* /*topic_name_*/, const struct eCAL::SReceiveCallbackData* data_) | ||
{ | ||
if (max_lines) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: implicit conversion 'int' -> bool [readability-implicit-bool-conversion]
if (max_lines) | |
if (max_lines != 0) |
long long time_point; | ||
}; | ||
|
||
std::vector<command> commands = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'commands' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
std::vector<command> commands =
^
|
||
for (const auto& command : commands) | ||
{ | ||
std::chrono::steady_clock::time_point time(std::chrono::milliseconds(command.time_point)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'time' of type 'std::chrono::steady_clock::time_point' (aka 'time_point<std::chrono::steady_clock, duration<long, ratio<1, 1000000000>>>') can be declared 'const' [misc-const-correctness]
std::chrono::steady_clock::time_point time(std::chrono::milliseconds(command.time_point)); | |
std::chrono::steady_clock::time_point const time(std::chrono::milliseconds(command.time_point)); |
sync-with-eclipse-ecal-2024-07-17