ruby-changes:5014
From: ko1@a...
Date: Wed, 21 May 2008 23:30:11 +0900 (JST)
Subject: [ruby-changes:5014] nobu - Ruby:r16507 (ruby_1_8): * eval.c (search_method, remove_method, error_print, rb_alias)
nobu 2008-05-21 23:29:55 +0900 (Wed, 21 May 2008) New Revision: 16507 Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/eval.c branches/ruby_1_8/gc.c branches/ruby_1_8/io.c branches/ruby_1_8/parse.y branches/ruby_1_8/signal.c Log: * eval.c (search_method, remove_method, error_print, rb_alias) (rb_eval, rb_rescue2, search_required, Init_eval, rb_thread_create), gc.c (rb_source_filename, Init_stack), io.c (rb_io_getline), parse.y (rb_id2name, rb_parser_free): suppress warnings. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=16507&r2=16506&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/io.c?r1=16507&r2=16506&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/signal.c?r1=16507&r2=16506&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/parse.y?r1=16507&r2=16506&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/gc.c?r1=16507&r2=16506&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/eval.c?r1=16507&r2=16506&diff_format=u Index: ruby_1_8/parse.y =================================================================== --- ruby_1_8/parse.y (revision 16506) +++ ruby_1_8/parse.y (revision 16507) @@ -6197,6 +6197,7 @@ ID id; { char *name; + st_data_t data; if (id < tLAST_TOKEN) { int i; @@ -6207,8 +6208,8 @@ } } - if (st_lookup(sym_rev_tbl, id, (st_data_t *)&name)) - return name; + if (st_lookup(sym_rev_tbl, id, &data)) + return (char *)data; if (is_attrset_id(id)) { ID id2 = (id & ~ID_SCOPE_MASK) | ID_LOCAL; @@ -6421,7 +6422,7 @@ { NODE **prev = &parser_heap, *n; - while (n = *prev) { + while ((n = *prev) != 0) { if (n->u1.node == ptr) { *prev = n->u2.node; rb_gc_force_recycle((VALUE)n); Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 16506) +++ ruby_1_8/ChangeLog (revision 16507) @@ -1,3 +1,10 @@ +Wed May 21 23:29:52 2008 Nobuyoshi Nakada <nobu@r...> + + * eval.c (search_method, remove_method, error_print, rb_alias) + (rb_eval, rb_rescue2, search_required, Init_eval, rb_thread_create), + gc.c (rb_source_filename, Init_stack), io.c (rb_io_getline), + parse.y (rb_id2name, rb_parser_free): suppress warnings. + Wed May 21 12:34:51 2008 Nobuyoshi Nakada <nobu@r...> * hash.c (rb_hash_delete): rdoc fix based on a patch from Gaston Ramos Index: ruby_1_8/io.c =================================================================== --- ruby_1_8/io.c (revision 16506) +++ ruby_1_8/io.c (revision 16507) @@ -1723,7 +1723,7 @@ while ((c = appendline(fptr, newline, &str)) != EOF && (c != newline || RSTRING(str)->len < rslen || - (rspara || rscheck(rsptr,rslen,rs), 0) || + ((rspara || rscheck(rsptr,rslen,rs)) && 0) || memcmp(RSTRING(str)->ptr+RSTRING(str)->len-rslen,rsptr,rslen))); if (rspara) { Index: ruby_1_8/signal.c =================================================================== --- ruby_1_8/signal.c (revision 16506) +++ ruby_1_8/signal.c (revision 16507) @@ -271,9 +271,9 @@ static VALUE interrupt_init(argc, argv, self) - int argc; - VALUE *argv; - VALUE self; + int argc; + VALUE *argv; + VALUE self; { VALUE args[2]; @@ -572,17 +572,18 @@ #if defined(HAVE_NATIVETHREAD) && defined(HAVE_NATIVETHREAD_KILL) if (!is_ruby_native_thread() && !rb_trap_accept_nativethreads[sig]) { - sigsend_to_ruby_thread(sig); - return; + sigsend_to_ruby_thread(sig); + return; } #endif #if !defined(BSD_SIGNAL) && !defined(POSIX_SIGNAL) if (rb_trap_accept_nativethreads[sig]) { - ruby_nativethread_signal(sig, sighandler); - } else { - ruby_signal(sig, sighandler); + ruby_nativethread_signal(sig, sighandler); } + else { + ruby_signal(sig, sighandler); + } #endif if (trap_list[sig].cmd == 0 && ATOMIC_TEST(rb_trap_immediate)) { Index: ruby_1_8/eval.c =================================================================== --- ruby_1_8/eval.c (revision 16506) +++ ruby_1_8/eval.c (revision 16507) @@ -467,16 +467,16 @@ VALUE klass, *origin; ID id; { - NODE *body; + st_data_t body; if (!klass) return 0; - while (!st_lookup(RCLASS(klass)->m_tbl, id, (st_data_t *)&body)) { + while (!st_lookup(RCLASS(klass)->m_tbl, id, &body)) { klass = RCLASS(klass)->super; if (!klass) return 0; } if (origin) *origin = klass; - return body; + return (NODE *)body; } static NODE* @@ -555,7 +555,8 @@ VALUE klass; ID mid; { - NODE *body; + st_data_t data; + NODE *body = 0; if (klass == rb_cObject) { rb_secure(4); @@ -567,10 +568,11 @@ if (mid == __id__ || mid == __send__ || mid == init) { rb_warn("removing `%s' may cause serious problem", rb_id2name(mid)); } - if (st_lookup(RCLASS(klass)->m_tbl, mid, (st_data_t *)&body)) { + if (st_lookup(RCLASS(klass)->m_tbl, mid, &data)) { + body = (NODE *)data; if (!body || !body->nd_body) body = 0; else { - st_delete(RCLASS(klass)->m_tbl, &mid, (st_data_t *)&body); + st_delete(RCLASS(klass)->m_tbl, &mid, &data); } } if (!body) { @@ -1286,7 +1288,7 @@ long len = elen; if (RSTRING(epath)->ptr[0] == '#') epath = 0; - if (tail = memchr(einfo, '\n', elen)) { + if ((tail = memchr(einfo, '\n', elen)) != 0) { len = tail - einfo; tail++; /* skip newline */ } @@ -2162,6 +2164,7 @@ VALUE origin; NODE *orig, *body, *node; VALUE singleton = 0; + st_data_t data; rb_frozen_class_p(klass); if (name == def) return; @@ -2189,7 +2192,8 @@ } rb_clear_cache_by_id(name); - if (RTEST(ruby_verbose) && st_lookup(RCLASS(klass)->m_tbl, name, (st_data_t *)&node)) { + if (RTEST(ruby_verbose) && st_lookup(RCLASS(klass)->m_tbl, name, &data)) { + node = (NODE *)data; if (node->nd_cnt == 0 && node->nd_body) { rb_warning("discarding old %s", rb_id2name(name)); } @@ -2940,6 +2944,7 @@ NODE * volatile node = n; int state; volatile VALUE result = Qnil; + st_data_t data; #define RETURN(v) do { \ result = (v); \ @@ -3978,7 +3983,8 @@ if (OBJ_FROZEN(recv)) rb_error_frozen("object"); klass = rb_singleton_class(recv); - if (st_lookup(RCLASS(klass)->m_tbl, node->nd_mid, (st_data_t *)&body)) { + if (st_lookup(RCLASS(klass)->m_tbl, node->nd_mid, &data)) { + body = (NODE *)data; if (ruby_safe_level >= 4) { rb_raise(rb_eSecurityError, "redefining method prohibited"); } @@ -5457,7 +5463,7 @@ if (handle) break; handle = Qfalse; va_init_list(args, data2); - while (eclass = va_arg(args, VALUE)) { + while ((eclass = va_arg(args, VALUE)) != 0) { if (rb_obj_is_kind_of(ruby_errinfo, eclass)) { handle = Qtrue; break; @@ -7222,7 +7228,7 @@ #else rb_str_cat2(tmp, DLEXT); OBJ_FREEZE(tmp); - if (*path = rb_find_file(tmp)) { + if ((*path = rb_find_file(tmp)) != 0) { return 's'; } #endif @@ -8074,11 +8080,11 @@ __id__ = rb_intern("__id__"); __send__ = rb_intern("__send__"); - rb_global_variable((VALUE*)&top_scope); - rb_global_variable((VALUE*)&ruby_eval_tree_begin); + rb_global_variable((void *)&top_scope); + rb_global_variable((void *)&ruby_eval_tree_begin); - rb_global_variable((VALUE*)&ruby_eval_tree); - rb_global_variable((VALUE*)&ruby_dyna_vars); + rb_global_variable((void *)&ruby_eval_tree); + rb_global_variable((void *)&ruby_dyna_vars); rb_define_virtual_variable("$@", errat_getter, errat_setter); rb_define_hooked_variable("$!", &ruby_errinfo, 0, errinfo_setter); @@ -8091,7 +8097,7 @@ rb_define_method(rb_mKernel, "respond_to?", obj_respond_to, -1); respond_to = rb_intern("respond_to?"); - rb_global_variable((VALUE*)&basic_respond_to); + rb_global_variable((void *)&basic_respond_to); basic_respond_to = rb_method_node(rb_cObject, respond_to); rb_define_global_function("raise", rb_f_raise, -1); @@ -11981,7 +11987,7 @@ return th; } -static int thread_init = 0; +static int thread_init; #if defined(_THREAD_SAFE) static void @@ -12194,7 +12200,7 @@ VALUE (*fn)(); void *arg; { - Init_stack((VALUE*)&arg); + Init_stack((void *)&arg); return rb_thread_start_0(fn, arg, rb_thread_alloc(rb_cThread)); } Index: ruby_1_8/gc.c =================================================================== --- ruby_1_8/gc.c (revision 16506) +++ ruby_1_8/gc.c (revision 16507) @@ -565,17 +565,18 @@ rb_source_filename(f) const char *f; { - char *name; + st_data_t name; - if (!st_lookup(source_filenames, (st_data_t)f, (st_data_t *)&name)) { + if (!st_lookup(source_filenames, (st_data_t)f, &name)) { long len = strlen(f) + 1; - char *ptr = name = ALLOC_N(char, len + 1); + char *ptr = ALLOC_N(char, len + 1); + name = (st_data_t)ptr; *ptr++ = 0; MEMCPY(ptr, f, char, len); - st_add_direct(source_filenames, (st_data_t)ptr, (st_data_t)name); + st_add_direct(source_filenames, (st_data_t)ptr, name); return ptr; } - return name + 1; + return (char *)name + 1; } static void @@ -1295,7 +1296,7 @@ if (RANY(obj)->as.scope.local_vars && RANY(obj)->as.scope.flags != SCOPE_ALLOCA) { VALUE *vars = RANY(obj)->as.scope.local_vars-1; - if (!(RANY(obj)->as.scope.flags & SCOPE_CLONE) && vars[0] == 0) + if (!(RANY(obj)->as.scope.flags & SCOPE_CLONE) && vars[0] == 0) RUBY_CRITICAL(free(RANY(obj)->as.scope.local_tbl)); if (RANY(obj)->as.scope.flags & SCOPE_MALLOC) RUBY_CRITICAL(free(vars)); @@ -1527,7 +1528,7 @@ rb_gc_stack_start = STACK_END_ADDRESS; } #else - if (!addr) addr = (VALUE *)&addr; + if (!addr) addr = (void *)&addr; STACK_UPPER(&addr, addr, ++addr); if (rb_gc_stack_start) { if (STACK_UPPER(&addr, @@ -1650,7 +1651,7 @@ p = heaps[i].slot; pend = p + heaps[i].limit; for (;p < pend; p++) { if (p->as.basic.flags) { - switch (TYPE(p)) { + switch (BUILTIN_TYPE(p)) { case T_NONE: case T_ICLASS: case T_VARMAP: -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/