After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 795152 - gdesktopappinfo: Mark GDesktopAppInfo constructors as nullable.
gdesktopappinfo: Mark GDesktopAppInfo constructors as nullable.
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: introspection
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2018-04-11 11:03 UTC by Tomasz Miąsko
Modified: 2018-05-04 16:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Mark GDesktopAppInfo constructors as nullable. (1.56 KB, patch)
2018-04-11 11:03 UTC, Tomasz Miąsko
none Details | Review
gdesktopappinfo: Mark GDesktopAppInfo constructors as nullable. (1.60 KB, patch)
2018-05-04 16:02 UTC, Tomasz Miąsko
committed Details | Review

Description Tomasz Miąsko 2018-04-11 11:03:46 UTC
Created attachment 370783 [details] [review]
Mark GDesktopAppInfo constructors as nullable.

GDesktopAppInfo constructors return NULL on an error and could be annotated
accordingly. Patch attached.
Comment 1 Ernestas Kulik 2018-04-11 11:13:31 UTC
But NULL is not a valid return value, as it indicates an error.
Comment 2 Ernestas Kulik 2018-04-11 11:14:27 UTC
These always trip me up, I might be wrong.
Comment 3 Philip Withnall 2018-04-11 11:39:23 UTC
Review of attachment 370783 [details] [review]:

This is correct, as there is no GError** parameter. If there is a GError** parameter, the return type should not be annotated as (nullable), unless NULL can also be returned when an error is not set. gobject-introspection knows that if a GError** is set, a function will (by convention) return NULL.

::: gio/gdesktopappinfo.c
@@ +1839,3 @@
  * Creates a new #GDesktopAppInfo.
  *
+ * Returns: (nullable) a new #GDesktopAppInfo or %NULL on error.

Missing `:` after `(nullable)`. Annotations should always have two colons:

Returns: (nullable): a new #GDesktopAppInfo, or %NULL on error.

Same for the ones below.
Comment 4 Tomasz Miąsko 2018-05-04 16:02:09 UTC
Created attachment 371677 [details] [review]
gdesktopappinfo: Mark GDesktopAppInfo constructors as nullable.

Thanks, updated accordingly.
Comment 5 Philip Withnall 2018-05-04 16:12:49 UTC
Review of attachment 371677 [details] [review]:

Thanks.
Comment 6 Philip Withnall 2018-05-04 16:15:49 UTC
Pushed to master, thanks.

Attachment 371677 [details] pushed as 9d40f64 - gdesktopappinfo: Mark GDesktopAppInfo constructors as nullable.