[glib] g_variant_new_from_data: mention that the caller might need to byteswap



commit 3869e40ac339a9395e47a9aa81b017dbaf8ad925
Author: Simon McVittie <simon mcvittie collabora co uk>
Date:   Mon Oct 3 14:19:58 2011 +0100

    g_variant_new_from_data: mention that the caller might need to byteswap
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=632049
    Signed-off-by: Simon McVittie <simon mcvittie collabora co uk>
    Reviewed-by: Ryan Lortie <desrt desrt ca>

 glib/gvariant.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/glib/gvariant.c b/glib/gvariant.c
index 35b0fe1..89b7ec3 100644
--- a/glib/gvariant.c
+++ b/glib/gvariant.c
@@ -5058,6 +5058,10 @@ g_variant_byteswap (GVariant *value)
  * should set trusted to %FALSE if @data is read from the network, a
  * file in the user's home directory, etc.
  *
+ * If @data was not stored in this machine's native endianness, any multi-byte
+ * numeric values in the returned variant will also be in non-native
+ * endianness. g_variant_byteswap() can be used to recover the original values.
+ *
  * @notify will be called with @user_data when @data is no longer
  * needed.  The exact time of this call is unspecified and might even be
  * before this function returns.



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