Commit 54e3e537 authored by Chris Cantwell's avatar Chris Cantwell

Merge branch 'fix/gcc-warnings' into 'master'

Fix (most) warnings from gcc

This fixes some simple warnings (mostly unused variables and declaring `int i` inside and outside a for).

From the outputs of buildbot, it seems the remaining warnings are either from ThirdyParty or from gcc being dumb.

See merge request !564
parents 4d372bb1 76bd915a
......@@ -268,9 +268,9 @@ void PtsField::AddField(const Array< OneD, NekDouble > &pts,
const string fieldName)
{
int nTotvars = m_pts.num_elements();
int nPts = m_pts[0].num_elements();
ASSERTL1(pts.num_elements() == nPts, "Field size mismatch");
ASSERTL1(pts.num_elements() == m_pts[0].num_elements(),
"Field size mismatch");
// redirect existing pts
Array<OneD, Array<OneD, NekDouble> > newpts(nTotvars + 1);
......
......@@ -407,6 +407,10 @@ unsigned int ThreadWorkerBoost::GetNumToLoad()
case e_dynamic:
numToLoad = m_threadManager->m_chunkSize;
break;
default:
ASSERTL0(0, "Invalid value for SchedType.");
break;
}
return numToLoad;
}
......
......@@ -254,9 +254,9 @@ void OUTPUT(int m_xpoints,
Array <OneD, NekDouble > test (m_xpoints, 0.0);
NekDouble dd, dm, scale, flg, dlta;
NekDouble dd, dm, scale, flg;
NekDouble xcher, ycher;
int index;
int index = -1;
z[0] = 0.0;
NekDouble sumd = 0.0;
......@@ -270,7 +270,6 @@ void OUTPUT(int m_xpoints,
if ((ff[1][i] > 0.999) && (flg < 1.0))
{
dlta = z[i];
flg = 2.0;
}
}
......@@ -343,6 +342,10 @@ void OUTPUT(int m_xpoints,
break;
}
}
if (index == -1)
{
ASSERTL0(false, "Could not determine index in CompressibleBL");
}
u_QuadraturePts[i] = u[index];
rho_QuadraturePts[i] = rho[index];
......@@ -365,13 +368,13 @@ int main(int argc, char *argv[])
string opt;
int i, j, numModes;
int i, j, k, numModes;
Array<OneD, NekDouble> xx(m_xpoints, 0.0);
Array<OneD, Array<OneD, NekDouble> > ff(nmax);
Array<OneD, NekDouble> parameter(9, 0.0);
for (int i = 0; i < nmax; i++)
for (i = 0; i < nmax; i++)
{
ff[i] = Array<OneD, NekDouble> (m_xpoints);
}
......@@ -526,7 +529,7 @@ int main(int argc, char *argv[])
RKDUMB(vstart, 5, 0.0, etamax, m_xpoints, xx, ff);
for (int k = 0; k < maxit; k++)
for (k = 0; k < maxit; k++)
{
vstart[2] = v[0];
......@@ -674,7 +677,7 @@ int main(int argc, char *argv[])
// Verification of the compressible similarity solution
ofstream verif;
verif.open("similarity_solution.dat");
for (int i=0; i< nQuadraturePts; i++)
for (i=0; i< nQuadraturePts; i++)
{
verif << scientific << setprecision(9) << x_QuadraturePts[i]
<< " \t " << y_QuadraturePts[i] << " \t " ;
......@@ -686,7 +689,7 @@ int main(int argc, char *argv[])
verif.close();
// Calculation of the physical variables
for (int i = 0; i < nQuadraturePts; i++)
for (i = 0; i < nQuadraturePts; i++)
{
rho_QuadraturePts[i] = rho_QuadraturePts[i] * m_rhoInf;
u_QuadraturePts[i] = u_QuadraturePts[i] * m_uInf;
......@@ -763,7 +766,7 @@ int main(int argc, char *argv[])
cout << argv[1] << endl;
string tmp = argv[1];
int len = tmp.size();
for (int i = 0; i < len-4; ++i)
for (i = 0; i < len-4; ++i)
{
file_name += argv[1][i];
}
......@@ -872,7 +875,7 @@ int main(int argc, char *argv[])
cout << argv[1] << endl;
string tmp = argv[1];
int len = tmp.size();
for (int i = 0; i < len-4; ++i)
for (i = 0; i < len-4; ++i)
{
file_name += argv[1][i];
}
......
......@@ -216,9 +216,6 @@ CoupledAssemblyMap::CoupledAssemblyMap(
ASSERTL1(globalId == m_numGlobalCoeffs, "Consistency error");
const Array<OneD, const MultiRegions::ExpListSharedPtr> &bndCondExp
= fields[0]->GetBndCondExpansions();
cnt1 = 0;
for (n = 0; n < nVel; ++n)
{
......
......@@ -36,7 +36,7 @@ int main(int argc, char *argv[])
char **newargv = new char*[newargc];
newargv[0] = argv[0];
newargv[1] = new char[30];
newargv[1] = new char[31];
strcpy(newargv[1], "--SetToOneSpaceDimension=false");
for(int i = 1; i < argc; ++i)
......
......@@ -241,7 +241,7 @@ int main(int argc, char *argv[])
}
}
for(int j = 0; j < addfields; ++j)
for(j = 0; j < addfields; ++j)
{
int ncoeffs = exp[0]->GetNcoeffs();
Array<OneD, NekDouble> output(ncoeffs);
......
......@@ -243,7 +243,7 @@ int main(int argc, char *argv[])
exp[j+1]->FwdTrans(exp[j+1]->GetPhys(), exp[j+1]->UpdateCoeffs());
}
for(int j = 0; j < addfields-expdim; ++j)
for(j = 0; j < addfields-expdim; ++j)
{
int ncoeffs = exp[0]->GetNcoeffs();
Array<OneD, NekDouble> output(ncoeffs);
......
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