Re: [pkcs11] Ones Complement versus Twos Complement - RE: Use CK_UNAVAILABLE_INFORMATION

From
Wan-Teh Chang <>
Date
2013-06-12T23:42:52+00:00
ID
Thread
Re: [pkcs11] Ones Complement versus Twos Complement - RE: Use CK_UNAVAILABLE_INFORMATION
Bob,

Thank you for writing this email. It was my action item from the
conference call today. You saved me some work.

The current definition of
        #define CK_UNAVAILABLE_INFORMATION (~0UL)
seems fine to me. My interpretation of  ~0UL is not -1 cast to
unsigned long, but rather the maximum value of unsigned long, i.e.,
the value of the ULONG_MAX macro defined in <limits.h>.

I don't understand why -1 cast to unsigned long would be better than
~0UL. ~0UL seems to be a portable way to represent the unsigned long
value consisting of all one bits.

Wan-Teh