Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2009-02-12 20:17:25 (GMT)
committer Colin Walters <walters@verbum.org>2009-02-19 02:54:04 (GMT)
commitc48b7ae03510c83b984ba86b60861c1f45d60046 (patch)
tree45a56031d355e9f4b201fb5e5398fb9de1e8fe3b
parentb006d50681ea8cdf93745e160a24a5e003855672 (diff)
Bug 571373 - Add padding to typelib objects
Expand various typelib objects to ensure we have at least 16 bits left for each one to add another string indirection or directory offset, and also that we have at least a few bits for more flags.
-rw-r--r--girepository/gtypelib.c20
-rw-r--r--girepository/gtypelib.h29
2 files changed, 36 insertions, 13 deletions
diff --git a/girepository/gtypelib.c b/girepository/gtypelib.c
index 6de6217..673436a 100644
--- a/girepository/gtypelib.c
+++ b/girepository/gtypelib.c
@@ -175,18 +175,18 @@ g_typelib_check_sanity (void)
CHECK_SIZE (ErrorTypeBlob, 4);
CHECK_SIZE (ErrorDomainBlob, 16);
CHECK_SIZE (ValueBlob, 12);
- CHECK_SIZE (FieldBlob, 12);
+ CHECK_SIZE (FieldBlob, 16);
CHECK_SIZE (RegisteredTypeBlob, 16);
- CHECK_SIZE (StructBlob, 24);
- CHECK_SIZE (EnumBlob, 20);
- CHECK_SIZE (PropertyBlob, 12);
- CHECK_SIZE (SignalBlob, 12);
- CHECK_SIZE (VFuncBlob, 16);
- CHECK_SIZE (ObjectBlob, 36);
- CHECK_SIZE (InterfaceBlob, 28);
- CHECK_SIZE (ConstantBlob, 20);
+ CHECK_SIZE (StructBlob, 32);
+ CHECK_SIZE (EnumBlob, 24);
+ CHECK_SIZE (PropertyBlob, 16);
+ CHECK_SIZE (SignalBlob, 16);
+ CHECK_SIZE (VFuncBlob, 20);
+ CHECK_SIZE (ObjectBlob, 44);
+ CHECK_SIZE (InterfaceBlob, 36);
+ CHECK_SIZE (ConstantBlob, 24);
CHECK_SIZE (AnnotationBlob, 12);
- CHECK_SIZE (UnionBlob, 32);
+ CHECK_SIZE (UnionBlob, 40);
#undef CHECK_SIZE
g_assert (size_check_ok);
diff --git a/girepository/gtypelib.h b/girepository/gtypelib.h
index 5ab2acb..9a78873 100644
--- a/girepository/gtypelib.h
+++ b/girepository/gtypelib.h
@@ -622,7 +622,9 @@ typedef struct {
guint8 reserved :6;
guint8 bits;
- guint16 struct_offset;
+ guint16 struct_offset;
+
+ guint32 reserved2;
SimpleTypeBlob type;
} FieldBlob;
@@ -678,6 +680,9 @@ typedef struct {
guint16 n_fields;
guint16 n_methods;
+ guint32 reserved2;
+ guint32 reserved3;
+
#if 0
/* variable-length parts of the blob */
FieldBlob fields[];
@@ -719,6 +724,9 @@ typedef struct {
guint16 n_fields;
guint16 n_functions;
+ guint32 reserved2;
+ guint32 reserved3;
+
gint32 discriminator_offset;
SimpleTypeBlob discriminator_type;
@@ -755,6 +763,8 @@ typedef struct {
guint16 n_values;
guint16 reserved2;
+ guint32 reserved3;
+
ValueBlob values[];
} EnumBlob;
@@ -777,8 +787,9 @@ typedef struct {
guint32 construct_only : 1;
guint32 reserved :27;
- SimpleTypeBlob type;
+ guint32 reserved2;
+ SimpleTypeBlob type;
} PropertyBlob;
/**
@@ -815,6 +826,8 @@ typedef struct {
guint32 name;
+ guint32 reserved2;
+
guint32 signature;
} SignalBlob;
@@ -847,6 +860,8 @@ typedef struct {
guint16 struct_offset;
guint16 reserved2;
+
+ guint32 reserved3;
guint32 signature;
} VFuncBlob;
@@ -886,7 +901,6 @@ typedef struct {
guint16 parent;
guint16 class_struct;
- guint16 reserved2;
guint16 n_interfaces;
guint16 n_fields;
@@ -895,6 +909,10 @@ typedef struct {
guint16 n_signals;
guint16 n_vfuncs;
guint16 n_constants;
+ guint16 reserved2;
+
+ guint32 reserved3;
+ guint32 reserved4;
guint16 interfaces[];
@@ -942,6 +960,9 @@ typedef struct {
guint16 n_vfuncs;
guint16 n_constants;
+ guint32 reserved2;
+ guint32 reserved3;
+
guint16 prerequisites[];
#if 0
@@ -971,6 +992,8 @@ typedef struct {
guint32 size;
guint32 offset;
+
+ guint32 reserved2;
} ConstantBlob;
/**