[glib] gclosure: add missing fundamental types to generic marshaler
- From: Xan Lopez <xan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gclosure: add missing fundamental types to generic marshaler
- Date: Tue, 14 Jun 2011 10:51:24 +0000 (UTC)
commit 42c2e42a39bb04aae8fae3b691e22b290d1da48a
Author: Xan Lopez <xlopez igalia com>
Date: Thu Jun 9 23:50:22 2011 +0200
gclosure: add missing fundamental types to generic marshaler
for GObject type the ffi->gvalue conversion was not handled. The
GFlags type was completely missing.
gobject/gclosure.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gobject/gclosure.c b/gobject/gclosure.c
index 0121fd9..42f8f8b 100644
--- a/gobject/gclosure.c
+++ b/gobject/gclosure.c
@@ -30,6 +30,7 @@
#include "gclosure.h"
#include "gboxed.h"
+#include "genums.h"
#include "gvalue.h"
#include "gvaluetypes.h"
@@ -957,6 +958,7 @@ value_to_ffi_type (const GValue *gvalue, gpointer *value)
break;
case G_TYPE_UCHAR:
case G_TYPE_UINT:
+ case G_TYPE_FLAGS:
rettype = &ffi_type_uint;
*value = (gpointer)&(gvalue->data[0].v_uint);
break;
@@ -1049,6 +1051,12 @@ value_from_ffi_type (GValue *gvalue, gpointer *value)
case G_TYPE_BOXED:
g_value_set_boxed (gvalue, *(gpointer*)value);
break;
+ case G_TYPE_FLAGS:
+ g_value_set_flags (gvalue, *(guint*)value);
+ break;
+ case G_TYPE_OBJECT:
+ g_value_set_object (gvalue, *(gpointer*)value);
+ break;
default:
g_warning ("value_from_ffi_type: Unsupported fundamental type: %s",
g_type_name (g_type_fundamental (G_VALUE_TYPE (gvalue))));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]