Skip to content

Commit d9f033d

Browse files
author
nitrocaster
committed
xrRender_R3: Fix conformance in For loop scope (#104).
1 parent 993864c commit d9f033d

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

src/Layers/xrRenderDX10/StateManager/dx10SamplerStateCache.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ void dx10SamplerStateCache::CreateState( StateDecs desc, IDeviceState** ppIState
5353
dx10SamplerStateCache::SHandle dx10SamplerStateCache::FindState( const StateDecs& desc, u32 StateCRC )
5454
{
5555
u32 res = 0xffffffff;
56-
for (u32 i=0; i<m_StateArray.size(); ++i)
56+
u32 i = 0;
57+
while (i<m_StateArray.size())
5758
{
5859
if (m_StateArray[i].m_crc==StateCRC)
5960
{
@@ -72,6 +73,7 @@ dx10SamplerStateCache::SHandle dx10SamplerStateCache::FindState( const StateDecs
7273
// VERIFY(0);
7374
//}
7475
}
76+
i++;
7577
}
7678

7779
return res != 0xffffffff ? i : (u32)hInvalidHandle;

src/Layers/xrRenderPC_R3/r3_loader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ void CRender::LoadSectors(IReader* fs)
348348
{
349349
CDB::Collector CL;
350350
fs->find_chunk (fsL_PORTALS);
351-
for (i=0; i<count; i++)
351+
for (u32 i=0; i<count; i++)
352352
{
353353
b_portal P;
354354
fs->r (&P,sizeof(P));

src/Layers/xrRenderPC_R3/r3_rendertarget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ CRenderTarget::CRenderTarget ()
877877
descHBAO.CPUAccessFlags = 0;
878878
descHBAO.MiscFlags = 0;
879879

880-
it = TEX_jitter_count-1;
880+
int it = TEX_jitter_count-1;
881881
subData[it].pSysMem = tempDataHBAO;
882882
subData[it].SysMemPitch = descHBAO.Width*sampleSize * sizeof(float);
883883

src/Layers/xrRenderPC_R3/r3_rendertarget_phase_bloom.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ void CalcGauss_k7(
4040
// calculate
4141
float mag = 0;
4242
for (int i=-7; i<=0; i++) W[-i] = expf (-float(i*i)/(2*r*r)); // weight
43-
for (i=0; i<8; i++) mag += i?2*W[i]:W[i]; // symmetrical weight
44-
for (i=0; i<8; i++) W[i] = s_out*W[i]/mag;
43+
for (int i=0; i<8; i++) mag += i?2*W[i]:W[i]; // symmetrical weight
44+
for (int i=0; i<8; i++) W[i] = s_out*W[i]/mag;
4545

4646
// W[0]=0, W[7]=-7
4747
w0.set (W[1],W[2],W[3],W[4]); // -1, -2, -3, -4

0 commit comments

Comments
 (0)