Fix warnings pointed out by GCC
authorJohan Dahlin <jdahlin@litl.com>
Sat, 21 Feb 2009 02:54:11 +0000 (23:54 -0300)
committerJohan Dahlin <johan@gnome.org>
Sat, 21 Feb 2009 02:54:11 +0000 (23:54 -0300)
giscanner/sourcescanner.h
tests/invoke/invoke.c
tests/invoke/testfns.c
tests/scanner/foo.c

index f36a808..276b0cb 100644 (file)
@@ -166,6 +166,8 @@ GISourceType *          gi_source_pointer_new              (GISourceType     *base_type);
 GISourceType *             gi_source_array_new                (GISourceSymbol   *size);
 GISourceType *             gi_source_function_new             (void);
 
+void ctype_free (GISourceType * type);
+
 G_END_DECLS
 
 #endif /* __SOURCE_SCANNER_H__ */
index cc1f94c..dc64253 100644 (file)
@@ -24,9 +24,8 @@ main (int argc, char *argv[])
   GArgument retval;
   gint res;
   gchar *blurb;
-  gint len;
+  guint len;
   GError *error = NULL;
-  const gchar *name;
   TestStruct *s;
   
   g_type_init ();
@@ -44,9 +43,11 @@ main (int argc, char *argv[])
 
   g_assert (g_irepository_is_registered (NULL, "testfns", NULL));
 
+#if 0
   g_print ("after dlopening %s: %d infos in the repository\n", 
           testfns,
           g_irepository_get_n_infos (rep, "testfns"));
+#endif
 
   /* test1 calculates x + 4, 
    * taking x as an in parameter
@@ -179,7 +180,7 @@ main (int argc, char *argv[])
               g_base_info_get_name (info),
               error->message);
 
-    g_print("returned %s\n", retval.v_pointer);
+    g_print("returned %p\n", retval.v_pointer);
     g_assert (strcmp(retval.v_pointer, "Hey there...")==0);
     g_list_foreach (list, (GFunc) g_free, NULL);
     g_list_free (list);
@@ -197,10 +198,10 @@ main (int argc, char *argv[])
   info = g_irepository_find_by_name (rep, "testfns", "TestStruct");
   g_assert (g_base_info_get_type (info) == GI_INFO_TYPE_STRUCT);
   record = (GIStructInfo *)info;
-  info = g_struct_info_find_method (record, "test8");
+  info = (GIBaseInfo*)g_struct_info_find_method (record, "test8");
   g_assert (g_base_info_get_type (info) == GI_INFO_TYPE_FUNCTION);
   function = (GIFunctionInfo *)info;
-  g_assert (g_function_info_get_flags (info) & GI_FUNCTION_IS_CONSTRUCTOR);
+  g_assert (g_function_info_get_flags (function) & GI_FUNCTION_IS_CONSTRUCTOR);
 
   {
     in_args[0].v_int = 42;
@@ -221,10 +222,10 @@ main (int argc, char *argv[])
   g_clear_error (&error);
 
   g_print("Test 9\n");
-  info = g_struct_info_find_method (record, "test9");
+  info = (GIBaseInfo*)g_struct_info_find_method (record, "test9");
   g_assert (g_base_info_get_type (info) == GI_INFO_TYPE_FUNCTION);
   function = (GIFunctionInfo *)info;
-  g_assert (g_function_info_get_flags (info) & GI_FUNCTION_IS_METHOD);
+  g_assert (g_function_info_get_flags (function) & GI_FUNCTION_IS_METHOD);
 
   {
     TestStruct s = { 42 };
@@ -242,7 +243,7 @@ main (int argc, char *argv[])
   }
 
   g_base_info_unref (info);
-  g_base_info_unref (record);
+  g_base_info_unref ((GIBaseInfo*)record);
   g_clear_error (&error);
 
 
@@ -262,7 +263,7 @@ main (int argc, char *argv[])
   g_base_info_unref (info);
   g_clear_error (&error);
 #endif
-  
+
   /* too few in arguments */
   info = g_irepository_find_by_name (rep, "testfns", "test2");  
   g_assert (g_base_info_get_type (info) == GI_INFO_TYPE_FUNCTION);
index 672d77a..77e54c1 100644 (file)
@@ -34,7 +34,7 @@ void test3 (gint *inout)
 
 void test4 (const gchar *blurb)
 {
-  g_printf (blurb);
+  g_printf ("%s", blurb);
 }
 
 void test5 (gchar **blurb, gint *len)
index fa1a66d..0e5beb6 100644 (file)
@@ -459,6 +459,8 @@ foo_some_variant (guint x, va_list args)
 {
 }
 
+GType foo_tile_handler_get_type(void);
+
 /* This setup of a totally hidden parent class matches
  * http://bugzilla.gnome.org/show_bug.cgi?id=561360
  */
@@ -521,4 +523,4 @@ foo_buffer_init (FooBuffer *object)
 void
 foo_buffer_some_method (FooBuffer *buffer)
 {
-}
\ No newline at end of file
+}