[gobject-introspection] Assume only that an array is embedded in a struct if it's fixed size
- From: Tomeu Vizoso <tomeuv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] Assume only that an array is embedded in a struct if it's fixed size
- Date: Mon, 6 Jun 2011 18:14:58 +0000 (UTC)
commit 480dac7364c7c42d977a7a94322a0725c6c5054a
Author: Tomeu Vizoso <tomeu vizoso collabora co uk>
Date: Mon Jun 6 20:06:54 2011 +0200
Assume only that an array is embedded in a struct if it's fixed size
girepository/gifieldinfo.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/girepository/gifieldinfo.c b/girepository/gifieldinfo.c
index eb0b6b2..106fc1c 100644
--- a/girepository/gifieldinfo.c
+++ b/girepository/gifieldinfo.c
@@ -193,8 +193,12 @@ g_field_info_get_field (GIFieldInfo *field_info,
if (g_type_info_is_pointer (type_info))
{
- if (g_type_info_get_array_type (type_info) == GI_ARRAY_TYPE_C)
- value->v_pointer = G_STRUCT_MEMBER_P ((mem), (offset));
+ if (g_type_info_get_array_type (type_info) == GI_ARRAY_TYPE_C &&
+ g_type_info_get_array_fixed_size (type_info) >= 0)
+ {
+ /* Consider fixed-size arrays as embedded inside the struct */
+ value->v_pointer = G_STRUCT_MEMBER_P ((mem), (offset));
+ }
else
value->v_pointer = G_STRUCT_MEMBER (gpointer, mem, offset);
result = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]