[Xfce4-commits] <xfconf:master> Don't use deprecated g_value_set_char (bug #8690).

Nick Schermer noreply at xfce.org
Fri Apr 13 17:52:03 CEST 2012


Updating branch refs/heads/master
         to 93e8623827e34b15694f4f2bb305e6171d8a8ecf (commit)
       from 53a1425b3bcd4fcfa8cec130ea3fb5ed163eb83e (commit)

commit 93e8623827e34b15694f4f2bb305e6171d8a8ecf
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Apr 13 17:50:15 2012 +0200

    Don't use deprecated g_value_set_char (bug #8690).

 common/xfconf-gvaluefuncs.c |    8 ++++++++
 xfconf/xfconf-channel.c     |    5 +++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/common/xfconf-gvaluefuncs.c b/common/xfconf-gvaluefuncs.c
index 1527cb8..22fe0f0 100644
--- a/common/xfconf-gvaluefuncs.c
+++ b/common/xfconf-gvaluefuncs.c
@@ -178,7 +178,11 @@ _xfconf_gvalue_from_string(GValue *value,
         case G_TYPE_UCHAR:
             HANDLE_UINT(0, XFCONF_MAXUCHAR, g_value_set_uchar);
         case G_TYPE_CHAR:
+#if GLIB_CHECK_VERSION (2, 32, 0)
+            HANDLE_INT(G_MININT8, G_MAXINT8, g_value_set_schar);
+#else
             HANDLE_INT(XFCONF_MINCHAR, XFCONF_MAXCHAR, g_value_set_char);
+#endif
         case G_TYPE_UINT:
             HANDLE_UINT(0, G_MAXUINT, g_value_set_uint);
         case G_TYPE_INT:
@@ -265,7 +269,11 @@ _xfconf_string_from_gvalue(GValue *val)
         case G_TYPE_UCHAR:
             return g_strdup_printf("%u", (guint)g_value_get_uchar(val));
         case G_TYPE_CHAR:
+#if GLIB_CHECK_VERSION (2, 32, 0)
+            return g_strdup_printf("%d", g_value_get_schar(val));
+#else
             return g_strdup_printf("%d", (gint)g_value_get_char(val));
+#endif
         case G_TYPE_UINT:
             return g_strdup_printf("%u", g_value_get_uint(val));
         case G_TYPE_INT:
diff --git a/xfconf/xfconf-channel.c b/xfconf/xfconf-channel.c
index 5539707..1361956 100644
--- a/xfconf/xfconf-channel.c
+++ b/xfconf/xfconf-channel.c
@@ -2195,8 +2195,13 @@ xfconf_channel_set_structv(XfconfChannel *channel,
                 break;
 
             case G_TYPE_CHAR:
+#if GLIB_CHECK_VERSION (2, 32, 0)
+                GET_STRUCT_VAL(gchar, G_TYPE_CHAR, ALIGNOF_GCHAR,
+                               g_value_set_schar);
+#else
                 GET_STRUCT_VAL(gchar, G_TYPE_CHAR, ALIGNOF_GCHAR,
                                g_value_set_char);
+#endif
                 break;
 
             case G_TYPE_UINT:


More information about the Xfce4-commits mailing list