The actual value of ~0UL is architecture dependent. The unsigned long type must be at least 32 bits, but can be larger. Especially on 64-bit systems, unsigned long usually is 64 bits long, for which ~0UL will result in 0xFFFFFFFFFFFFFFFF instead of 0xFFFFFFFF. If this is the case, comparisons like kv->len == ~0UL, where kv->len is of type uint32_t, are always false. This commit replaces ~0UL with the appropriate max value defines from stdint.h.
The actual value of
~0UL
is architecture dependent. Theunsigned long
type must be at least 32 bits, but can be larger. Especially on 64-bit systems,unsigned long
usually is 64 bits long, for which~0UL
will result in0xFFFFFFFFFFFFFFFF
instead of0xFFFFFFFF
. If this is the case, comparisons likekv->len == ~0UL
, wherekv->len
is of typeuint32_t
, are always false. This commit replaces~0UL
with the appropriate max value defines from stdint.h.