Re: G_TYPE_<unterminated-string> (was: Re: Status of 2.0 API freeze bugs)



Owen Taylor wrote:

> OK, let's forget about strings for now and look at the question of
> arrays in general:
>
> Currently, it's clear that there is a considerable lack of unity:
>
>  Pango, GDK, and much of GTK+ (GtkTextView, etc.), use the 'widget, n_widgets'
>  ordering.
>
>  GObject and other parts of GTK+ (GtkItemfactory, etc.) use the 'n_widgets, widgets'.
>
> If you count the instances, the majority is certainly the first ordering,
> but it's conceivable that this is something "new-fangled", and Havoc and
> I have been rapidly adding API with stuff in the wrong order.

If you look at functions in the Standard C Library that use arrays (fread, qsort,
memcpy, etc.), element sizes and counts always follow the array.  I'm not sure what
their rationale is but they set the standard (or convention in this case.

Eric.






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