checkpointing: another small overload fix
authorSteve Reinhardt <steve.reinhardt@amd.com>
Tue, 6 Jul 2010 05:57:23 +0000 (22:57 -0700)
committerSteve Reinhardt <steve.reinhardt@amd.com>
Tue, 6 Jul 2010 05:57:23 +0000 (22:57 -0700)
On Nate's advice, overload 'char' as well as 'signed char'
and 'unsigned char'.

src/base/str.cc
src/sim/serialize.cc

index 2df1c103c2e4253ca415a5352434b1718e26090b..1e2be95a8819bcc573243e88d0c9c41f2221635a 100644 (file)
@@ -334,6 +334,7 @@ STN(unsigned short);
 STN(signed short);
 STN(unsigned char);
 STN(signed char);
+STN(char);
 
 template<>
 bool to_number<bool>(const string &value, bool &retval)
index 5f854a776c28022cb5b0e39c981981ef58541dbc..d95092629a725af8b32439df5a10902da7567549 100644 (file)
@@ -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 &section,                     \
              const string &name, vector<type> &param);
 
+INSTANTIATE_PARAM_TEMPLATES(char)
 INSTANTIATE_PARAM_TEMPLATES(signed char)
 INSTANTIATE_PARAM_TEMPLATES(unsigned char)
 INSTANTIATE_PARAM_TEMPLATES(signed short)