From 26f5a9c2cb6025459027bba1386c6ffb2e935fff Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Mon, 5 Jul 2010 22:57:23 -0700 Subject: checkpointing: another small overload fix On Nate's advice, overload 'char' as well as 'signed char' and 'unsigned char'. --- src/base/str.cc | 1 + src/sim/serialize.cc | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/base/str.cc b/src/base/str.cc index 2df1c103c..1e2be95a8 100644 --- a/src/base/str.cc +++ b/src/base/str.cc @@ -334,6 +334,7 @@ STN(unsigned short); STN(signed short); STN(unsigned char); STN(signed char); +STN(char); template<> bool to_number(const string &value, bool &retval) diff --git a/src/sim/serialize.cc b/src/sim/serialize.cc index 5f854a776..d95092629 100644 --- a/src/sim/serialize.cc +++ b/src/sim/serialize.cc @@ -85,6 +85,14 @@ showParam(ostream &os, const T &value) // // Treat 8-bit ints (chars) as ints on output, not as chars +template <> +void +showParam(ostream &os, const char &value) +{ + os << (int)value; +} + + template <> void showParam(ostream &os, const signed char &value) @@ -350,6 +358,7 @@ template void \ arrayParamIn(Checkpoint *cp, const string §ion, \ const string &name, vector ¶m); +INSTANTIATE_PARAM_TEMPLATES(char) INSTANTIATE_PARAM_TEMPLATES(signed char) INSTANTIATE_PARAM_TEMPLATES(unsigned char) INSTANTIATE_PARAM_TEMPLATES(signed short) -- cgit v1.2.3