diff --git a/src/foam/containers/LinkedLists/accessTypes/ILList/ILList.C b/src/foam/containers/LinkedLists/accessTypes/ILList/ILList.C index 9711d8ce7..4fe948799 100644 --- a/src/foam/containers/LinkedLists/accessTypes/ILList/ILList.C +++ b/src/foam/containers/LinkedLists/accessTypes/ILList/ILList.C @@ -44,7 +44,6 @@ Foam::ILList::ILList(const ILList& lst) } -#ifndef __INTEL_COMPILER template template Foam::ILList::ILList @@ -65,7 +64,6 @@ Foam::ILList::ILList this->append(iter().clone(cloneArg).ptr()); } } -#endif // * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * // @@ -114,7 +112,7 @@ template void Foam::ILList::clear() { label oldSize = this->size(); - for (label i=0; i { - // Private member functions + // Private Member Functions //- Read from Istream using given Istream constructor class template @@ -95,34 +95,15 @@ public: //- Copy constructor with additional argument for clone template - ILList(const ILList& lst, const CloneArg& cloneArg) - #ifdef __INTEL_COMPILER - : - UILList() - { - for - ( - typename UILList::const_iterator iter = - lst.begin(); - iter != lst.end(); - ++iter - ) - { - append(iter().clone(cloneArg).ptr()); - } - } - #else - ; - #endif + ILList(const ILList& lst, const CloneArg& cloneArg); //- Construct from Istream using given Istream constructor class template ILList(Istream&, const INew&); - // Destructor - - ~ILList(); + //- Destructor + ~ILList(); // Member Functions @@ -139,7 +120,7 @@ public: void clear(); //- Transfer the contents of the argument into this List - // and annull the argument list. + // and annul the argument list. void transfer(ILList&); diff --git a/src/foam/containers/LinkedLists/accessTypes/ILList/ILListIO.C b/src/foam/containers/LinkedLists/accessTypes/ILList/ILListIO.C index 0d408b1cb..62c02e3f0 100644 --- a/src/foam/containers/LinkedLists/accessTypes/ILList/ILListIO.C +++ b/src/foam/containers/LinkedLists/accessTypes/ILList/ILListIO.C @@ -21,8 +21,6 @@ License You should have received a copy of the GNU General Public License along with foam-extend. If not, see . -Description - \*---------------------------------------------------------------------------*/ #include "ILList.H" @@ -55,7 +53,7 @@ void Foam::ILList::read(Istream& is, const INew& iNew) { if (delimiter == token::BEGIN_LIST) { - for (label i=0; iappend(iNew(is).ptr()); @@ -77,7 +75,7 @@ void Foam::ILList::read(Istream& is, const INew& iNew) "reading entry" ); - for (label i=1; iappend(new T(*tPtr)); } @@ -133,14 +131,14 @@ template template Foam::ILList::ILList(Istream& is, const INew& iNew) { - read(is, iNew); + this->read(is, iNew); } template Foam::ILList::ILList(Istream& is) { - read(is, INew()); + this->read(is, INew()); } @@ -156,6 +154,4 @@ Foam::Istream& Foam::operator>>(Istream& is, ILList& L) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - // ************************************************************************* // diff --git a/src/foam/containers/LinkedLists/accessTypes/LList/LList.C b/src/foam/containers/LinkedLists/accessTypes/LList/LList.C index a30131b90..ab9e794ed 100644 --- a/src/foam/containers/LinkedLists/accessTypes/LList/LList.C +++ b/src/foam/containers/LinkedLists/accessTypes/LList/LList.C @@ -37,7 +37,7 @@ Foam::LList::LList(const LList& lst) { for (const_iterator iter = lst.begin(); iter != lst.end(); ++iter) { - append(iter()); + this->append(iter()); } } @@ -55,9 +55,9 @@ template void Foam::LList::clear() { label oldSize = this->size(); - for (label i=0; iremoveHead(); } LListBase::clear(); @@ -81,7 +81,7 @@ void Foam::LList::operator=(const LList& lst) for (const_iterator iter = lst.begin(); iter != lst.end(); ++iter) { - append(iter()); + this->append(iter()); } } diff --git a/src/foam/containers/LinkedLists/accessTypes/LList/LList.H b/src/foam/containers/LinkedLists/accessTypes/LList/LList.H index f68b94c16..dbbf7e13e 100644 --- a/src/foam/containers/LinkedLists/accessTypes/LList/LList.H +++ b/src/foam/containers/LinkedLists/accessTypes/LList/LList.H @@ -122,9 +122,8 @@ public: LList(const LList&); - // Destructor - - ~LList(); + //- Destructor + ~LList(); // Member Functions @@ -201,9 +200,10 @@ public: void clear(); //- Transfer the contents of the argument into this List - // and annull the argument list. + // and annul the argument list. void transfer(LList&); + // Member operators void operator=(const LList&); @@ -239,10 +239,7 @@ public: public: //- Construct from base iterator - iterator - ( - LListBase_iterator baseIter - ) + iterator(LListBase_iterator baseIter) : LListBase_iterator(baseIter) {} @@ -283,20 +280,14 @@ public: public: //- Construct from base const_iterator - const_iterator - ( - LListBase_const_iterator baseIter - ) + const_iterator(LListBase_const_iterator baseIter) : LListBase_const_iterator(baseIter) {} //- Construct from base iterator - const_iterator - ( - LListBase_iterator baseIter - ) + const_iterator(LListBase_iterator baseIter) : LListBase_const_iterator(baseIter) {} diff --git a/src/foam/containers/LinkedLists/accessTypes/LList/LListIO.C b/src/foam/containers/LinkedLists/accessTypes/LList/LListIO.C index 92fb69256..1f47964fc 100644 --- a/src/foam/containers/LinkedLists/accessTypes/LList/LListIO.C +++ b/src/foam/containers/LinkedLists/accessTypes/LList/LListIO.C @@ -66,7 +66,7 @@ Foam::Istream& Foam::operator>>(Istream& is, LList& L) { if (delimiter == token::BEGIN_LIST) { - for (register label i=0; i> element; @@ -78,7 +78,7 @@ Foam::Istream& Foam::operator>>(Istream& is, LList& L) T element; is >> element; - for (register label i=0; i::LPtrList(const LPtrList& lst) { for (const_iterator iter = lst.begin(); iter != lst.end(); ++iter) { - append(iter().clone().ptr()); + this->append(iter().clone().ptr()); } } @@ -44,7 +44,7 @@ Foam::LPtrList::LPtrList(const LPtrList& lst) template Foam::LPtrList::~LPtrList() { - clear(); + this->clear(); } @@ -69,8 +69,8 @@ bool Foam::LPtrList::eraseHead() template void Foam::LPtrList::clear() { - label oldSize = this->size(); - for (label i=0; isize(); + for (label i=0; i::operator=(const LPtrList& lst) for (const_iterator iter = lst.begin(); iter != lst.end(); ++iter) { - append(iter().clone().ptr()); + this->append(iter().clone().ptr()); } } diff --git a/src/foam/containers/LinkedLists/accessTypes/LPtrList/LPtrList.H b/src/foam/containers/LinkedLists/accessTypes/LPtrList/LPtrList.H index 6d5f6d659..b6b6fdbb1 100644 --- a/src/foam/containers/LinkedLists/accessTypes/LPtrList/LPtrList.H +++ b/src/foam/containers/LinkedLists/accessTypes/LPtrList/LPtrList.H @@ -71,11 +71,11 @@ class LPtrList : public LList { - // Private member functions + // Private Member Functions //- Read from Istream using given Istream constructor class template - void read(Istream&, const INew& inewt); + void read(Istream&, const INew&); public: @@ -112,9 +112,8 @@ public: LPtrList(const LPtrList&); - // Destructor - - ~LPtrList(); + //- Destructor + ~LPtrList(); // Member Functions @@ -155,7 +154,7 @@ public: void clear(); //- Transfer the contents of the argument into this List - // and annull the argument list. + // and annul the argument list. void transfer(LPtrList&); @@ -189,10 +188,7 @@ public: public: //- Construct from base iterator - iterator - ( - LListBase_iterator baseIter - ) + iterator(LListBase_iterator baseIter) : LList::iterator(baseIter) {} @@ -225,19 +221,13 @@ public: public: //- Construct from base const_iterator - const_iterator - ( - LListBase_const_iterator baseIter - ) + const_iterator(LListBase_const_iterator baseIter) : LList::const_iterator(baseIter) {} //- Construct from base iterator - const_iterator - ( - LListBase_iterator baseIter - ) + const_iterator(LListBase_iterator baseIter) : LList::const_iterator(baseIter) {} diff --git a/src/foam/containers/LinkedLists/accessTypes/LPtrList/LPtrListIO.C b/src/foam/containers/LinkedLists/accessTypes/LPtrList/LPtrListIO.C index 799aebfd7..171cb1d68 100644 --- a/src/foam/containers/LinkedLists/accessTypes/LPtrList/LPtrListIO.C +++ b/src/foam/containers/LinkedLists/accessTypes/LPtrList/LPtrListIO.C @@ -58,7 +58,7 @@ void Foam::LPtrList::read(Istream& is, const INew& iNew) { if (delimiter == token::BEGIN_LIST) { - for (label i=0; iappend(iNew(is).ptr()); @@ -80,7 +80,7 @@ void Foam::LPtrList::read(Istream& is, const INew& iNew) "reading entry" ); - for (label i=1; iappend(tPtr->clone().ptr()); } diff --git a/src/foam/containers/LinkedLists/accessTypes/UILList/UILList.C b/src/foam/containers/LinkedLists/accessTypes/UILList/UILList.C index 975054a35..5b1585182 100644 --- a/src/foam/containers/LinkedLists/accessTypes/UILList/UILList.C +++ b/src/foam/containers/LinkedLists/accessTypes/UILList/UILList.C @@ -34,7 +34,7 @@ Foam::UILList::UILList(const UILList& lst) { for (const_iterator iter = lst.begin(); iter != lst.end(); ++iter) { - append(&iter()); + this->append(&iter()); } } @@ -48,7 +48,7 @@ void Foam::UILList::operator=(const UILList& rhs) for (const_iterator iter = rhs.begin(); iter != rhs.end(); ++iter) { - append(&iter()); + this->append(&iter()); } } diff --git a/src/foam/containers/LinkedLists/accessTypes/UILList/UILList.H b/src/foam/containers/LinkedLists/accessTypes/UILList/UILList.H index 66b695f52..f83d73e8a 100644 --- a/src/foam/containers/LinkedLists/accessTypes/UILList/UILList.H +++ b/src/foam/containers/LinkedLists/accessTypes/UILList/UILList.H @@ -181,10 +181,7 @@ public: public: //- Construct from base iterator - iterator - ( - LListBase_iterator baseIter - ) + iterator(LListBase_iterator baseIter) : LListBase_iterator(baseIter) {} @@ -223,19 +220,13 @@ public: public: //- Construct from base const_iterator - const_iterator - ( - LListBase_const_iterator baseIter - ) + const_iterator(LListBase_const_iterator baseIter) : LListBase_const_iterator(baseIter) {} //- Construct from base iterator - const_iterator - ( - LListBase_iterator baseIter - ) + const_iterator(LListBase_iterator baseIter) : LListBase_const_iterator(baseIter) {} diff --git a/src/foam/containers/LinkedLists/linkTypes/DLListBase/DLListBase.C b/src/foam/containers/LinkedLists/linkTypes/DLListBase/DLListBase.C index 535859e38..4431e55d4 100644 --- a/src/foam/containers/LinkedLists/linkTypes/DLListBase/DLListBase.C +++ b/src/foam/containers/LinkedLists/linkTypes/DLListBase/DLListBase.C @@ -94,23 +94,23 @@ bool Foam::DLListBase::swapUp(DLListBase::link* a) if (ap == first_) { first_ = a; + ap->prev_ = a; + } + else + { + ap->prev_->next_ = a; } if (a == last_) { last_ = ap; + a->next_ = ap; } - - if (a->next_) + else { a->next_->prev_ = ap; } - if (ap->prev_) - { - ap->prev_->next_ = a; - } - a->prev_ = ap->prev_; ap->prev_ = a; @@ -135,19 +135,19 @@ bool Foam::DLListBase::swapDown(DLListBase::link* a) if (a == first_) { first_ = an; + a->prev_ = an; + } + else + { + a->prev_->next_ = an; } if (an == last_) { last_ = a; + an->next_ = a; } - - if (a->prev_) - { - a->prev_->next_ = an; - } - - if (an->next_) + else { an->next_->prev_ = a; } diff --git a/src/foam/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H b/src/foam/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H index 9f466e9bf..567afba8f 100644 --- a/src/foam/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H +++ b/src/foam/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H @@ -81,7 +81,7 @@ private: label nElmts_; - // Private member functions + // Private Member Functions //- Disallow default bitwise copy construct DLListBase(const DLListBase&); @@ -110,9 +110,8 @@ public: inline DLListBase(link*); - // Destructor - - ~DLListBase(); + //- Destructor + ~DLListBase(); // Member Functions @@ -171,7 +170,7 @@ public: inline void clear(); //- Transfer the contents of the argument into this List - // and annull the argument list. + // and annul the argument list. inline void transfer(DLListBase&); // STL iterator @@ -263,7 +262,7 @@ public: private: - //- iterator returned by end() + //- Iterator returned by end() static iterator endIter_; //- const_iterator returned by end() diff --git a/src/foam/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H b/src/foam/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H index bfa316745..f96ede33c 100644 --- a/src/foam/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H +++ b/src/foam/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H @@ -78,7 +78,7 @@ private: //- Number of elements in in list label nElmts_; - // Private member functions + // Private Member Functions //- Disallow default bitwise copy construct SLListBase(const SLListBase&); @@ -107,9 +107,8 @@ public: inline SLListBase(link*); - // Destructor - - ~SLListBase(); + //- Destructor + ~SLListBase(); // Member Functions @@ -156,7 +155,7 @@ public: inline void clear(); //- Transfer the contents of the argument into this List - // and annull the argument list. + // and annul the argument list. inline void transfer(SLListBase&); // STL iterator @@ -250,7 +249,7 @@ public: private: - //- iterator returned by end() + //- Iterator returned by end() static iterator endIter_; //- const_iterator returned by end() diff --git a/src/foam/containers/LinkedLists/user/SLList.H b/src/foam/containers/LinkedLists/user/SLList.H index e1d1d84dc..2a302e719 100644 --- a/src/foam/containers/LinkedLists/user/SLList.H +++ b/src/foam/containers/LinkedLists/user/SLList.H @@ -65,7 +65,7 @@ public: {} //- Construct from Istream - SLList(Istream& is) + explicit SLList(Istream& is) : LList(is) {}