ruby-changes:34156
From: usa <ko1@a...>
Date: Fri, 30 May 2014 00:45:30 +0900 (JST)
Subject: [ruby-changes:34156] usa:r46237 (trunk): * vm_trace.c, vm.c, thread.c: get rid of (maybe false positive) warnings about
usa 2014-05-30 00:45:25 +0900 (Fri, 30 May 2014) New Revision: 46237 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?revision=46237&view=revision Log: * vm_trace.c, vm.c, thread.c: get rid of (maybe false positive) warnings about using uninitialized var with VC++. Modified files: trunk/thread.c trunk/vm.c trunk/vm_trace.c Index: thread.c =================================================================== --- thread.c (revision 46236) +++ thread.c (revision 46237) @@ -371,7 +371,7 @@ rb_threadptr_trap_interrupt(rb_thread_t https://github.com/ruby/ruby/blob/trunk/thread.c#L371 static void terminate_all(rb_vm_t *vm, const rb_thread_t *main_thread) { - rb_thread_t *th; + rb_thread_t *th = 0; list_for_each(&vm->living_threads, th, vmlt_node) { if (th != main_thread) { @@ -2070,7 +2070,7 @@ void https://github.com/ruby/ruby/blob/trunk/thread.c#L2070 rb_thread_fd_close(int fd) { rb_vm_t *vm = GET_THREAD()->vm; - rb_thread_t *th; + rb_thread_t *th = 0; list_for_each(&vm->living_threads, th, vmlt_node) { if (th->waiting_fd == fd) { @@ -2324,7 +2324,7 @@ rb_thread_list(void) https://github.com/ruby/ruby/blob/trunk/thread.c#L2324 { VALUE ary = rb_ary_new(); rb_vm_t *vm = GET_THREAD()->vm; - rb_thread_t *th; + rb_thread_t *th = 0; list_for_each(&vm->living_threads, th, vmlt_node) { switch (th->status) { @@ -3882,7 +3882,7 @@ thgroup_list(VALUE group) https://github.com/ruby/ruby/blob/trunk/thread.c#L3882 { VALUE ary = rb_ary_new(); rb_vm_t *vm = GET_THREAD()->vm; - rb_thread_t *th; + rb_thread_t *th = 0; list_for_each(&vm->living_threads, th, vmlt_node) { if (th->thgroup == group) { @@ -5030,7 +5030,7 @@ static void https://github.com/ruby/ruby/blob/trunk/thread.c#L5030 debug_deadlock_check(rb_vm_t *vm) { #ifdef DEBUG_DEADLOCK_CHECK - rb_thread_t *th; + rb_thread_t *th = 0; printf("%d %d %p %p\n", vm_living_thread_num(vm), vm->sleeper, GET_THREAD(), vm->main_thread); list_for_each(&vm->living_threads, th, vmlt_node) { @@ -5053,7 +5053,7 @@ static void https://github.com/ruby/ruby/blob/trunk/thread.c#L5053 rb_check_deadlock(rb_vm_t *vm) { int found = 0; - rb_thread_t *th; + rb_thread_t *th = 0; if (vm_living_thread_num(vm) > vm->sleeper) return; if (vm_living_thread_num(vm) < vm->sleeper) rb_bug("sleeper must not be more than vm_living_thread_num(vm)"); Index: vm_trace.c =================================================================== --- vm_trace.c (revision 46236) +++ vm_trace.c (revision 46237) @@ -216,7 +216,7 @@ void https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L216 rb_clear_trace_func(void) { rb_vm_t *vm = GET_VM(); - rb_thread_t *th; + rb_thread_t *th = 0; list_for_each(&vm->living_threads, th, vmlt_node) { rb_threadptr_remove_event_hook(th, 0, Qundef); Index: vm.c =================================================================== --- vm.c (revision 46236) +++ vm.c (revision 46237) @@ -1696,7 +1696,7 @@ rb_vm_mark(void *ptr) https://github.com/ruby/ruby/blob/trunk/vm.c#L1696 RUBY_GC_INFO("-------------------------------------------------\n"); if (ptr) { rb_vm_t *vm = ptr; - rb_thread_t *th; + rb_thread_t *th = 0; list_for_each(&vm->living_threads, th, vmlt_node) { rb_gc_mark(th->self); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/