diff options
author | Colin Walters <walters@verbum.org> | 2009-02-11 23:51:28 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2009-02-18 21:54:03 -0500 |
commit | d286484efbc9321f5783a7264ca94b1f54f69e2e (patch) | |
tree | 0af555b16a9a4561c6e20d0fe174f7870f40f39d /girepository | |
parent | fdeaf8e51dbcb5ed909249d74c0d711d6dfb6e2d (diff) | |
download | gobject-introspection-d286484efbc9321f5783a7264ca94b1f54f69e2e.tar.gz |
Bug 571373 - Remove hardcoded offsets in ginfo.c
In a few places we had hardcoded sizes for accessing structure members
and computing into variable size arrays. Remove those.
Diffstat (limited to 'girepository')
-rw-r--r-- | girepository/ginfo.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/girepository/ginfo.c b/girepository/ginfo.c index f4ca1310..7ecfe633 100644 --- a/girepository/ginfo.c +++ b/girepository/ginfo.c @@ -775,7 +775,7 @@ g_arg_info_get_type (GIArgInfo *info) { GIBaseInfo *base = (GIBaseInfo *)info; - return g_type_info_new (base, base->typelib, base->offset + 12); + return g_type_info_new (base, base->typelib, base->offset + G_STRUCT_OFFSET (ArgBlob, arg_type)); } /* GITypeInfo functions */ @@ -828,7 +828,9 @@ g_type_info_get_param_type (GITypeInfo *info, case GI_TYPE_TAG_GLIST: case GI_TYPE_TAG_GSLIST: case GI_TYPE_TAG_GHASH: - return g_type_info_new (base, base->typelib, base->offset + 4 + 4 * n); + return g_type_info_new (base, base->typelib, + base->offset + sizeof (ParamTypeBlob) + + sizeof (SimpleTypeBlob) * n); break; default: ; @@ -1024,7 +1026,7 @@ g_field_info_get_type (GIFieldInfo *info) { GIBaseInfo *base = (GIBaseInfo *)info; - return g_type_info_new (base, base->typelib, base->offset + 8); + return g_type_info_new (base, base->typelib, base->offset + G_STRUCT_OFFSET (FieldBlob, type)); } /* GIRegisteredTypeInfo functions */ @@ -1722,7 +1724,7 @@ g_property_info_get_type (GIPropertyInfo *info) { GIBaseInfo *base = (GIBaseInfo *)info; - return g_type_info_new (base, base->typelib, base->offset + 8); + return g_type_info_new (base, base->typelib, base->offset + G_STRUCT_OFFSET (PropertyBlob, type)); } |