Print out "any" for VOID+pointer, not "none"
authorColin Walters <walters@src.gnome.org>
Tue, 16 Sep 2008 19:44:26 +0000 (19:44 +0000)
committerColin Walters <walters@src.gnome.org>
Tue, 16 Sep 2008 19:44:26 +0000 (19:44 +0000)
* tools/generate.c: Print out "any" for VOID+pointer,
not "none"

svn path=/trunk/; revision=610

tools/generate.c

index efa4e7a..c63acdc 100644 (file)
@@ -52,6 +52,7 @@ write_type_info (const gchar *namespace,
   gint tag;
   gint i;
   GITypeInfo *type;
+  gboolean is_pointer;
   
   const gchar* basic[] = {
     "none", 
@@ -77,8 +78,14 @@ write_type_info (const gchar *namespace,
   };
 
   tag = g_type_info_get_tag (info);
-
-  if (tag < 20)
+  is_pointer = g_type_info_is_pointer (info);
+
+  if (tag == GI_TYPE_TAG_VOID) {
+    if (is_pointer)
+      g_fprintf (file, "%s", "any");
+    else
+      g_fprintf (file, "%s", "none");
+  } else if (tag < 20)
     g_fprintf (file, "%s", basic[tag]);
   else if (tag == 20)
     {