diff options
author | Steve Reinhardt <stever@eecs.umich.edu> | 2004-02-02 15:55:35 -0800 |
---|---|---|
committer | Steve Reinhardt <stever@eecs.umich.edu> | 2004-02-02 15:55:35 -0800 |
commit | 548b4a1cb045c6675692e8ed7c6375ebb808c803 (patch) | |
tree | c7a28b92dddb711c6bb2ed2c7a11ea2d387277a3 | |
parent | 956aff1291990639f8a59a95c6b22e0c17bb8cd8 (diff) | |
download | gem5-548b4a1cb045c6675692e8ed7c6375ebb808c803.tar.xz |
Change "Foo& foo" declarations to "Foo &foo".
This primarily to be internally consistent (sometimes we used one,
sometimes the other, even within the same line of code!).
I picked the latter to be symmetric with "Foo *foo".
base/cprintf_formats.hh:
base/range.hh:
base/refcnt.hh:
base/res_list.hh:
base/statistics.hh:
base/str.hh:
cpu/exec_context.hh:
cpu/simple_cpu/simple_cpu.cc:
cpu/simple_cpu/simple_cpu.hh:
sim/serialize.cc:
sim/serialize.hh:
sim/syscall_emul.hh:
Change "Foo& foo" declarations to "Foo &foo".
--HG--
extra : convert_revision : ca1b0e85a578b539214bda3b8d61ac23792f2e87
-rw-r--r-- | base/cprintf_formats.hh | 14 | ||||
-rw-r--r-- | base/range.hh | 2 | ||||
-rw-r--r-- | base/refcnt.hh | 4 | ||||
-rw-r--r-- | base/res_list.hh | 2 | ||||
-rw-r--r-- | base/statistics.hh | 22 | ||||
-rw-r--r-- | base/str.hh | 2 | ||||
-rw-r--r-- | cpu/exec_context.hh | 4 | ||||
-rw-r--r-- | cpu/simple_cpu/simple_cpu.cc | 2 | ||||
-rw-r--r-- | cpu/simple_cpu/simple_cpu.hh | 2 | ||||
-rw-r--r-- | sim/serialize.cc | 4 | ||||
-rw-r--r-- | sim/serialize.hh | 4 | ||||
-rw-r--r-- | sim/syscall_emul.hh | 4 |
12 files changed, 33 insertions, 33 deletions
diff --git a/base/cprintf_formats.hh b/base/cprintf_formats.hh index b921c0506..c3e01c935 100644 --- a/base/cprintf_formats.hh +++ b/base/cprintf_formats.hh @@ -62,7 +62,7 @@ struct Format template <typename T> inline void -_format_char(std::ostream &out, const T& data, Format &fmt) +_format_char(std::ostream &out, const T &data, Format &fmt) { using namespace std; @@ -71,7 +71,7 @@ _format_char(std::ostream &out, const T& data, Format &fmt) template <typename T> inline void -_format_integer(std::ostream &out, const T& data, Format &fmt) +_format_integer(std::ostream &out, const T &data, Format &fmt) { using namespace std; @@ -128,7 +128,7 @@ _format_integer(std::ostream &out, const T& data, Format &fmt) template <typename T> inline void -_format_float(std::ostream &out, const T& data, Format &fmt) +_format_float(std::ostream &out, const T &data, Format &fmt) { using namespace std; @@ -180,7 +180,7 @@ _format_float(std::ostream &out, const T& data, Format &fmt) template <typename T> inline void -_format_string(std::ostream &out, const T& data, Format &fmt) +_format_string(std::ostream &out, const T &data, Format &fmt) { using namespace std; @@ -225,7 +225,7 @@ _format_string(std::ostream &out, const T& data, Format &fmt) // template <typename T> inline void -format_char(std::ostream &out, const T& data, Format &fmt) +format_char(std::ostream &out, const T &data, Format &fmt) { out << "<bad arg type for char format>"; } inline void @@ -321,7 +321,7 @@ format_integer(std::ostream &out, unsigned long long data, Format &fmt) // template <typename T> inline void -format_float(std::ostream &out, const T& data, Format &fmt) +format_float(std::ostream &out, const T &data, Format &fmt) { out << "<bad arg type for float format>"; } inline void @@ -337,7 +337,7 @@ format_float(std::ostream &out, double data, Format &fmt) // template <typename T> inline void -format_string(std::ostream &out, const T& data, Format &fmt) +format_string(std::ostream &out, const T &data, Format &fmt) { _format_string(out, data, fmt); } inline void diff --git a/base/range.hh b/base/range.hh index 0d3383b01..3443bf246 100644 --- a/base/range.hh +++ b/base/range.hh @@ -49,7 +49,7 @@ class Range Range(const Range &r) { operator=(r); } - Range(const T& s, const T& e) + Range(const T &s, const T &e) : start(s), end(e) { valid = (start <= end); diff --git a/base/refcnt.hh b/base/refcnt.hh index 5bc62ae23..f3e0e4114 100644 --- a/base/refcnt.hh +++ b/base/refcnt.hh @@ -64,7 +64,7 @@ class RefCountingPtr public: RefCountingPtr() : data(NULL) {} RefCountingPtr(T *data) { copy(data); } - RefCountingPtr(const RefCountingPtr& r) { copy(r.data); } + RefCountingPtr(const RefCountingPtr &r) { copy(r.data); } ~RefCountingPtr() { del(); } T *operator->() { return data; } @@ -83,7 +83,7 @@ class RefCountingPtr return *this; } - RefCountingPtr &operator=(const RefCountingPtr& r) { + RefCountingPtr &operator=(const RefCountingPtr &r) { if (data != r.data) { del(); copy(r.data); diff --git a/base/res_list.hh b/base/res_list.hh index c856c1226..04c3b7cfa 100644 --- a/base/res_list.hh +++ b/base/res_list.hh @@ -103,7 +103,7 @@ class res_list : public res_list_base iterator prev(void) { return iterator(p->prev); } bool operator== (iterator x) { return (x.p == this->p); } bool operator != (iterator x) { return (x.p != this->p); } - T& operator * (void) { return *(p->data); } + T &operator * (void) { return *(p->data); } T* operator -> (void) { return p->data; } bool isnull(void) { return (p==0); } bool notnull(void) { return (p!=0); } diff --git a/base/statistics.hh b/base/statistics.hh index cbc976053..d8b78fbff 100644 --- a/base/statistics.hh +++ b/base/statistics.hh @@ -838,7 +838,7 @@ class ScalarBase : public DataAccess * @param v The new value. */ template <typename U> - void operator=(const U& v) { data()->set(v, params); } + void operator=(const U &v) { data()->set(v, params); } /** * Increment the stat by the given value. This calls the associated @@ -846,7 +846,7 @@ class ScalarBase : public DataAccess * @param v The value to add. */ template <typename U> - void operator+=(const U& v) { data()->inc(v, params); } + void operator+=(const U &v) { data()->inc(v, params); } /** * Decrement the stat by the given value. This calls the associated @@ -854,7 +854,7 @@ class ScalarBase : public DataAccess * @param v The value to substract. */ template <typename U> - void operator-=(const U& v) { data()->dec(v, params); } + void operator-=(const U &v) { data()->dec(v, params); } /** * Return the number of elements, always 1 for a scalar. @@ -1105,7 +1105,7 @@ class ScalarProxy * @param v The new value. */ template <typename U> - void operator=(const U& v) { data()->set(v, *params); } + void operator=(const U &v) { data()->set(v, *params); } /** * Increment the stat by the given value. This calls the associated @@ -1113,7 +1113,7 @@ class ScalarProxy * @param v The value to add. */ template <typename U> - void operator+=(const U& v) { data()->inc(v, *params); } + void operator+=(const U &v) { data()->inc(v, *params); } /** * Decrement the stat by the given value. This calls the associated @@ -1121,7 +1121,7 @@ class ScalarProxy * @param v The value to substract. */ template <typename U> - void operator-=(const U& v) { data()->dec(v, *params); } + void operator-=(const U &v) { data()->dec(v, *params); } /** * Return the number of elements, always 1 for a scalar. @@ -1574,7 +1574,7 @@ struct AvgFancy * @param number The number of times to add the value. * @param p The paramters of the distribution. */ - void sample(T val, int number, const Params& p) + void sample(T val, int number, const Params &p) { T value = val * number; sum += value; @@ -1663,7 +1663,7 @@ class DistBase : public DataAccess * @param n The number of times to add it, defaults to 1. */ template <typename U> - void sample(const U& v, int n = 1) { data()->sample(v, n, params); } + void sample(const U &v, int n = 1) { data()->sample(v, n, params); } /** * Return the number of entries in this stat. @@ -1787,7 +1787,7 @@ class DistProxy public: template <typename U> - void sample(const U& v, int n = 1) { data()->sample(v, n, cstat->params); } + void sample(const U &v, int n = 1) { data()->sample(v, n, cstat->params); } size_t size() const { return 1; } bool zero() const { return data()->zero(cstat->params); } @@ -2534,7 +2534,7 @@ class Scalar * @param v The new value. */ template <typename U> - void operator=(const U& v) { Base::operator=(v); } + void operator=(const U &v) { Base::operator=(v); } }; /** @@ -2562,7 +2562,7 @@ class Average * @param v The new value. */ template <typename U> - void operator=(const U& v) { Base::operator=(v); } + void operator=(const U &v) { Base::operator=(v); } }; /** diff --git a/base/str.hh b/base/str.hh index 6c3453b8b..8fee21a10 100644 --- a/base/str.hh +++ b/base/str.hh @@ -99,7 +99,7 @@ to_number(const std::string &value, T &retval); template <class T> inline std::string -to_string(const T& value) +to_string(const T &value) { std::stringstream str; str << value; diff --git a/cpu/exec_context.hh b/cpu/exec_context.hh index b49db9720..768f2e7d4 100644 --- a/cpu/exec_context.hh +++ b/cpu/exec_context.hh @@ -241,7 +241,7 @@ class ExecContext #endif template <class T> - Fault read(MemReqPtr &req, T& data) + Fault read(MemReqPtr &req, T &data) { #if defined(TARGET_ALPHA) && defined(FULL_SYSTEM) if (req->flags & LOCKED) { @@ -254,7 +254,7 @@ class ExecContext } template <class T> - Fault write(MemReqPtr &req, T& data) + Fault write(MemReqPtr &req, T &data) { #if defined(TARGET_ALPHA) && defined(FULL_SYSTEM) diff --git a/cpu/simple_cpu/simple_cpu.cc b/cpu/simple_cpu/simple_cpu.cc index 0d5fc4077..e9284ad31 100644 --- a/cpu/simple_cpu/simple_cpu.cc +++ b/cpu/simple_cpu/simple_cpu.cc @@ -321,7 +321,7 @@ change_thread_state(int thread_number, int activate, int priority) // precise architected memory state accessor macros template <class T> Fault -SimpleCPU::read(Addr addr, T& data, unsigned flags) +SimpleCPU::read(Addr addr, T &data, unsigned flags) { memReq->reset(addr, sizeof(T), flags); diff --git a/cpu/simple_cpu/simple_cpu.hh b/cpu/simple_cpu/simple_cpu.hh index 7c9d4ea75..16753fa4f 100644 --- a/cpu/simple_cpu/simple_cpu.hh +++ b/cpu/simple_cpu/simple_cpu.hh @@ -227,7 +227,7 @@ class SimpleCPU : public BaseCPU virtual void unserialize(Checkpoint *cp, const std::string §ion); template <class T> - Fault read(Addr addr, T& data, unsigned flags); + Fault read(Addr addr, T &data, unsigned flags); template <class T> Fault write(T data, Addr addr, unsigned flags, diff --git a/sim/serialize.cc b/sim/serialize.cc index 281e7cfc8..180cc38a0 100644 --- a/sim/serialize.cc +++ b/sim/serialize.cc @@ -62,7 +62,7 @@ Serializable::nameOut(ostream &os, const string &_name) template <class T> void -paramOut(ostream &os, const std::string &name, const T& param) +paramOut(ostream &os, const std::string &name, const T ¶m) { os << name << "="; showParam(os, param); @@ -73,7 +73,7 @@ paramOut(ostream &os, const std::string &name, const T& param) template <class T> void paramIn(Checkpoint *cp, const std::string §ion, - const std::string &name, T& param) + const std::string &name, T ¶m) { std::string str; if (!cp->find(section, name, str) || !parseParam(str, param)) { diff --git a/sim/serialize.hh b/sim/serialize.hh index 32802409d..9ab2fa833 100644 --- a/sim/serialize.hh +++ b/sim/serialize.hh @@ -45,11 +45,11 @@ class Serializable; class Checkpoint; template <class T> -void paramOut(std::ostream &os, const std::string &name, const T& param); +void paramOut(std::ostream &os, const std::string &name, const T ¶m); template <class T> void paramIn(Checkpoint *cp, const std::string §ion, - const std::string &name, T& param); + const std::string &name, T ¶m); template <class T> void arrayParamOut(std::ostream &os, const std::string &name, diff --git a/sim/syscall_emul.hh b/sim/syscall_emul.hh index 1031b0823..df4038f71 100644 --- a/sim/syscall_emul.hh +++ b/sim/syscall_emul.hh @@ -141,9 +141,9 @@ class TypedBufferArg : public BaseBufferArg operator T*() { return (T *)bufPtr; } // dereference operators - T& operator*() { return *((T *)bufPtr); } + T &operator*() { return *((T *)bufPtr); } T* operator->() { return (T *)bufPtr; } - T& operator[](int i) { return ((T *)bufPtr)[i]; } + T &operator[](int i) { return ((T *)bufPtr)[i]; } }; ////////////////////////////////////////////////////////////////////// |