From a4c0d9a8183e7101814db1f38c9864cdd00665bd Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 19 Aug 2016 01:43:25 +0300 Subject: [PATCH] Eliminate 'cast to void* from int' compiler warnings (Darwin/x64) (Cherry-pick commit f4d9e05 from 'release-7_6' branch.) * darwin_stop_world.c (GC_stack_range_for, GC_suspend_thread_list, GC_stop_world, GC_thread_resume, GC_start_world): Cast thread variable to pointer via word type. --- darwin_stop_world.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/darwin_stop_world.c b/darwin_stop_world.c index 14aa1d36..5887e7ba 100644 --- a/darwin_stop_world.c +++ b/darwin_stop_world.c @@ -259,7 +259,7 @@ STATIC ptr_t GC_stack_range_for(ptr_t *phi, thread_act_t thread, GC_thread p, # endif # ifdef DEBUG_THREADS GC_log_printf("Darwin: Stack for thread %p = [%p,%p)\n", - (void *)thread, lo, *phi); + (void *)(word)thread, lo, *phi); # endif return lo; } @@ -384,7 +384,8 @@ STATIC GC_bool GC_suspend_thread_list(thread_act_array_t act_list, int count, # endif # ifdef DEBUG_THREADS - GC_log_printf("Attempting to suspend thread %p\n", (void *)thread); + GC_log_printf("Attempting to suspend thread %p\n", + (void *)(word)thread); # endif /* find the current thread in the old list */ found = FALSE; @@ -428,7 +429,8 @@ STATIC GC_bool GC_suspend_thread_list(thread_act_array_t act_list, int count, continue; } # ifdef DEBUG_THREADS - GC_log_printf("Thread state for %p = %d\n", (void *)thread, info.run_state); + GC_log_printf("Thread state for %p = %d\n", (void *)(word)thread, + info.run_state); # endif if (info.suspend_count != 0) { /* thread is already suspended. */ @@ -438,7 +440,7 @@ STATIC GC_bool GC_suspend_thread_list(thread_act_array_t act_list, int count, } # ifdef DEBUG_THREADS - GC_log_printf("Suspending %p\n", (void *)thread); + GC_log_printf("Suspending %p\n", (void *)(word)thread); # endif kern_result = thread_suspend(thread); if (kern_result != KERN_SUCCESS) { @@ -465,7 +467,8 @@ GC_INNER void GC_stop_world(void) kern_return_t kern_result; # ifdef DEBUG_THREADS - GC_log_printf("Stopping the world from thread %p\n", (void *)my_thread); + GC_log_printf("Stopping the world from thread %p\n", + (void *)(word)my_thread); # endif # ifdef PARALLEL_MARK if (GC_parallel) { @@ -554,7 +557,7 @@ GC_INNER void GC_stop_world(void) # endif # ifdef DEBUG_THREADS - GC_log_printf("World stopped from %p\n", (void *)my_thread); + GC_log_printf("World stopped from %p\n", (void *)(word)my_thread); # endif mach_port_deallocate(my_task, my_thread); } @@ -571,7 +574,7 @@ GC_INLINE void GC_thread_resume(thread_act_t thread) ABORT("thread_info failed"); # endif # ifdef DEBUG_THREADS - GC_log_printf("Resuming thread %p with state %d\n", (void *)thread, + GC_log_printf("Resuming thread %p with state %d\n", (void *)(word)thread, info.run_state); # endif /* Resume the thread */ @@ -630,7 +633,7 @@ GC_INNER void GC_start_world(void) if (GC_mach_threads[j].already_suspended) { # ifdef DEBUG_THREADS GC_log_printf("Not resuming already suspended thread %p\n", - (void *)thread); + (void *)(word)thread); # endif } else { GC_thread_resume(thread); -- 2.40.0