GNOME Bugzilla – Bug 791023
Constant type declarations missing from gobject.vapi
Last modified: 2017-11-30 17:05:23 UTC
Created attachment 364668 [details] [review] 0001-gobject.vapi-add-missing-GObject-type-constants.patch Several constant-valued GTypes listed in the GObject documentation[1] are not declared in the Vala bindings, which can make things like switch statements with GTypes a pain. I've added a patch that just adds the missing declarations to gobject-2.0.vapi.
Review of attachment 364668 [details] [review]: Looks good. Couple of points: - GTYPE and CHECKSUM are missing, why are they not needed? - Maybe sort the constants alphabetically, this makes them appear in order on the valadoc.org page: https://valadoc.org/gobject-2.0/GLib.Type.html I know the current order is the same as the documentation https://developer.gnome.org/gobject/stable/gobject-Type-Information.html
> - GTYPE and CHECKSUM are missing, why are they not needed? GTYPE and CHECKSUM aren't constants, they're function calls. I suppose they could still be added, but it might cause unexpected C errors since a C compiler doesn't typically allow a function call to be used in a 'case' statement, for example. > - GTYPE and CHECKSUM are missing, why are they not needed? I'll add an amended patch in a moment.
woops, that last quote was meant to read: > - Maybe sort the constants alphabetically
Created attachment 364678 [details] [review] 0001-gobject.vapi-add-missing-GObject-type-constants.patch Sorted GType constants alphabetically
Review of attachment 364678 [details] [review]: Looks good to me, patch applies and has the relevant constants