​Spend some time with C++ and it becomes more obvious that ~0 and -1 are
the same thing:  0 is an integer, and ~0 is also an integer, with the bits
flipped, and -1 is an integer with the same bit pattern as ~0. So if the
intent is to have an unsigned int with the same bit pattern as ~0 or -1,
the way to write that is ~0U (0U is an unsigned int, and ~ is an also an
unsigned int, but with the bits flipped.) [Invariably C++ throws out
warnings and/or errors for this type of thing, unlike C.]

Burt
_______________________________________________
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Reply via email to