r32408 - in /desktop/unstable/glib2.0/debian: changelog libglib2.0-0.symbols patches/93-gvalue-Add-explicitly-signed-g_value_get_schar-and-g.patch patches/94-closure-fix-handling-of-ENUMs-and-integral-return-ty.patch patches/series
biebl at users.alioth.debian.org
biebl at users.alioth.debian.org
Wed Jan 18 11:55:11 UTC 2012
Author: biebl
Date: Wed Jan 18 11:55:11 2012
New Revision: 32408
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=32408
Log:
* Cherry-pick patches from upstream Git which fix handling of ENUMs and
integral return types on 64-bit BE platforms.Closes: #653308
- Add d/p/94-closure-fix-handling-of-ENUMs-and-integral-return-ty.patch.
- Add d/p/93-gvalue-Add-explicitly-signed-g_value_get_schar-and-g.patch.
- Update symbols file accordingly.
Added:
desktop/unstable/glib2.0/debian/patches/93-gvalue-Add-explicitly-signed-g_value_get_schar-and-g.patch
desktop/unstable/glib2.0/debian/patches/94-closure-fix-handling-of-ENUMs-and-integral-return-ty.patch
Modified:
desktop/unstable/glib2.0/debian/changelog
desktop/unstable/glib2.0/debian/libglib2.0-0.symbols
desktop/unstable/glib2.0/debian/patches/series
Modified: desktop/unstable/glib2.0/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/glib2.0/debian/changelog?rev=32408&op=diff
==============================================================================
--- desktop/unstable/glib2.0/debian/changelog [utf-8] (original)
+++ desktop/unstable/glib2.0/debian/changelog [utf-8] Wed Jan 18 11:55:11 2012
@@ -15,7 +15,14 @@
system ("Unable to open directory /usr/lib/gio/modules: Error opening
directory '/usr/lib/gio/modules': No such file or directory").
- -- Josselin Mouette <joss at debian.org> Thu, 24 Nov 2011 21:12:46 +0100
+ [ Michael Biebl ]
+ * Cherry-pick patches from upstream Git which fix handling of ENUMs and
+ integral return types on 64-bit BE platforms.Closes: #653308
+ - Add d/p/94-closure-fix-handling-of-ENUMs-and-integral-return-ty.patch.
+ - Add d/p/93-gvalue-Add-explicitly-signed-g_value_get_schar-and-g.patch.
+ - Update symbols file accordingly.
+
+ -- Michael Biebl <biebl at debian.org> Wed, 18 Jan 2012 12:46:47 +0100
glib2.0 (2.30.2-4) unstable; urgency=low
Modified: desktop/unstable/glib2.0/debian/libglib2.0-0.symbols
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/glib2.0/debian/libglib2.0-0.symbols?rev=32408&op=diff
==============================================================================
--- desktop/unstable/glib2.0/debian/libglib2.0-0.symbols [utf-8] (original)
+++ desktop/unstable/glib2.0/debian/libglib2.0-0.symbols [utf-8] Wed Jan 18 11:55:11 2012
@@ -3308,6 +3308,7 @@
g_value_get_object at Base 2.12.0
g_value_get_param at Base 2.12.0
g_value_get_pointer at Base 2.12.0
+ g_value_get_schar at Base 2.30.2-5~
g_value_get_string at Base 2.12.0
g_value_get_type at Base 2.12.0
g_value_get_uchar at Base 2.12.0
@@ -3337,6 +3338,7 @@
g_value_set_param at Base 2.12.0
g_value_set_param_take_ownership at Base 2.12.0
g_value_set_pointer at Base 2.12.0
+ g_value_set_schar at Base 2.30.2-5~
g_value_set_static_boxed at Base 2.12.0
g_value_set_static_string at Base 2.12.0
g_value_set_string at Base 2.12.0
Added: desktop/unstable/glib2.0/debian/patches/93-gvalue-Add-explicitly-signed-g_value_get_schar-and-g.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/glib2.0/debian/patches/93-gvalue-Add-explicitly-signed-g_value_get_schar-and-g.patch?rev=32408&op=file
==============================================================================
--- desktop/unstable/glib2.0/debian/patches/93-gvalue-Add-explicitly-signed-g_value_get_schar-and-g.patch (added)
+++ desktop/unstable/glib2.0/debian/patches/93-gvalue-Add-explicitly-signed-g_value_get_schar-and-g.patch [utf-8] Wed Jan 18 11:55:11 2012
@@ -1,0 +1,308 @@
+From b8f04bfb1db1bd240210bdc7957673e63def82db Mon Sep 17 00:00:00 2001
+From: Colin Walters <walters at verbum.org>
+Date: Thu, 22 Sep 2011 16:08:35 -0400
+Subject: [PATCH 1/2] gvalue: Add explicitly signed g_value_get_schar() and
+ g_value_set_schar()
+
+The documentation for G_TYPE_CHAR says:
+
+"The type designated by G_TYPE_CHAR is unconditionally an 8-bit signed
+ integer."
+
+However the return value for g_value_get_char() was just "char" which
+in C has an unspecified signedness; on e.g. x86 it's signed (which
+matches the GType), but on e.g. PowerPC or ARM, it's not.
+
+We can't break the old API, so we need to suck it up and add new API.
+Port most internal users, but keep some tests of the old API too.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=659870
+---
+ gio/gsettings-mapping.c | 4 +-
+ gio/tests/gsettings.c | 6 ++--
+ gobject/gclosure.c | 2 +-
+ gobject/glib-genmarshal.c | 2 +-
+ gobject/gmarshal.c | 2 +-
+ gobject/gobject.symbols | 2 +
+ gobject/gvaluetypes.c | 42 +++++++++++++++++++++++++++++++++++++++-
+ gobject/gvaluetypes.h | 5 ++++
+ gobject/tests/param.c | 13 +++++++++--
+ tests/gobject/gvalue-test.c | 1 +
+ tests/gobject/paramspec-test.c | 16 +++++++++++++++
+ 11 files changed, 83 insertions(+), 12 deletions(-)
+
+diff --git a/gio/gsettings-mapping.c b/gio/gsettings-mapping.c
+index fda7463..6a9c41b 100644
+--- a/gio/gsettings-mapping.c
++++ b/gio/gsettings-mapping.c
+@@ -346,7 +346,7 @@ g_settings_set_mapping (const GValue *value,
+ if (g_variant_type_equal (expected_type, G_VARIANT_TYPE_BYTE))
+ {
+ if (G_VALUE_HOLDS_CHAR (value))
+- return g_variant_new_byte (g_value_get_char (value));
++ return g_variant_new_byte (g_value_get_schar (value));
+ else
+ return g_variant_new_byte (g_value_get_uchar (value));
+ }
+@@ -453,7 +453,7 @@ g_settings_get_mapping (GValue *value,
+ if (G_VALUE_HOLDS_UCHAR (value))
+ g_value_set_uchar (value, g_variant_get_byte (variant));
+ else if (G_VALUE_HOLDS_CHAR (value))
+- g_value_set_char (value, (gchar) g_variant_get_byte (variant));
++ g_value_set_schar (value, (gint8)g_variant_get_byte (variant));
+ else
+ return FALSE;
+ return TRUE;
+diff --git a/gio/tests/gsettings.c b/gio/tests/gsettings.c
+index fce4978..2655ed7 100644
+--- a/gio/tests/gsettings.c
++++ b/gio/tests/gsettings.c
+@@ -718,7 +718,7 @@ typedef struct
+
+ gboolean bool_prop;
+ gboolean anti_bool_prop;
+- gchar byte_prop;
++ gint8 byte_prop;
+ gint int16_prop;
+ guint16 uint16_prop;
+ gint int_prop;
+@@ -771,7 +771,7 @@ test_object_get_property (GObject *object,
+ g_value_set_boolean (value, test_object->anti_bool_prop);
+ break;
+ case PROP_BYTE:
+- g_value_set_char (value, test_object->byte_prop);
++ g_value_set_schar (value, test_object->byte_prop);
+ break;
+ case PROP_UINT16:
+ g_value_set_uint (value, test_object->uint16_prop);
+@@ -829,7 +829,7 @@ test_object_set_property (GObject *object,
+ test_object->anti_bool_prop = g_value_get_boolean (value);
+ break;
+ case PROP_BYTE:
+- test_object->byte_prop = g_value_get_char (value);
++ test_object->byte_prop = g_value_get_schar (value);
+ break;
+ case PROP_INT16:
+ test_object->int16_prop = g_value_get_int (value);
+diff --git a/gobject/gclosure.c b/gobject/gclosure.c
+index 5fd928b..36ec4b0 100644
+--- a/gobject/gclosure.c
++++ b/gobject/gclosure.c
+@@ -1029,7 +1029,7 @@ value_from_ffi_type (GValue *gvalue, gpointer *value)
+ g_value_set_string (gvalue, *(gchar**)value);
+ break;
+ case G_TYPE_CHAR:
+- g_value_set_char (gvalue, *(gchar*)value);
++ g_value_set_schar (gvalue, *(gint8*)value);
+ break;
+ case G_TYPE_UCHAR:
+ g_value_set_uchar (gvalue, *(guchar*)value);
+diff --git a/gobject/glib-genmarshal.c b/gobject/glib-genmarshal.c
+index 8afacdb..d79ae79 100644
+--- a/gobject/glib-genmarshal.c
++++ b/gobject/glib-genmarshal.c
+@@ -134,7 +134,7 @@ put_marshal_value_getters (void)
+ fputs ("\n", fout);
+ fputs ("#ifdef G_ENABLE_DEBUG\n", fout);
+ fputs ("#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)\n", fout);
+- fputs ("#define g_marshal_value_peek_char(v) g_value_get_char (v)\n", fout);
++ fputs ("#define g_marshal_value_peek_char(v) g_value_get_schar (v)\n", fout);
+ fputs ("#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v)\n", fout);
+ fputs ("#define g_marshal_value_peek_int(v) g_value_get_int (v)\n", fout);
+ fputs ("#define g_marshal_value_peek_uint(v) g_value_get_uint (v)\n", fout);
+diff --git a/gobject/gmarshal.c b/gobject/gmarshal.c
+index bc53b5d..c7bcce4 100644
+--- a/gobject/gmarshal.c
++++ b/gobject/gmarshal.c
+@@ -8,7 +8,7 @@
+
+ #ifdef G_ENABLE_DEBUG
+ #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
+-#define g_marshal_value_peek_char(v) g_value_get_char (v)
++#define g_marshal_value_peek_char(v) g_value_get_schar (v)
+ #define g_marshal_value_peek_uchar(v) g_value_get_uchar (v)
+ #define g_marshal_value_peek_int(v) g_value_get_int (v)
+ #define g_marshal_value_peek_uint(v) g_value_get_uint (v)
+diff --git a/gobject/gobject.symbols b/gobject/gobject.symbols
+index f03f551..d5b2522 100644
+--- a/gobject/gobject.symbols
++++ b/gobject/gobject.symbols
+@@ -218,6 +218,7 @@ g_value_set_int64
+ g_value_set_long
+ g_value_set_pointer
+ g_value_set_static_string
++g_value_set_schar
+ g_value_set_string
+ g_value_set_string_take_ownership
+ g_value_set_uchar
+@@ -233,6 +234,7 @@ g_value_get_int
+ g_value_get_int64
+ g_value_get_long
+ g_value_get_pointer
++g_value_get_schar
+ g_value_get_string
+ g_value_get_uchar
+ g_value_get_uint
+diff --git a/gobject/gvaluetypes.c b/gobject/gvaluetypes.c
+index a05ccd9..c2850d1 100644
+--- a/gobject/gvaluetypes.c
++++ b/gobject/gvaluetypes.c
+@@ -636,6 +636,7 @@ _g_value_types_init (void)
+ * @v_char: character value to be set
+ *
+ * Set the contents of a %G_TYPE_CHAR #GValue to @v_char.
++ * Deprecated: 2.32: This function's input type is broken, see g_value_set_schar()
+ */
+ void
+ g_value_set_char (GValue *value,
+@@ -650,9 +651,13 @@ g_value_set_char (GValue *value,
+ * g_value_get_char:
+ * @value: a valid #GValue of type %G_TYPE_CHAR
+ *
+- * Get the contents of a %G_TYPE_CHAR #GValue.
++ * Do not use this function; it is broken on platforms where the %char
++ * type is unsigned, such as ARM and PowerPC. See g_value_get_schar().
++ *
++ * Get the contents of a %G_TYPE_CHAR #GValue.
+ *
+ * Returns: character contents of @value
++ * Deprecated: 2.32: This function's return type is broken, see g_value_get_schar()
+ */
+ gchar
+ g_value_get_char (const GValue *value)
+@@ -663,6 +668,41 @@ g_value_get_char (const GValue *value)
+ }
+
+ /**
++ * g_value_set_schar:
++ * @value: a valid #GValue of type %G_TYPE_CHAR
++ * @v_char: signed 8 bit integer to be set
++ *
++ * Set the contents of a %G_TYPE_CHAR #GValue to @v_char.
++ *
++ * Since: 2.32
++ */
++void
++g_value_set_schar (GValue *value,
++ gint8 v_char)
++{
++ g_return_if_fail (G_VALUE_HOLDS_CHAR (value));
++
++ value->data[0].v_int = v_char;
++}
++
++/**
++ * g_value_get_schar:
++ * @value: a valid #GValue of type %G_TYPE_CHAR
++ *
++ * Get the contents of a %G_TYPE_CHAR #GValue.
++ *
++ * Returns: signed 8 bit integer contents of @value
++ * Since: 2.32
++ */
++gint8
++g_value_get_schar (const GValue *value)
++{
++ g_return_val_if_fail (G_VALUE_HOLDS_CHAR (value), 0);
++
++ return value->data[0].v_int;
++}
++
++/**
+ * g_value_set_uchar:
+ * @value: a valid #GValue of type %G_TYPE_UCHAR
+ * @v_uchar: unsigned character value to be set
+diff --git a/gobject/gvaluetypes.h b/gobject/gvaluetypes.h
+index 972c868..a7c2414 100644
+--- a/gobject/gvaluetypes.h
++++ b/gobject/gvaluetypes.h
+@@ -177,9 +177,14 @@ G_BEGIN_DECLS
+
+
+ /* --- prototypes --- */
++#ifndef G_DISABLE_DEPRECATED
+ void g_value_set_char (GValue *value,
+ gchar v_char);
+ gchar g_value_get_char (const GValue *value);
++#endif
++void g_value_set_schar (GValue *value,
++ gint8 v_char);
++gint8 g_value_get_schar (const GValue *value);
+ void g_value_set_uchar (GValue *value,
+ guchar v_uchar);
+ guchar g_value_get_uchar (const GValue *value);
+diff --git a/gobject/tests/param.c b/gobject/tests/param.c
+index 53d5159..d06bd51 100644
+--- a/gobject/tests/param.c
++++ b/gobject/tests/param.c
+@@ -145,8 +145,15 @@ test_value_transform (void)
+ g_value_unset (&src); \
+ g_value_unset (&dest);
+
+- CHECK_INT_CONVERSION(G_TYPE_CHAR, char, -124)
++ /* Keep a check for an integer in the range of 0-127 so we're
++ * still testing g_value_get_char(). See
++ * https://bugzilla.gnome.org/show_bug.cgi?id=659870
++ * for why it is broken.
++ */
+ CHECK_INT_CONVERSION(G_TYPE_CHAR, char, 124)
++
++ CHECK_INT_CONVERSION(G_TYPE_CHAR, schar, -124)
++ CHECK_INT_CONVERSION(G_TYPE_CHAR, schar, 124)
+ CHECK_INT_CONVERSION(G_TYPE_UCHAR, uchar, 0)
+ CHECK_INT_CONVERSION(G_TYPE_UCHAR, uchar, 255)
+ CHECK_INT_CONVERSION(G_TYPE_INT, int, -12345)
+@@ -378,9 +385,9 @@ test_value_transform (void)
+ g_value_init (&src, G_TYPE_STRING);
+ g_value_init (&dest, G_TYPE_CHAR);
+ g_value_set_static_string (&src, "bla");
+- g_value_set_char (&dest, 'c');
++ g_value_set_schar (&dest, 'c');
+ g_assert (!g_value_transform (&src, &dest));
+- g_assert_cmpint (g_value_get_char (&dest), ==, 'c');
++ g_assert_cmpint (g_value_get_schar (&dest), ==, 'c');
+ g_value_unset (&src);
+ g_value_unset (&dest);
+ }
+diff --git a/tests/gobject/gvalue-test.c b/tests/gobject/gvalue-test.c
+index 516a484..bec3c64 100644
+--- a/tests/gobject/gvalue-test.c
++++ b/tests/gobject/gvalue-test.c
+@@ -50,6 +50,7 @@ test_enum_transformation (void)
+ g_value_init (&xform, G_TYPE_CHAR);
+ g_value_transform (&orig, &xform);
+ g_assert (g_value_get_char (&xform) == 1);
++ g_assert (g_value_get_schar (&xform) == 1);
+
+ memset (&xform, 0, sizeof (GValue));
+ g_value_init (&xform, G_TYPE_UCHAR);
+diff --git a/tests/gobject/paramspec-test.c b/tests/gobject/paramspec-test.c
+index 6de850f..d09945b 100644
+--- a/tests/gobject/paramspec-test.c
++++ b/tests/gobject/paramspec-test.c
+@@ -67,6 +67,22 @@ test_param_spec_char (void)
+ modified = g_param_value_validate (pspec, &value);
+ g_assert (modified && g_value_get_char (&value) == 40);
+
++ g_value_set_schar (&value, 0);
++ modified = g_param_value_validate (pspec, &value);
++ g_assert (modified && g_value_get_schar (&value) == 20);
++
++ g_value_set_schar (&value, 20);
++ modified = g_param_value_validate (pspec, &value);
++ g_assert (!modified && g_value_get_schar (&value) == 20);
++
++ g_value_set_schar (&value, 40);
++ modified = g_param_value_validate (pspec, &value);
++ g_assert (!modified && g_value_get_schar (&value) == 40);
++
++ g_value_set_schar (&value, 60);
++ modified = g_param_value_validate (pspec, &value);
++ g_assert (modified && g_value_get_schar (&value) == 40);
++
+ g_param_spec_unref (pspec);
+ }
+
+--
+1.7.8.2
+
Added: desktop/unstable/glib2.0/debian/patches/94-closure-fix-handling-of-ENUMs-and-integral-return-ty.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/glib2.0/debian/patches/94-closure-fix-handling-of-ENUMs-and-integral-return-ty.patch?rev=32408&op=file
==============================================================================
--- desktop/unstable/glib2.0/debian/patches/94-closure-fix-handling-of-ENUMs-and-integral-return-ty.patch (added)
+++ desktop/unstable/glib2.0/debian/patches/94-closure-fix-handling-of-ENUMs-and-integral-return-ty.patch [utf-8] Wed Jan 18 11:55:11 2012
@@ -1,0 +1,218 @@
+From 3dd50961b8a50be8173a004fc21da1660f51c34c Mon Sep 17 00:00:00 2001
+From: Dan Williams <dcbw at redhat.com>
+Date: Fri, 23 Sep 2011 12:32:23 -0500
+Subject: [PATCH 2/2] closure: fix handling of ENUMs and integral return types
+ on 64-bit BE platforms
+
+enums are stored in v_long but need to be marshalled as signed
+integers. On platforms where int is 32 bits, taking the
+address of v_long resulted in the wrong 32 bits being marshalled.
+So we need to stuff the enum's int-sized value to a temporary
+int-sized variable and marshall that instead.
+
+Second, on return, libffi actually returns a pointer to a value
+that's sized according to platform conventions, not according to
+what the caller requested. ie if ffi_type_sint was requested, the
+value can still be a 64-bit sign-extended long on a 64-bit
+architecture like PPC64, thus the caller cannot simply cast
+the return value as a pointer to the desired type, but must cast
+as a pointer to an integral type and then cast to the desired
+type to remove any sign extension complications.
+
+For more information on how to correctly handle libffi return
+values, see the following bug, specifically comment 35:
+
+https://bugzilla.redhat.com/show_bug.cgi?id=736489
+
+"For 64-bit ABIs that extend integral returns types to 64-bits, libffi always
+returns full 64-bit values that you can truncate in the calling code. It's
+just the way it is has always been. Please don't change libffi. I'll document
+this clearly for the next version (perhaps there is a mention of this, I
+haven't looked yet).
+
+The same is true for returning 8-bit values, for instance, on 32-bit systems.
+All ABIs extend those results to the full 32-bits so you need to provide a
+properly aligned buffer that's big enough to hold the result."
+
+https://bugzilla.gnome.org/show_bug.cgi?id=659881
+---
+ gobject/gclosure.c | 76 ++++++++++++++++++++++++++++++++++++++++-----------
+ 1 files changed, 59 insertions(+), 17 deletions(-)
+
+diff --git a/gobject/gclosure.c b/gobject/gclosure.c
+index 36ec4b0..6893484 100644
+--- a/gobject/gclosure.c
++++ b/gobject/gclosure.c
+@@ -944,21 +944,42 @@ g_signal_type_cclosure_new (GType itype,
+
+ #include <ffi.h>
+ static ffi_type *
+-value_to_ffi_type (const GValue *gvalue, gpointer *value)
++value_to_ffi_type (const GValue *gvalue,
++ gpointer *value,
++ gint *enum_tmpval,
++ gboolean *tmpval_used)
+ {
+ ffi_type *rettype = NULL;
+ GType type = g_type_fundamental (G_VALUE_TYPE (gvalue));
+ g_assert (type != G_TYPE_INVALID);
+
++ if (enum_tmpval)
++ {
++ g_assert (tmpval_used != NULL);
++ *tmpval_used = FALSE;
++ }
++
+ switch (type)
+ {
+ case G_TYPE_BOOLEAN:
+ case G_TYPE_CHAR:
+ case G_TYPE_INT:
+- case G_TYPE_ENUM:
+ rettype = &ffi_type_sint;
+ *value = (gpointer)&(gvalue->data[0].v_int);
+ break;
++ case G_TYPE_ENUM:
++ /* enums are stored in v_long even though they are integers, which makes
++ * marshalling through libffi somewhat complicated. They need to be
++ * marshalled as signed ints, but we need to use a temporary int sized
++ * value to pass to libffi otherwise it'll pull the wrong value on
++ * BE machines with 32-bit integers when treating v_long as 32-bit int.
++ */
++ g_assert (enum_tmpval != NULL);
++ rettype = &ffi_type_sint;
++ *enum_tmpval = g_value_get_enum (gvalue);
++ *value = enum_tmpval;
++ *tmpval_used = TRUE;
++ break;
+ case G_TYPE_UCHAR:
+ case G_TYPE_UINT:
+ case G_TYPE_FLAGS:
+@@ -1011,10 +1032,12 @@ value_to_ffi_type (const GValue *gvalue, gpointer *value)
+ static void
+ value_from_ffi_type (GValue *gvalue, gpointer *value)
+ {
++ ffi_arg *int_val = value;
++
+ switch (g_type_fundamental (G_VALUE_TYPE (gvalue)))
+ {
+ case G_TYPE_INT:
+- g_value_set_int (gvalue, *(gint*)value);
++ g_value_set_int (gvalue, (gint) *int_val);
+ break;
+ case G_TYPE_FLOAT:
+ g_value_set_float (gvalue, *(gfloat*)value);
+@@ -1023,43 +1046,43 @@ value_from_ffi_type (GValue *gvalue, gpointer *value)
+ g_value_set_double (gvalue, *(gdouble*)value);
+ break;
+ case G_TYPE_BOOLEAN:
+- g_value_set_boolean (gvalue, *(gboolean*)value);
++ g_value_set_boolean (gvalue, (gboolean) *int_val);
+ break;
+ case G_TYPE_STRING:
+ g_value_set_string (gvalue, *(gchar**)value);
+ break;
+ case G_TYPE_CHAR:
+- g_value_set_schar (gvalue, *(gint8*)value);
++ g_value_set_schar (gvalue, (gint8) *int_val);
+ break;
+ case G_TYPE_UCHAR:
+- g_value_set_uchar (gvalue, *(guchar*)value);
++ g_value_set_uchar (gvalue, (guchar) *int_val);
+ break;
+ case G_TYPE_UINT:
+- g_value_set_uint (gvalue, *(guint*)value);
++ g_value_set_uint (gvalue, (guint) *int_val);
+ break;
+ case G_TYPE_POINTER:
+ g_value_set_pointer (gvalue, *(gpointer*)value);
+ break;
+ case G_TYPE_LONG:
+- g_value_set_long (gvalue, *(glong*)value);
++ g_value_set_long (gvalue, (glong) *int_val);
+ break;
+ case G_TYPE_ULONG:
+- g_value_set_ulong (gvalue, *(gulong*)value);
++ g_value_set_ulong (gvalue, (gulong) *int_val);
+ break;
+ case G_TYPE_INT64:
+- g_value_set_int64 (gvalue, *(gint64*)value);
++ g_value_set_int64 (gvalue, (gint64) *int_val);
+ break;
+ case G_TYPE_UINT64:
+- g_value_set_uint64 (gvalue, *(guint64*)value);
++ g_value_set_uint64 (gvalue, (guint64) *int_val);
+ break;
+ case G_TYPE_BOXED:
+ g_value_set_boxed (gvalue, *(gpointer*)value);
+ break;
+ case G_TYPE_ENUM:
+- g_value_set_enum (gvalue, *(gint*)value);
++ g_value_set_enum (gvalue, (gint) *int_val);
+ break;
+ case G_TYPE_FLAGS:
+- g_value_set_flags (gvalue, *(guint*)value);
++ g_value_set_flags (gvalue, (guint) *int_val);
+ break;
+ case G_TYPE_PARAM:
+ g_value_set_param (gvalue, *(gpointer*)value);
+@@ -1108,10 +1131,13 @@ g_cclosure_marshal_generic (GClosure *closure,
+ int i;
+ ffi_cif cif;
+ GCClosure *cc = (GCClosure*) closure;
++ gint *enum_tmpval;
++ gboolean tmpval_used = FALSE;
+
++ enum_tmpval = g_alloca (sizeof (gint));
+ if (return_gvalue && G_VALUE_TYPE (return_gvalue))
+ {
+- rtype = value_to_ffi_type (return_gvalue, &rvalue);
++ rtype = value_to_ffi_type (return_gvalue, &rvalue, enum_tmpval, &tmpval_used);
+ }
+ else
+ {
+@@ -1124,22 +1150,38 @@ g_cclosure_marshal_generic (GClosure *closure,
+ atypes = g_alloca (sizeof (ffi_type *) * n_args);
+ args = g_alloca (sizeof (gpointer) * n_args);
+
++ if (tmpval_used)
++ enum_tmpval = g_alloca (sizeof (gint));
++
+ if (G_CCLOSURE_SWAP_DATA (closure))
+ {
+ atypes[n_args-1] = value_to_ffi_type (param_values + 0,
+- &args[n_args-1]);
++ &args[n_args-1],
++ enum_tmpval,
++ &tmpval_used);
+ atypes[0] = &ffi_type_pointer;
+ args[0] = &closure->data;
+ }
+ else
+ {
+- atypes[0] = value_to_ffi_type (param_values + 0, &args[0]);
++ atypes[0] = value_to_ffi_type (param_values + 0,
++ &args[0],
++ enum_tmpval,
++ &tmpval_used);
+ atypes[n_args-1] = &ffi_type_pointer;
+ args[n_args-1] = &closure->data;
+ }
+
+ for (i = 1; i < n_args - 1; i++)
+- atypes[i] = value_to_ffi_type (param_values + i, &args[i]);
++ {
++ if (tmpval_used)
++ enum_tmpval = g_alloca (sizeof (gint));
++
++ atypes[i] = value_to_ffi_type (param_values + i,
++ &args[i],
++ enum_tmpval,
++ &tmpval_used);
++ }
+
+ if (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, n_args, rtype, atypes) != FFI_OK)
+ return;
+--
+1.7.8.2
+
Modified: desktop/unstable/glib2.0/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/glib2.0/debian/patches/series?rev=32408&op=diff
==============================================================================
--- desktop/unstable/glib2.0/debian/patches/series [utf-8] (original)
+++ desktop/unstable/glib2.0/debian/patches/series [utf-8] Wed Jan 18 11:55:11 2012
@@ -4,6 +4,8 @@
04_homedir_env.patch
61_glib-compile-schemas-path.patch
90-gio-modules-multiarch-compat.patch
+93-gvalue-Add-explicitly-signed-g_value_get_schar-and-g.patch
+94-closure-fix-handling-of-ENUMs-and-integral-return-ty.patch
95-gmain-get-rid-of-poll_waiting.patch
96-fix-one-bit-mutex-test-on-some-platforms.patch
97-silence-compiler-warnings.patch
More information about the pkg-gnome-commits
mailing list