diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2013-02-19 05:56:06 -0500 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2013-02-19 05:56:06 -0500 |
commit | c10098f28be209e90277925e3f983b7e62d1d037 (patch) | |
tree | 0b9c9f562c030ae74ae0a5fea25f804fdb84cec0 /src/base | |
parent | 860155a5fc48f983e9af40c19bf8db8250709c26 (diff) | |
download | gem5-c10098f28be209e90277925e3f983b7e62d1d037.tar.xz |
scons: Fix up numerous warnings about name shadowing
This patch address the most important name shadowing warnings (as
produced when using gcc/clang with -Wshadow). There are many
locations where constructor parameters and function parameters shadow
local variables, but these are left unchanged.
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/inifile.cc | 2 | ||||
-rw-r--r-- | src/base/output.cc | 10 | ||||
-rw-r--r-- | src/base/statistics.hh | 11 |
3 files changed, 11 insertions, 12 deletions
diff --git a/src/base/inifile.cc b/src/base/inifile.cc index 91e37f327..011887635 100644 --- a/src/base/inifile.cc +++ b/src/base/inifile.cc @@ -254,7 +254,7 @@ IniFile::Section::printUnreferenced(const string §ionName) for (EntryTable::iterator ei = table.begin(); ei != table.end(); ++ei) { const string &entryName = ei->first; - Entry *entry = ei->second; + entry = ei->second; if (entryName == "unref_section_ok" || entryName == "unref_entries_ok") diff --git a/src/base/output.cc b/src/base/output.cc index c0ddd0fae..912ec20e9 100644 --- a/src/base/output.cc +++ b/src/base/output.cc @@ -233,27 +233,27 @@ OutputDirectory::remove(const string &name, bool recursive) } else { // assume 'name' is a directory if (recursive) { - DIR *dir = opendir(fname.c_str()); + DIR *subdir = opendir(fname.c_str()); // silently ignore removal request for non-existent directory - if ((!dir) && (errno == ENOENT)) + if ((!subdir) && (errno == ENOENT)) return; // fail on other errors - if (!dir) { + if (!subdir) { perror("opendir"); fatal("Error opening directory for recursive removal '%s'\n", fname); } - struct dirent *de = readdir(dir); + struct dirent *de = readdir(subdir); while (de != NULL) { // ignore files starting with a '.'; user must delete those // manually if they really want to if (de->d_name[0] != '.') remove(name + PATH_SEPARATOR + de->d_name, recursive); - de = readdir(dir); + de = readdir(subdir); } } diff --git a/src/base/statistics.hh b/src/base/statistics.hh index 723c8bd9c..c46eedfde 100644 --- a/src/base/statistics.hh +++ b/src/base/statistics.hh @@ -1416,9 +1416,8 @@ class DistStor data.underflow = underflow; data.overflow = overflow; - size_type buckets = params->buckets; - data.cvec.resize(buckets); - for (off_type i = 0; i < buckets; ++i) + data.cvec.resize(params->buckets); + for (off_type i = 0; i < params->buckets; ++i) data.cvec[i] = cvec[i]; data.sum = sum; @@ -2372,13 +2371,13 @@ class SumNode : public Node size_type size = lvec.size(); assert(size > 0); - Result vresult = 0.0; + Result result = 0.0; Op op; for (off_type i = 0; i < size; ++i) - vresult = op(vresult, lvec[i]); + result = op(result, lvec[i]); - return vresult; + return result; } size_type size() const { return 1; } |