From: nobu.nakada@... Date: 2002-12-28T20:15:55+09:00 Subject: [ruby-dev:19225] [PATCH] gcc-3 -O3 warning なかだです。 gcc 3.2.1で-O3をつけるといくつか警告が出ます。 nd_rvalをNODE*にするというのも考えたんですが、cbaseまで波及しそ うなので止めときました。 Index: dln.c =================================================================== RCS file: /cvs/ruby/src/ruby/dln.c,v retrieving revision 1.46 diff -u -2 -p -r1.46 dln.c --- dln.c 15 Dec 2002 03:18:04 -0000 1.46 +++ dln.c 28 Dec 2002 10:56:31 -0000 @@ -108,15 +108,16 @@ static int init_funcname_len(buf, file) char **buf; - char *file; + const char *file; { - char *p, *slash; + char *p; + const char *slash; int len; /* Load the file as an object one */ - for (p = file, slash = p-1; *p; p++) /* Find position of last '/' */ + for (slash = file-1; *file; file++) /* Find position of last '/' */ #ifdef __MACOS__ - if (*p == ':') slash = p; + if (*file == ':') slash = file; #else - if (*p == '/') slash = p; + if (*file == '/') slash = file; #endif Index: eval.c =================================================================== RCS file: /cvs/ruby/src/ruby/eval.c,v retrieving revision 1.368 diff -u -2 -p -r1.368 eval.c --- eval.c 24 Dec 2002 08:53:56 -0000 1.368 +++ eval.c 28 Dec 2002 10:43:02 -0000 @@ -1767,5 +1767,5 @@ static NODE* copy_node_scope(node, rval) NODE *node; - VALUE rval; + NODE *rval; { NODE *copy = rb_node_newnode(NODE_SCOPE,0,rval,node->nd_next); Index: hash.c =================================================================== RCS file: /cvs/ruby/src/ruby/hash.c,v retrieving revision 1.86 diff -u -2 -p -r1.86 hash.c --- hash.c 21 Dec 2002 18:02:00 -0000 1.86 +++ hash.c 28 Dec 2002 10:51:58 -0000 @@ -121,5 +121,5 @@ struct rb_hash_foreach_arg { VALUE hash; enum st_retval (*func)(); - char *arg; + VALUE arg; }; @@ -168,5 +168,5 @@ rb_hash_foreach(hash, func, farg) VALUE hash; enum st_retval (*func)(); - char *farg; + VALUE farg; { struct rb_hash_foreach_arg arg; @@ -463,5 +463,5 @@ rb_hash_shift(hash) } -static int +static enum st_retval delete_if_i(key, value) VALUE key, value; @@ -499,7 +499,7 @@ rb_hash_reject(hash) } -static int +static enum st_retval select_i(key, value, result) - VALUE key, value; + VALUE key, value, result; { VALUE assoc; @@ -612,5 +612,5 @@ rb_hash_empty_p(hash) } -static int +static enum st_retval each_value_i(key, value) VALUE key, value; @@ -629,5 +629,5 @@ rb_hash_each_value(hash) } -static int +static enum st_retval each_key_i(key, value) VALUE key, value; @@ -646,5 +646,5 @@ rb_hash_each_key(hash) } -static int +static enum st_retval each_pair_i(key, value) VALUE key, value; @@ -1077,5 +1077,5 @@ rb_env_path_tainted() static int envix(nam) -char *nam; +const char *nam; { register int i, len = strlen(nam); Index: range.c =================================================================== RCS file: /cvs/ruby/src/ruby/range.c,v retrieving revision 1.47 diff -u -2 -p -r1.47 range.c --- range.c 19 Dec 2002 09:20:20 -0000 1.47 +++ range.c 28 Dec 2002 10:55:14 -0000 @@ -209,5 +209,5 @@ static void range_each_func(range, func, v, e, arg) VALUE range; - void (*func) _((VALUE, void*)); + VALUE (*func) _((VALUE, void*)); VALUE v, e; void *arg; -- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦