GVariant: support serialising to GVariantVectors
[platform/upstream/glib.git] / glib / garray.c
index bb38c6b..8a94720 100644 (file)
@@ -71,9 +71,8 @@
  * |[<!-- language="C" -->
  *   GArray *garray;
  *   gint i;
- *   /&ast; We create a new array to store gint values.
- *    &ast; We don't want it zero-terminated or cleared to 0's.
- *    &ast;/
+ *   // We create a new array to store gint values.
+ *   // We don't want it zero-terminated or cleared to 0's.
  *   garray = g_array_new (FALSE, FALSE, sizeof (gint));
  *   for (i = 0; i < 10000; i++)
  *     g_array_append_val (garray, i);
@@ -122,9 +121,8 @@ struct _GRealArray
  * This example gets a pointer to an element in a #GArray:
  * |[<!-- language="C" -->
  *   EDayViewEvent *event;
- *   /&ast; This gets a pointer to the 4th element
- *    &ast; in the array of EDayViewEvent structs.
- *    &ast;/
+ *   // This gets a pointer to the 4th element in the array of
+ *   // EDayViewEvent structs.
  *   event = &g_array_index (events, EDayViewEvent, 3);
  * ]|
  *
@@ -818,9 +816,11 @@ g_array_maybe_expand (GRealArray *array,
  * An example using a #GPtrArray:
  * |[<!-- language="C" -->
  *   GPtrArray *array;
- *   gchar *string1 = "one", *string2 = "two", *string3 = "three";
+ *   gchar *string1 = "one";
+ *   gchar *string2 = "two";
+ *   gchar *string3 = "three";
  *
- *   gparray = g_ptr_array_new ();
+ *   array = g_ptr_array_new ();
  *   g_ptr_array_add (array, (gpointer) string1);
  *   g_ptr_array_add (array, (gpointer) string2);
  *   g_ptr_array_add (array, (gpointer) string3);
@@ -1589,6 +1589,7 @@ g_byte_array_new_take (guint8 *data,
 
   real->data = data;
   real->len = len;
+  real->alloc = len;
 
   return array;
 }