summaryrefslogtreecommitdiff
path: root/src/sim/serialize.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim/serialize.cc')
-rw-r--r--src/sim/serialize.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/sim/serialize.cc b/src/sim/serialize.cc
index 3127d9a04..0ecf45b6d 100644
--- a/src/sim/serialize.cc
+++ b/src/sim/serialize.cc
@@ -223,12 +223,13 @@ paramIn(CheckpointIn &cp, const string &name, T &param)
template <class T>
bool
-optParamIn(CheckpointIn &cp, const string &name, T &param)
+optParamIn(CheckpointIn &cp, const string &name, T &param, bool warn)
{
const string &section(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;
@@ -384,7 +385,8 @@ objParamIn(CheckpointIn &cp, const string &name, SimObject * &param)
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); \