summaryrefslogtreecommitdiff
path: root/src/base/statistics.cc
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2008-10-09 04:58:23 -0700
committerNathan Binkert <nate@binkert.org>2008-10-09 04:58:23 -0700
commit7cc2a88038ccfd828a0caa7aa9d1b758d096d37d (patch)
tree9f58474948f0d6dac4abb2e48cff075cdf6caa42 /src/base/statistics.cc
parenta52dce6d623f6cb289004d4af12be0769966dadf (diff)
downloadgem5-7cc2a88038ccfd828a0caa7aa9d1b758d096d37d.tar.xz
stats: use properly signed types for looping and comparison
Diffstat (limited to 'src/base/statistics.cc')
-rw-r--r--src/base/statistics.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/base/statistics.cc b/src/base/statistics.cc
index 2acef83c5..cf2e6d4e7 100644
--- a/src/base/statistics.cc
+++ b/src/base/statistics.cc
@@ -117,8 +117,8 @@ StatData::less(StatData *stat1, StatData *stat2)
tokenize(v1, name1, '.');
tokenize(v2, name2, '.');
- int last = min(v1.size(), v2.size()) - 1;
- for (int i = 0; i < last; ++i)
+ size_type last = min(v1.size(), v2.size()) - 1;
+ for (off_type i = 0; i < last; ++i)
if (v1[i] != v2[i])
return v1[i] < v2[i];
@@ -164,7 +164,7 @@ FormulaBase::total() const
return root ? root->total() : 0.0;
}
-size_t
+size_type
FormulaBase::size() const
{
if (!root)
@@ -183,7 +183,7 @@ FormulaBase::zero() const
{
VResult vec;
result(vec);
- for (int i = 0; i < vec.size(); ++i)
+ for (off_t i = 0; i < vec.size(); ++i)
if (vec[i] != 0.0)
return false;
return true;
@@ -244,7 +244,7 @@ check()
panic("stat check failed for %s\n", data->name);
}
- int j = 0;
+ off_t j = 0;
for (i = Database::stats().begin(); i != end; ++i) {
StatData *data = *i;
if (!(data->flags & print))