Skip to content

Commit

Permalink
Update CommonInclude.h
Browse files Browse the repository at this point in the history
  • Loading branch information
turanszkij authored Feb 23, 2024
1 parent 6763b7e commit 37a3c6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions WickedEngine/CommonInclude.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ inline unsigned long firstbithigh(unsigned long value)
unsigned long bit_index;
if (_BitScanReverse(&bit_index, value))
{
return bit_index;
return 31ul - bit_index;
}
return 0;
}
Expand All @@ -71,7 +71,7 @@ inline unsigned long firstbithigh(unsigned long long value)
unsigned long bit_index;
if (_BitScanReverse64(&bit_index, value))
{
return bit_index;
return 31ull - bit_index;
}
return 0;
}
Expand Down

0 comments on commit 37a3c6a

Please sign in to comment.