[xkbcommon] Use an integer type for modifiers bit mask.

Thiago Macieira thiago.macieira at intel.com
Thu Oct 3 21:45:04 PDT 2013


On quinta-feira, 3 de outubro de 2013 23:03:44, Wander Lairson Costa wrote:
> If we combine two enum values, the result is not a valid enum value
> anymore, so it cannot be attributed to an enum variable.
> 
> C++ compilers will complain if such an assigment is done.

This is done all the time in C++. The enum must be backed by an integer with 
at least as many bits as the enum possesses. With the ABI that GCC uses, it's 
always at least 4 bytes.

The only thing is that you need to cast it from integer back to the enum type.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20131003/a2224f71/attachment.pgp>


More information about the wayland-devel mailing list