Commit 72300041 authored by Henry Weller's avatar Henry Weller
Browse files

Removed use of the deprecated "register" keyword

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4340.html
parent 138c34fb
......@@ -796,8 +796,8 @@ static uint32_t crc_table[256];
#define CRC32POLYNOMIAL 0x04c11db7L
static void GenerateCRC32Table (void) {
register int i, j;
register uint32_t crc_accum;
int i, j;
uint32_t crc_accum;
for ( i = 0; i < 256; i++ ) {
crc_accum = ( (unsigned long) i << 24 );
......@@ -821,8 +821,8 @@ static uint32_t UpdateCRC32
const char *data_blk_ptr,
int data_blk_size
) {
register int j;
register uint8_t i;
int j;
uint8_t i;
for (j = 0; j < data_blk_size; j++) {
i = (crc_accum >> 24) ^ *data_blk_ptr++;
......@@ -1017,7 +1017,7 @@ int i;
uint32_t stroustrup (const char * s, int len) {
uint32_t h;
for (register int i=0; i < len; ++s, ++i)
for (int i=0; i < len; ++s, ++i)
{
h = (h << 1) ^ (unsigned char) s[i];
}
......
......@@ -26,7 +26,7 @@ int main()
label* redAddr = new label[size];
label* redAddr2 = new label[size];
for (register label i=0; i<size; i++)
for (label i=0; i<size; i++)
{
f1[i] = 1.0;
f2[i] = 1.0;
......@@ -36,12 +36,12 @@ int main()
redAddr2[i] = (size - i - 1)/redFac;
}
for (register label i=0; i<size; i+=rndAddrSkip)
for (label i=0; i<size; i+=rndAddrSkip)
{
addr[i] = genAddr.integer(0, size-1);
}
for (register label i=0; i<redSize; i++)
for (label i=0; i<redSize; i++)
{
fr[i] = 1.0;
}
......@@ -56,7 +56,7 @@ int main()
for (int j=0; j<nIter; j++)
{
for (register label i=0; i<size; i++)
for (label i=0; i<size; i++)
{
f4[i] = f1[i] + f2[i] - f3[i];
}
......@@ -77,7 +77,7 @@ int main()
for (int j=0; j<nIter; j++)
{
for (register label i=0; i<size; i++)
for (label i=0; i<size; i++)
{
f4[addr[i]] = f1[addr[i]] + f2[addr[i]] - f3[addr[i]];
}
......@@ -99,7 +99,7 @@ int main()
for (int j=0; j<nIter; j++)
{
for (register label i=0; i<size; i++)
for (label i=0; i<size; i++)
{
label j = i/redFac;
fr[j] += f1[i];
......@@ -122,7 +122,7 @@ int main()
for (int j=0; j<nIter; j++)
{
for (register label i=0; i<size; i++)
for (label i=0; i<size; i++)
{
fr[redAddr[i]] += f1[i];
fr[redAddr2[i]] -= f2[i];
......@@ -143,15 +143,15 @@ int main()
for (int j=0; j<nIter; j++)
{
for (register label i=0; i<size; i++)
for (label i=0; i<size; i++)
{
f4[i] = f1[i];
}
for (register label i=0; i<size; i++)
for (label i=0; i<size; i++)
{
f4[i] += f2[i];
}
for (register label i=0; i<size; i++)
for (label i=0; i<size; i++)
{
f4[i] -= f3[i];
}
......
......@@ -25,7 +25,7 @@ int main()
Info<< "vectorField algebra" << endl;
for (register int j=0; j<nIter; j++)
for (int j=0; j<nIter; j++)
{
vf4 = vf1 + vf2 - vf3;
}
......
......@@ -279,7 +279,7 @@ int main(int argc, char *argv[])
sqrMergeTol /= 10.0;
register bool found = false;
bool found = false;
// N-squared point search over all points of all faces of
// master block over all point of all faces of slave block
......@@ -354,7 +354,7 @@ int main(int argc, char *argv[])
}
register bool changedPointMerge = false;
bool changedPointMerge = false;
label nPasses = 0;
do
......
......@@ -604,7 +604,7 @@ endOfSection {space}")"{space}
<readCellData>{space}{lbrac} {
// Quickly scan to the end of the cell data block and discard
register int c;
int c;
while ((c = yyinput()) != 0 && c != ')')
{}
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -63,9 +63,9 @@ Foam::scalar Foam::EulerSI::solve
{
odes_.jacobian(x0, y0, dfdx_, dfdy_);
for (register label i=0; i<n_; i++)
for (label i=0; i<n_; i++)
{
for (register label j=0; j<n_; j++)
for (label j=0; j<n_; j++)
{
a_[i][j] = -dfdy_[i][j];
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -77,9 +77,9 @@ Foam::scalar Foam::Rosenbrock12::solve
{
odes_.jacobian(x0, y0, dfdx_, dfdy_);
for (register label i=0; i<n_; i++)
for (label i=0; i<n_; i++)
{
for (register label j=0; j<n_; j++)
for (label j=0; j<n_; j++)
{
a_[i][j] = -dfdy_[i][j];
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -90,9 +90,9 @@ Foam::scalar Foam::Rosenbrock23::solve
{
odes_.jacobian(x0, y0, dfdx_, dfdy_);
for (register label i=0; i<n_; i++)
for (label i=0; i<n_; i++)
{
for (register label j=0; j<n_; j++)
for (label j=0; j<n_; j++)
{
a_[i][j] = -dfdy_[i][j];
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -135,9 +135,9 @@ Foam::scalar Foam::Rosenbrock34::solve
{
odes_.jacobian(x0, y0, dfdx_, dfdy_);
for (register label i=0; i<n_; i++)
for (label i=0; i<n_; i++)
{
for (register label j=0; j<n_; j++)
for (label j=0; j<n_; j++)
{
a_[i][j] = -dfdy_[i][j];
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -86,14 +86,14 @@ void Foam::SIBS::solve
scalar eps1 = safe1*relTol_[0];
a_[0] = nSeq_[0] + 1;
for (register label k=0; k<kMaxX_; k++)
for (label k=0; k<kMaxX_; k++)
{
a_[k + 1] = a_[k] + nSeq_[k + 1];
}
for (register label iq = 1; iq<kMaxX_; iq++)
for (label iq = 1; iq<kMaxX_; iq++)
{
for (register label k=0; k<iq; k++)
for (label k=0; k<iq; k++)
{
alpha_[k][iq] =
pow(eps1, (a_[k + 1] - a_[iq + 1])
......@@ -104,7 +104,7 @@ void Foam::SIBS::solve
epsOld_ = relTol_[0];
a_[0] += n_;
for (register label k=0; k<kMaxX_; k++)
for (label k=0; k<kMaxX_; k++)
{
a_[k + 1] = a_[k] + nSeq_[k + 1];
}
......@@ -158,7 +158,7 @@ void Foam::SIBS::solve
if (k != 0)
{
maxErr = SMALL;
for (register label i=0; i<n_; i++)
for (label i=0; i<n_; i++)
{
maxErr = max
(
......@@ -217,7 +217,7 @@ void Foam::SIBS::solve
scalar wrkmin = GREAT;
scalar scale = 1.0;
for (register label kk=0; kk<=km; kk++)
for (label kk=0; kk<=km; kk++)
{
scalar fact = max(err_[kk], scaleMX);
scalar work = fact*a_[kk + 1];
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -42,9 +42,9 @@ void Foam::SIBS::SIMPR
scalar h = deltaX/nSteps;
scalarSquareMatrix a(n_);
for (register label i=0; i<n_; i++)
for (label i=0; i<n_; i++)
{
for (register label j=0; j<n_; j++)
for (label j=0; j<n_; j++)
{
a[i][j] = -h*dfdy[i][j];
}
......@@ -54,7 +54,7 @@ void Foam::SIBS::SIMPR
labelList pivotIndices(n_);
LUDecompose(a, pivotIndices);
for (register label i=0; i<n_; i++)
for (label i=0; i<n_; i++)
{
yEnd[i] = h*(dydx[i] + h*dfdx[i]);
}
......@@ -64,7 +64,7 @@ void Foam::SIBS::SIMPR
scalarField del(yEnd);
scalarField ytemp(n_);
for (register label i=0; i<n_; i++)
for (label i=0; i<n_; i++)
{
ytemp[i] = y[i] + del[i];
}
......@@ -73,16 +73,16 @@ void Foam::SIBS::SIMPR
odes_.derivatives(x, ytemp, yEnd);
for (register label nn=2; nn<=nSteps; nn++)
for (label nn=2; nn<=nSteps; nn++)
{
for (register label i=0; i<n_; i++)
for (label i=0; i<n_; i++)
{
yEnd[i] = h*yEnd[i] - del[i];
}
LUBacksubstitute(a, pivotIndices, yEnd);
for (register label i=0; i<n_; i++)
for (label i=0; i<n_; i++)
{
ytemp[i] += (del[i] += 2.0*yEnd[i]);
}
......@@ -91,14 +91,14 @@ void Foam::SIBS::SIMPR
odes_.derivatives(x, ytemp, yEnd);
}
for (register label i=0; i<n_; i++)
for (label i=0; i<n_; i++)
{
yEnd[i] = h*yEnd[i] - del[i];
}
LUBacksubstitute(a, pivotIndices, yEnd);
for (register label i=0; i<n_; i++)
for (label i=0; i<n_; i++)
{
yEnd[i] += ytemp[i];
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -42,14 +42,14 @@ void Foam::SIBS::polyExtrapolate
x[iest] = xest;
for (register label j=0; j<n; j++)
for (label j=0; j<n; j++)
{
dy[j] = yz[j] = yest[j];
}
if (iest == 0)
{
for (register label j=0; j<n; j++)
for (label j=0; j<n; j++)
{
d[j][0] = yest[j];
}
......@@ -58,13 +58,13 @@ void Foam::SIBS::polyExtrapolate
{
scalarField c(yest);
for (register label k1=0; k1<iest; k1++)
for (label k1=0; k1<iest; k1++)
{
scalar delta = 1.0/(x[iest - k1 - 1] - xest);
scalar f1 = xest*delta;
scalar f2 = x[iest - k1 - 1]*delta;
for (register label j=0; j<n; j++)
for (label j=0; j<n; j++)
{
scalar q = d[j][k1];
d[j][k1] = dy[j];
......@@ -75,7 +75,7 @@ void Foam::SIBS::polyExtrapolate
}
}
for (register label j=0; j<n; j++)
for (label j=0; j<n; j++)
{
d[j][iest] = dy[j];
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -81,9 +81,9 @@ Foam::scalar Foam::rodas23::solve
{
odes_.jacobian(x0, y0, dfdx_, dfdy_);
for (register label i=0; i<n_; i++)
for (label i=0; i<n_; i++)
{
for (register label j=0; j<n_; j++)
for (label j=0; j<n_; j++)
{
a_[i][j] = -dfdy_[i][j];
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -104,9 +104,9 @@ Foam::scalar Foam::rodas34::solve
{
odes_.jacobian(x0, y0, dfdx_, dfdy_);
for (register label i=0; i<n_; i++)
for (label i=0; i<n_; i++)
{
for (register label j=0; j<n_; j++)
for (label j=0; j<n_; j++)
{
a_[i][j] = -dfdy_[i][j];
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -64,7 +64,7 @@ Foam::Istream& Foam::operator>>(Istream& is, LList<LListBase, T>& L)
{
if (delimiter == token::BEGIN_LIST)
{
for (register label i=0; i<s; ++i)
for (label i=0; i<s; ++i)
{
T element;
is >> element;
......@@ -76,7 +76,7 @@ Foam::Istream& Foam::operator>>(Istream& is, LList<LListBase, T>& L)
T element;
is >> element;
for (register label i=0; i<s; ++i)
for (label i=0; i<s; ++i)
{
L.append(element);
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -37,7 +37,7 @@ inline Foam::FixedList<T, Size>::FixedList()
template<class T, unsigned Size>
inline Foam::FixedList<T, Size>::FixedList(const T v[Size])
{
for (register unsigned i=0; i<Size; i++)
for (unsigned i=0; i<Size; i++)
{
v_[i] = v[i];
}
......@@ -47,7 +47,7 @@ inline Foam::FixedList<T, Size>::FixedList(const T v[Size])
template<class T, unsigned Size>
inline Foam::FixedList<T, Size>::FixedList(const T& t)
{
for (register unsigned i=0; i<Size; i++)
for (unsigned i=0; i<Size; i++)
{
v_[i] = t;
}
......@@ -59,7 +59,7 @@ inline Foam::FixedList<T, Size>::FixedList(const UList<T>& lst)
{
checkSize(lst.size());
for (register unsigned i=0; i<Size; i++)
for (unsigned i=0; i<Size; i++)
{
v_[i] = lst[i];
}
......@@ -71,7 +71,7 @@ inline Foam::FixedList<T, Size>::FixedList(const SLList<T>& lst)
{
checkSize(lst.size());
register label i = 0;
label i = 0;
for
(
typename SLList<T>::const_iterator iter = lst.begin();
......@@ -87,7 +87,7 @@ inline Foam::FixedList<T, Size>::FixedList(const SLList<T>& lst)
template<class T, unsigned Size>
inline Foam::FixedList<T, Size>::FixedList(const FixedList<T, Size>& lst)
{
for (register unsigned i=0; i<Size; i++)
for (unsigned i=0; i<Size; i++)
{
v_[i] = lst[i];
}
......@@ -184,7 +184,7 @@ inline void Foam::FixedList<T, Size>::setSize(const label s)
template<class T, unsigned Size>
inline void Foam::FixedList<T, Size>::transfer(const FixedList<T, Size>& lst)
{
for (register unsigned i=0; i<Size; i++)
for (unsigned i=0; i<Size; i++)
{
v_[i] = lst[i];
}
......@@ -262,7 +262,7 @@ inline const T& Foam::FixedList<T, Size>::operator[](const label i) const
template<class T, unsigned Size>
inline void Foam::FixedList<T, Size>::operator=(const T lst[Size])
{
for (register unsigned i=0; i<Size; i++)
for (unsigned i=0; i<Size; i++)
{
v_[i] = lst[i];
}
......@@ -273,7 +273,7 @@ inline void Foam::FixedList<T, Size>::operator=(const UList<T>& lst)
{
checkSize(lst.size());
for (register unsigned i=0; i<Size; i++)
for (unsigned i=0; i<Size; i++)
{
v_[i] = lst[i];
}
......@@ -284,7 +284,7 @@ inline void Foam::FixedList<T, Size>::operator=(const SLList<T>& lst)
{
checkSize(lst.size());
register label i = 0;
label i = 0;
for
(
typename SLList<T>::const_iterator iter = lst.begin();
......@@ -299,7 +299,7 @@ inline void Foam::FixedList<T, Size>::operator=(const SLList<T>& lst)
template<class T, unsigned Size>
inline void Foam::FixedList<T, Size>::operator=(const T& t)
{
for (register unsigned i=0; i<Size; i++)
for (unsigned i=0; i<Size; i++)
{
v_[i] = t;
}
......@@ -443,7 +443,7 @@ inline unsigned Foam::FixedList<T, Size>::Hash<HashT>::operator()
// hash incrementally
unsigned val = seed;