Merge branch 'fix_more_warnings' into 'master'

Fix more warnings

See merge request GNOME/glib!2074
This commit is contained in:
Philip Withnall 2021-05-04 09:43:31 +00:00
commit 2cb303b7aa
6 changed files with 17 additions and 16 deletions

View File

@ -53,7 +53,7 @@ int
main (int argc,
char *argv[])
{
gint i;
gsize i;
struct {
gchar *filename;
gchar *dirname;
@ -100,9 +100,8 @@ main (int argc,
{ "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;

View File

@ -197,7 +197,7 @@ static const PerformanceTest tests[] = {
};
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 @@ run_test (const PerformanceTest *test)
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 @@ main (int argc,
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 @@ main (int argc,
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);
}

View File

@ -1015,7 +1015,7 @@ static PerformanceTest tests[] = {
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 @@ main (int argc,
}
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;

View File

@ -33,7 +33,7 @@ io_pipe (GIOChannel **channels)
}
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 @@ read_all (GIOChannel *channel, char *buf, int len)
}
static gboolean
write_all (GIOChannel *channel, char *buf, int len)
write_all (GIOChannel *channel, char *buf, gsize len)
{
gsize bytes_written = 0;
gsize count;

View File

@ -352,7 +352,7 @@ create_crawler (void)
static void
cleanup_crawlers (GMainContext *context)
{
gint i;
guint i;
G_LOCK (crawler_array_lock);
for (i = 0; i < crawler_array->len; i++)

View File

@ -115,7 +115,7 @@ run_thread (GTest * test)
int
main (int argc, char **argv)
{
gint i;
guint i;
GTest *test1, *test2;
GArray *test_threads;
const guint n_threads = 5;