Re: [PATCH] gjs: Use enum info from GI, to support unregistered enums



> +                        first_value = g_enum_info_get_value((GIEnumInfo *)symbol_info, 0);
> +                        last_value = g_enum_info_get_value((GIEnumInfo *)symbol_info, n_values - 1);

> +                        if (arg->v_int < g_value_info_get_value(first_value) ||
>+                            arg->v_int > g_value_info_get_value(last_value)) {

Hmm, enum_values are guaranteed to be in increasing order? And I think
enums are not necessarily continuous. Would it make sense to have
something like 'gboolean g_enum_info_check_value()' in girepo itself?

Otherwise looks good to me.


-- 
Tommi Komulainen                                 tommi komulainen iki fi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]