diff options
author | Dan Winship <danw@gnome.org> | 2011-05-19 16:12:03 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2011-08-12 11:10:43 -0400 |
commit | 4dabe20ed5753bccd2abf8ad02e95ce6ab53036c (patch) | |
tree | 493ae7ef585a60e35c9c7b37bbb31b9f98a42e48 /girepository/gitypelib.c | |
parent | a588cee7d719e0b1764d2b7687cd90424faec9d0 (diff) | |
download | gobject-introspection-4dabe20ed5753bccd2abf8ad02e95ce6ab53036c.tar.gz |
Deprecate ErrorDomain
The previous ErrorDomain blob was never actually scanned or used, and
it was kind of a lame API conceptually.
To keep some compatibility, rather than removing the enumeration
values, rename them to _INVALID, and don't bump the typelib version.
This should in theory allow a new libgirepository to read an old
typelib.
Based on a patch from Colin Walters
https://bugzilla.gnome.org/show_bug.cgi?id=602516
Diffstat (limited to 'girepository/gitypelib.c')
-rw-r--r-- | girepository/gitypelib.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/girepository/gitypelib.c b/girepository/gitypelib.c index 6d1333ba..3869a6d2 100644 --- a/girepository/gitypelib.c +++ b/girepository/gitypelib.c @@ -284,7 +284,6 @@ g_typelib_check_sanity (void) CHECK_SIZE (ArrayTypeBlob, 8); CHECK_SIZE (ParamTypeBlob, 4); CHECK_SIZE (ErrorTypeBlob, 4); - CHECK_SIZE (ErrorDomainBlob, 16); CHECK_SIZE (ValueBlob, 12); CHECK_SIZE (FieldBlob, 16); CHECK_SIZE (RegisteredTypeBlob, 16); @@ -446,7 +445,6 @@ validate_header_basic (const guint8 *memory, header->field_blob_size != sizeof (FieldBlob) || header->value_blob_size != sizeof (ValueBlob) || header->constant_blob_size != sizeof (ConstantBlob) || - header->error_domain_blob_size != sizeof (ErrorDomainBlob) || header->attribute_blob_size != sizeof (AttributeBlob) || header->signature_blob_size != sizeof (SignatureBlob) || header->enum_blob_size != sizeof (EnumBlob) || @@ -607,8 +605,6 @@ validate_error_type_blob (GITypelib *typelib, { ErrorTypeBlob *blob; Header *header; - gint i; - DirEntry *entry; blob = (ErrorTypeBlob*)&typelib->data[offset]; @@ -623,30 +619,6 @@ validate_error_type_blob (GITypelib *typelib, return FALSE; } - for (i = 0; i < blob->n_domains; i++) - { - if (blob->domains[i] == 0 || blob->domains[i] > header->n_entries) - { - g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, - "Invalid directory index %d", blob->domains[i]); - return FALSE; - } - - entry = g_typelib_get_dir_entry (typelib, blob->domains[i]); - - if (entry->blob_type != BLOB_TYPE_ERROR_DOMAIN && - (entry->local || entry->blob_type != BLOB_TYPE_INVALID)) - { - g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, - "Wrong blob type"); - return FALSE; - } - } - return TRUE; } @@ -1825,14 +1797,6 @@ validate_interface_blob (ValidateContext *ctx, } static gboolean -validate_errordomain_blob (GITypelib *typelib, - guint32 offset, - GError **error) -{ - return TRUE; -} - -static gboolean validate_union_blob (GITypelib *typelib, guint32 offset, GError **error) @@ -1891,10 +1855,6 @@ validate_blob (ValidateContext *ctx, if (!validate_constant_blob (typelib, offset, error)) return FALSE; break; - case BLOB_TYPE_ERROR_DOMAIN: - if (!validate_errordomain_blob (typelib, offset, error)) - return FALSE; - break; case BLOB_TYPE_UNION: if (!validate_union_blob (typelib, offset, error)) return FALSE; |