Merge branch 'fix_more_warnings' into 'master'

Fix more warnings

See merge request GNOME/glib!2074
diff --git a/tests/dirname-test.c b/tests/dirname-test.c
index 52a4678..81c55d5 100644
--- a/tests/dirname-test.c
+++ b/tests/dirname-test.c
@@ -53,7 +53,7 @@
 main (int   argc,
       char *argv[])
 {
-  gint i;
+  gsize i;
   struct {
     gchar *filename;
     gchar *dirname;
@@ -100,9 +100,8 @@
     { "a:\\/", "a:\\" },
 #endif
   };
-  guint n_dirname_checks = sizeof (dirname_checks) / sizeof (dirname_checks[0]);
 
-  for (i = 0; i < n_dirname_checks; i++)
+  for (i = 0; i < G_N_ELEMENTS (dirname_checks); i++)
     {
       gchar *dirname;
 
diff --git a/tests/gobject/performance-threaded.c b/tests/gobject/performance-threaded.c
index c98541d..897372e 100644
--- a/tests/gobject/performance-threaded.c
+++ b/tests/gobject/performance-threaded.c
@@ -197,7 +197,7 @@
 };
 
 static gboolean verbose = FALSE;
-static int n_threads = 0;
+static guint n_threads = 0;
 static gboolean list = FALSE;
 static int test_length = DEFAULT_TEST_TIME;
 
@@ -320,7 +320,7 @@
 static const PerformanceTest *
 find_test (const char *name)
 {
-  int i;
+  gsize i;
   for (i = 0; i < G_N_ELEMENTS (tests); i++)
     {
       if (strcmp (tests[i].name, name) == 0)
@@ -336,7 +336,7 @@
   const PerformanceTest *test;
   GOptionContext *context;
   GError *error = NULL;
-  int i;
+  gsize i;
 
   context = g_option_context_new ("GObject performance tests");
   g_option_context_add_main_entries (context, cmd_entries, NULL);
@@ -357,9 +357,10 @@
 
   if (argc > 1)
     {
-      for (i = 1; i < argc; i++)
+      gsize k;
+      for (k = 1; k < argc; k++)
 	{
-	  test = find_test (argv[i]);
+	  test = find_test (argv[k]);
 	  if (test)
 	    run_test (test);
 	}
diff --git a/tests/gobject/performance.c b/tests/gobject/performance.c
index 163be58..40ab48a 100644
--- a/tests/gobject/performance.c
+++ b/tests/gobject/performance.c
@@ -1015,7 +1015,7 @@
 static PerformanceTest *
 find_test (const char *name)
 {
-  int i;
+  gsize i;
   for (i = 0; i < G_N_ELEMENTS (tests); i++)
     {
       if (strcmp (tests[i].name, name) == 0)
@@ -1051,8 +1051,9 @@
     }
   else
     {
-      for (i = 0; i < G_N_ELEMENTS (tests); i++)
-	run_test (&tests[i]);
+      gsize k;
+      for (k = 0; k < G_N_ELEMENTS (tests); k++)
+        run_test (&tests[k]);
     }
 
   return 0;
diff --git a/tests/gobject/timeloop-closure.c b/tests/gobject/timeloop-closure.c
index c904c2a..51dd6f1 100644
--- a/tests/gobject/timeloop-closure.c
+++ b/tests/gobject/timeloop-closure.c
@@ -33,7 +33,7 @@
 }
 
 static gboolean
-read_all (GIOChannel *channel, char *buf, int len)
+read_all (GIOChannel *channel, char *buf, gsize len)
 {
   gsize bytes_read = 0;
   gsize count;
@@ -57,7 +57,7 @@
 }
 
 static gboolean
-write_all (GIOChannel *channel, char *buf, int len)
+write_all (GIOChannel *channel, char *buf, gsize len)
 {
   gsize bytes_written = 0;
   gsize count;
diff --git a/tests/mainloop-test.c b/tests/mainloop-test.c
index 5a3e6c9..be6024a 100644
--- a/tests/mainloop-test.c
+++ b/tests/mainloop-test.c
@@ -352,10 +352,10 @@
 static void
 cleanup_crawlers (GMainContext *context)
 {
-  gint i;
+  guint i;
   
   G_LOCK (crawler_array_lock);
-  for (i=0; i < crawler_array->len; i++)
+  for (i = 0; i < crawler_array->len; i++)
     {
       if (g_source_get_context (crawler_array->pdata[i]) == context)
 	{
diff --git a/tests/refcount/objects.c b/tests/refcount/objects.c
index 0c471a4..06b8719 100644
--- a/tests/refcount/objects.c
+++ b/tests/refcount/objects.c
@@ -115,7 +115,7 @@
 int
 main (int argc, char **argv)
 {
-  gint i;
+  guint i;
   GTest *test1, *test2;
   GArray *test_threads;
   const guint n_threads = 5;