diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-24 18:33:50 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-24 18:33:50 +0000 |
commit | 5dd2b7102c42cd31a0fec424addbdeaeefb235ac (patch) | |
tree | c04ed9798be30923eec668e9deed5f377e67b02d | |
parent | c9aad4c098193cad0440228595c85aadc44bebe5 (diff) |
* gcc -Wall clean-up.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | array.c | 2 | ||||
-rw-r--r-- | bignum.c | 3 | ||||
-rw-r--r-- | dln.c | 2 | ||||
-rw-r--r-- | eval.c | 10 | ||||
-rw-r--r-- | ext/etc/etc.c | 4 | ||||
-rw-r--r-- | ext/tcltklib/tcltklib.c | 2 | ||||
-rw-r--r-- | file.c | 2 | ||||
-rw-r--r-- | gc.c | 9 | ||||
-rw-r--r-- | hash.c | 3 | ||||
-rw-r--r-- | io.c | 1 | ||||
-rw-r--r-- | lib/debug.rb | 2 | ||||
-rw-r--r-- | object.c | 1 | ||||
-rw-r--r-- | process.c | 4 | ||||
-rw-r--r-- | range.c | 23 | ||||
-rw-r--r-- | regex.c | 1 | ||||
-rw-r--r-- | time.c | 1 | ||||
-rw-r--r-- | variable.c | 4 |
17 files changed, 15 insertions, 59 deletions
@@ -1458,7 +1458,7 @@ rb_ary_transpose(ary) VALUE ary; { long elen = -1, alen, i, j; - VALUE tmp, result; + VALUE tmp, result = 0; alen = RARRAY(ary)->len; if (alen == 0) return rb_ary_dup(ary); @@ -314,7 +314,8 @@ rb_cstr_to_inum(str, base, badcheck) { const char *s = str; char *end; - char sign = 1, c, nondigit = 0; + char sign = 1, nondigit = 0; + int c; BDIGIT_DBL num; long len, blen = 1; long i; @@ -31,7 +31,7 @@ char *dln_argv0; #pragma alloca #endif -#if defined(HAVE_ALLOCA_H) && !defined(__GNUC__) +#if defined(HAVE_ALLOCA_H) #include <alloca.h> #endif @@ -4538,7 +4538,7 @@ rb_rescue(b_proc, data1, r_proc, data2) VALUE (*b_proc)(), (*r_proc)(); VALUE data1, data2; { - return rb_rescue2(b_proc, data1, r_proc, data2, rb_eStandardError, 0); + return rb_rescue2(b_proc, data1, r_proc, data2, rb_eStandardError, (VALUE)0); } VALUE @@ -7376,13 +7376,6 @@ method_unbind(obj) } static VALUE -umethod_unbind(obj) - VALUE obj; -{ - return obj; -} - -static VALUE rb_obj_method(obj, vid) VALUE obj; VALUE vid; @@ -9937,7 +9930,6 @@ thgroup_enclose(group) VALUE group; { struct thgroup *data; - rb_thread_t th; Data_Get_Struct(group, struct thgroup, data); data->enclosed = 1; diff --git a/ext/etc/etc.c b/ext/etc/etc.c index ea8cb61802..3636b5480d 100644 --- a/ext/etc/etc.c +++ b/ext/etc/etc.c @@ -316,11 +316,11 @@ Init_etc() #ifdef HAVE_ST_PW_EXPIRE "expire", #endif - 0); + NULL); rb_global_variable(&sPasswd); #ifdef HAVE_GETGRENT - sGroup = rb_struct_define("Group", "name", "passwd", "gid", "mem", 0); + sGroup = rb_struct_define("Group", "name", "passwd", "gid", "mem", NULL); rb_global_variable(&sGroup); #endif } diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c index 8393bf0746..5331e1fd03 100644 --- a/ext/tcltklib/tcltklib.c +++ b/ext/tcltklib/tcltklib.c @@ -532,7 +532,7 @@ ip_ruby(clientData, interp, argc, argv) rb_trap_immediate = 0; res = rb_rescue2(rb_eval_string, (VALUE)arg, ip_eval_rescue, (VALUE)&failed, - rb_eStandardError, rb_eScriptError, 0); + rb_eStandardError, rb_eScriptError, (VALUE)0); rb_trap_immediate = old_trapflg; Tcl_ResetResult(interp); @@ -1234,7 +1234,7 @@ rb_file_s_utime(argc, argv) #endif -NORETURN(static void syserr2 _((VALUE,VALUE))); +NORETURN(static void sys_fail2 _((VALUE,VALUE))); static void sys_fail2(s1, s2) VALUE s1, s2; @@ -899,15 +899,6 @@ rb_gc_mark_children(ptr) static void obj_free _((VALUE)); -static unsigned long -size_of_table(tbl) - struct st_table *tbl; -{ - if (!tbl) return 0; - return tbl->num_bins * sizeof(struct st_table_entry *) + - tbl->num_entries * 4 * sizeof(VALUE); -} - static void gc_sweep() { @@ -528,7 +528,6 @@ rb_hash_select(argc, argv, hash) VALUE hash; { VALUE result; - long i; if (!rb_block_given_p()) { #if RUBY_VERSION_CODE < 181 @@ -1424,7 +1423,6 @@ env_select(argc, argv) VALUE *argv; { VALUE result; - long i; char **env; if (!rb_block_given_p()) { @@ -1853,6 +1851,7 @@ Init_Hash() rb_define_singleton_method(envtbl,"inspect", env_inspect, 0); rb_define_singleton_method(envtbl,"rehash", env_none, 0); rb_define_singleton_method(envtbl,"to_a", env_to_a, 0); + rb_define_singleton_method(envtbl,"to_s", env_to_s, 0); rb_define_singleton_method(envtbl,"index", env_index, 1); rb_define_singleton_method(envtbl,"indexes", env_indexes, -1); rb_define_singleton_method(envtbl,"indices", env_indexes, -1); @@ -96,7 +96,6 @@ VALUE rb_eIOError; VALUE rb_stdin, rb_stdout, rb_stderr, rb_defout, rb_deferr; static VALUE orig_stdin, orig_stdout, orig_stderr; -static int saved_fd[3] = {0, 1, 2}; VALUE rb_output_fs; VALUE rb_rs; diff --git a/lib/debug.rb b/lib/debug.rb index 17879e5145..74026233c7 100644 --- a/lib/debug.rb +++ b/lib/debug.rb @@ -703,7 +703,7 @@ EOHELP frame_set_pos(file, line) if !@no_step or @frames.size == @no_step @stop_next -= 1 - @stop_next = 0 if @stop_next < 0 + @stop_next = -1 if @stop_next < 0 elsif @frames.size < @no_step @stop_next = 0 # break here before leaving... else @@ -656,7 +656,6 @@ static VALUE rb_mod_cmp(mod, arg) VALUE mod, arg; { - VALUE start = mod; VALUE cmp; if (mod == arg) return INT2FIX(0); @@ -2227,7 +2227,7 @@ Init_process() rb_define_module_function(rb_mProcess, "times", rb_proc_times, 0); #if defined(HAVE_TIMES) || defined(_WIN32) - S_Tms = rb_struct_define("Tms", "utime", "stime", "cutime", "cstime", 0); + S_Tms = rb_struct_define("Tms", "utime", "stime", "cutime", "cstime", NULL); #endif SAVED_USER_ID = geteuid(); @@ -2261,7 +2261,7 @@ Init_process() rb_define_module_function(rb_mProcGID, "sid_available?", p_gid_have_saved_id, 0); rb_define_module_function(rb_mProcUID, "switch", p_uid_switch, 0); - rb_define_module_function(rb_mProcGID, "switch", p_uid_switch, 0); + rb_define_module_function(rb_mProcGID, "switch", p_gid_switch, 0); rb_mProcID_Syscall = rb_define_module_under(rb_mProcess, "Sys"); @@ -109,17 +109,6 @@ range_eq(range, obj) } static int -r_eq(a, b) - VALUE a, b; -{ - if (a == b) return Qtrue; - - if (rb_funcall(a, id_cmp, 1, b) == INT2FIX(0)) - return Qtrue; - return Qfalse; -} - -static int r_lt(a, b) VALUE a, b; { @@ -142,17 +131,6 @@ r_le(a, b) } -static int -r_gt(a,b) - VALUE a, b; -{ - VALUE r = rb_funcall(a, id_cmp, 1, b); - - if (NIL_P(r)) return Qfalse; - if (rb_cmpint(r, a, b) > 0) return Qtrue; - return Qfalse; -} - static VALUE range_eql(range, obj) VALUE range, obj; @@ -383,7 +361,6 @@ rb_range_beg_len(range, begp, lenp, len, err) len = end - beg; if (len < 0) goto out_of_range; - length_set: *begp = beg; *lenp = len; return Qtrue; @@ -185,6 +185,7 @@ static int current_mbctype = MBCTYPE_ASCII; #ifdef RUBY #include "util.h" +void rb_warn _((char*)); # define re_warning(x) rb_warn(x) #endif @@ -702,7 +702,6 @@ time_cmp(time1, time2) VALUE time1, time2; { struct time_object *tobj1, *tobj2; - long i; GetTimeval(time1, tobj1); if (TYPE(time2) == T_DATA && RDATA(time2)->dfree == time_free) { diff --git a/variable.c b/variable.c index 76c0939c46..63a1461b62 100644 --- a/variable.c +++ b/variable.c @@ -1136,8 +1136,6 @@ static struct st_table * check_autoload_table(av) VALUE av; { - struct st_table *tbl; - Check_Type(av, T_DATA); if (RDATA(av)->dmark != (RUBY_DATA_FUNC)rb_mark_tbl || RDATA(av)->dfree != (RUBY_DATA_FUNC)st_free_table) { @@ -1210,7 +1208,7 @@ rb_autoload_load(klass, id) VALUE klass; ID id; { - VALUE file, value; + VALUE file; file = autoload_delete(klass, id); if (NIL_P(file)) { |