[glibmm] Glib::Value: Deprecate Value<char>, add Value<signed char>



commit 8d08e770183ce51bbec25d740c4f91096e4b3506
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Wed Feb 18 09:41:27 2015 +0100

    Glib::Value: Deprecate Value<char>, add Value<signed char>
    
    * glib/src/value_basictypes.[cc|h].m4: Deprecate Value<char>.
    Add Value<signed char>. g_value_[get,set]_char() are deprecated in favour of
    g_value_[get,set]_schar(). G_TYPE_CHAR is a signed char even on platforms
    where a plain char is unsigned.

 glib/src/value_basictypes.cc.m4 |   10 +++++-----
 glib/src/value_basictypes.h.m4  |    8 +++++---
 2 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/glib/src/value_basictypes.cc.m4 b/glib/src/value_basictypes.cc.m4
index 62cc547..090b33b 100644
--- a/glib/src/value_basictypes.cc.m4
+++ b/glib/src/value_basictypes.cc.m4
@@ -1,7 +1,5 @@
 divert(-1)
 
-dnl $Id$
-
 dnl  Glib::Value specializations for fundamental types
 dnl
 dnl  Copyright 2002 The gtkmm Development Team
@@ -34,7 +32,7 @@ dnl Please ignore the format stuff.  I was just tired and played a little.
 // static
 GType Value<$1>::value_type()
 {
-  return G_TYPE_[]UPPER($2);
+  return G_TYPE_[]UPPER(ifelse($2,schar,char,$2));
 }
 
 void Value<$1>::set($1 data)
@@ -49,7 +47,7 @@ $1 Value<$1>::get() const
 
 GParamSpec* Value<$1>::create_param_spec(const Glib::ustring& name) const
 {
-  return g_param_spec_$2(
+  return g_param_spec_[]ifelse($2,schar,char,$2)(
       name.c_str(), 0, 0,ifelse($2,pointer,,[
       ifelse($3,,,[$3, $4, ])[]g_value_get_$2(&gobject_),])
       GParamFlags(G_PARAM_READABLE | G_PARAM_WRITABLE));
@@ -57,7 +55,6 @@ GParamSpec* Value<$1>::create_param_spec(const Glib::ustring& name) const
 ])
 
 divert[]dnl
-// -*- c++ -*-
 // This is a generated file, do not edit.  Generated from __file__
 
 /* So we can use deprecated functions in our deprecated methods */
@@ -73,7 +70,10 @@ G_GNUC_EXTENSION typedef long long long_long;
 G_GNUC_EXTENSION typedef unsigned long long unsigned_long_long;
 
 GLIB_VALUE_BASIC(bool, boolean)
+#ifndef GLIBMM_DISABLE_DEPRECATED
 GLIB_VALUE_BASIC(char, char, -128, 127)
+#endif // GLIBMM_DISABLE_DEPRECATED
+GLIB_VALUE_BASIC(signed char, schar, -128, 127)
 GLIB_VALUE_BASIC(unsigned char, uchar, 0, 255)
 GLIB_VALUE_BASIC(int, int, G_MININT, G_MAXINT)
 GLIB_VALUE_BASIC(unsigned int, uint, 0, G_MAXUINT)
diff --git a/glib/src/value_basictypes.h.m4 b/glib/src/value_basictypes.h.m4
index 11b4c6c..f9648c0 100644
--- a/glib/src/value_basictypes.h.m4
+++ b/glib/src/value_basictypes.h.m4
@@ -1,7 +1,5 @@
 divert(-1)
 
-dnl $Id$
-
 dnl  Glib::Value specializations for fundamental types
 dnl
 dnl  Copyright 2002 The gtkmm Development Team
@@ -50,7 +48,6 @@ public:
 ])
 
 divert[]dnl
-// -*- c++ -*-
 // This is a generated file, do not edit.  Generated from __file__
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -68,7 +65,12 @@ divert[]dnl
 namespace Glib
 {
 GLIB_VALUE_BASIC(bool, boolean)
+#ifndef GLIBMM_DISABLE_DEPRECATED
+/// @deprecated Use Value<signed char> instead.
 GLIB_VALUE_BASIC(char, char)
+#endif // GLIBMM_DISABLE_DEPRECATED
+/// @newin{2,44}
+GLIB_VALUE_BASIC(signed char, int8)
 GLIB_VALUE_BASIC(unsigned char, uchar)
 GLIB_VALUE_BASIC(int, int)
 GLIB_VALUE_BASIC(unsigned int, uint)


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