Commit 3bd5dcdc authored by Franjo's avatar Franjo
Browse files

Removes occurences for register from the code

parent bc1bdf9b
......@@ -34,19 +34,34 @@ Foam::Ostream& Foam::operator<<
const Foam::FRWGraph<T, width>& DL
)
{
os << DL.size() << "(" << endl;
#if defined(__clang__)
os << DL.size() << "(" << nl;
for(label i=0;i<DL.size();++i)
#else
for(register label i=0;i<DL.size();++i)
#endif
{
os << width << "(";
for(label j=0;j<width;++j)
os << DL(i, j) << " " << endl;
os << ")" << endl;
{
if( j )
{
os << " ";
}
os << DL(i, j);
}
os << ")" << nl;
}
os << ")";
// Check state of IOstream
os.check
(
"template<class T, Foam::label width>Foam::Ostream& Foam::operator<<"
"(Foam::Ostream& os, const Foam::FRWGraph<T, width>&)"
);
return os;
}
......
......@@ -36,7 +36,7 @@ void Foam::FRWGraph<T, width>::checkIndex(const label i, const label j) const
<< " is not in range " << 0
<< " and " << nRows_ << abort(FatalError);
}
if( (j < 0) || (j >= width) )
FatalErrorIn
(
......@@ -105,7 +105,7 @@ inline Foam::label Foam::FRWGraph<T,width>::size() const
}
template<class T, Foam::label width>
inline Foam::label Foam::FRWGraph<T,width>::sizeOfRow(const label /*rowI*/) const
inline Foam::label Foam::FRWGraph<T,width>::sizeOfRow(const label) const
{
return width;
}
......@@ -155,14 +155,11 @@ inline bool Foam::FRWGraph<T,width>::contains
) const
{
const label start = rowI * width;
#if defined(__clang__)
for(label i=0;i<width;++i)
#else
for(register label i=0;i<width;++i)
#endif
if( data_[start+i] == e )
return true;
return false;
}
......@@ -174,14 +171,11 @@ inline Foam::label Foam::FRWGraph<T,width>::containsAtPosition
) const
{
const label start = rowI * width;
#if defined(__clang__)
for(label i=0;i<width;++i)
#else
for(register label i=0;i<width;++i)
#endif
if( data_[start+i] == e )
return i;
return -1;
}
......@@ -196,7 +190,7 @@ inline const T& Foam::FRWGraph<T,width>::operator()
#ifdef FULLDEBUG
checkIndex(i, j);
#endif
return data_[i * width + j];
}
......@@ -209,7 +203,7 @@ inline T& Foam::FRWGraph<T,width>::operator()
#ifdef FULLDEBUG
checkIndex(i, j);
#endif
return data_[i * width + j];
}
......
......@@ -202,11 +202,7 @@ Foam::Istream& Foam::operator>>
if( listDelimiter == token::BEGIN_LIST )
{
#if defined(__clang__)
for(label i=0;i<size;++i)
#else
for(register label i=0;i<size;++i)
#endif
{
is >> DL[i];
......@@ -227,11 +223,7 @@ Foam::Istream& Foam::operator>>
"reading the single entry"
);
#if defined(__clang__)
for(label i=0;i<size;++i)
#else
for(register label i=0;i<size;++i)
#endif
{
DL[i] = element;
}
......@@ -314,11 +306,7 @@ void Foam::LongList<T, Offset>::appendFromStream(Istream& is)
if( listDelimiter == token::BEGIN_LIST )
{
#if defined(__clang__)
for(label i=0;i<size;++i)
#else
for(register label i=0;i<size;++i)
#endif
{
is >> this->operator[](origSize);
++origSize;
......@@ -340,11 +328,7 @@ void Foam::LongList<T, Offset>::appendFromStream(Istream& is)
"reading the single entry"
);
#if defined(__clang__)
for(label i=0;i<size;++i)
#else
for(register label i=0;i<size;++i)
#endif
{
this->operator[](origSize) = element;
++origSize;
......@@ -362,31 +346,6 @@ void Foam::LongList<T, Offset>::appendFromStream(Istream& is)
forAll(buf, i)
this->operator[](origSize++) = buf[i];
/*const label blockSize = 1<<shift_;
Info << "nextFree_ " << nextFree_ << endl;
//- append elements by reading binary block
while( origSize < nextFree_ )
{
const label currBlock = origSize >> shift_;
const label currPos = origSize & mask_;
Info << "Orig size " << origSize
<< nl << "currBlock " << currBlock
<< nl << "currPos " << currPos << endl;
T* data = &dataPtr_[currBlock][currPos];
label bs = Foam::min(nextFree_-origSize, blockSize);
bs = Foam::min(blockSize - currPos, bs);
Info << "bs " << bs << endl;
is.read(reinterpret_cast<char*>(data), bs * sizeof(T));
origSize += bs;
} */
is.fatalCheck
(
"appendFromStream(Istream& is)"
......
......@@ -78,11 +78,7 @@ inline void Foam::LongList<T, Offset>::allocateSize(const label s)
if( numblock1 < numBlocks_ )
{
#if defined(__clang__)
for(label i=numblock1;i<numBlocks_;++i)
#else
for(register label i=numblock1;i<numBlocks_;++i)
#endif
delete [] dataPtr_[i];
}
else if( numblock1 > numBlocks_ )
......@@ -95,11 +91,8 @@ inline void Foam::LongList<T, Offset>::allocateSize(const label s)
} while( numblock1 > numAllocatedBlocks_ );
T** dataptr1 = new T*[numAllocatedBlocks_];
#if defined(__clang__)
for(label i=0;i<numBlocks_;++i)
#else
for(register label i=0;i<numBlocks_;++i)
#endif
dataptr1[i] = dataPtr_[i];
if( dataPtr_ )
......@@ -107,11 +100,7 @@ inline void Foam::LongList<T, Offset>::allocateSize(const label s)
dataPtr_ = dataptr1;
}
#if defined(__clang__)
for(label i=numBlocks_;i<numblock1;++i)
#else
for(register label i=numBlocks_;i<numblock1;++i)
#endif
dataPtr_[i] = new T[blockSize];
}
......@@ -122,11 +111,7 @@ inline void Foam::LongList<T, Offset>::allocateSize(const label s)
template<class T, Foam::label Offset>
void Foam::LongList<T, Offset>::clearOut()
{
#if defined(__clang__)
for(label i=0;i<numBlocks_;++i)
#else
for(register label i=0;i<numBlocks_;++i)
#endif
delete [] dataPtr_[i];
if( dataPtr_ )
......@@ -297,11 +282,7 @@ inline void Foam::LongList<T, Offset>::appendIfNotIn(const T& e)
template<class T, Foam::label Offset>
inline bool Foam::LongList<T, Offset>::contains(const T& e) const
{
#if defined(__clang__)
for(label i=0;i<nextFree_;++i)
#else
for(register label i=0;i<nextFree_;++i)
#endif
if( (*this)[i] == e )
return true;
......@@ -314,11 +295,7 @@ inline Foam::label Foam::LongList<T, Offset>::containsAtPosition
const T& e
) const
{
#if defined(__clang__)
for(label i=0;i<nextFree_;++i)
#else
for(register label i=0;i<nextFree_;++i)
#endif
if( (*this)[i] == e )
return i;
......@@ -400,11 +377,7 @@ inline T& Foam::LongList<T, Offset>::newElmt(const label i)
template<class T, Foam::label Offset>
inline void Foam::LongList<T, Offset>::operator=(const T& t)
{
#if defined(__clang__)
for(label i=0;i<nextFree_;++i)
#else
for(register label i=0;i<nextFree_;++i)
#endif
operator[](i) = t;
}
......@@ -412,11 +385,8 @@ template<class T, Foam::label Offset>
inline void Foam::LongList<T, Offset>::operator=(const LongList<T, Offset>& l)
{
setSize(l.size());
#if defined(__clang__)
for(label i=0;i<l.nextFree_;++i)
#else
for(register label i=0;i<l.nextFree_;++i)
#endif
operator[](i) = l[i];
}
......
......@@ -35,26 +35,29 @@ Foam::Ostream& Foam::operator<<
const Foam::VRWGraph& DL
)
{
os << DL.size() << nl << token::BEGIN_LIST;
#if defined(__clang__)
os << DL.size() << nl << token::BEGIN_LIST << nl;
for(label i=0;i<DL.size();++i)
#else
for(register label i=0;i<DL.size();++i)
#endif
{
os << nl << DL.sizeOfRow(i) << token::BEGIN_LIST;
os << DL.sizeOfRow(i) << token::BEGIN_LIST;
for(label j=0;j<DL.sizeOfRow(i);++j)
{
if( j > 0 ) os << token::SPACE;
if( j ) os << token::SPACE;
os << DL(i, j);
}
os << token::END_LIST;
os << token::END_LIST << nl;
}
os << nl << token::END_LIST;
os << token::END_LIST;
// Check state of IOstream
os.check
(
"Foam::Ostream& Foam::operator<<(Foam::Ostream&, const Foam::VRWGraph&)"
);
return os;
}
......@@ -94,14 +97,14 @@ void Foam::VRWGraph::optimizeMemoryUsage()
{
newPosForNode[elI] = -1;
}
//- create new data
for(label elI=0;elI<nElements;++elI)
if( (newPosForNode[elI] != -1) && (newPosForNode[elI] < elI) )
data_[newPosForNode[elI]] = data_[elI];
data_.setSize(pos);
//- renumber rows
nElements = rows_.size();
for(label rowI=0;rowI<nElements;++rowI)
......
......@@ -518,11 +518,7 @@ inline bool Foam::VRWGraph::contains
return false;
const label size = rows_[rowI].size();
#if defined(__clang__)
for(label i=0;i<size;++i)
#else
for(register label i=0;i<size;++i)
#endif
if( data_[start+i] == e )
return true;
......@@ -540,11 +536,8 @@ inline Foam::label Foam::VRWGraph::containsAtPosition
return -1;
const label size = rows_[rowI].size();
#if defined(__clang__)
for(label i=0;i<size;++i)
#else
for(register label i=0;i<size;++i)
#endif
if( data_[start+i] == e )
return i;
......
......@@ -36,17 +36,21 @@ Foam::Ostream& Foam::operator<<
)
{
os << DL.size() << nl << token::BEGIN_LIST;
#if defined(__clang__)
for(label i=0;i<DL.size();++i)
#else
for(register label i=0;i<DL.size();++i)
#endif
{
os << nl << DL[i];
}
os << nl << token::END_LIST;
// Check state of IOstream
os.check
(
"Foam::Ostream& Foam::operator<<"
"(Foam::Ostream&, const Foam::VRWGraphList&)"
);
return os;
}
......
......@@ -370,11 +370,7 @@ void decomposeFaces::decomposeConcaveInternalFaces
# endif
//- decompose internal faces
#if defined(__clang__)
for(label faceI=0;faceI<nIntFaces;++faceI)
#else
for(register label faceI=0;faceI<nIntFaces;++faceI)
#endif
{
const face& f = faces[faceI];
......
......@@ -187,11 +187,7 @@ void polyMeshGenModifier::removeFaces(const boolList& removeFace)
neiProcNo[npI] = procBoundaries[patchI].neiProcNo();
nFacesInPatch[npI] = 0;
#if defined(__clang__)
for(label faceI=0;faceI<oldNumFacesInPatch;++faceI)
#else
for(register label faceI=0;faceI<oldNumFacesInPatch;++faceI)
#endif
{
if(
!removeFace[oldStart+faceI] &&
......
......@@ -531,11 +531,8 @@ bool surfaceMorpherCells::morphInternalFaces()
//- remove faces which do not exist any more
boolList removeFace(faces.size(), false);
bool removeFaces(false);
#if defined(__clang__)
for(label faceI=0;faceI<nIntFaces;++faceI)
#else
for(register label faceI=0;faceI<nIntFaces;++faceI)
#endif
if( faces[faceI].size() < 3 )
{
removeFace[faceI] = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment