[glib/glib-2-30] g_variant_new_from_data: mention that the caller	might need to byteswap
- From: Simon McVittie <smcv src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [glib/glib-2-30] g_variant_new_from_data: mention that the caller	might need to byteswap
 
- Date: Tue,  4 Oct 2011 11:38:18 +0000 (UTC)
 
commit 340e702a5f2f8f62350289cfbae3f21183465072
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 9be99cf..5e53619 100644
--- a/glib/gvariant.c
+++ b/glib/gvariant.c
@@ -4992,6 +4992,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]