ruby-changes:9151
From: yugui <ko1@a...>
Date: Sat, 13 Dec 2008 10:02:39 +0900 (JST)
Subject: [ruby-changes:9151] Ruby:r20687 (ruby_1_9_1): merges r20593 from trunk into ruby_1_9_1.
yugui 2008-12-13 10:01:02 +0900 (Sat, 13 Dec 2008) New Revision: 20687 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20687 Log: merges r20593 from trunk into ruby_1_9_1. * compile.c (iseq_compile_each), gc.c (assign_heap_slot), (gc_mark_children), parse.y (vtable_alloc, vtable_free, vtable_add), proc.c (proc_to_s), thread.c (terminate_i, rb_thread_terminate_all), (thread_start_func_2, blocking_region_begin, blocking_region_end), (rb_thread_kill), thread_pthread.c (native_thread_create), (ubf_pthread_cond_signal), vm.c (check_env, thread_free), vm_dump.c (vm_env_dump_raw, vm_stack_dump_each, vm_thread_dump_state), (vm_call0): use void pointer for %p. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/compile.c branches/ruby_1_9_1/gc.c branches/ruby_1_9_1/parse.y branches/ruby_1_9_1/proc.c branches/ruby_1_9_1/thread.c branches/ruby_1_9_1/thread_pthread.c branches/ruby_1_9_1/vm.c branches/ruby_1_9_1/vm_dump.c branches/ruby_1_9_1/vm_eval.c Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 20686) +++ ruby_1_9_1/ChangeLog (revision 20687) @@ -1,5 +1,14 @@ -Tue Dec 9 13:25:51 2008 Nobuyoshi Nakada <nobu@r...> +Tue Dec 9 13:33:53 2008 Nobuyoshi Nakada <nobu@r...> + * compile.c (iseq_compile_each), gc.c (assign_heap_slot), + (gc_mark_children), parse.y (vtable_alloc, vtable_free, vtable_add), + proc.c (proc_to_s), thread.c (terminate_i, rb_thread_terminate_all), + (thread_start_func_2, blocking_region_begin, blocking_region_end), + (rb_thread_kill), thread_pthread.c (native_thread_create), + (ubf_pthread_cond_signal), vm.c (check_env, thread_free), vm_dump.c + (vm_env_dump_raw, vm_stack_dump_each, vm_thread_dump_state), + (vm_call0): use void pointer for %p. + * cont.c (fiber_status), template/insns.inc.tmpl (ruby_vminsn_type), vm_insnhelper.h (BOP): ISO C forbids comma at end of enumerator list. Index: ruby_1_9_1/thread_pthread.c =================================================================== --- ruby_1_9_1/thread_pthread.c (revision 20686) +++ ruby_1_9_1/thread_pthread.c (revision 20687) @@ -461,7 +461,7 @@ int err = 0; if (use_cached_thread(th)) { - thread_debug("create (use cached thread): %p\n", th); + thread_debug("create (use cached thread): %p\n", (void *)th); } else { pthread_attr_t attr; @@ -494,7 +494,7 @@ CHECK_ERR(pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED)); err = pthread_create(&th->thread_id, &attr, thread_start_func_1, th); - thread_debug("create: %p (%d)", th, err); + thread_debug("create: %p (%d)", (void *)th, err); CHECK_ERR(pthread_attr_destroy(&attr)); if (!err) { @@ -553,7 +553,7 @@ ubf_pthread_cond_signal(void *ptr) { rb_thread_t *th = (rb_thread_t *)ptr; - thread_debug("ubf_pthread_cond_signal (%p)\n", th); + thread_debug("ubf_pthread_cond_signal (%p)\n", (void *)th); pthread_cond_signal(&th->native_thread_data.sleep_cond); } Index: ruby_1_9_1/compile.c =================================================================== --- ruby_1_9_1/compile.c (revision 20686) +++ ruby_1_9_1/compile.c (revision 20687) @@ -4629,7 +4629,7 @@ LABEL *lfin = NEW_LABEL(nd_line(node)); LABEL *ltrue = NEW_LABEL(nd_line(node)); VALUE key = rb_sprintf("flipflag/%s-%p-%d", - RSTRING_PTR(iseq->name), iseq, + RSTRING_PTR(iseq->name), (void *)iseq, iseq->compile_data->flip_cnt++); iseq_add_mark_object_compile_time(iseq, key); Index: ruby_1_9_1/vm_eval.c =================================================================== --- ruby_1_9_1/vm_eval.c (revision 20686) +++ ruby_1_9_1/vm_eval.c (revision 20687) @@ -29,7 +29,7 @@ if (0) printf("id: %s, nd: %s, argc: %d, passed: %p\n", rb_id2name(id), ruby_node_name(nd_type(body)), - argc, th->passed_block); + argc, (void *)th->passed_block); if (th->passed_block) { blockptr = th->passed_block; Index: ruby_1_9_1/proc.c =================================================================== --- ruby_1_9_1/proc.c (revision 20686) +++ ruby_1_9_1/proc.c (revision 20687) @@ -733,7 +733,7 @@ line_no, is_lambda); } else { - str = rb_sprintf("#<%s:%p%s>", cname, proc->block.iseq, + str = rb_sprintf("#<%s:%p%s>", cname, (void *)proc->block.iseq, is_lambda); } Index: ruby_1_9_1/thread.c =================================================================== --- ruby_1_9_1/thread.c (revision 20686) +++ ruby_1_9_1/thread.c (revision 20687) @@ -270,13 +270,13 @@ GetThreadPtr(thval, th); if (th != main_thread) { - thread_debug("terminate_i: %p\n", th); + thread_debug("terminate_i: %p\n", (void *)th); rb_thread_interrupt(th); th->thrown_errinfo = eTerminateSignal; th->status = THREAD_TO_KILL; } else { - thread_debug("terminate_i: main thread (%p)\n", th); + thread_debug("terminate_i: main thread (%p)\n", (void *)th); } return ST_CONTINUE; } @@ -298,7 +298,8 @@ rb_thread_t *th = GET_THREAD(); /* main thread */ rb_vm_t *vm = th->vm; if (vm->main_thread != th) { - rb_bug("rb_thread_terminate_all: called by child thread (%p, %p)", vm->main_thread, th); + rb_bug("rb_thread_terminate_all: called by child thread (%p, %p)", + (void *)vm->main_thread, (void *)th); } /* unlock all locking mutexes */ @@ -306,7 +307,7 @@ rb_mutex_unlock_all(th->keeping_mutexes); } - thread_debug("rb_thread_terminate_all (main thread: %p)\n", th); + thread_debug("rb_thread_terminate_all (main thread: %p)\n", (void *)th); st_foreach(vm->living_threads, terminate_i, (st_data_t)th); while (!rb_thread_alone()) { @@ -365,11 +366,11 @@ #ifdef __ia64 th->machine_register_stack_start = register_stack_start; #endif - thread_debug("thread start: %p\n", th); + thread_debug("thread start: %p\n", (void *)th); native_mutex_lock(&th->vm->global_vm_lock); { - thread_debug("thread start (get lock): %p\n", th); + thread_debug("thread start (get lock): %p\n", (void *)th); rb_thread_set_current(th); TH_PUSH_TAG(th); @@ -413,7 +414,7 @@ } th->status = THREAD_KILLED; - thread_debug("thread end: %p\n", th); + thread_debug("thread end: %p\n", (void *)th); main_th = th->vm->main_thread; if (th != main_th) { @@ -427,7 +428,7 @@ /* locking_mutex must be Qfalse */ if (th->locking_mutex != Qfalse) { rb_bug("thread_start_func_2: locking_mutex must not be set (%p:%"PRIxVALUE")", - th, th->locking_mutex); + (void *)th, th->locking_mutex); } /* unlock all locking mutexes */ @@ -949,7 +950,7 @@ region->prev_status = th->status; set_unblock_function(th, func, arg, ®ion->oldubf); th->status = THREAD_STOPPED; - thread_debug("enter blocking region (%p)\n", th); + thread_debug("enter blocking region (%p)\n", (void *)th); rb_gc_save_machine_context(th); native_mutex_unlock(&th->vm->global_vm_lock); } @@ -959,7 +960,7 @@ { native_mutex_lock(&th->vm->global_vm_lock); rb_thread_set_current(th); - thread_debug("leave blocking region (%p)\n", th); + thread_debug("leave blocking region (%p)\n", (void *)th); remove_signal_thread_list(th); reset_unblock_function(th, ®ion->oldubf); if (th->status == THREAD_STOPPED) { @@ -1276,7 +1277,7 @@ rb_exit(EXIT_SUCCESS); } - thread_debug("rb_thread_kill: %p (%p)\n", th, (void *)th->thread_id); + thread_debug("rb_thread_kill: %p (%p)\n", (void *)th, (void *)th->thread_id); rb_thread_interrupt(th); th->thrown_errinfo = eKillSignal; Index: ruby_1_9_1/gc.c =================================================================== --- ruby_1_9_1/gc.c (revision 20686) +++ ruby_1_9_1/gc.c (revision 20687) @@ -819,7 +819,7 @@ hi = mid; } else { - rb_bug("same heap slot is allocated: %p at %"PRIuVALUE, membase, (VALUE)mid); + rb_bug("same heap slot is allocated: %p at %"PRIuVALUE, (void *)membase, (VALUE)mid); } } if (hi < heaps_used) { @@ -1563,7 +1563,7 @@ default: rb_bug("rb_gc_mark(): unknown data type 0x%lx(%p) %s", - BUILTIN_TYPE(obj), obj, + BUILTIN_TYPE(obj), (void *)obj, is_pointer_to_heap(objspace, obj) ? "corrupted object" : "non object"); } } Index: ruby_1_9_1/parse.y =================================================================== --- ruby_1_9_1/parse.y (revision 20686) +++ ruby_1_9_1/parse.y (revision 20687) @@ -129,14 +129,14 @@ tbl->capa = 8; tbl->tbl = ALLOC_N(ID, tbl->capa); tbl->prev = prev; - if (VTBL_DEBUG) printf("vtable_alloc: %p\n", tbl); + if (VTBL_DEBUG) printf("vtable_alloc: %p\n", (void *)tbl); return tbl; } static void vtable_free(struct vtable *tbl) { - if (VTBL_DEBUG)printf("vtable_free: %p\n", tbl); + if (VTBL_DEBUG)printf("vtable_free: %p\n", (void *)tbl); if (POINTER_P(tbl)) { if (tbl->tbl) { xfree(tbl->tbl); @@ -149,9 +149,9 @@ vtable_add(struct vtable *tbl, ID id) { if (!POINTER_P(tbl)) { - rb_bug("vtable_add: vtable is not allocated (%p)", tbl); + rb_bug("vtable_add: vtable is not allocated (%p)", (void *)tbl); } - if (VTBL_DEBUG) printf("vtable_add: %p, %s\n", tbl, rb_id2name(id)); + if (VTBL_DEBUG) printf("vtable_add: %p, %s\n", (void *)tbl, rb_id2name(id)); if (tbl->pos == tbl->capa) { tbl->capa = tbl->capa * 2; Index: ruby_1_9_1/vm.c =================================================================== --- ruby_1_9_1/vm.c (revision 20686) +++ ruby_1_9_1/vm.c (revision 20687) @@ -205,15 +205,15 @@ check_env(rb_env_t * const env) { printf("---\n"); - printf("envptr: %p\n", &env->block.dfp[0]); + printf("envptr: %p\n", (void *)&env->block.dfp[0]); printf("orphan: %p\n", (void *)env->block.dfp[1]); printf("inheap: %p\n", (void *)env->block.dfp[2]); printf("envval: %10p ", (void *)env->block.dfp[3]); dp(env->block.dfp[3]); printf("penvv : %10p ", (void *)env->block.dfp[4]); dp(env->block.dfp[4]); - printf("lfp: %10p\n", env->block.lfp); - printf("dfp: %10p\n", env->block.dfp); + printf("lfp: %10p\n", (void *)env->block.lfp); + printf("dfp: %10p\n", (void *)env->block.dfp); if (env->block.dfp[4]) { printf(">>\n"); check_env_value(env->block.dfp[4]); @@ -1464,10 +1464,10 @@ } if (th->locking_mutex != Qfalse) { - rb_bug("thread_free: locking_mutex must be NULL (%p:%ld)", th, th->locking_mutex); + rb_bug("thread_free: locking_mutex must be NULL (%p:%ld)", (void *)th, th->locking_mutex); } if (th->keeping_mutexes != NULL) { - rb_bug("thread_free: keeping_mutexes must be NULL (%p:%ld)", th, th->locking_mutex); + rb_bug("thread_free: keeping_mutexes must be NULL (%p:%ld)", (void *)th, th->locking_mutex); } if (th->local_storage) { Index: ruby_1_9_1/vm_dump.c =================================================================== --- ruby_1_9_1/vm_dump.c (revision 20686) +++ ruby_1_9_1/vm_dump.c (revision 20687) @@ -196,7 +196,7 @@ fprintf(stderr, "--\n"); for (i = 0; i < env->env_size; i++) { fprintf(stderr, "%04d: %08lx (%p)", -env->local_size + i, env->env[i], - &env->env[i]); + (void *)&env->env[i]); if (&env->env[i] == lfp) fprintf(stderr, " <- lfp"); if (&env->env[i] == dfp) @@ -295,12 +295,12 @@ for (i = 0; i < argc; i++) { rstr = rb_inspect(*ptr); fprintf(stderr, " arg %2d: %8s (%p)\n", i, StringValueCStr(rstr), - ptr++); + (void *)ptr++); } for (; i < local_size - 1; i++) { rstr = rb_inspect(*ptr); fprintf(stderr, " local %2d: %8s (%p)\n", i, StringValueCStr(rstr), - ptr++); + (void *)ptr++); } ptr = cfp->bp; @@ -562,8 +562,8 @@ cfp = th->cfp; fprintf(stderr, "Thread state dump:\n"); - fprintf(stderr, "pc : %p, sp : %p\n", cfp->pc, cfp->sp); - fprintf(stderr, "cfp: %p, lfp: %p, dfp: %p\n", cfp, cfp->lfp, cfp->dfp); + fprintf(stderr, "pc : %p, sp : %p\n", (void *)cfp->pc, (void *)cfp->sp); + fprintf(stderr, "cfp: %p, lfp: %p, dfp: %p\n", (void *)cfp, (void *)cfp->lfp, (void *)cfp->dfp); return Qnil; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/