2011/10/5 bsquared <[email protected]>

> Luca Bruno <[email protected]> writes:
>
> > On Wed, Oct 5, 2011 at 6:30 PM, bsquared <[email protected]> wrote:
> >
> >> 1.  Is it necessary/recommended to specialize a generic?
> >>    The generated vapi has lists without specialization, and these work
> >>    fine in the tests.
> >>    public GLib.SList list_databases ();
> >>    public GLib.SList<string> list_databases ();
> >>
> >
> > The latter obviously.
> >
> I ask because in the gir the elements are generic, and the compiler does
> not issue warnings.
>
>
The better is to add annotations to gtk-doc, documentation if exists, in
order to define data type stored in lists using (element-type TYPE)
annotation.

See at
http://live.gnome.org/GObjectIntrospection/Annotations

Some times even with annotations is necessary to create a metadata file in
order to set correct data types. See at resent annotations and metadata done
in libgda at:

http://git.gnome.org/browse/libgda/tree/libgda/Gda-5.0.metadata?id=637f3d1e10e3d29b30083e59f7b49e4dc3eb0181



> >>
> >> 2. What can I do to optimize the generated c code in my tests?
> >>   The generated code is 4x the size of original test code
> >>   (test-couchdb-glib.c) as is the executable.
> >>
> >
> > For the C code, nothing. About the executable, optimize with -O3 (or
> -Os).
> >
> I was thinking there may be some kind of best practice to minimize the
> number of temp vars in the generated code.
>
> --
> Regards,
> Brian Winfrey
>
> _______________________________________________
> vala-list mailing list
> [email protected]
> http://mail.gnome.org/mailman/listinfo/vala-list
>
_______________________________________________
vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to