On sexta-feira, 4 de outubro de 2013 09:09:32, Wander Lairson Costa wrote: > The issued raised when I took code from window.c in the weston clients: > > mask = xkb_state_serialize_mods(input->xkb.state, > XKB_STATE_DEPRESSED | > XKB_STATE_LATCHED); > > g++ gave me a build error because I was passing an integer to enum > parameter. C++ is a bit more nit-picky than C regarding implicit > conversions. Therefore I had to use a cast.
Like you said, it's window.c. Why are you copy & pasting C code into a C++ file? > > With the ABI that GCC uses, it's always at least 4 bytes. > > Personally, I don't like enum's in the ABI at all, because according > to C/C++ standards, the compiler is free to choose whatever type it > likes, and indeed I had problems with that in the past. C++11 fixed > that [1]. But nevermind. We're not relying on the ABI. I said "The enum must be backed by an integer with at least as many bits as the enum possesses.". If you cast back from an int that contains one of the enum values or an OR combination of enum values, it *will* fit. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel