summaryrefslogtreecommitdiff
path: root/pthread_support.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2011-09-08 12:17:26 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-09-12 12:41:04 +0200
commitcddcd3839fa6cf69a46fe30a09a5b07fb66a70d4 (patch)
treeec2c4f700e0fb57a771e39419f5de81103631e2d /pthread_support.c
parenteb650a2a7697e7320ffadda1be064866a816349d (diff)
Resolve "comparison of signed and unsigned values" compiler warnings.
(Apply commit 96f7891) * cord/cordprnt.c (CORD_vsprintf): Cast "prec" and "width" local variables to size_t. * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Change type of "i" local variable to int. * pthread_support.c (start_mark_threads): Likewise. * os_dep.c (GC_repeat_read): Change type of "num_read" to size_t. * os_dep.c (GC_get_maps): Change type of "result" local variable from int to ssize_t; cast "result" to size_t in comparison. * pthread_support.c (GC_remove_all_threads_but_me): Cast "result" to int. * pthread_support.c (GC_wait_for_gc_completion): Change type of "old_gc_no" local variable to word. * pthread_support.c (GC_lock): Change type of "i" local variable to unsigned. * tests/staticrootstest.c (main): Cast sizeof() value to int in comparisons.
Diffstat (limited to 'pthread_support.c')
-rw-r--r--pthread_support.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pthread_support.c b/pthread_support.c
index 8731775..38f4476 100644
--- a/pthread_support.c
+++ b/pthread_support.c
@@ -400,7 +400,7 @@ STATIC pthread_t GC_mark_threads[MAX_MARKERS];
static void start_mark_threads(void)
{
- unsigned i;
+ int i;
pthread_attr_t attr;
GC_ASSERT(I_DONT_HOLD_LOCK());
@@ -737,7 +737,7 @@ STATIC void GC_remove_all_threads_but_me(void)
if (stat_buf[i] == '\n' && stat_buf[i+1] == 'c'
&& stat_buf[i+2] == 'p' && stat_buf[i+3] == 'u') {
int cpu_no = atoi(&stat_buf[i + 4]);
- if (cpu_no >= result)
+ if (cpu_no >= (int)result)
result = cpu_no + 1;
}
}
@@ -756,7 +756,7 @@ STATIC void GC_wait_for_gc_completion(GC_bool wait_for_all)
GC_ASSERT(I_HOLD_LOCK());
ASSERT_CANCEL_DISABLED();
if (GC_incremental && GC_collection_in_progress()) {
- int old_gc_no = GC_gc_no;
+ word old_gc_no = GC_gc_no;
/* Make sure that no part of our stack is still on the mark stack, */
/* since it's about to be unmapped. */
@@ -1704,7 +1704,7 @@ GC_INNER void GC_lock(void)
unsigned my_spin_max;
static unsigned last_spins = 0;
unsigned my_last_spins;
- int i;
+ unsigned i;
if (AO_test_and_set_acquire(&GC_allocate_lock) == AO_TS_CLEAR) {
return;