diff options
-rw-r--r-- | girepository/gifieldinfo.c | 5 | ||||
-rw-r--r-- | tests/scanner/Regress-1.0-expected.gir | 10 | ||||
-rw-r--r-- | tests/scanner/regress.h | 5 |
3 files changed, 19 insertions, 1 deletions
diff --git a/girepository/gifieldinfo.c b/girepository/gifieldinfo.c index cf5c2332..b9b56a4d 100644 --- a/girepository/gifieldinfo.c +++ b/girepository/gifieldinfo.c @@ -193,7 +193,10 @@ g_field_info_get_field (GIFieldInfo *field_info, if (g_type_info_is_pointer (type_info)) { - value->v_pointer = G_STRUCT_MEMBER (gpointer, mem, offset); + if (g_type_info_get_array_type (type_info) == GI_ARRAY_TYPE_C) + value->v_pointer = G_STRUCT_MEMBER_P ((mem), (offset)); + else + value->v_pointer = G_STRUCT_MEMBER (gpointer, mem, offset); result = TRUE; } else diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir index 2bae748b..07985544 100644 --- a/tests/scanner/Regress-1.0-expected.gir +++ b/tests/scanner/Regress-1.0-expected.gir @@ -886,6 +886,16 @@ TpAccount::status-changed</doc> </parameters> </method> </record> + <record name="TestStructFixedArray" c:type="RegressTestStructFixedArray"> + <field name="just_int" writable="1"> + <type name="gint" c:type="gint"/> + </field> + <field name="array" writable="1"> + <array zero-terminated="0" c:type="gint" fixed-size="10"> + <type name="gint" c:type="gint"/> + </array> + </field> + </record> <class name="TestSubObj" c:symbol-prefix="test_sub_obj" c:type="RegressTestSubObj" diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h index 89209ebc..5937fa5d 100644 --- a/tests/scanner/regress.h +++ b/tests/scanner/regress.h @@ -609,6 +609,11 @@ typedef enum { REGRESS_TEST_PUBLIC_ENUM_AFTER = 1 << 2, } RegressTestPrivateEnum; +typedef struct { + gint just_int; + gint array[10]; +} RegressTestStructFixedArray; + #define REGRESS_UTF8_CONSTANT "const \xe2\x99\xa5 utf8" #endif /* __GITESTTYPES_H__ */ |