Commit 2f567e53 authored by Mark Olesen's avatar Mark Olesen
Browse files

COMP: silence some compiler warnings/errors

- catch (value)
- forward declarations for operator<<()
- non-const access to Reaction name()
- spurious return statement
parent 272e09b0
......@@ -510,19 +510,6 @@ public:
return *this;
}
friend Ostream& operator<<
(
Ostream& os,
const InfoProxy<bitSet>& info
);
friend Ostream& operator<<
(
Ostream& os,
const bitSet& bitset
);
// Housekeeping
//- Identical to toc()
......@@ -533,6 +520,10 @@ public:
// Global Operators
//
Ostream& operator<<(Ostream& os, const InfoProxy<bitSet>& info);
Ostream& operator<<(Ostream& os, const bitSet& bitset);
//- Bitwise-AND of two bitsets.
// See bitSet::operator&= for more details.
......
......@@ -107,7 +107,7 @@ void Foam::bitSet::writeEntry
}
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Ostream Operators * * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const bitSet& bitset)
{
......
......@@ -197,7 +197,6 @@ inline void Foam::PtrDynList<T, SizeMin>::shrink()
PtrList<T>::resize(capacity_);
PtrList<T>::size(nextFree);
}
return *this;
}
......
......@@ -170,7 +170,7 @@ void Foam::IFstream::rewind()
{
gzPtr = dynamic_cast<igzstream*>(allocatedPtr_);
}
catch (std::bad_cast)
catch (std::bad_cast&)
{
gzPtr = nullptr;
}
......
......@@ -88,7 +88,7 @@ inline To& dynamicCast(From& r)
{
return dynamic_cast<To&>(r);
}
catch (std::bad_cast)
catch (std::bad_cast&)
{
FatalErrorInFunction
<< "Attempt to cast type " << typeid(r).name()
......@@ -109,7 +109,7 @@ inline To& refCast(From& r)
{
return dynamic_cast<To&>(r);
}
catch (std::bad_cast)
catch (std::bad_cast&)
{
FatalErrorInFunction
<< "Attempt to cast type " << r.type()
......
......@@ -55,6 +55,8 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
class faMesh;
class faBoundaryMesh;
Ostream& operator<<(Ostream&, const faBoundaryMesh&);
/*---------------------------------------------------------------------------*\
Class faBoundaryMesh Declaration
......
......@@ -56,6 +56,8 @@ namespace Foam
{
class faBoundaryMesh;
class faPatch;
Ostream& operator<<(Ostream&, const faPatch&);
/*---------------------------------------------------------------------------*\
Class faPatch Declaration
......@@ -91,10 +93,10 @@ private:
// Private Member Functions
//- Disallow construct as copy
//- No copy construct
faPatch(const faPatch&) = delete;
//- Disallow assignment
//- No copy assignment
void operator=(const faPatch&) = delete;
......
......@@ -104,12 +104,13 @@ class loopControl
//- Execute specified function names
bool checkConverged() const;
//- Disallow default bitwise copy construct
//- No copy construct
loopControl(const loopControl&) = delete;
//- Disallow default bitwise assignment
//- No copy assignment
void operator=(const loopControl&) = delete;
protected:
// Protected data
......@@ -206,18 +207,15 @@ public:
// }
// \endcode
bool loop();
// IOstream operators
//- Write name and state (on/off, index/total) to Ostream
friend Ostream& operator<<(Ostream& os, const loopControl& ctrl);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Write name and state (on/off, index/total) to Ostream
Ostream& operator<<(Ostream& os, const loopControl& ctrl);
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -149,8 +149,8 @@ private:
//- Construct reaction thermo
void setThermo(const HashPtrTable<ReactionThermo>& thermoDatabase);
//- Disallow default bitwise assignment
void operator=(const Reaction<ReactionThermo>&);
//- No copy assignment
void operator=(const Reaction<ReactionThermo>&) = delete;
//- Return new reaction ID for un-named reactions
label getNewReactionID();
......@@ -244,7 +244,6 @@ public:
// Access
inline word& name();
inline const word& name() const;
// - Access to basic components of the reaction
......
......@@ -32,13 +32,6 @@ namespace Foam
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ReactionThermo>
inline word& Reaction<ReactionThermo>::name()
{
return name_;
}
template<class ReactionThermo>
inline const word& Reaction<ReactionThermo>::name() const
{
......
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