[pygobject] Fix enum and flags marshaling type assumptions
- From: Simon Feltman <sfeltman src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Fix enum and flags marshaling type assumptions
- Date: Fri, 5 Apr 2013 01:23:28 +0000 (UTC)
commit 216caf590b262fed40d10bb34d020089d1197160
Author: Simon Feltman <sfeltman src gnome org>
Date: Thu Apr 4 15:57:12 2013 -0700
Fix enum and flags marshaling type assumptions
Replace assignments of GFlags and GEnum values to various GIArgument
members with v_uint and v_int respectively.
gi/pygi-argument.c | 6 +++---
gi/pygi-property.c | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gi/pygi-argument.c b/gi/pygi-argument.c
index 4cf82d0..6cb8417 100644
--- a/gi/pygi-argument.c
+++ b/gi/pygi-argument.c
@@ -1828,7 +1828,7 @@ _pygi_argument_to_object (GIArgument *arg,
} else if (info_type == GI_INFO_TYPE_ENUM) {
object = pyg_enum_from_gtype (type, arg->v_int);
} else {
- object = pyg_flags_from_gtype (type, arg->v_int);
+ object = pyg_flags_from_gtype (type, arg->v_uint);
}
break;
@@ -2082,10 +2082,10 @@ _pygi_argument_from_g_value(const GValue *value,
switch (info_type) {
case GI_INFO_TYPE_FLAGS:
- arg.v_long = g_value_get_flags (value);
+ arg.v_uint = g_value_get_flags (value);
break;
case GI_INFO_TYPE_ENUM:
- arg.v_long = g_value_get_enum (value);
+ arg.v_int = g_value_get_enum (value);
break;
case GI_INFO_TYPE_INTERFACE:
case GI_INFO_TYPE_OBJECT:
diff --git a/gi/pygi-property.c b/gi/pygi-property.c
index ae49f08..a5464ab 100644
--- a/gi/pygi-property.c
+++ b/gi/pygi-property.c
@@ -192,7 +192,7 @@ pygi_get_property_value_real (PyGObject *instance, GParamSpec *pspec)
switch (info_type) {
case GI_INFO_TYPE_ENUM:
- arg.v_int32 = g_value_get_enum (&value);
+ arg.v_int = g_value_get_enum (&value);
break;
case GI_INFO_TYPE_INTERFACE:
case GI_INFO_TYPE_OBJECT:
@@ -319,7 +319,7 @@ pygi_set_property_value_real (PyGObject *instance,
switch (info_type) {
case GI_INFO_TYPE_ENUM:
- g_value_set_enum (&value, arg.v_int32);
+ g_value_set_enum (&value, arg.v_int);
break;
case GI_INFO_TYPE_INTERFACE:
case GI_INFO_TYPE_OBJECT:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]