[gtk-doc] scan: Fixed gcc warnings. Fixes #580206



commit d1d7169582fc5150c08cc3355edec06172ab100c
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sat Apr 25 11:38:01 2009 +0100

    scan: Fixed gcc warnings. Fixes #580206
    
    Fixes unreachable code, non-C90 compliance, missing cases.
---
 gtkdoc-scangobj.in |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/gtkdoc-scangobj.in b/gtkdoc-scangobj.in
index 75d6fc4..aa6f5f0 100644
--- a/gtkdoc-scangobj.in
+++ b/gtkdoc-scangobj.in
@@ -161,6 +161,7 @@ GType object_types[$ntypes];
 static GType *
 get_object_types (void)
 {
+    gpointer g_object_class;
     gint i = 0;
 EOT
 
@@ -173,7 +174,7 @@ print OUTPUT <<EOT;
 
     /* reference the GObjectClass to initialize the param spec pool
      * potentially needed by interfaces. See http://bugs.gnome.org/571820 */
-    gpointer g_object_class = g_type_class_ref (G_TYPE_OBJECT);
+    g_object_class = g_type_class_ref (G_TYPE_OBJECT);
 
     /* Need to make sure all the types are loaded in and initialize
      * their signals and properties.
@@ -235,9 +236,6 @@ static void output_object_args (FILE *fp, GType object_type);
 int
 main (int argc, char *argv[])
 {
-  /* Silence the compiler: */
-  if (argv != argv) argc = argc;
-
   $TYPE_INIT_FUNC;
 
   get_object_types ();
@@ -1055,6 +1053,8 @@ describe_signed_constant (gsize size, gint64 value)
       else if (value == G_MININT64)
         desc = g_strdup ("G_MININT64");
       break;
+    default:
+      break;
   }
   if (!desc)
     desc = g_strdup_printf ("%" G_GINT64_FORMAT, value);
@@ -1094,6 +1094,8 @@ describe_unsigned_constant (gsize size, guint64 value)
       else if (value == G_MAXUINT64)
         desc = g_strdup ("G_MAXUINT64");
       break;
+    default:
+      break;
   }
   if (!desc)
     desc = g_strdup_printf ("%" G_GUINT64_FORMAT, value);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]