summaryrefslogtreecommitdiff
path: root/src/sim/serialize.cc
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2009-06-04 23:21:12 -0700
committerNathan Binkert <nate@binkert.org>2009-06-04 23:21:12 -0700
commit6faf377b5305f9dcc3c7b013c4d67f5accb92617 (patch)
tree0e437fb49a32dd3d2d2bec95a8dc3bdb4ddf05b0 /src/sim/serialize.cc
parent4e3426624557b555c354035ee3961eab7554d81d (diff)
downloadgem5-6faf377b5305f9dcc3c7b013c4d67f5accb92617.tar.xz
types: clean up types, especially signed vs unsigned
Diffstat (limited to 'src/sim/serialize.cc')
-rw-r--r--src/sim/serialize.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/sim/serialize.cc b/src/sim/serialize.cc
index f73fc93a3..5ae9128e5 100644
--- a/src/sim/serialize.cc
+++ b/src/sim/serialize.cc
@@ -182,11 +182,11 @@ template <class T>
void
arrayParamOut(ostream &os, const string &name, const vector<T> &param)
{
- int size = param.size();
+ typename vector<T>::size_type size = param.size();
os << name << "=";
if (size > 0)
showParam(os, param[0]);
- for (int i = 1; i < size; ++i) {
+ for (typename vector<T>::size_type i = 1; i < size; ++i) {
os << " ";
showParam(os, param[i]);
}
@@ -207,12 +207,12 @@ paramIn(Checkpoint *cp, const string &section, const string &name, T &param)
template <class T>
void
-arrayParamOut(ostream &os, const string &name, const T *param, int size)
+arrayParamOut(ostream &os, const string &name, const T *param, unsigned size)
{
os << name << "=";
if (size > 0)
showParam(os, param[0]);
- for (int i = 1; i < size; ++i) {
+ for (unsigned i = 1; i < size; ++i) {
os << " ";
showParam(os, param[i]);
}
@@ -223,7 +223,7 @@ arrayParamOut(ostream &os, const string &name, const T *param, int size)
template <class T>
void
arrayParamIn(Checkpoint *cp, const string &section, const string &name,
- T *param, int size)
+ T *param, unsigned size)
{
string str;
if (!cp->find(section, name, str)) {
@@ -244,7 +244,7 @@ arrayParamIn(Checkpoint *cp, const string &section, const string &name,
fatal("Array size mismatch on %s:%s'\n", section, name);
}
- for (int i = 0; i < tokens.size(); i++) {
+ for (vector<string>::size_type i = 0; i < tokens.size(); i++) {
// need to parse into local variable to handle vector<bool>,
// for which operator[] returns a special reference class
// that's not the same as 'bool&', (since it's a packed
@@ -286,7 +286,7 @@ arrayParamIn(Checkpoint *cp, const string &section,
param.resize(tokens.size());
- for (int i = 0; i < tokens.size(); i++) {
+ for (vector<string>::size_type i = 0; i < tokens.size(); i++) {
// need to parse into local variable to handle vector<bool>,
// for which operator[] returns a special reference class
// that's not the same as 'bool&', (since it's a packed
@@ -306,8 +306,6 @@ arrayParamIn(Checkpoint *cp, const string &section,
}
}
-
-
void
objParamIn(Checkpoint *cp, const string &section,
const string &name, SimObject * &param)
@@ -326,10 +324,10 @@ paramIn(Checkpoint *cp, const string &section, \
const string &name, type & param); \
template void \
arrayParamOut(ostream &os, const string &name, \
- type const *param, int size); \
+ type const *param, unsigned size); \
template void \
arrayParamIn(Checkpoint *cp, const string &section, \
- const string &name, type *param, int size); \
+ const string &name, type *param, unsigned size); \
template void \
arrayParamOut(ostream &os, const string &name, \
const vector<type> &param); \