mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
Fix several signedness warnings in tests/threadpool-test.c
tests/threadpool-test.c: In function ‘test_thread_sort’: tests/threadpool-test.c:283:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} 283 | for (i = 0; i < limit; i++) { | ^ tests/threadpool-test.c:296:50: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} 296 | g_assert (g_thread_pool_get_max_threads (pool) == max_threads); | ^~ glib/gmacros.h:941:25: note: in definition of macro ‘G_LIKELY’ 941 | #define G_LIKELY(expr) (expr) | ^~~~ tests/threadpool-test.c:296:3: note: in expansion of macro ‘g_assert’ 296 | g_assert (g_thread_pool_get_max_threads (pool) == max_threads); | ^~~~~~~~ tests/threadpool-test.c:297:50: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘gint’ {aka ‘int’} 297 | g_assert (g_thread_pool_get_num_threads (pool) == g_thread_pool_get_max_threads (pool)); | ^~ glib/gmacros.h:941:25: note: in definition of macro ‘G_LIKELY’ 941 | #define G_LIKELY(expr) (expr) | ^~~~ tests/threadpool-test.c:297:3: note: in expansion of macro ‘g_assert’ 297 | g_assert (g_thread_pool_get_num_threads (pool) == g_thread_pool_get_max_threads (pool)); | ^~~~~~~~ tests/threadpool-test.c: In function ‘test_thread_idle_time’: tests/threadpool-test.c:355:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} 355 | for (i = 0; i < limit; i++) { | ^
This commit is contained in:
parent
3951ccffae
commit
951105fae5
@ -248,7 +248,7 @@ test_thread_sort (gboolean sort)
|
||||
GThreadPool *pool;
|
||||
guint limit;
|
||||
guint max_threads;
|
||||
gint i;
|
||||
guint i;
|
||||
|
||||
limit = MAX_THREADS * 10;
|
||||
|
||||
@ -293,8 +293,8 @@ test_thread_sort (gboolean sort)
|
||||
g_thread_pool_unprocessed (pool)));
|
||||
}
|
||||
|
||||
g_assert (g_thread_pool_get_max_threads (pool) == max_threads);
|
||||
g_assert (g_thread_pool_get_num_threads (pool) == g_thread_pool_get_max_threads (pool));
|
||||
g_assert (g_thread_pool_get_max_threads (pool) == (gint) max_threads);
|
||||
g_assert (g_thread_pool_get_num_threads (pool) == (guint) g_thread_pool_get_max_threads (pool));
|
||||
g_thread_pool_free (pool, TRUE, TRUE);
|
||||
}
|
||||
|
||||
@ -337,7 +337,7 @@ test_thread_idle_time (void)
|
||||
{
|
||||
guint limit = 50;
|
||||
guint interval = 10000;
|
||||
gint i;
|
||||
guint i;
|
||||
|
||||
idle_pool = g_thread_pool_new (test_thread_idle_time_entry_func,
|
||||
NULL,
|
||||
|
Loading…
Reference in New Issue
Block a user