mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0031671: Coding Rules - eliminate warnings issued by clang 11
Fixed -Wdeprecated-copy warning by removing trivial operator=. Fixed formatting issues in places producing -Wmisleading-indentation warning.
This commit is contained in:
@@ -66,23 +66,13 @@ public:
|
||||
// ******** More
|
||||
Standard_Boolean More (void) const
|
||||
{ return (myCurrent!=NULL); }
|
||||
// ******** Assignment operator
|
||||
Iterator& operator= (const Iterator& theIt)
|
||||
{
|
||||
if (&theIt != this)
|
||||
{
|
||||
myCurrent = theIt.myCurrent;
|
||||
myPrevious = theIt.myPrevious;
|
||||
}
|
||||
return * this;
|
||||
}
|
||||
//skt----------------------------------------------------
|
||||
|
||||
// ******** Comparison operator
|
||||
Standard_Boolean operator== (const Iterator& theIt) const
|
||||
{
|
||||
return myCurrent == theIt.myCurrent;
|
||||
}
|
||||
//-------------------------------------------------------
|
||||
|
||||
//! Performs comparison of two iterators
|
||||
Standard_Boolean IsEqual (const Iterator& theOther) const
|
||||
{
|
||||
|
@@ -75,13 +75,6 @@ public:
|
||||
myPrevious = (isStart ? NULL : theSeq.myLastItem);
|
||||
}
|
||||
|
||||
//! Assignment
|
||||
Iterator& operator = (const Iterator& theOther)
|
||||
{
|
||||
myCurrent = theOther.myCurrent;
|
||||
myPrevious = theOther.myPrevious;
|
||||
return *this;
|
||||
}
|
||||
//! Switch to previous element; note that it will reset
|
||||
void Previous()
|
||||
{
|
||||
|
@@ -14,23 +14,10 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <NCollection_BaseVector.hxx>
|
||||
|
||||
#include <Standard_RangeError.hxx>
|
||||
#include <cstdlib>
|
||||
|
||||
//=======================================================================
|
||||
//function : NCollection_BaseVector::Iterator::copyV
|
||||
//purpose : Copy from another iterator
|
||||
//=======================================================================
|
||||
|
||||
void NCollection_BaseVector::Iterator::copyV (const NCollection_BaseVector::Iterator& theOth)
|
||||
{
|
||||
myVector = theOth.myVector;
|
||||
myICurBlock = theOth.myICurBlock;
|
||||
myIEndBlock = theOth.myIEndBlock;
|
||||
myCurIndex = theOth.myCurIndex;
|
||||
myEndIndex = theOth.myEndIndex;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : initV
|
||||
//purpose : Initialisation of iterator by a vector
|
||||
|
@@ -79,15 +79,8 @@ protected:
|
||||
initV (theVector, theToEnd);
|
||||
}
|
||||
|
||||
Iterator (const Iterator& theVector)
|
||||
{
|
||||
copyV (theVector);
|
||||
}
|
||||
|
||||
Standard_EXPORT void initV (const NCollection_BaseVector& theVector, Standard_Boolean theToEnd = Standard_False);
|
||||
|
||||
Standard_EXPORT void copyV (const Iterator&);
|
||||
|
||||
Standard_Boolean moreV() const
|
||||
{
|
||||
return (myICurBlock < myIEndBlock || myCurIndex < myEndIndex);
|
||||
@@ -136,6 +129,7 @@ protected:
|
||||
return &myVector->myData[myICurBlock];
|
||||
}
|
||||
|
||||
protected:
|
||||
const NCollection_BaseVector* myVector; //!< the Master vector
|
||||
Standard_Integer myICurBlock; //!< # of the current block
|
||||
Standard_Integer myIEndBlock;
|
||||
|
@@ -61,23 +61,12 @@ public:
|
||||
Iterator (const NCollection_Vector& theVector, Standard_Boolean theToEnd = Standard_False)
|
||||
: NCollection_BaseVector::Iterator (theVector, theToEnd) {}
|
||||
|
||||
//! Copy constructor
|
||||
Iterator (const Iterator& theOther)
|
||||
: NCollection_BaseVector::Iterator (theOther) {}
|
||||
|
||||
//! Initialisation
|
||||
void Init (const NCollection_Vector& theVector)
|
||||
{
|
||||
initV (theVector);
|
||||
}
|
||||
|
||||
//! Assignment
|
||||
Iterator& operator= (const Iterator& theOther)
|
||||
{
|
||||
copyV (theOther);
|
||||
return *this;
|
||||
}
|
||||
|
||||
//! Check end
|
||||
Standard_Boolean More() const
|
||||
{
|
||||
|
Reference in New Issue
Block a user