[flac-dev] unsigned int and FLAC__uint32 are used interchangeably

lvqcl lvqcl.mail at gmail.com
Sun Jan 15 05:00:18 UTC 2017


Erik de Castro Lopo wrote:

>> Also MSVC fails because src/libFLAC/include/private/bitmath.h now
>> contains "uint32_t long idx" instead of "unsigned long idx".
>
> Ah, missed that because it was MSVC code. They should be `uint64_t`.

No, sizeof(unsigned long) is always 4 on Windows.
See http://www.viva64.com/en/t/0012/

>> According to MSDN _BitScanReverse*() functions have signatures:
>> unsigned char _BitScanReverse(unsigned long *, unsigned long);
>> unsigned char _BitScanReverse64(unsigned long *, unsigned __int64);
>
> The `unsigned long` type should be synonymous with `uint64_t` so using
> `uint64_t` should be safe. Furthermore if they aren't synonymous we
> *want* that to be a compile error!

It's synonymous to uint32_t, but if the 1st parameter for  
_BitScanReverse*()
functions has 'pointer to unsigned long' type then IMHO it's better to
simply use unsigned long variable there.


More information about the flac-dev mailing list