[vala/mjog/gbytes-nullable-get-data] glib: Flag GLib.Bytes values as nullable



commit afca5bff112717897c49faab20b74ee5f28403e5
Author: Michael Gratton <mike vee net>
Date:   Thu Jun 25 16:56:46 2020 +1000

    glib: Flag GLib.Bytes values as nullable
    
    [Per the docs](https://developer.gnome.org/glib/stable/glib-Byte-Arrays.html),
    ctors accepting uint8 arrays accept null as 0-sized arrays and the
    `get_data` may return null if the size of the buffer is 0.

 vapi/glib-2.0.vapi | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index 839ceff98..cfdfcd930 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -5318,17 +5318,17 @@ namespace GLib {
        [Version (since = "2.32")]
        [CCode (cprefix = "g_bytes_", ref_function = "g_bytes_ref", unref_function = "g_bytes_unref", type_id 
= "G_TYPE_BYTES")]
        public class Bytes {
-               public Bytes ([CCode (array_length_type = "gsize")] uint8[] data);
-               public Bytes.take ([CCode (array_length_type = "gsize")] owned uint8[] data);
-               public Bytes.static ([CCode (array_length_type = "gsize")] uint8[] data);
-               public Bytes.with_free_func ([CCode (array_length_type = "gsize")] owned uint8[] data, 
GLib.DestroyNotify? free_func, void* user_data);
+               public Bytes ([CCode (array_length_type = "gsize")] uint8[]? data);
+               public Bytes.take ([CCode (array_length_type = "gsize")] owned uint8[]? data);
+               public Bytes.static ([CCode (array_length_type = "gsize")] uint8[]? data);
+               public Bytes.with_free_func ([CCode (array_length_type = "gsize")] owned uint8[]? data, 
GLib.DestroyNotify? free_func, void* user_data);
                public Bytes.from_bytes (GLib.Bytes bytes, size_t offset, size_t length);
 
                [CCode (cname = "g_bytes_new_with_free_func", simple_generics = true)]
                public static Bytes new_with_owner<T> ([CCode (array_length_type = "gsize")] uint8[] data, 
[CCode (destroy_notify_pos = 1.9)] owned T? owner = null);
 
                [CCode (array_length_type = "gsize")]
-               public unowned uint8[] get_data ();
+               public unowned uint8[]? get_data ();
                public size_t get_size ();
                public uint hash ();
                public int compare (GLib.Bytes bytes2);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]