diff --git a/src/OpenFOAM/containers/Lists/UList/UList.H b/src/OpenFOAM/containers/Lists/UList/UList.H index 719df10a0f00cf28afdb2549d7a1e8359510189c..a31416cc7374a5f520a486c099b003c163ea49a6 100644 --- a/src/OpenFOAM/containers/Lists/UList/UList.H +++ b/src/OpenFOAM/containers/Lists/UList/UList.H @@ -427,7 +427,7 @@ inline void reverse(UList<T>&); // \endcode // \sa forAllReverse #define forAll(list, i) \ - for (Foam::label i=0; i<(list).size(); i++) + for (Foam::label i=0; i<(list).size(); ++i) //- Reverse loop across all elements in \a list // \par Usage @@ -439,7 +439,7 @@ inline void reverse(UList<T>&); // \endcode // \sa forAll #define forAllReverse(list, i) \ - for (Foam::label i=(list).size()-1; i>=0; i--) + for (Foam::label i=(list).size()-1; i>=0; --i) //- Iterate across all elements in the \a container object of type // \a Container. @@ -472,8 +472,8 @@ inline void reverse(UList<T>&); #define forAllConstIter(Container,container,iter) \ for \ ( \ - Container::const_iterator iter = (container).begin(); \ - iter != (container).end(); \ + Container::const_iterator iter = (container).cbegin(); \ + iter != (container).cend(); \ ++iter \ ) diff --git a/src/OpenFOAM/containers/Lists/UList/UListI.H b/src/OpenFOAM/containers/Lists/UList/UListI.H index 0e4825c79c85f578c3bfcaeedcdcce01ab316712..bd9fe339ebd7697b2924fbeee98390439615958b 100644 --- a/src/OpenFOAM/containers/Lists/UList/UListI.H +++ b/src/OpenFOAM/containers/Lists/UList/UListI.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,7 +33,7 @@ template<class T> inline Foam::UList<T>::UList() : size_(0), - v_(0) + v_(nullptr) {} @@ -321,7 +321,7 @@ inline bool Foam::UList<T>::empty() const template<class T> inline void Foam::reverse(UList<T>& ul, const label n) { - for (int i=0; i<n/2; i++) + for (int i=0; i<n/2; ++i) { Swap(ul[i], ul[n-1-i]); }