GNOME Bugzilla – Bug 759391
Add 'nullable'/'allow-none' to many return values
Last modified: 2015-12-15 12:11:43 UTC
Created attachment 317259 [details] [review] Patch to add nullable annotation to many return values I did a simple grep over the code base to see where the human readable docs said that NULL could be returned but no `nullable`/`allow-none` annotation was present.
Created attachment 317260 [details] [review] Patch to add allow-none annotation to many return values (gtk2)
Looks like we're trying to solve the same problem, but you've covered more functions: https://bugzilla.gnome.org/show_bug.cgi?id=753520 I have one comment though: I don't understand why the use of allow-none in gtk2, allow-none is not used anymore for return values, nullables is the way to go, and GObject introspection is independent from gtk. I am pretty sure you ought to be using nullable there.
@Alberto: I didn't find a single mention of 'nullable' in gtk2 branch, so I thought, I'd go with the already present style.
(In reply to Erika from comment #3) > @Alberto: I didn't find a single mention of 'nullable' in gtk2 branch, so I > thought, I'd go with the already present style. allow-none is only used for arguments not for return values, nullable was recently added Also, you seemed to have added nullable to quite a few functions that return NULL only when an error occurs and constructors as well which should not be done.
*** This bug has been marked as a duplicate of bug 753520 ***