[glib/glib-2-34] GBytes: Add missing annotations



commit e10e97fa9d698d602908078ab24aa95e86e9b9b8
Author: Martin Pitt <martinpitt gnome org>
Date:   Fri Nov 9 09:02:22 2012 +0100

    GBytes: Add missing annotations
    
    Annotate g_bytes_new*()'s data argument to be a guint8 array, as
    introspection clients cannot deal with raw gconstpointers. This makes
    GBytes' behaviour similar to GByteArray whose API already uses guint8.
    
    Add missing transfer annotation to g_bytes_get_data() to make it
    introspectable.
    
    This is covered by test cases in PyGObject.

 glib/gbytes.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/glib/gbytes.c b/glib/gbytes.c
index 93f74dd..4d1f6c6 100644
--- a/glib/gbytes.c
+++ b/glib/gbytes.c
@@ -77,7 +77,8 @@ struct _GBytes
 
 /**
  * g_bytes_new:
- * @data: (array length=size): the data to be used for the bytes
+ * @data: (transfer none) (array length=size) (element-type guint8):
+ *        the data to be used for the bytes
  * @size: the size of @data
  *
  * Creates a new #GBytes from @data.
@@ -97,7 +98,8 @@ g_bytes_new (gconstpointer data,
 
 /**
  * g_bytes_new_take:
- * @data: (transfer full) (array length=size): the data to be used for the bytes
+ * @data: (transfer full) (array length=size) (element-type guint8):
+          the data to be used for the bytes
  * @size: the size of @data
  *
  * Creates a new #GBytes from @data.
@@ -124,8 +126,9 @@ g_bytes_new_take (gpointer data,
 
 
 /**
- * g_bytes_new_static:
- * @data: (array length=size): the data to be used for the bytes
+ * g_bytes_new_static: (skip)
+ * @data: (transfer full) (array length=size) (element-type guint8):
+          the data to be used for the bytes
  * @size: the size of @data
  *
  * Creates a new #GBytes from static data.
@@ -218,7 +221,8 @@ g_bytes_new_from_bytes (GBytes  *bytes,
  *
  * This function will always return the same pointer for a given #GBytes.
  *
- * Returns: (array length=size) (type guint8): a pointer to the byte data
+ * Returns: (transfer none) (array length=size) (type guint8): a pointer to the
+ *          byte data
  *
  * Since: 2.32
  */



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