Skip to content

Commit

Permalink
Fix VC warning
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-lunarg committed Feb 8, 2024
1 parent 0a3aa8b commit ce58d95
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/core/core_func_integer_find_lsb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ static int ntz7_christophe(unsigned x)
unsigned y, bz, b4, b3, b2, b1, b0;

y = x & -x; // Isolate rightmost 1-bit.
bz = unsigned(!bool(y)); // 1 if y = 0.
b4 = unsigned(!bool(y & 0x0000FFFF)) * 16;
b3 = unsigned(!bool(y & 0x00FF00FF)) * 8;
b2 = unsigned(!bool(y & 0x0F0F0F0F)) * 4;
b1 = unsigned(!bool(y & 0x33333333)) * 2;
b0 = unsigned(!bool(y & 0x55555555)) * 1;
bz = static_cast<unsigned>(!static_cast<bool>(y)); // 1 if y = 0.
b4 = static_cast<unsigned>(!static_cast<bool>(y & 0x0000FFFF)) * 16;
b3 = static_cast<unsigned>(!static_cast<bool>(y & 0x00FF00FF)) * 8;
b2 = static_cast<unsigned>(!static_cast<bool>(y & 0x0F0F0F0F)) * 4;
b1 = static_cast<unsigned>(!static_cast<bool>(y & 0x33333333)) * 2;
b0 = static_cast<unsigned>(!static_cast<bool>(y & 0x55555555)) * 1;
return bz + b4 + b3 + b2 + b1 + b0;
}

Expand Down

0 comments on commit ce58d95

Please sign in to comment.