diff --git a/src/DynamicModel.cc b/src/DynamicModel.cc index 39e7935e72afa13bad912d4d5864c0f4f68c834e..b3a7d690ae4d1f017db8ab3aa4df66cfcc218a84 100644 --- a/src/DynamicModel.cc +++ b/src/DynamicModel.cc @@ -5995,8 +5995,8 @@ DynamicModel::writeJsonVariableMapping(ostream &output) const auto [var, eqs] = *it; output << R"({"name": ")" << symbol_table.getName(var) << R"(", "equations":[)"; bool first_eq = true; - for (auto it2 = eqs.begin(); it2 != eqs.end(); ++it2) - if (auto tmp = equation_tags.getTagValueByEqnAndKey(*it2, "name"); + for (int it2 : eqs) + if (auto tmp = equation_tags.getTagValueByEqnAndKey(it2, "name"); !tmp.empty()) { if (first_eq) diff --git a/src/ModelEquationBlock.cc b/src/ModelEquationBlock.cc index c136805f3ed21c5295432c788f612936f2f7b42d..96d09c644c2aa8682d6a8979f9f9076698f6e72d 100644 --- a/src/ModelEquationBlock.cc +++ b/src/ModelEquationBlock.cc @@ -1,5 +1,5 @@ /* - * Copyright © 2010-2019 Dynare Team + * Copyright © 2010-2021 Dynare Team * * This file is part of Dynare. * @@ -274,7 +274,7 @@ SteadyStateModel::writeJsonSteadyStateFile(ostream &output, bool transformComput } if (symb_ids.size() > 1) output << "]"; - output << ", \"rhs\":\""; + output << R"(, "rhs":")"; def_table[i].second->writeJsonOutput(output, {}, {}, false); output << "\"}" << endl; } diff --git a/src/macro/Environment.hh b/src/macro/Environment.hh index 7c4bed3faa81fea83c709723df95aa594d58fda2..a02e27048a16c94906533dbf77bd03b3b5eb998e 100644 --- a/src/macro/Environment.hh +++ b/src/macro/Environment.hh @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Dynare Team + * Copyright © 2019-2021 Dynare Team * * This file is part of Dynare. * @@ -30,11 +30,11 @@ namespace macro class Environment { private: - const Environment *parent; + const Environment *parent{nullptr}; map<string, ExpressionPtr> variables; map<string, tuple<FunctionPtr, ExpressionPtr>> functions; public: - Environment() : parent{nullptr} { } + Environment() = default; Environment(const Environment *parent_arg) : parent{parent_arg} { } void define(VariablePtr var, ExpressionPtr value); void define(FunctionPtr func, ExpressionPtr value);