summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorColin Walters <walters@src.gnome.org>2008-09-23 22:18:06 +0000
committerColin Walters <walters@src.gnome.org>2008-09-23 22:18:06 +0000
commitdf736500a6f74945bbd44d50d3383ca13057357d (patch)
treeec8524004bc205b855eed9721287282a600c9ffd /tools
parentb0c1b03f82b1e71a27cf32211bcf1410e022ea5c (diff)
downloadgobject-introspection-df736500a6f74945bbd44d50d3383ca13057357d.tar.gz
Use symbolic names for type tags instead of hardcoded integers
svn path=/trunk/; revision=626
Diffstat (limited to 'tools')
-rw-r--r--tools/generate.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/tools/generate.c b/tools/generate.c
index f10bdf91..dca2cdac 100644
--- a/tools/generate.c
+++ b/tools/generate.c
@@ -100,9 +100,9 @@ write_type_info (const gchar *namespace,
else
g_fprintf (file, "%s", "none");
}
- else if (tag < 20)
+ else if (tag < GI_TYPE_TAG_ARRAY)
g_fprintf (file, "%s", basic[tag]);
- else if (tag == 20)
+ else if (tag == GI_TYPE_TAG_ARRAY)
{
gint length;
@@ -121,13 +121,13 @@ write_type_info (const gchar *namespace,
g_fprintf (file, "]");
g_base_info_unref ((GIBaseInfo *)type);
}
- else if (tag == 21)
+ else if (tag == GI_TYPE_TAG_INTERFACE)
{
GIBaseInfo *iface = g_type_info_get_interface (info);
write_type_name (namespace, iface, file);
g_base_info_unref (iface);
}
- else if (tag == 22)
+ else if (tag == GI_TYPE_TAG_GLIST)
{
type = g_type_info_get_param_type (info, 0);
g_fprintf (file, "GLib.List");
@@ -139,7 +139,7 @@ write_type_info (const gchar *namespace,
g_base_info_unref ((GIBaseInfo *)type);
}
}
- else if (tag == 23)
+ else if (tag == GI_TYPE_TAG_GSLIST)
{
type = g_type_info_get_param_type (info, 0);
g_fprintf (file, "GLib.SList");
@@ -151,7 +151,7 @@ write_type_info (const gchar *namespace,
g_base_info_unref ((GIBaseInfo *)type);
}
}
- else if (tag == 24)
+ else if (tag == GI_TYPE_TAG_GHASH)
{
type = g_type_info_get_param_type (info, 0);
g_fprintf (file, "GLib.HashTable");
@@ -167,7 +167,7 @@ write_type_info (const gchar *namespace,
g_base_info_unref ((GIBaseInfo *)type);
}
}
- else if (tag == 25)
+ else if (tag == GI_TYPE_TAG_ERROR)
{
gint n;
@@ -188,7 +188,10 @@ write_type_info (const gchar *namespace,
}
}
else
- g_assert_not_reached ();
+ {
+ g_printerr ("Unhandled type tag %d\n", tag);
+ g_assert_not_reached ();
+ }
}
static void