mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-27 07:56:14 +01:00
Add g_return_if_fail()s to g_variant_new_from_data()
also, document that @type must be definite
This commit is contained in:
parent
a3dc7f8006
commit
3349bab022
@ -4087,7 +4087,7 @@ g_variant_byteswap (GVariant *value)
|
||||
|
||||
/**
|
||||
* g_variant_new_from_data:
|
||||
* @type: a #GVariantType
|
||||
* @type: a definite #GVariantType
|
||||
* @data: the serialised data
|
||||
* @size: the size of @data
|
||||
* @trusted: %TRUE if @data is definitely in normal form
|
||||
@ -4129,6 +4129,9 @@ g_variant_new_from_data (const GVariantType *type,
|
||||
GVariant *value;
|
||||
GBuffer *buffer;
|
||||
|
||||
g_return_val_if_fail (g_variant_type_is_definite (type), NULL);
|
||||
g_return_val_if_fail (data != NULL || size == 0, NULL);
|
||||
|
||||
if (notify)
|
||||
buffer = g_buffer_new_from_pointer (data, size, notify, user_data);
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user