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
This commit is contained in:
Steve Reinhardt 2004-02-02 15:55:35 -08:00
parent 956aff1291
commit 548b4a1cb0
12 changed files with 33 additions and 33 deletions

View file

@ -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

View file

@ -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);

View file

@ -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);

View file

@ -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); }

View file

@ -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); }
};
/**

View file

@ -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;

View file

@ -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)

View file

@ -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);

View file

@ -227,7 +227,7 @@ class SimpleCPU : public BaseCPU
virtual void unserialize(Checkpoint *cp, const std::string &section);
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,

View file

@ -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 &param)
{
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 &section,
const std::string &name, T& param)
const std::string &name, T &param)
{
std::string str;
if (!cp->find(section, name, str) || !parseParam(str, param)) {

View file

@ -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 &param);
template <class T>
void paramIn(Checkpoint *cp, const std::string &section,
const std::string &name, T& param);
const std::string &name, T &param);
template <class T>
void arrayParamOut(std::ostream &os, const std::string &name,

View file

@ -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]; }
};
//////////////////////////////////////////////////////////////////////