summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-29 15:45:25 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-29 15:45:25 +0000
commit6c42f57177e7cb6c8025e3c482df5ba7359c4f4e (patch)
tree94c0f01cbea4849ba0f29db9c4153e0b91877a10
parentce0c2b2170f4fd562b1019e325638649def9d924 (diff)
* vm_trace.c, vm.c, thread.c: get rid of (maybe false positive) warnings about
using uninitialized var with VC++. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--thread.c12
-rw-r--r--vm.c2
-rw-r--r--vm_trace.c2
3 files changed, 8 insertions, 8 deletions
diff --git a/thread.c b/thread.c
index 0454bd7bf4..e4166b5b95 100644
--- a/thread.c
+++ b/thread.c
@@ -371,7 +371,7 @@ rb_threadptr_trap_interrupt(rb_thread_t *th)
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
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)
{
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)
{
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
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
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)");
diff --git a/vm.c b/vm.c
index f66122b0a8..ae0148e852 100644
--- a/vm.c
+++ b/vm.c
@@ -1696,7 +1696,7 @@ rb_vm_mark(void *ptr)
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);
diff --git a/vm_trace.c b/vm_trace.c
index 678b819068..a56261974e 100644
--- a/vm_trace.c
+++ b/vm_trace.c
@@ -216,7 +216,7 @@ void
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);