Skip to content
Commit 72671f62 authored by Colomban Wendling's avatar Colomban Wendling Committed by Rico Tzschichholz
Browse files

Fix converting enumerations and flags to arrays

Enumerations and flags are classed types for Vala, not integers, so
they don't fall in the `typeof(G) == typeof(int)` kind of tests. This
leads to using the generic code in which Vala assumes pointer-sized
elements, which is often not true for enumerations and flags.

Add special case for those to use the `int` converters for enumerations
and flags.

This is most generally correct, but not always: the compiler will
likely chose a larger type for a specific enumeration if one of its
value is larger than `int`.  It would be tempting to use the
enumeration's class minimum and maximum values to determine the
appropriate type, but unfortunately the API for this uses int itself,
so doesn't help.

https://bugzilla.gnome.org/show_bug.cgi?id=774669
parent d52a07b1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment