[glib: 8/19] gsettings-mapping: Fix HANDLE being treated as unsigned




commit cdb97620725616db4f76e1d79f778cad58ffa201
Author: Egor Bychin <e bychin drweb com>
Date:   Mon Oct 11 14:04:04 2021 +0300

    gsettings-mapping: Fix HANDLE being treated as unsigned

 gio/gsettings-mapping.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gio/gsettings-mapping.c b/gio/gsettings-mapping.c
index 4db9724fe..c4ffc9b45 100644
--- a/gio/gsettings-mapping.c
+++ b/gio/gsettings-mapping.c
@@ -200,6 +200,8 @@ g_settings_get_mapping_int (GValue   *value,
     l = g_variant_get_int32 (variant);
   else if (g_variant_type_equal (type, G_VARIANT_TYPE_INT64))
     l = g_variant_get_int64 (variant);
+  else if (g_variant_type_equal (type, G_VARIANT_TYPE_HANDLE))
+    l = g_variant_get_handle (variant);
   else
     return FALSE;
 
@@ -291,8 +293,6 @@ g_settings_get_mapping_unsigned_int (GValue   *value,
     u = g_variant_get_uint32 (variant);
   else if (g_variant_type_equal (type, G_VARIANT_TYPE_UINT64))
     u = g_variant_get_uint64 (variant);
-  else if (g_variant_type_equal (type, G_VARIANT_TYPE_HANDLE))
-    u = g_variant_get_handle (variant);
   else
     return FALSE;
 
@@ -459,7 +459,8 @@ g_settings_get_mapping (GValue   *value,
 
   else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_INT16)  ||
            g_variant_is_of_type (variant, G_VARIANT_TYPE_INT32)  ||
-           g_variant_is_of_type (variant, G_VARIANT_TYPE_INT64))
+           g_variant_is_of_type (variant, G_VARIANT_TYPE_INT64)  ||
+           g_variant_is_of_type (variant, G_VARIANT_TYPE_HANDLE))
     return g_settings_get_mapping_int (value, variant);
 
   else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_DOUBLE))
@@ -467,8 +468,7 @@ g_settings_get_mapping (GValue   *value,
 
   else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_UINT16) ||
            g_variant_is_of_type (variant, G_VARIANT_TYPE_UINT32) ||
-           g_variant_is_of_type (variant, G_VARIANT_TYPE_UINT64) ||
-           g_variant_is_of_type (variant, G_VARIANT_TYPE_HANDLE))
+           g_variant_is_of_type (variant, G_VARIANT_TYPE_UINT64))
     return g_settings_get_mapping_unsigned_int (value, variant);
 
   else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_STRING)      ||


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