Skip to content

Commit

Permalink
clang-tidy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
phlptp committed Jan 6, 2024
1 parent 192d6cf commit bb08638
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/helics/application_api/Endpoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ SPDX-License-Identifier: BSD-3-Clause

namespace helics {

Endpoint::Endpoint(MessageFederate* mFed, std::string_view name, InterfaceHandle id):
Interface(mFed, id, name), fed(mFed)
Endpoint::Endpoint(MessageFederate* mFed, std::string_view name, InterfaceHandle hid):
Interface(mFed, hid, name), fed(mFed)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/helics/application_api/Endpoints.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class HELICS_CXX_EXPORT Endpoint: public Interface {
Endpoint() = default;
/**/
// constructor used by messageFederateManager
Endpoint(MessageFederate* mFed, std::string_view name, InterfaceHandle id);
Endpoint(MessageFederate* mFed, std::string_view name, InterfaceHandle hid);

Endpoint(MessageFederate* mFed,
std::string_view name,
Expand Down
6 changes: 3 additions & 3 deletions src/helics/application_api/Federate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1558,7 +1558,7 @@ void Federate::registerConnectorInterfacesToml(const std::string& tomlString)
const std::string outputType = getOrDefault(filt, "outputType", emptyStr);
const bool useTypes = !((inputType.empty()) && (outputType.empty()));
const bool global = getOrDefault(filt, "global", defaultGlobal);
std::string operation = getOrDefault(filt, "operation", std::string("custom"));
const std::string operation = getOrDefault(filt, "operation", std::string("custom"));

auto opType = filterTypeFromString(operation);
if (!checkValidFilterType(useTypes, opType, operation)) {
Expand Down Expand Up @@ -1592,7 +1592,7 @@ void Federate::registerConnectorInterfacesToml(const std::string& tomlString)
}
auto& transArray = transs.as_array();
for (const auto& trans : transArray) {
std::string key = getOrDefault(trans, "name", emptyStr);
const std::string key = getOrDefault(trans, "name", emptyStr);

std::string ttype = getOrDefault(trans, "type", std::string("custom"));
auto opType = translatorTypeFromString(ttype);
Expand All @@ -1603,7 +1603,7 @@ void Federate::registerConnectorInterfacesToml(const std::string& tomlString)

if (opType == TranslatorTypes::UNRECOGNIZED) {
if (strictConfigChecking) {
std::string emessage = fmt::format("unrecognized translator type:{}", ttype);
const std::string emessage = fmt::format("unrecognized translator type:{}", ttype);
logMessage(HELICS_LOG_LEVEL_ERROR, emessage);

throw(InvalidParameter(emessage));
Expand Down
2 changes: 1 addition & 1 deletion src/helics/application_api/Filters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class HELICS_CXX_EXPORT Filter: public Interface {
/** check if the filter is a cloning filter*/
bool isCloningFilter() const { return cloning; }
/** set a message operator to process the message*/
void setOperator(std::shared_ptr<FilterOperator> mo);
void setOperator(std::shared_ptr<FilterOperator> filterOp);

virtual const std::string& getDisplayName() const override { return getName(); }

Expand Down
14 changes: 7 additions & 7 deletions src/helics/application_api/Translator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ void addOperations(Translator* trans, TranslatorTypes type)
default:
break;
case TranslatorTypes::JSON: {
auto op = std::make_shared<JsonTranslatorOperation>();
trans->setTranslatorOperations(std::move(op));
auto operation = std::make_shared<JsonTranslatorOperation>();
trans->setTranslatorOperations(std::move(operation));
} break;
case TranslatorTypes::BINARY: {
auto op = std::make_shared<BinaryTranslatorOperation>();
trans->setTranslatorOperations(std::move(op));
auto operation = std::make_shared<BinaryTranslatorOperation>();
trans->setTranslatorOperations(std::move(operation));
} break;
}
}
Expand All @@ -71,10 +71,10 @@ Translator::Translator(Core* core, const std::string_view translatorName):
}
}

void Translator::setOperator(std::shared_ptr<TranslatorOperator> mo)
void Translator::setOperator(std::shared_ptr<TranslatorOperator> operation)
{
if (mo) {
setTranslatorOperations(std::make_shared<CustomTranslatorOperation>(std::move(mo)));
if (operation) {
setTranslatorOperations(std::make_shared<CustomTranslatorOperation>(std::move(operation)));
} else {
setTranslatorOperations(nullptr);
}
Expand Down
2 changes: 1 addition & 1 deletion src/helics/application_api/Translator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class HELICS_CXX_EXPORT Translator: public Interface {
Translator& operator=(const Translator& trans) = default;

/** set a message operator to process the message*/
void setOperator(std::shared_ptr<TranslatorOperator> mo);
void setOperator(std::shared_ptr<TranslatorOperator> operation);

virtual const std::string& getDisplayName() const override { return getName(); }

Expand Down
12 changes: 6 additions & 6 deletions src/helics/application_api/ValueFederate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,14 +485,14 @@ static void generateData(std::vector<std::pair<std::string, dvalue>>& vpairs,
Json::Value val)
{
for (auto& name : val.getMemberNames()) {
auto& so = val[name];
if (so.isObject()) {
generateData(vpairs, prefix + name + separator, separator, so);
auto& field = val[name];
if (field.isObject()) {
generateData(vpairs, prefix + name + separator, separator, field);
} else {
if (so.isDouble()) {
vpairs.emplace_back(prefix + name, so.asDouble());
if (field.isDouble()) {
vpairs.emplace_back(prefix + name, field.asDouble());
} else {
vpairs.emplace_back(prefix + name, so.asString());
vpairs.emplace_back(prefix + name, field.asString());
}
}
}
Expand Down

0 comments on commit bb08638

Please sign in to comment.