1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* gcc -Wall clean-up.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-07-24 18:33:50 +00:00
parent c9aad4c098
commit 5dd2b7102c
17 changed files with 15 additions and 59 deletions

View file

@ -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);

View file

@ -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;

2
dln.c
View file

@ -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

10
eval.c
View file

@ -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
@ -7375,13 +7375,6 @@ method_unbind(obj)
return method;
}
static VALUE
umethod_unbind(obj)
VALUE obj;
{
return obj;
}
static VALUE
rb_obj_method(obj, vid)
VALUE obj;
@ -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;

View file

@ -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
}

View file

@ -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);

2
file.c
View file

@ -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;

9
gc.c
View file

@ -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()
{

3
hash.c
View file

@ -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);

1
io.c
View file

@ -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;

View file

@ -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

View file

@ -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);

View file

@ -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");

23
range.c
View file

@ -108,17 +108,6 @@ range_eq(range, obj)
return Qtrue;
}
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;

View file

@ -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

1
time.c
View file

@ -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) {

View file

@ -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)) {