diff --git a/docs/reference/glib/gvariant-varargs.xml b/docs/reference/glib/gvariant-varargs.xml index 8e87cde58..2aac40b08 100644 --- a/docs/reference/glib/gvariant-varargs.xml +++ b/docs/reference/glib/gvariant-varargs.xml @@ -219,12 +219,12 @@ Used as a prefix on a GVariant type string (not format string). Denotes that a pointer to a GVariant should be used in place of the normal C type or types. For g_variant_new() this means that you must pass a - non-NULL (GVariant + non-NULL (GVariant *); if it is a floating reference, ownership will be taken, as if by using g_variant_ref_sink(). For g_variant_get() this means that you must pass a pointer to a (GVariant *) for the value to be returned - by reference or NULL to ignore the value. See + by reference or NULL to ignore the value. See GVariant * below. @@ -294,7 +294,7 @@ Variable argument conversions from numeric types work in the most obvious way possible. Upon encountering one of these characters, g_variant_new() takes the equivalent C type as an argument. g_variant_get() takes a pointer to - the equivalent C type (or NULL to ignore the value). + the equivalent C type (or NULL to ignore the value). @@ -475,8 +475,8 @@ When using the 'x' and 't' characters, you must ensure that the value that you provide is 64 bit. This means that you should use a cast or make use of the - G_GINT64_CONSTANT or - G_GUINT64_CONSTANT macros. + G_GINT64_CONSTANT or + G_GUINT64_CONSTANT macros. @@ -521,7 +521,7 @@ value4 = g_variant_new ("x", G_GINT64_CONSTANT (998877665544332211)); 's', 'o' or 'g' in a format string, g_variant_new() takes a (const gchar *) and makes a copy of it. - NULL is not a valid string. If the 'o' or + NULL is not a valid string. If the 'o' or 'g' characters are used, care must be taken to ensure that the passed string is a valid DBus object path or DBus type signature, respectively. @@ -531,7 +531,7 @@ value4 = g_variant_new ("x", G_GINT64_CONSTANT (998877665544332211)); (gchar *) (ie: (gchar **)) and sets it to a newly-allocated copy of the string. It is appropriate to free this copy using g_free(). - NULL may also be passed to indicate that the value of the + NULL may also be passed to indicate that the value of the string should be ignored (in which case no copy is made). @@ -579,7 +579,7 @@ value3 = g_variant_new ("g", "iias"); ). It is set to a new reference to a GVariant instance containing the contents of the variant value. It is appropriate to free this reference using g_variant_unref(). - NULL may also be passed to indicate that the value should be + NULL may also be passed to indicate that the value should be ignored (in which case no new reference is created). @@ -614,7 +614,7 @@ y = g_variant_get_variant (x);]]> for an array of the type given in the type string. The builder will have g_variant_builder_end() called on it and the result will be used as the value. As a special exception, if the given type string is a definite type, then - NULL may be given to mean an empty array of that type. + NULL may be given to mean an empty array of that type. @@ -625,7 +625,7 @@ y = g_variant_get_variant (x);]]> A new heap-allocated iterator is created and returned, initialised for iterating over the elements of the array. This iterator should be freed when you are done with it, using g_variant_iter_free(). - NULL may also be given to indicate that the value of the array + NULL may also be given to indicate that the value of the array should be ignored. @@ -675,11 +675,11 @@ g_variant_unref (value);]]> 'g', 'v', '@', '*', '?', 'r', '&', or '^'. In all of these cases, for non-maybe types, g_variant_new() takes - a pointer to a non-NULL value and + a pointer to a non-NULL value and g_variant_get() returns (by reference) a - non-NULL pointer. When any of these format strings are + non-NULL pointer. When any of these format strings are prefixed with an 'm', the type of arguments that are collected does not change in any way, but - NULL becomes a permissable value, to indicate the Nothing case. + NULL becomes a permissable value, to indicate the Nothing case. Note that the "special exception" introduced in the array section for constructing empty arrays is ignored @@ -695,20 +695,20 @@ g_variant_unref (value);]]> collected for the equivalent non-maybe type will be collected. - If FALSE is given to + If FALSE is given to g_variant_new() then the Nothing value is constructed and - the collected arguments are ignored. Otherwise (if TRUE was + the collected arguments are ignored. Otherwise (if TRUE was given), the arguments are used in the normal way to create the Just value. - If NULL is given to + If NULL is given to g_variant_get() then the value is ignored. If a - non-NULL pointer is given then it is used to return by reference + non-NULL pointer is given then it is used to return by reference whether the value was Just. In the case that the value was Just, the gboolean will be set to - TRUE and the value will be stored in the arguments in the usual + TRUE and the value will be stored in the arguments in the usual way. In the case that the value was Nothing, the gboolean will be set to - FALSE and the arguments will be collected in the normal way + FALSE and the arguments will be collected in the normal way but have their values set to binary zero. @@ -842,7 +842,7 @@ dict = g_variant_builder_end (b);]]> Upon encountering a '@' in front of a type string, g_variant_new() takes a - non-NULL pointer to a + non-NULL pointer to a GVariant and uses its value directly instead of collecting arguments to create the value. The provided GVariant must have a type that matches the type string following the '@'. '*' is @@ -857,7 +857,7 @@ dict = g_variant_builder_end (b);]]> takes a pointer to a (GVariant *) (ie: a (GVariant **)) and sets it to a new reference to a GVariant containing the value (instead of deconstructing the value into - C types in the usual way). NULL can be given to ignore the + C types in the usual way). NULL can be given to ignore the value. '*', '?' and 'r' are handled in a way analogous to what is stated above. diff --git a/glib/gvariant.c b/glib/gvariant.c index fc7461117..caf6bd014 100644 --- a/glib/gvariant.c +++ b/glib/gvariant.c @@ -667,7 +667,7 @@ g_variant_get_maybe (GVariant *value) /** * g_variant_new_variant: - * @value: a #GVariance instance + * @value: a #GVariant instance * @returns: a floating reference to a new variant #GVariant instance * * Boxes @value. The result is a #GVariant instance representing a @@ -692,7 +692,7 @@ g_variant_new_variant (GVariant *value) /** * g_variant_get_variant: - * @value: a variant #GVariance instance + * @value: a variant #GVariant instance * @returns: the item contained in the variant * * Unboxes @value. The result is the #GVariant instance that was @@ -2888,7 +2888,7 @@ g_variant_builder_ref (GVariantBuilder *builder) * through. This function need not be called if you call * g_variant_builder_end() and it also doesn't need to be called on * builders allocated with g_variant_builder_new (see - * g_variant_builder_free() for that). + * g_variant_builder_unref() for that). * * This function leaves the #GVariantBuilder structure set to all-zeros. * It is valid to call this function on either an initialised diff --git a/glib/gvarianttype.c b/glib/gvarianttype.c index a43aecf51..e8a976a25 100644 --- a/glib/gvarianttype.c +++ b/glib/gvarianttype.c @@ -79,11 +79,12 @@ * indefinite type as its type, but values can exist that have types * that are subtypes of indefinite types. That is to say, * g_variant_get_type() will never return an indefinite type, but - * calling g_variant_is_a() with an indefinite type may return %TRUE. - * For example, you can not have a value that represents "an array of no - * particular type", but you can have an "array of integers" which - * certainly matches the type of "an array of no particular type", since - * "array of integers" is a subtype of "array of no particular type". + * calling g_variant_is_of_type() with an indefinite type may return + * %TRUE. For example, you can not have a value that represents "an + * array of no particular type", but you can have an "array of integers" + * which certainly matches the type of "an array of no particular type", + * since "array of integers" is a subtype of "array of no particular + * type". * * This is similar to how instances of abstract classes may not * directly exist in other type systems, but instances of their diff --git a/glib/gvarianttype.h b/glib/gvarianttype.h index 124fa46b5..55285632a 100644 --- a/glib/gvarianttype.h +++ b/glib/gvarianttype.h @@ -38,7 +38,7 @@ G_BEGIN_DECLS * A type in the GVariant type system. * * Two types may not be compared by value; use g_variant_type_equal() or - * g_variant_type_is_subtype(). May be copied using + * g_variant_type_is_subtype_of(). May be copied using * g_variant_type_copy() and freed using g_variant_type_free(). **/ typedef struct _GVariantType GVariantType;