Skip to content

Commit 35bd837

Browse files
author
nitrocaster
committed
xrCDB: Fix conformance in For loop scope (#104).
1 parent b1e139d commit 35bd837

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/xrCDB/Frustum.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ void CFrustum::CreateOccluder(Fvector* p, int count, Fvector& vBase, CFrustum& c
257257
for (int j=0; j<count; j++) cls[j]=_abs(P.classify(p[j]));
258258

259259
// test edges to see which lies directly on plane
260-
for (j=0; j<count; j++) {
260+
for (int j=0; j<count; j++) {
261261
if (cls[j]<EPS_L)
262262
{
263263
int next = j+1; if (next>=count) next=0;
@@ -272,7 +272,7 @@ void CFrustum::CreateOccluder(Fvector* p, int count, Fvector& vBase, CFrustum& c
272272
// here we have all edges marked accordenly to 'open' / 'closed' classification
273273
_clear ();
274274
_add (p[0],p[1],p[2]); // main plane
275-
for (i=0; i<count; i++)
275+
for (int i=0; i<count; i++)
276276
{
277277
if (!edge[i]) {
278278
int next = i+1; if (next>=count) next=0;
@@ -300,7 +300,7 @@ sPoly* CFrustum::ClipPoly(sPoly& S, sPoly& D) const
300300
cls[src->size()] = cls[0];
301301
src->push_back((*src)[0]);
302302
Fvector D; float denum,t;
303-
for (j=0; j<src->size()-1; j++)
303+
for (u32 j=0; j<src->size()-1; j++)
304304
{
305305
if ((*src)[j].similar((*src)[j+1],EPS_S)) continue;
306306

src/xrCDB/OPC_AABBTree.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ bool AABBTreeNode::Subdivide(AABBTreeBuilder* builder)
180180

181181
// Compute variances
182182
Point Vars(0.0f, 0.0f, 0.0f);
183-
for(i=0;i<mNbPrimitives;i++)
183+
for(udword i=0;i<mNbPrimitives;i++)
184184
{
185185
udword Index = mNodePrimitives[i];
186186
float Cx = builder->GetSplittingValue(Index, 0);

src/xrCDB/OPC_OptimizedTree.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ bool AABBNoLeafTree::Build(AABBTree* tree)
354354
mExtentsCoeff.y = 1.0f / EQuantCoeff.y; \
355355
mExtentsCoeff.z = 1.0f / EQuantCoeff.z;
356356

357-
#define PERFORM_QUANTIZATION \
357+
#define PERFORM_QUANTIZATION(i)\
358358
/* Quantize */ \
359359
((float*)mNodes[i].mAABB.mCenter)[0] = sword(Nodes[i].mAABB.mCenter.x * CQuantCoeff.x); \
360360
((float*)mNodes[i].mAABB.mCenter)[1] = sword(Nodes[i].mAABB.mCenter.y * CQuantCoeff.y); \
@@ -460,9 +460,9 @@ bool AABBQuantizedTree::Build(AABBTree* tree)
460460

461461
// Quantize
462462
uintptr_t Data;
463-
for(i=0;i<mNbNodes;i++)
463+
for (udword i = 0; i<mNbNodes; i++)
464464
{
465-
PERFORM_QUANTIZATION
465+
PERFORM_QUANTIZATION(i)
466466
REMAP_DATA(mData)
467467
}
468468

@@ -538,9 +538,9 @@ bool AABBQuantizedNoLeafTree::Build(AABBTree* tree)
538538

539539
// Quantize
540540
uintptr_t Data;
541-
for(i=0;i<mNbNodes;i++)
541+
for(udword i = 0; i<mNbNodes; i++)
542542
{
543-
PERFORM_QUANTIZATION
543+
PERFORM_QUANTIZATION(i)
544544
REMAP_DATA(mData)
545545
REMAP_DATA(mData2)
546546
}

0 commit comments

Comments
 (0)