Updates to remove warning messages from gcc-4.3.1

This commit is contained in:
h.weller@opencfd.co.uk
2008-06-17 22:17:36 +01:00
committed by graham
parent 604527dc5e
commit ddbb9c0619
4 changed files with 26 additions and 30 deletions

View File

@ -123,8 +123,8 @@ public:
{ {
return return
( (
(a.first() == b.first()) && (a.second() == b.second()) ((a.first() == b.first()) && (a.second() == b.second()))
|| (a.first() == b.second()) && (a.second() == b.first()) || ((a.first() == b.second()) && (a.second() == b.first()))
); );
} }
@ -143,7 +143,7 @@ private:
// Private data // Private data
//- Dictionary of phases //- Dictionary of phases
PtrDictionary<phase> phases_; PtrDictionary<phase> phases_;
//- The phase chosen as reference, the one which is derived from //- The phase chosen as reference, the one which is derived from

View File

@ -30,29 +30,24 @@ License
#include "PtrListLoopM.H" #include "PtrListLoopM.H"
#include "SLPtrList.H" #include "SLPtrList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
template<class T> template<class T>
PtrList<T>::PtrList() Foam::PtrList<T>::PtrList()
: :
ptrs_() ptrs_()
{} {}
template<class T> template<class T>
PtrList<T>::PtrList(const label s) Foam::PtrList<T>::PtrList(const label s)
: :
ptrs_(s, reinterpret_cast<T*>(NULL)) ptrs_(s, reinterpret_cast<T*>(NULL))
{} {}
template<class T> template<class T>
PtrList<T>::PtrList(const PtrList<T>& a) Foam::PtrList<T>::PtrList(const PtrList<T>& a)
: :
ptrs_(a.size()) ptrs_(a.size())
{ {
@ -65,7 +60,7 @@ PtrList<T>::PtrList(const PtrList<T>& a)
template<class T> template<class T>
template<class CloneArg> template<class CloneArg>
PtrList<T>::PtrList(const PtrList<T>& a, const CloneArg& cloneArg) Foam::PtrList<T>::PtrList(const PtrList<T>& a, const CloneArg& cloneArg)
: :
ptrs_(a.size()) ptrs_(a.size())
{ {
@ -77,7 +72,7 @@ PtrList<T>::PtrList(const PtrList<T>& a, const CloneArg& cloneArg)
template<class T> template<class T>
PtrList<T>::PtrList(PtrList<T>& a, bool reUse) Foam::PtrList<T>::PtrList(PtrList<T>& a, bool reUse)
: :
ptrs_(a.size()) ptrs_(a.size())
{ {
@ -101,7 +96,7 @@ PtrList<T>::PtrList(PtrList<T>& a, bool reUse)
template<class T> template<class T>
PtrList<T>::PtrList(const SLPtrList<T>& sll) Foam::PtrList<T>::PtrList(const SLPtrList<T>& sll)
: :
ptrs_(sll.size()) ptrs_(sll.size())
{ {
@ -124,7 +119,7 @@ PtrList<T>::PtrList(const SLPtrList<T>& sll)
// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
template<class T> template<class T>
PtrList<T>::~PtrList() Foam::PtrList<T>::~PtrList()
{ {
forAll(*this, i) forAll(*this, i)
{ {
@ -139,8 +134,15 @@ PtrList<T>::~PtrList()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class T> template<class T>
void PtrList<T>::setSize(const label newSize) void Foam::PtrList<T>::setSize(const label newSize)
{ {
if (newSize < 0)
{
FatalErrorIn("PtrList<T>::setSize(const label)")
<< "bad set size " << newSize
<< abort(FatalError);
}
label oldSize = size(); label oldSize = size();
if (newSize == 0) if (newSize == 0)
@ -160,7 +162,7 @@ void PtrList<T>::setSize(const label newSize)
ptrs_.setSize(newSize); ptrs_.setSize(newSize);
} }
else if (newSize > oldSize) else // newSize > oldSize
{ {
ptrs_.setSize(newSize); ptrs_.setSize(newSize);
@ -174,7 +176,7 @@ void PtrList<T>::setSize(const label newSize)
template<class T> template<class T>
void PtrList<T>::clear() void Foam::PtrList<T>::clear()
{ {
forAll(*this, i) forAll(*this, i)
{ {
@ -189,7 +191,7 @@ void PtrList<T>::clear()
template<class T> template<class T>
void PtrList<T>::transfer(PtrList<T>& a) void Foam::PtrList<T>::transfer(PtrList<T>& a)
{ {
clear(); clear();
ptrs_.transfer(a.ptrs_); ptrs_.transfer(a.ptrs_);
@ -197,7 +199,7 @@ void PtrList<T>::transfer(PtrList<T>& a)
template<class T> template<class T>
void PtrList<T>::reorder(const UList<label>& oldToNew) void Foam::PtrList<T>::reorder(const UList<label>& oldToNew)
{ {
if (oldToNew.size() != size()) if (oldToNew.size() != size())
{ {
@ -247,7 +249,7 @@ void PtrList<T>::reorder(const UList<label>& oldToNew)
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class T> template<class T>
PtrList<T>& PtrList<T>::operator=(const PtrList<T>& a) Foam::PtrList<T>& Foam::PtrList<T>::operator=(const PtrList<T>& a)
{ {
if (this == &a) if (this == &a)
{ {
@ -284,10 +286,6 @@ PtrList<T>& PtrList<T>::operator=(const PtrList<T>& a)
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "PtrListIO.C" #include "PtrListIO.C"

View File

@ -85,7 +85,7 @@ void Foam::fvMeshDistribute::addPatchFields(const word& patchFieldType)
); );
label sz = bfld.size(); label sz = bfld.size();
bfld.setSize(sz+1); bfld.setSize(sz + 1);
bfld.set bfld.set
( (
sz, sz,
@ -124,10 +124,8 @@ void Foam::fvMeshDistribute::deleteTrailingPatchFields()
fld.boundaryField() fld.boundaryField()
); );
label sz = bfld.size();
// Shrink patchFields // Shrink patchFields
bfld.setSize(sz-1); bfld.setSize(bfld.size() - 1);
} }
} }

View File

@ -196,7 +196,7 @@ public:
const triSurfaceMeshes& surfaces() const; const triSurfaceMeshes& surfaces() const;
//- Mode of projection/following //- Mode of projection/following
const followMode projectMode() const followMode projectMode() const
{ {
return projectMode_; return projectMode_;
} }