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