Skip to content

Commit

Permalink
Added some clang tidy improvements (e.g. usage of const)
Browse files Browse the repository at this point in the history
  • Loading branch information
Peguen committed Apr 11, 2024
1 parent e0a1656 commit 063b484
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/mon/mon_gui/src/ecalmon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ Ecalmon::Ecalmon(QWidget *parent)
network_mode_warning_icon_->setPixmap(warning_icon);
network_mode_warning_icon_->setVisible(false);

bool network_mode = eCAL::Config::GetCurrentConfig().transport_layer_options.network_enabled;
int multicast_ttl = eCAL::Config::GetCurrentConfig().transport_layer_options.mc_options.ttl;
const bool network_mode = eCAL::Config::GetCurrentConfig().transport_layer_options.network_enabled;
const int multicast_ttl = eCAL::Config::GetCurrentConfig().transport_layer_options.mc_options.ttl;

if (network_mode)
{
Expand Down
2 changes: 1 addition & 1 deletion app/rec/rec_client_core/src/job/record_job.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ namespace eCAL
#undef CopyFile
#endif // CopyFile
{
std::string ecal_ini_original_path = Config::GetCurrentConfig().loaded_ecal_ini_file;
const std::string ecal_ini_original_path = Config::GetCurrentConfig().loaded_ecal_ini_file;

if (ecal_ini_original_path.empty())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ void ImportFromCloudWidget::loadExcludeTasksFilter()
QFile default_cfg_file(default_cfg_file_path.c_str());
if (default_cfg_file.exists())
{
std::regex reg(eCAL::Config::GetCurrentConfig().application_options.sys_options.filter_excl, std::regex::icase);
const std::regex reg(eCAL::Config::GetCurrentConfig().application_options.sys_options.filter_excl, std::regex::icase);
exclude_tasks_regex_valid_ = !eCAL::Config::GetCurrentConfig().application_options.sys_options.filter_excl.empty();
exclude_tasks_regex_ = reg;
}
Expand Down
2 changes: 1 addition & 1 deletion ecal/core/include/ecal/types/ecal_custom_data_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace eCAL

private:
ECAL_API void validateIpString(const std::string& ip_address_);
void exitApp(const std::string& ip_adress_ = std::string(""));
void exitApp(const std::string& ip_address_ = std::string(""));

std::string m_ip_address;
};
Expand Down
4 changes: 1 addition & 3 deletions ecal/core/src/config/ecal_cmd_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ namespace eCAL
}
}

CmdParser::~CmdParser()
{
}
CmdParser::~CmdParser() = default;
}
}
9 changes: 5 additions & 4 deletions ecal/core/src/config/ecal_config_initializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ namespace {
void tokenize(const std::string& str, std::vector<std::string>& tokens,
const std::string& delimiters = " ", bool trimEmpty = false)
{
std::string::size_type pos, lastPos = 0;
std::string::size_type pos = 0;
std::string::size_type lastPos = 0;

for (;;)
{
Expand All @@ -54,15 +55,15 @@ namespace {
pos = str.length();
if (pos != lastPos || !trimEmpty)
{
tokens.emplace_back(std::string(str.data() + lastPos, pos - lastPos));
tokens.emplace_back(str.data() + lastPos, pos - lastPos);
}
break;
}
else
{
if (pos != lastPos || !trimEmpty)
{
tokens.emplace_back(std::string(str.data() + lastPos, pos - lastPos));
tokens.emplace_back(str.data() + lastPos, pos - lastPos);
}
}
lastPos = pos + 1;
Expand Down Expand Up @@ -156,7 +157,7 @@ namespace eCAL

// monitoring options
auto& monitoringOptions = monitoring_options;
auto monitoringMode = iniConfig.get(EXPERIMENTAL, "shm_monitoring_enabled", false) == true ? MonitoringMode::shm_monitoring : MonitoringMode::none;
auto monitoringMode = iniConfig.get(EXPERIMENTAL, "shm_monitoring_enabled", false) ? MonitoringMode::shm_monitoring : MonitoringMode::none;
monitoringOptions.monitoring_mode = static_cast<eCAL_MonitoringMode_Filter>(monitoringMode);
monitoringOptions.monitoring_timeout = iniConfig.get(MONITORING, "timeout", MON_TIMEOUT);;
monitoringOptions.network_monitoring = iniConfig.get(EXPERIMENTAL, "network_monitoring", EXP_NETWORK_MONITORING_ENABLED);
Expand Down

0 comments on commit 063b484

Please sign in to comment.