Enums, bitfields and wl_arrays
Pekka Paalanen
ppaalanen at gmail.com
Wed Oct 14 01:19:45 PDT 2015
On Tue, 13 Oct 2015 10:19:43 -0700
Bill Spitzak <spitzak at gmail.com> wrote:
> On 10/13/2015 08:18 AM, Erik De Rijcke wrote:
>
> > Because Java is not C/C++. In Java, enum values are unique by instance
> > alone. It does not have user 'defined' value(s) that make it unique. It
> > *can* have user defined properties (like any object) in addition to
> > implicit compiler generated enum type specific properties. One of
> > those properties is it's "ordinal". Change the order of the enums and
> > the ordinal property will change, which can cause undefined behavior.
> > Now you need to wonder no more. :)
>
> The language binding should sort the enum by numerical value and use
> that to determine the ordinal number. Ie it is based on the numerical
> value, not on the location in the xml file.
This still has the very same issue if you need to add a new value that
falls between existing values in the sort order.
You dropped all CC's, btw.
Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20151014/629766f0/attachment.sig>
More information about the wayland-devel
mailing list