platform.h (lines 552-553): _BitScanReverse #320

Open
opened 2026-01-29 20:41:59 +00:00 by claunia · 0 comments
Owner

Originally created by @dejanyy on GitHub (May 22, 2020).

On lines 552-553 of platform.h we have:

uint32_t msb;
_BitScanReverse(&msb, x);

I think "uint32_t msb;" is wrong. Certainly doesn't compile with MS Visual Studio 2017. Changing that line to "unsigned long msb;" seems to fix the problem. See:
https://docs.microsoft.com/en-us/cpp/intrinsics/bitscanreverse-bitscanreverse64?view=vs-2019

Originally created by @dejanyy on GitHub (May 22, 2020). On lines 552-553 of platform.h we have: uint32_t msb; _BitScanReverse(&msb, x); I think "uint32_t msb;" is wrong. Certainly doesn't compile with MS Visual Studio 2017. Changing that line to "unsigned long msb;" seems to fix the problem. See: https://docs.microsoft.com/en-us/cpp/intrinsics/bitscanreverse-bitscanreverse64?view=vs-2019
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#320