Fix warnings (Intel compiler)

ICC complains about ambigous variable 'i' applying old/new scoping rules.
Therefore, use local loop variables in for loops.
This commit is contained in:
Matthias Hochsteger 2017-03-23 15:53:55 +01:00
parent 079406f615
commit 5e2d2f685c

View File

@ -109,7 +109,7 @@ static double CalcLocH (const Array<Point3d> & locpoints,
sum = 0; sum = 0;
weight = 0; weight = 0;
for (i = 1; i <= locfaces.Size(); i++) for(int i = 1; i <= locfaces.Size(); i++)
{ {
pc.X() = pc.Y() = pc.Z() = 0; pc.X() = pc.Y() = pc.Z() = 0;
for (j = 1; j <= 3; j++) for (j = 1; j <= 3; j++)
@ -187,7 +187,7 @@ GenerateMesh (Mesh & mesh, const MeshingParameters & mp)
Array<int> delpoints, delfaces; // points and lines to be deleted Array<int> delpoints, delfaces; // points and lines to be deleted
Array<Element> locelements; // new generated elements Array<Element> locelements; // new generated elements
int i, j, oldnp, oldnf; int j, oldnp, oldnf;
int found; int found;
referencetransform trans; referencetransform trans;
int rotind; int rotind;
@ -344,7 +344,7 @@ GenerateMesh (Mesh & mesh, const MeshingParameters & mp)
allowpoint.SetSize(locpoints.Size()); allowpoint.SetSize(locpoints.Size());
if (uselocalh && stat.qualclass <= 3) if (uselocalh && stat.qualclass <= 3)
for (i = 1; i <= allowpoint.Size(); i++) for(int i = 1; i <= allowpoint.Size(); i++)
{ {
allowpoint.Elem(i) = allowpoint.Elem(i) =
(mesh.GetH (locpoints.Get(i)) > 0.4 * hshould / mp.sloppy) ? 2 : 1; (mesh.GetH (locpoints.Get(i)) > 0.4 * hshould / mp.sloppy) ? 2 : 1;
@ -378,10 +378,10 @@ GenerateMesh (Mesh & mesh, const MeshingParameters & mp)
{ {
(*testout) << "inner point found" << endl; (*testout) << "inner point found" << endl;
for (i = 1; i <= groupfaces.Size(); i++) for(int i = 1; i <= groupfaces.Size(); i++)
adfront -> DeleteFace (groupfindex.Get(i)); adfront -> DeleteFace (groupfindex.Get(i));
for (i = 1; i <= groupfaces.Size(); i++) for(int i = 1; i <= groupfaces.Size(); i++)
for (j = 1; j <= locfaces.Size(); j++) for (j = 1; j <= locfaces.Size(); j++)
if (findex.Get(j) == groupfindex.Get(i)) if (findex.Get(j) == groupfindex.Get(i))
delfaces.Append (j); delfaces.Append (j);
@ -396,7 +396,7 @@ GenerateMesh (Mesh & mesh, const MeshingParameters & mp)
newel.SetNP(4); newel.SetNP(4);
newel.PNum(4) = npi; newel.PNum(4) = npi;
for (i = 1; i <= groupfaces.Size(); i++) for(int i = 1; i <= groupfaces.Size(); i++)
{ {
for (j = 1; j <= 3; j++) for (j = 1; j <= 3; j++)
{ {
@ -417,14 +417,14 @@ GenerateMesh (Mesh & mesh, const MeshingParameters & mp)
// int optother = 0; // int optother = 0;
/* /*
for (i = 1; i <= locfaces.Size(); i++) for(int i = 1; i <= locfaces.Size(); i++)
{ {
(*testout) << "Face " << i << ": "; (*testout) << "Face " << i << ": ";
for (j = 1; j <= locfaces.Get(i).GetNP(); j++) for (j = 1; j <= locfaces.Get(i).GetNP(); j++)
(*testout) << pindex.Get(locfaces.Get(i).PNum(j)) << " "; (*testout) << pindex.Get(locfaces.Get(i).PNum(j)) << " ";
(*testout) << endl; (*testout) << endl;
} }
for (i = 1; i <= locpoints.Size(); i++) for(int i = 1; i <= locpoints.Size(); i++)
{ {
(*testout) << "p" << i (*testout) << "p" << i
<< ", gi = " << pindex.Get(i) << ", gi = " << pindex.Get(i)
@ -470,7 +470,7 @@ GenerateMesh (Mesh & mesh, const MeshingParameters & mp)
if (stat.cnttrials % 100 == 0) if (stat.cnttrials % 100 == 0)
{ {
(*testout) << "\n"; (*testout) << "\n";
for (i = 1; i <= canuse.Size(); i++) for(int i = 1; i <= canuse.Size(); i++)
{ {
(*testout) << foundmap.Get(i) << "/" (*testout) << foundmap.Get(i) << "/"
<< canuse.Get(i) << "/" << canuse.Get(i) << "/"
@ -565,7 +565,7 @@ GenerateMesh (Mesh & mesh, const MeshingParameters & mp)
if (testmode) if (testmode)
{ {
(*testout) << "found is active, 3" << endl; (*testout) << "found is active, 3" << endl;
for (i = 1; i <= plainpoints.Size(); i++) for(int i = 1; i <= plainpoints.Size(); i++)
{ {
(*testout) << "p"; (*testout) << "p";
if (i <= pindex.Size()) if (i <= pindex.Size())
@ -582,19 +582,19 @@ GenerateMesh (Mesh & mesh, const MeshingParameters & mp)
minerr = err; minerr = err;
tempnewpoints.SetSize (0); tempnewpoints.SetSize (0);
for (i = oldnp+1; i <= locpoints.Size(); i++) for(int i = oldnp+1; i <= locpoints.Size(); i++)
tempnewpoints.Append (locpoints.Get(i)); tempnewpoints.Append (locpoints.Get(i));
tempnewfaces.SetSize (0); tempnewfaces.SetSize (0);
for (i = oldnf+1; i <= locfaces.Size(); i++) for(int i = oldnf+1; i <= locfaces.Size(); i++)
tempnewfaces.Append (locfaces.Get(i)); tempnewfaces.Append (locfaces.Get(i));
tempdelfaces.SetSize (0); tempdelfaces.SetSize (0);
for (i = 1; i <= delfaces.Size(); i++) for(int i = 1; i <= delfaces.Size(); i++)
tempdelfaces.Append (delfaces.Get(i)); tempdelfaces.Append (delfaces.Get(i));
templocelements.SetSize (0); templocelements.SetSize (0);
for (i = 1; i <= locelements.Size(); i++) for(int i = 1; i <= locelements.Size(); i++)
templocelements.Append (locelements.Get(i)); templocelements.Append (locelements.Get(i));
/* /*
@ -624,20 +624,20 @@ GenerateMesh (Mesh & mesh, const MeshingParameters & mp)
} }
*/ */
for (i = 1; i <= tempnewpoints.Size(); i++) for(int i = 1; i <= tempnewpoints.Size(); i++)
locpoints.Append (tempnewpoints.Get(i)); locpoints.Append (tempnewpoints.Get(i));
for (i = 1; i <= tempnewfaces.Size(); i++) for(int i = 1; i <= tempnewfaces.Size(); i++)
locfaces.Append (tempnewfaces.Get(i)); locfaces.Append (tempnewfaces.Get(i));
for (i = 1; i <= tempdelfaces.Size(); i++) for(int i = 1; i <= tempdelfaces.Size(); i++)
delfaces.Append (tempdelfaces.Get(i)); delfaces.Append (tempdelfaces.Get(i));
for (i = 1; i <= templocelements.Size(); i++) for(int i = 1; i <= templocelements.Size(); i++)
locelements.Append (templocelements.Get(i)); locelements.Append (templocelements.Get(i));
if (loktestmode) if (loktestmode)
{ {
(*testout) << "apply rule" << endl; (*testout) << "apply rule" << endl;
for (i = 1; i <= locpoints.Size(); i++) for(int i = 1; i <= locpoints.Size(); i++)
{ {
(*testout) << "p"; (*testout) << "p";
if (i <= pindex.Size()) if (i <= pindex.Size())
@ -676,7 +676,7 @@ GenerateMesh (Mesh & mesh, const MeshingParameters & mp)
stat.cntelem++; stat.cntelem++;
} }
for (i = oldnf+1; i <= locfaces.Size(); i++) for(int i = oldnf+1; i <= locfaces.Size(); i++)
{ {
for (j = 1; j <= locfaces.Get(i).GetNP(); j++) for (j = 1; j <= locfaces.Get(i).GetNP(); j++)
locfaces.Elem(i).PNum(j) = locfaces.Elem(i).PNum(j) =
@ -685,7 +685,7 @@ GenerateMesh (Mesh & mesh, const MeshingParameters & mp)
adfront->AddFace (locfaces.Get(i)); adfront->AddFace (locfaces.Get(i));
} }
for (i = 1; i <= delfaces.Size(); i++) for(int i = 1; i <= delfaces.Size(); i++)
adfront->DeleteFace (findex.Get(delfaces.Get(i))); adfront->DeleteFace (findex.Get(delfaces.Get(i)));
} }
else else
@ -709,7 +709,7 @@ GenerateMesh (Mesh & mesh, const MeshingParameters & mp)
PrintMessage (5, ""); // line feed after statistics PrintMessage (5, ""); // line feed after statistics
for (i = 1; i <= ruleused.Size(); i++) for(int i = 1; i <= ruleused.Size(); i++)
(*testout) << setw(4) << ruleused.Get(i) (*testout) << setw(4) << ruleused.Get(i)
<< " times used rule " << rules.Get(i) -> Name() << endl; << " times used rule " << rules.Get(i) -> Name() << endl;
@ -742,7 +742,7 @@ void Meshing3 :: BlockFill (Mesh & mesh, double gh)
double xminb, xmaxb, yminb, ymaxb, zminb, zmaxb; double xminb, xmaxb, yminb, ymaxb, zminb, zmaxb;
//double rad = 0.7 * gh; //double rad = 0.7 * gh;
for (i = 1; i <= adfront->GetNP(); i++) for(int i = 1; i <= adfront->GetNP(); i++)
{ {
const Point3d & p = adfront->GetPoint(PointIndex(i)); const Point3d & p = adfront->GetPoint(PointIndex(i));
if (i == 1) if (i == 1)
@ -780,13 +780,13 @@ void Meshing3 :: BlockFill (Mesh & mesh, double gh)
// initialize inner to 1 // initialize inner to 1
for (i = 1; i <= n; i++) for(int i = 1; i <= n; i++)
inner.Elem(i) = BLOCKUNDEF; inner.Elem(i) = BLOCKUNDEF;
// set blocks cutting surfaces to 0 // set blocks cutting surfaces to 0
for (i = 1; i <= adfront->GetNF(); i++) for(int i = 1; i <= adfront->GetNF(); i++)
{ {
const MiniElement2d & el = adfront->GetFace(i); const MiniElement2d & el = adfront->GetFace(i);
xminb = xmax; xmaxb = xmin; xminb = xmax; xmaxb = xmin;
@ -916,14 +916,14 @@ void Meshing3 :: BlockFill (Mesh & mesh, double gh)
filled = 0; filled = 0;
for (i = 1; i <= n; i++) for(int i = 1; i <= n; i++)
if (inner.Elem(i) == BLOCKINNER) if (inner.Elem(i) == BLOCKINNER)
{ {
filled++; filled++;
} }
PrintMessage (5, "Filled blocks: ", filled); PrintMessage (5, "Filled blocks: ", filled);
for (i = 1; i <= n; i++) for(int i = 1; i <= n; i++)
{ {
pointnr.Elem(i) = 0; pointnr.Elem(i) = 0;
frontpointnr.Elem(i) = 0; frontpointnr.Elem(i) = 0;