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 730957 - Missing nullability annotations
Missing nullability annotations
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other Linux
: Normal normal
: 1.3.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 730983
 
 
Reported: 2014-05-29 20:14 UTC by Evan Nemerson
Modified: 2014-06-28 08:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
introspection: add many missing nullability annotations (10.06 KB, patch)
2014-05-29 20:14 UTC, Evan Nemerson
none Details | Review
introspection: add many missing nullability annotations (23.71 KB, patch)
2014-05-29 22:02 UTC, Evan Nemerson
none Details | Review
introspection: add many missing nullability annotations (83.59 KB, patch)
2014-05-30 03:45 UTC, Evan Nemerson
none Details | Review
introspection: add many missing nullability annotations (86.09 KB, patch)
2014-05-30 08:19 UTC, Evan Nemerson
none Details | Review
introspection: add missing (nullable) annotations to return values (60.59 KB, patch)
2014-06-11 23:22 UTC, Evan Nemerson
committed Details | Review
introspection: add nullability annotations to out and inout params (10.44 KB, patch)
2014-06-11 23:24 UTC, Evan Nemerson
committed Details | Review
introspection: add some missing allow-none annotations to in params (13.53 KB, patch)
2014-06-11 23:25 UTC, Evan Nemerson
committed Details | Review

Description Evan Nemerson 2014-05-29 20:14:59 UTC
Created attachment 277484 [details] [review]
introspection: add many missing nullability annotations

Just the stuff I found based on grepping for %NULL, I'm sure it's not complete.

Also, I'll do it again after I finish switching all the docs from NULL to %NULL, so please don't close this bug yet.
Comment 1 Evan Nemerson 2014-05-29 22:02:36 UTC
Created attachment 277495 [details] [review]
introspection: add many missing nullability annotations

Oops, attached the one for gst-rtsp-server by accident.  This is the one for gstreamer core.
Comment 2 Evan Nemerson 2014-05-30 03:45:43 UTC
Created attachment 277509 [details] [review]
introspection: add many missing nullability annotations

Complete version—went through all the documentation looking for %NULL after the patch from bug #730961 was applied.
Comment 3 Evan Nemerson 2014-05-30 08:19:31 UTC
Created attachment 277519 [details] [review]
introspection: add many missing nullability annotations

As requested, version which includes both nullable/optional and allow-none annotations.
Comment 4 Evan Nemerson 2014-06-11 23:22:47 UTC
Created attachment 278292 [details] [review]
introspection: add missing (nullable) annotations to return values

Splitting this up to make it a bit more reviewer-friendly.  

Support for (nullable) was added to G-I at the same time as nullable return values.  Previous versions of G-I will not mark return values as nullable, even when an (allow-none) annotation is present, so it is not necessary to add (allow-none) annotations for compatibility with older versions of G-I.
Comment 5 Evan Nemerson 2014-06-11 23:24:55 UTC
Created attachment 278293 [details] [review]
introspection: add nullability annotations to out and inout params

This one deals with out and inout params only, adding (nullable) and (allow-none) annotations where appropriate.  (nullable) is only available in new G-I, but there was no equivalent in older versions, so the only fallout should be some harmless warnings from g-ir-scanner about an unknown annotation.
Comment 6 Evan Nemerson 2014-06-11 23:25:59 UTC
Created attachment 278294 [details] [review]
introspection: add some missing allow-none annotations to in params

This one is for in params which are missing allow-one annotations.
Comment 7 Sebastian Dröge (slomo) 2014-06-26 17:03:34 UTC
Review of attachment 278294 [details] [review]:

::: gst/gstmessage.c
@@ +787,3 @@
  * @src: (transfer none): The object originating the message.
+ * @structure: (transfer full) (allow-none): The structure for the
+ *     message. The message will take ownership of the structure.

While this technically allows NULL it is not really valid
Comment 8 Sebastian Dröge (slomo) 2014-06-26 17:05:56 UTC
commit fe192fe399bf5fb913938b1b70d9cbf198ede565
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Thu Jun 26 19:02:06 2014 +0200

    message: Application and element messages should not have NULL structures
    
    It does not make sense for them.

commit 4088363aead586c3dbcd0400b7f959744e49ad37
Author: Evan Nemerson <evan@nemerson.com>
Date:   Wed Jun 11 16:19:01 2014 -0700

    introspection: add some missing allow-none annotations to in params
    
    https://bugzilla.gnome.org/show_bug.cgi?id=730957

commit 5d80cf12ba095ab1957a8732d37e34a8b37551b9
Author: Evan Nemerson <evan@nemerson.com>
Date:   Wed Jun 11 16:06:19 2014 -0700

    introspection: add nullability annotations to out and inout params
    
    https://bugzilla.gnome.org/show_bug.cgi?id=730957

commit 2759882379fb4fd91038be3ff35cc9180e231841
Author: Evan Nemerson <evan@nemerson.com>
Date:   Wed Jun 11 15:21:34 2014 -0700

    introspection: add missing (nullable) annotations to return values
    
    Support for (nullable) was added to G-I at the same time as nullable
    return values.  Previous versions of G-I will not mark return values as
    nullable, even when an (allow-none) annotation is present, so it is
    not necessary to add (allow-none) annotations for compatibility with
    older versions of G-I.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=730957