Skip to content

Commit ad729c8

Browse files
author
nitrocaster
committed
xrLC: Fix conformance in For loop scope (#104).
1 parent 83440c9 commit ad729c8

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/Common/NvMender2003/NVMeshMender.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,14 @@ void MeshMender::ProcessNormals(TriangleList& possibleNeighbors,
214214

215215

216216
//reset each triangle to prepare for smoothing group building
217-
for( unsigned int i = 0; i < possibleNeighbors.size(); ++i )
217+
for(u32 i = 0; i < possibleNeighbors.size(); ++i )
218218
{
219219
m_Triangles[ possibleNeighbors[i] ].Reset();
220220
}
221221

222222
//now start building groups
223223
CanSmoothNormalsChecker canSmoothNormalsChecker;
224-
for( i = 0; i < possibleNeighbors.size(); ++i )
224+
for(u32 i = 0; i < possibleNeighbors.size(); ++i )
225225
{
226226
Triangle* currTri = &(m_Triangles[ possibleNeighbors[i] ]);
227227
assert(currTri);
@@ -236,7 +236,7 @@ void MeshMender::ProcessNormals(TriangleList& possibleNeighbors,
236236

237237
xr_vector<D3DXVECTOR3> groupNormalVectors;
238238

239-
for( i = 0; i < neighborGroups.size(); ++i )
239+
for(u32 i = 0; i < neighborGroups.size(); ++i )
240240
{
241241
//for each group, calculate the group normal
242242
TriangleList& curGroup = neighborGroups[ i ];
@@ -256,7 +256,7 @@ void MeshMender::ProcessNormals(TriangleList& possibleNeighbors,
256256
//next step, ensure that triangles in different groups are not
257257
//sharing vertices. and give the shared vertex their new group vector
258258
xr_set<size_t> otherGroupsIndices;
259-
for( i = 0; i < neighborGroups.size(); ++i )
259+
for(u32 i = 0; i < neighborGroups.size(); ++i )
260260
{
261261
TriangleList& curGroup = neighborGroups[ i ];
262262
xr_set<size_t> thisGroupIndices;
@@ -313,14 +313,14 @@ void MeshMender::ProcessTangents(TriangleList& possibleNeighbors,
313313

314314

315315
//reset each triangle to prepare for smoothing group building
316-
for(unsigned int i =0; i < possibleNeighbors.size(); ++i)
316+
for(u32 i =0; i < possibleNeighbors.size(); ++i)
317317
{
318318
m_Triangles[ possibleNeighbors[i] ].Reset();
319319
}
320320

321321
//now start building groups
322322
CanSmoothTangentsChecker canSmoothTangentsChecker;
323-
for(i =0; i < possibleNeighbors.size(); ++i)
323+
for(u32 i =0; i < possibleNeighbors.size(); ++i)
324324
{
325325
Triangle* currTri = &(m_Triangles[ possibleNeighbors[i] ]);
326326
assert(currTri);
@@ -336,7 +336,7 @@ void MeshMender::ProcessTangents(TriangleList& possibleNeighbors,
336336
xr_vector<D3DXVECTOR3> groupTangentVectors;
337337

338338

339-
for(i=0; i<neighborGroups.size(); ++i)
339+
for(u32 i=0; i<neighborGroups.size(); ++i)
340340
{
341341
D3DXVECTOR3 gtang(0,0,0);
342342
for(unsigned int t = 0; t < neighborGroups[i].size(); ++t)//for each triangle in the group,
@@ -351,7 +351,7 @@ void MeshMender::ProcessTangents(TriangleList& possibleNeighbors,
351351
//next step, ensure that triangles in different groups are not
352352
//sharing vertices. and give the shared vertex their new group vector
353353
xr_set<size_t> otherGroupsIndices;
354-
for( i = 0; i < neighborGroups.size(); ++i )
354+
for(u32 i = 0; i < neighborGroups.size(); ++i )
355355
{
356356
TriangleList& curGroup = neighborGroups[ i ];
357357
xr_set<size_t> thisGroupIndices;
@@ -410,14 +410,14 @@ void MeshMender::ProcessBinormals(TriangleList& possibleNeighbors,
410410

411411

412412
//reset each triangle to prepare for smoothing group building
413-
for(unsigned int i =0; i < possibleNeighbors.size(); ++i )
413+
for(u32 i =0; i < possibleNeighbors.size(); ++i )
414414
{
415415
m_Triangles[ possibleNeighbors[i] ].Reset();
416416
}
417417

418418
//now start building groups
419419
CanSmoothBinormalsChecker canSmoothBinormalsChecker;
420-
for(i =0; i < possibleNeighbors.size(); ++i )
420+
for(u32 i =0; i < possibleNeighbors.size(); ++i )
421421
{
422422
Triangle* currTri = &(m_Triangles[ possibleNeighbors[i] ]);
423423
assert(currTri);
@@ -433,7 +433,7 @@ void MeshMender::ProcessBinormals(TriangleList& possibleNeighbors,
433433
xr_vector<D3DXVECTOR3> groupBinormalVectors;
434434

435435

436-
for(i=0; i<neighborGroups.size(); ++i)
436+
for(u32 i=0; i<neighborGroups.size(); ++i)
437437
{
438438
D3DXVECTOR3 gbinormal(0,0,0);
439439
for(unsigned int t = 0; t < neighborGroups[i].size(); ++t)//for each triangle in the group,
@@ -448,7 +448,7 @@ void MeshMender::ProcessBinormals(TriangleList& possibleNeighbors,
448448
//next step, ensure that triangles in different groups are not
449449
//sharing vertices. and give the shared vertex their new group vector
450450
xr_set<size_t> otherGroupsIndices;
451-
for( i = 0; i < neighborGroups.size(); ++i )
451+
for(u32 i = 0; i < neighborGroups.size(); ++i )
452452
{
453453
TriangleList& curGroup = neighborGroups[ i ];
454454
xr_set<size_t> thisGroupIndices;

src/utils/xrLC/xrOptimizeCFORM_qslim.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void SimplifyCFORM (CDB::CollectorPacked& CL)
106106

107107
// constraint material&sector vertex
108108
Ivector2 f_rm[3]={{0,1}, {1,2}, {2,0}};
109-
for (f_idx=0; f_idx<slim->valid_faces; f_idx++){
109+
for (u32 f_idx=0; f_idx<slim->valid_faces; f_idx++){
110110
if (mdl->face_is_valid(f_idx)){
111111
MxFace& base_f = mdl->face(f_idx);
112112
for (u32 edge_idx=0; edge_idx<3; edge_idx++){
@@ -154,7 +154,7 @@ void SimplifyCFORM (CDB::CollectorPacked& CL)
154154
mdl->compact_vertices ();
155155

156156
// rebuild CDB
157-
for (f_idx=0; f_idx<mdl->face_count(); f_idx++){
157+
for (u32 f_idx=0; f_idx<mdl->face_count(); f_idx++){
158158
if (mdl->face_is_valid(f_idx)){
159159
MxFace& F = mdl->face(f_idx);
160160
face_props& FP = FPs[f_idx];

0 commit comments

Comments
 (0)