[pygobject] Remove workaround for g_struct_info_get_size reporting incorrect size
- From: Simon Feltman <sfeltman src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Remove workaround for g_struct_info_get_size reporting incorrect size
- Date: Sun, 10 Feb 2013 23:02:56 +0000 (UTC)
commit aff2ea1b681c3019f7dbdc841c2e33de78dbb88f
Author: Simon Feltman <sfeltman src gnome org>
Date: Sun Feb 10 13:40:45 2013 -0800
Remove workaround for g_struct_info_get_size reporting incorrect size
Remove workaround for g_struct_info_get_size reporting incorrect size
for boxed GValues. Verified this now returns the correct size of 24.
https://bugzilla.gnome.org/show_bug.cgi?id=622711
gi/pygi-boxed.c | 31 +++++++++++++------------------
1 files changed, 13 insertions(+), 18 deletions(-)
---
diff --git a/gi/pygi-boxed.c b/gi/pygi-boxed.c
index ff3db9b..c15c927 100644
--- a/gi/pygi-boxed.c
+++ b/gi/pygi-boxed.c
@@ -53,24 +53,19 @@ _pygi_boxed_alloc (GIBaseInfo *info, gsize *size_out)
{
gsize size;
- /* FIXME: Remove when bgo#622711 is fixed */
- if (g_registered_type_info_get_g_type (info) == G_TYPE_VALUE) {
- size = sizeof (GValue);
- } else {
- switch (g_base_info_get_type (info)) {
- case GI_INFO_TYPE_UNION:
- size = g_union_info_get_size ( (GIUnionInfo *) info);
- break;
- case GI_INFO_TYPE_BOXED:
- case GI_INFO_TYPE_STRUCT:
- size = g_struct_info_get_size ( (GIStructInfo *) info);
- break;
- default:
- PyErr_Format (PyExc_TypeError,
- "info should be Boxed or Union, not '%d'",
- g_base_info_get_type (info));
- return NULL;
- }
+ switch (g_base_info_get_type (info)) {
+ case GI_INFO_TYPE_UNION:
+ size = g_union_info_get_size ( (GIUnionInfo *) info);
+ break;
+ case GI_INFO_TYPE_BOXED:
+ case GI_INFO_TYPE_STRUCT:
+ size = g_struct_info_get_size ( (GIStructInfo *) info);
+ break;
+ default:
+ PyErr_Format (PyExc_TypeError,
+ "info should be Boxed or Union, not '%d'",
+ g_base_info_get_type (info));
+ return NULL;
}
if( size_out != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]