fix warnings
authorDan Winship <danw@gnome.org>
Mon, 30 Apr 2012 10:31:20 +0000 (06:31 -0400)
committerDan Winship <danw@gnome.org>
Mon, 30 Apr 2012 13:28:42 +0000 (09:28 -0400)
gio/gdbusdaemon.c
gio/gtestdbus.c
gio/tests/buffered-input-stream.c
glib/goption.c
tests/gobject/defaultiface.c
tests/gobject/dynamictype.c
tests/gobject/ifaceinit.c
tests/slice-color.c
tests/slice-test.c
tests/threadpool-test.c

index 96db54d..35a724c 100644 (file)
@@ -1523,7 +1523,6 @@ on_authorize_authenticated_peer (GDBusAuthObserver *observer,
                                 GCredentials      *credentials,
                                 gpointer           user_data)
 {
-  GDBusDaemon *daemon = user_data;
   gboolean authorized = TRUE;
 
   if (credentials != NULL)
index 99f855b..6b9fdd3 100644 (file)
@@ -515,7 +515,7 @@ start_daemon (GTestDBus *self)
   GError *error = NULL;
 
   if (g_getenv ("G_TEST_DBUS_DAEMON") != NULL)
-    argv[0] = g_getenv ("G_TEST_DBUS_DAEMON");
+    argv[0] = (gchar *)g_getenv ("G_TEST_DBUS_DAEMON");
 
   /* Write config file and set its path in argv */
   file = write_config_file (self);
index 7039367..82604db 100644 (file)
@@ -297,7 +297,7 @@ test_seek (void)
   error = NULL;
 
   /* Seek by read */
-  g_assert_cmpstr (g_seekable_tell (G_SEEKABLE (in)), ==, 0);
+  g_assert_cmpint (g_seekable_tell (G_SEEKABLE (in)), ==, 0);
   byte = g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, &error);
   g_assert_no_error (error);
   g_assert_cmpint (byte, ==, 'a');
index f5372ff..7f8af97 100644 (file)
@@ -261,7 +261,6 @@ static glong
 _g_utf8_strwidth (const gchar *p)
 {
   glong len = 0;
-  const gchar *start = p;
   g_return_val_if_fail (p != NULL, 0);
 
   while (*p)
index ece9259..b6710a4 100644 (file)
@@ -139,10 +139,9 @@ module_register (GTypeModule *module)
 static void
 test_dynamic_iface (void)
 {
-  GTypeModule *module;
   TestDynamicIfaceClass *dynamic_iface;
 
-  module = test_module_new (module_register);
+  test_module_new (module_register);
 
   /* Not loaded until we call ref for the first time */
   dynamic_iface = g_type_default_interface_peek (TEST_TYPE_DYNAMIC_IFACE);
index fba1ced..4516bd6 100644 (file)
@@ -110,10 +110,9 @@ module_register (GTypeModule *module)
 static void
 test_dynamic_type (void)
 {
-  GTypeModule *module;
   DynamicObjectClass *class;
 
-  module = test_module_new (module_register);
+  test_module_new (module_register);
 
   /* Not loaded until we call ref for the first time */
   class = g_type_class_peek (DYNAMIC_OBJECT_TYPE);
index 9715c95..a4aa268 100644 (file)
@@ -418,5 +418,7 @@ main (int   argc,
   iface = TEST_IFACE6_GET_CLASS (object);
   g_assert (iface && iface->val == 0x60006 && iface->base_val == 0x660066);
 
+  g_type_class_unref (object_class);
+
   return 0;
 }
index c4a417d..6245f5b 100644 (file)
@@ -131,13 +131,14 @@ main (int   argc,
   /* basic sanity checks */
   if (!block_size || !n_blocks || block_size >= area_size)
     {
-      g_printerr ("Invalid arguments: block-size=%llu memory-size=%llu\n", block_size, area_size);
+      g_printerr ("Invalid arguments: block-size=%" G_GUINT64_FORMAT " memory-size=%" G_GUINT64_FORMAT "\n", block_size, area_size);
       usage();
       return 1;
     }
 
-  g_printerr ("Will allocate and touch %llu blocks of %llu bytes (= %llu bytes) %llu times with color increment: 0x%08llx\n",
-              n_blocks, block_size, n_blocks * block_size, repeats, g_slice_get_config (G_SLICE_CONFIG_COLOR_INCREMENT));
+  g_printerr ("Will allocate and touch %" G_GUINT64_FORMAT " blocks of %" G_GUINT64_FORMAT " bytes (= %" G_GUINT64_FORMAT " bytes) %" G_GUINT64_FORMAT " times with color increment: 0x%08" G_GUINT64_MODIFIER "x\n",
+              n_blocks, block_size, n_blocks * block_size, repeats,
+             (guint64)g_slice_get_config (G_SLICE_CONFIG_COLOR_INCREMENT));
 
   touch_mem (block_size, n_blocks, repeats);
   
index beafce3..9ff96ae 100644 (file)
@@ -297,7 +297,7 @@ main (int   argc,
         for (i = 0; i < n_chunks; i++)
           {
             gint64 *vals = g_slice_get_config_state (G_SLICE_CONFIG_CONTENTION_COUNTER, i, &n);
-            g_print ("  %9llu   |  %9llu   |  %9llu\n", vals[0], vals[2], vals[1]);
+            g_print ("  %9" G_GINT64_FORMAT "   |  %9" G_GINT64_FORMAT "   |  %9" G_GINT64_FORMAT "\n", vals[0], vals[2], vals[1]);
             g_free (vals);
           }
       }
index 6e1f6fc..1f0442b 100644 (file)
@@ -5,8 +5,13 @@
 
 #include <glib.h>
 
-#define DEBUG_MSG(x)
-/* #define DEBUG_MSG(args) g_printerr args ; g_printerr ("\n");  */
+/* #define DEBUG 1 */
+
+#ifdef DEBUG
+# define DEBUG_MSG(args) g_printerr args ; g_printerr ("\n");
+#else
+# define DEBUG_MSG(x)
+#endif
 
 #define WAIT                5    /* seconds */
 #define MAX_THREADS         10
@@ -128,9 +133,11 @@ test_thread_stop_unused (void)
 static void
 test_thread_pools_entry_func (gpointer data, gpointer user_data)
 {
+#ifdef DEBUG
   guint id = 0;
 
   id = GPOINTER_TO_UINT (data);
+#endif
 
   DEBUG_MSG (("[pool] ---> [%3.3d] entered thread.", id));
 
@@ -293,9 +300,11 @@ test_thread_sort (gboolean sort)
 static void
 test_thread_idle_time_entry_func (gpointer data, gpointer user_data)
 {
+#ifdef DEBUG
   guint thread_id;
 
   thread_id = GPOINTER_TO_UINT (data);
+#endif
 
   DEBUG_MSG (("[idle] ---> entered thread:%2.2d", thread_id));
 
@@ -307,11 +316,8 @@ test_thread_idle_time_entry_func (gpointer data, gpointer user_data)
 static gboolean
 test_thread_idle_timeout (gpointer data)
 {
-  guint interval;
   gint i;
 
-  interval = GPOINTER_TO_UINT (data);
-
   for (i = 0; i < 2; i++) {
     g_thread_pool_push (idle_pool, GUINT_TO_POINTER (100 + i), NULL);
     DEBUG_MSG (("[idle] ===> pushed new thread with id:%d, number "