svn commit: r340450 - head/sys/sys

Andriy Gapon avg at FreeBSD.org
Mon Nov 19 07:31:46 UTC 2018


On 19/11/2018 03:38, Warner Losh wrote:
> I'll talk to Allan to see if he can test that. the bare 1 should be handled
> properly because of C's promotion rules. 1ull << 32 is an unsigned long long.
> What I really wanted was "~(uint32_t)0" but that construct has bit me in the past.

I think that you could just do (unsigned int)-1 or UINT_MAX.

As a side note, I wonder if those functions are ever used on negative values,
given the type of the argument, and if anyone checked their correctness in that
case.

-- 
Andriy Gapon


More information about the svn-src-all mailing list