[Base] Fix non-Windows bit_scan_forward.

This commit is contained in:
gibbed 2020-02-09 16:36:20 -06:00 committed by Rick Gibbed
parent fc37f3e93a
commit 0b3cdf2aaa
1 changed files with 2 additions and 2 deletions

View File

@ -233,12 +233,12 @@ inline bool bit_scan_forward(uint64_t v, uint32_t* out_first_set_index) {
#else
inline bool bit_scan_forward(uint32_t v, uint32_t* out_first_set_index) {
int i = ffs(v);
*out_first_set_index = i;
*out_first_set_index = i - 1;
return i != 0;
}
inline bool bit_scan_forward(uint64_t v, uint32_t* out_first_set_index) {
int i = ffsll(v);
*out_first_set_index = i;
*out_first_set_index = i - 1;
return i != 0;
}
#endif // XE_PLATFORM_WIN32