Commit 278e8c50 authored by henry's avatar henry
Browse files

Converted constant reference to primitive arguments to constant primitive arguments.

parent 86c3affb
......@@ -220,7 +220,7 @@ void Foam::writeFuns::writePointDataHeader
}
void Foam::writeFuns::insert(const scalar& pt, DynamicList<floatScalar>& dest)
void Foam::writeFuns::insert(const scalar pt, DynamicList<floatScalar>& dest)
{
dest.append(float(pt));
}
......
......@@ -86,7 +86,7 @@ public:
// Convert to VTK and store
static void insert(const scalar&, DynamicList<floatScalar>&);
static void insert(const scalar, DynamicList<floatScalar>&);
static void insert(const point&, DynamicList<floatScalar>&);
static void insert(const sphericalTensor&, DynamicList<floatScalar>&);
static void insert(const symmTensor&, DynamicList<floatScalar>&);
......
......@@ -42,7 +42,7 @@ Foam::scalarRange::scalarRange()
{}
Foam::scalarRange::scalarRange(const scalar& lower, const scalar& upper)
Foam::scalarRange::scalarRange(const scalar lower, const scalar upper)
:
type_(RANGE),
value_(lower),
......@@ -123,7 +123,7 @@ Foam::scalar Foam::scalarRange::upper() const
}
bool Foam::scalarRange::selected(const scalar& value) const
bool Foam::scalarRange::selected(const scalar value) const
{
switch (type_)
{
......
......@@ -92,7 +92,7 @@ public:
scalarRange();
//- Construct a Range
scalarRange(const scalar& lower, const scalar& upper);
scalarRange(const scalar lower, const scalar upper);
//- Construct from Istream.
// Since commas can be used as list delimiters,
......@@ -119,7 +119,7 @@ public:
scalar upper() const;
//- Return true if the value is within the range
bool selected(const scalar&) const;
bool selected(const scalar) const;
// Member Operators
......
......@@ -57,7 +57,7 @@ Foam::scalarRanges::scalarRanges(Istream& is)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::scalarRanges::selected(const scalar& value) const
bool Foam::scalarRanges::selected(const scalar value) const
{
forAll(*this, i)
{
......
......@@ -66,7 +66,7 @@ public:
// Member Functions
//- Return true if the given value is within the ranges
bool selected(const scalar&) const;
bool selected(const scalar) const;
//- Return the set of selected entries in the given list
// that are within the ranges
......
......@@ -45,13 +45,13 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Conversion from degrees to radians
inline scalar degToRad(const scalar& deg)
inline scalar degToRad(const scalar deg)
{
return (deg*pi/180.0);
}
//- Conversion from radians to degrees
inline scalar radToDeg(const scalar& rad)
inline scalar radToDeg(const scalar rad)
{
return (rad*180.0/pi);
}
......
......@@ -76,7 +76,7 @@ public:
{}
//- Construct from components
objectHit(const bool success, const label& obj)
objectHit(const bool success, const label obj)
:
hit_(success),
hitObject_(obj)
......@@ -111,7 +111,7 @@ public:
{
return ((a.hit_ == b.hit_) && (a.hitObject_ == b.hitObject_));
}
friend bool operator!=(const objectHit& a, const objectHit& b)
{
return (!(a == b));
......
......@@ -107,7 +107,7 @@ public:
//- Incrementally hash a label.
// This will necessarily return a different value than the
// non-incremental version.
unsigned operator()(const label& p, unsigned seed) const
unsigned operator()(const label p, unsigned seed) const
{
return Hasher(&p, sizeof(label), seed);
}
......@@ -115,11 +115,10 @@ public:
//- Return the unsigned representation of a label.
// This helps if people have relied on the hash value corresponding to
// the natural order.
unsigned operator()(const label& p) const
unsigned operator()(const label p) const
{
return p;
}
};
......
......@@ -47,8 +47,7 @@ namespace Foam
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// construct given seed
Random::Random(const label& seed)
Random::Random(const label seed)
{
if (seed > 1)
{
......
......@@ -61,7 +61,7 @@ public:
// Constructors
//- Construct given seed
Random(const label&);
Random(const label);
// Member functions
......@@ -70,14 +70,19 @@ public:
//- scalar [0..1] (so including 0,1)
scalar scalar01();
//- vector with every component scalar01
vector vector01();
//- sphericalTensor with every component scalar01
sphericalTensor sphericalTensor01();
//- symmTensor with every component scalar01
symmTensor symmTensor01();
//- tensor with every component scalar01
tensor tensor01();
//- label [lower..upper]
label integer(const label lower, const label upper);
......
......@@ -74,7 +74,7 @@ bool Foam::ensightFile::allowUndef(bool value)
}
Foam::scalar Foam::ensightFile::undefValue(const scalar& value)
Foam::scalar Foam::ensightFile::undefValue(const scalar value)
{
// enable its use too
allowUndef_ = true;
......@@ -133,7 +133,7 @@ Foam::Ostream& Foam::ensightFile::write(const string& value)
}
Foam::Ostream& Foam::ensightFile::write(const label& value)
Foam::Ostream& Foam::ensightFile::write(const label value)
{
if (format() == IOstream::BINARY)
{
......@@ -157,7 +157,7 @@ Foam::Ostream& Foam::ensightFile::write(const label& value)
Foam::Ostream& Foam::ensightFile::write
(
const label& value,
const label value,
const label fieldWidth
)
{
......@@ -181,7 +181,7 @@ Foam::Ostream& Foam::ensightFile::write
}
Foam::Ostream& Foam::ensightFile::write(const scalar& value)
Foam::Ostream& Foam::ensightFile::write(const scalar value)
{
if (format() == IOstream::BINARY)
{
......
......@@ -103,7 +103,7 @@ public:
//- Assign the value to represent undef in the results
// Returns the previous value
// NB: do not use values larger than floatScalarVGREAT
static scalar undefValue(const scalar&);
static scalar undefValue(const scalar);
// Output
......@@ -124,13 +124,13 @@ public:
Ostream& write(const string& value);
//- write integer as "%10d" or as binary
Ostream& write(const label& value);
Ostream& write(const label value);
//- write integer with specified width or as binary
Ostream& write(const label& value, const label fieldWidth);
Ostream& write(const label value, const label fieldWidth);
//- write float as "%12.5e" or as binary
Ostream& write(const scalar& value);
Ostream& write(const scalar value);
//- Add carriage return to ascii stream
void newline();
......
......@@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "cellTable.H"
......@@ -81,7 +79,7 @@ void Foam::cellTable::addDefaults()
void Foam::cellTable::setEntry
(
const label& id,
const label id,
const word& keyWord,
const word& value
)
......@@ -192,7 +190,7 @@ Foam::Map<Foam::word> Foam::cellTable::names
}
Foam::word Foam::cellTable::name(const label& id) const
Foam::word Foam::cellTable::name(const label id) const
{
word theName("cellTable_" + Foam::name(id));
......@@ -289,19 +287,19 @@ Foam::Map<Foam::word> Foam::cellTable::shells() const
void Foam::cellTable::setMaterial(const label& id, const word& matlType)
void Foam::cellTable::setMaterial(const label id, const word& matlType)
{
setEntry(id, "MaterialType", matlType);
}
void Foam::cellTable::setName(const label& id, const word& name)
void Foam::cellTable::setName(const label id, const word& name)
{
setEntry(id, "Label", name);
}
void Foam::cellTable::setName(const label& id)
void Foam::cellTable::setName(const label id)
{
iterator iter = find(id);
......
......@@ -96,7 +96,7 @@ class cellTable
//- Add required entries - MaterialType
void addDefaults();
void setEntry(const label& id, const word& keyWord, const word& value);
void setEntry(const label id, const word& keyWord, const word& value);
//- Disallow default bitwise copy construct
cellTable(const cellTable&);
......@@ -133,7 +133,7 @@ public:
//- Return the name corresponding to id
// returns cellTable_ID if not otherwise defined
word name(const label& id) const;
word name(const label id) const;
//- Return a Map of (id => name)
Map<word> names() const;
......@@ -157,13 +157,13 @@ public:
Map<word> materialTypes() const;
//- Assign material Type
void setMaterial(const label&, const word&);
void setMaterial(const label, const word&);
//- Assign name
void setName(const label&, const word&);
void setName(const label, const word&);
//- Assign default name if not already set
void setName(const label&);
void setName(const label);
//- Read constant/cellTable
void readDict
......
......@@ -1536,7 +1536,7 @@ void Foam::faceCoupleInfo::perfectPointMatch
FatalErrorIn
(
"faceCoupleInfo::perfectPointMatch"
"(const scalar&, const bool)"
"(const scalar, const bool)"
) << "Did not match all of the master faces to the slave faces"
<< endl
<< "This usually means that the slave patch and master patch"
......
......@@ -55,7 +55,7 @@ namespace Foam
class ifEqEqOp
{
public:
void operator()(label& x, const label& y) const
void operator()(label x, const label y) const
{
x = (x==y) ? x : value;
}
......
......@@ -36,7 +36,7 @@ Foam::spline::spline(const pointField& knotPoints)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::spline::B(const scalar& tau) const
Foam::scalar Foam::spline::B(const scalar tau) const
{
if (tau <= -2.0 || tau >= 2.0)
{
......@@ -60,7 +60,7 @@ Foam::scalar Foam::spline::B(const scalar& tau) const
}
else
{
FatalErrorIn("spline::B(const scalar&)")
FatalErrorIn("spline::B(const scalar)")
<< "Programming error???, "
<< "tau = " << tau
<< abort(FatalError);
......
......@@ -59,7 +59,7 @@ class spline
// Private Member Functions
//- Blending function for constructing spline
scalar B(const scalar&) const;
scalar B(const scalar) const;
//- Disallow default bitwise copy construct
spline(const spline&);
......
......@@ -158,10 +158,6 @@ public:
static const FixedList<vector, 6> faceNormals;
//- Face on which neighbour is
static direction neighbourFaceBits(const label&);
// Constructors
//- Construct null setting points to zero
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment