[gobject-introspection] girepository: Use G_TYPE_TAG_IS_BASIC consistently
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] girepository: Use G_TYPE_TAG_IS_BASIC consistently
- Date: Tue, 26 Oct 2010 14:05:05 +0000 (UTC)
commit e4eef4fe4a35161907ab353515ec7aa6a31c282b
Author: Colin Walters <walters verbum org>
Date: Tue Oct 26 10:03:29 2010 -0400
girepository: Use G_TYPE_TAG_IS_BASIC consistently
This is a preparatory patch for adding a new basic tag.
girepository/girnode.c | 8 +++-----
girepository/gitypelib.c | 2 +-
2 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/girepository/girnode.c b/girepository/girnode.c
index 2f6a270..46fd3c7 100644
--- a/girepository/girnode.c
+++ b/girepository/girnode.c
@@ -636,7 +636,7 @@ g_ir_node_get_full_size_internal (GIrNode *parent,
{
GIrNodeType *type = (GIrNodeType *)node;
size = sizeof (SimpleTypeBlob);
- if (type->tag >= GI_TYPE_TAG_ARRAY)
+ if (!G_TYPE_TAG_IS_BASIC(type->tag))
{
g_debug ("node %p type tag '%s'", node,
g_type_tag_to_string (type->tag));
@@ -1220,7 +1220,7 @@ serialize_type (GIrTypelibBuild *build,
{
gint i;
- if (node->tag < GI_TYPE_TAG_ARRAY)
+ if (G_TYPE_TAG_IS_BASIC(node->tag))
{
g_string_append_printf (str, "%s%s", g_type_tag_to_string (node->tag),
node->is_pointer ? "*" : "");
@@ -1415,9 +1415,7 @@ g_ir_node_build_typelib (GIrNode *node,
*offset += sizeof (SimpleTypeBlob);
- if (type->tag < GI_TYPE_TAG_ARRAY ||
- type->tag == GI_TYPE_TAG_UTF8 ||
- type->tag == GI_TYPE_TAG_FILENAME)
+ if (G_TYPE_TAG_IS_BASIC(type->tag))
{
blob->flags.reserved = 0;
blob->flags.reserved2 = 0;
diff --git a/girepository/gitypelib.c b/girepository/gitypelib.c
index 4f85170..4d119b7 100644
--- a/girepository/gitypelib.c
+++ b/girepository/gitypelib.c
@@ -642,7 +642,7 @@ validate_type_blob (GITypelib *typelib,
if (simple->flags.reserved == 0 &&
simple->flags.reserved2 == 0)
{
- if (simple->flags.tag >= GI_TYPE_TAG_ARRAY)
+ if (!G_TYPE_TAG_IS_BASIC(simple->flags.tag))
{
g_set_error (error,
G_TYPELIB_ERROR,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]