More automatic modernizations with clang-tidy

issue#70
Sébastien Villemot 2019-04-03 16:19:19 +02:00
parent 8a41a75c85
commit 39926133b8
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
2 changed files with 6 additions and 6 deletions

View File

@ -283,19 +283,19 @@ PacModelStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolida
if (growth == nullptr)
return;
VariableNode *vn = dynamic_cast<VariableNode *>(growth);
auto *vn = dynamic_cast<VariableNode *>(growth);
if (vn != nullptr)
{
mod_file_struct.pac_params.insert(vn->symb_id);
mod_file_struct.pac_params.insert(vn->lag);
}
UnaryOpNode *uon = dynamic_cast<UnaryOpNode *>(growth);
auto *uon = dynamic_cast<UnaryOpNode *>(growth);
if (uon != nullptr)
if (uon->op_code == UnaryOpcode::diff)
{
VariableNode *uonvn = dynamic_cast<VariableNode *>(uon->arg);
UnaryOpNode *uon1 = dynamic_cast<UnaryOpNode *>(uon->arg);
auto *uonvn = dynamic_cast<VariableNode *>(uon->arg);
auto *uon1 = dynamic_cast<UnaryOpNode *>(uon->arg);
while (uonvn == nullptr && uon1 != nullptr)
{
uonvn = dynamic_cast<VariableNode *>(uon1->arg);
@ -324,7 +324,7 @@ PacModelStatement::overwriteGrowth(expr_t new_growth)
return;
growth = new_growth;
VariableNode *vn = dynamic_cast<VariableNode *>(growth);
auto *vn = dynamic_cast<VariableNode *>(growth);
if (vn == nullptr)
{
cerr << "PacModelStatement::overwriteGrowth: Internal Dynare error: should not arrive here" << endl;

View File

@ -5710,7 +5710,7 @@ BinaryOpNode::getPacAREC(int lhs_symb_id, int lhs_orig_symb_id,
}
else
// This is a residual additive term
additive_vars_params_and_constants.push_back({ vid, lag, pid, constant});
additive_vars_params_and_constants.emplace_back(vid, lag, pid, constant);
}
}