Skip to content

Commit 92ef30e

Browse files
author
nitrocaster
committed
xrDXT: Fix conformance in For loop scope (#104).
1 parent 8cd1471 commit 92ef30e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/utils/xrDXT/Image_DXTC.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -990,9 +990,11 @@ inline void GetColorBlockColors_m1(DXTColBlock* pBlock, Color8888* col_0, Color8
990990
//-----------------------------------------------------------------------------
991991
WORD GetNumberOfBits(DWORD dwMask)
992992
{
993-
for (WORD wBits = 0; dwMask; wBits++)
993+
WORD wBits = 0;
994+
while (dwMask)
994995
{
995-
dwMask = dwMask & (dwMask - 1);
996+
dwMask &= dwMask-1;
997+
wBits++;
996998
}
997999
return wBits;
9981000
}

0 commit comments

Comments
 (0)