diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H index 6a5fa9e8c2..95ff5d327a 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H @@ -123,8 +123,8 @@ public: { return ( - (a.first() == b.first()) && (a.second() == b.second()) - || (a.first() == b.second()) && (a.second() == b.first()) + ((a.first() == b.first()) && (a.second() == b.second())) + || ((a.first() == b.second()) && (a.second() == b.first())) ); } @@ -143,7 +143,7 @@ private: // Private data - //- Dictionary of phases + //- Dictionary of phases PtrDictionary phases_; //- The phase chosen as reference, the one which is derived from diff --git a/src/OpenFOAM/containers/Lists/PtrList/PtrList.C b/src/OpenFOAM/containers/Lists/PtrList/PtrList.C index 2f4e617f05..c36656b33c 100644 --- a/src/OpenFOAM/containers/Lists/PtrList/PtrList.C +++ b/src/OpenFOAM/containers/Lists/PtrList/PtrList.C @@ -30,29 +30,24 @@ License #include "PtrListLoopM.H" #include "SLPtrList.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * // template -PtrList::PtrList() +Foam::PtrList::PtrList() : ptrs_() {} template -PtrList::PtrList(const label s) +Foam::PtrList::PtrList(const label s) : ptrs_(s, reinterpret_cast(NULL)) {} template -PtrList::PtrList(const PtrList& a) +Foam::PtrList::PtrList(const PtrList& a) : ptrs_(a.size()) { @@ -65,7 +60,7 @@ PtrList::PtrList(const PtrList& a) template template -PtrList::PtrList(const PtrList& a, const CloneArg& cloneArg) +Foam::PtrList::PtrList(const PtrList& a, const CloneArg& cloneArg) : ptrs_(a.size()) { @@ -77,7 +72,7 @@ PtrList::PtrList(const PtrList& a, const CloneArg& cloneArg) template -PtrList::PtrList(PtrList& a, bool reUse) +Foam::PtrList::PtrList(PtrList& a, bool reUse) : ptrs_(a.size()) { @@ -101,7 +96,7 @@ PtrList::PtrList(PtrList& a, bool reUse) template -PtrList::PtrList(const SLPtrList& sll) +Foam::PtrList::PtrList(const SLPtrList& sll) : ptrs_(sll.size()) { @@ -124,7 +119,7 @@ PtrList::PtrList(const SLPtrList& sll) // * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * // template -PtrList::~PtrList() +Foam::PtrList::~PtrList() { forAll(*this, i) { @@ -139,8 +134,15 @@ PtrList::~PtrList() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void PtrList::setSize(const label newSize) +void Foam::PtrList::setSize(const label newSize) { + if (newSize < 0) + { + FatalErrorIn("PtrList::setSize(const label)") + << "bad set size " << newSize + << abort(FatalError); + } + label oldSize = size(); if (newSize == 0) @@ -160,7 +162,7 @@ void PtrList::setSize(const label newSize) ptrs_.setSize(newSize); } - else if (newSize > oldSize) + else // newSize > oldSize { ptrs_.setSize(newSize); @@ -174,7 +176,7 @@ void PtrList::setSize(const label newSize) template -void PtrList::clear() +void Foam::PtrList::clear() { forAll(*this, i) { @@ -189,7 +191,7 @@ void PtrList::clear() template -void PtrList::transfer(PtrList& a) +void Foam::PtrList::transfer(PtrList& a) { clear(); ptrs_.transfer(a.ptrs_); @@ -197,7 +199,7 @@ void PtrList::transfer(PtrList& a) template -void PtrList::reorder(const UList