diff --git a/src/sim/serialize.hh b/src/sim/serialize.hh --- a/src/sim/serialize.hh +++ b/src/sim/serialize.hh @@ -99,13 +99,15 @@ } template -bool optParamIn(CheckpointIn &cp, const std::string &name, T ¶m); +bool optParamIn(CheckpointIn &cp, const std::string &name, T ¶m, + bool warn = true); template bool optParamIn(CheckpointIn &cp, const std::string &name, - BitfieldBackend::BitUnionOperators &p) + BitfieldBackend::BitUnionOperators &p, + bool warn = true) { - return optParamIn(cp, name, p.__data); + return optParamIn(cp, name, p.__data, warn); } template # Node ID 08141b27e53287f4a9fc30b8b3a8dc60d984f869 # Parent 5723d29b779f6141bc2dd95dec8207ee09bdaa7c diff --git a/src/sim/serialize.cc b/src/sim/serialize.cc --- a/src/sim/serialize.cc +++ b/src/sim/serialize.cc @@ -222,12 +222,13 @@ template bool -optParamIn(CheckpointIn &cp, const string &name, T ¶m) +optParamIn(CheckpointIn &cp, const string &name, T ¶m, bool warn) { const string §ion(Serializable::currentSection()); string str; if (!cp.find(section, name, str) || !parseParam(str, param)) { - warn("optional parameter %s:%s not present\n", section, name); + if (warn) + warn("optional parameter %s:%s not present\n", section, name); return false; } else { return true; @@ -383,7 +384,8 @@ template void \ paramIn(CheckpointIn &cp, const string &name, type & param); \ template bool \ - optParamIn(CheckpointIn &cp, const string &name, type & param); \ + optParamIn(CheckpointIn &cp, const string &name, type & param, \ + bool warn); \ template void \ arrayParamOut(CheckpointOut &os, const string &name, \ type const *param, unsigned size); \