girepository: Use G_TYPE_TAG_IS_BASIC consistently
authorColin Walters <walters@verbum.org>
Tue, 26 Oct 2010 14:03:29 +0000 (10:03 -0400)
committerColin Walters <walters@verbum.org>
Tue, 26 Oct 2010 14:04:46 +0000 (10:04 -0400)
This is a preparatory patch for adding a new basic tag.

girepository/girnode.c
girepository/gitypelib.c

index 2f6a27090d8c8ab9af2accb4b1cd95a488e579ae..46fd3c7d9acda8b9ad8f535d513112109656b236 100644 (file)
@@ -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;
index 4f85170268047d5c222b1aa2df3b646045208647..4d119b73126fb86ca2a120d2d696da839fab19e0 100644 (file)
@@ -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,