From 1efdd657bd29b1fa3d5da7669a741f295cba4b13 Mon Sep 17 00:00:00 2001 From: henry Date: Tue, 17 Jun 2008 22:17:36 +0100 Subject: [PATCH] Updates to remove warning messages from gcc-4.3.1 --- .../multiphaseMixture/multiphaseMixture.H | 6 +-- .../containers/Lists/PtrList/PtrList.C | 42 +++++++++---------- .../fvMeshDistributeTemplates.C | 6 +-- ...aceSlipDisplacementPointPatchVectorField.H | 2 +- .../bufferedAccumulator/bufferedAccumulator.H | 2 +- .../bufferedAccumulatorI.H | 2 +- .../correlationFunction/correlationFunction.H | 8 ++-- .../correlationFunctionI.H | 8 ++-- .../molecule/distribution/distribution.H | 10 ++--- .../molecule/distribution/distributionI.H | 9 +--- src/lagrangian/molecule/molecule/molecule.H | 8 ++-- src/lagrangian/molecule/molecule/moleculeI.H | 39 +++++++---------- .../molecule/moleculeCloud/moleculeCloud.H | 4 +- .../molecule/moleculeCloud/moleculeCloudI.H | 4 +- .../pairPotential/basic/pairPotential.H | 16 +++---- .../pairPotential/basic/pairPotentialI.H | 16 +++---- .../pairPotential/basic/pairPotentialList.C | 4 +- .../pairPotential/basic/pairPotentialList.H | 4 +- 18 files changed, 86 insertions(+), 104 deletions(-) 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