Hi,
#2 of calming cure for -Wall compilation.
(Mostly unused variables.)
Please check.
Michal
diff -ur ruby/eval.c ruby-my/eval.c
--- ruby/eval.c Fri Apr 19 16:54:51 2002
+++ ruby-my/eval.c Fri Apr 19 14:16:04 2002
@@ -4932,7 +4929,7 @@
char *file;
int line;
{
- struct BLOCK *data;
+ struct BLOCK *data = NULL;
volatile VALUE result = Qnil;
struct SCOPE * volatile old_scope;
struct BLOCK * volatile old_block;
@@ -5475,7 +5472,6 @@
{
VALUE feature, tmp;
char *ext, *ftptr; /* OK */
- volatile VALUE load;
int state;
volatile int safe = ruby_safe_level;
diff -ur ruby/file.c ruby-my/file.c
--- ruby/file.c Fri Apr 19 15:29:48 2002
+++ ruby-my/file.c Fri Apr 19 12:24:49 2002
@@ -1587,7 +1587,7 @@
VALUE *argv;
{
VALUE fname, fext, basename;
- char *name, *p, *ext;
+ char *name, *p, *ext = NULL;
int f;
if (rb_scan_args(argc, argv, "11", &fname, &fext) == 2) {
@@ -1998,7 +1998,7 @@
rb_stat_clone(obj)
VALUE obj;
{
- struct stat st, *nst;
+ struct stat *nst;
VALUE clone;
@@ -2403,7 +2403,7 @@
VALUE *filep;
const char * const *ext;
{
- char *path, *e, *found;
+ char *path, *found;
char *f = RSTRING(*filep)->ptr;
VALUE fname;
int i, j;
@@ -2454,10 +2454,9 @@
rb_find_file(path)
VALUE path;
{
- VALUE tmp, fname;
+ VALUE tmp;
char *f = RSTRING(path)->ptr;
char *lpath;
- struct stat st;
if (f[0] == '~') {
path = rb_file_s_expand_path(1, &path);
Binary files ruby/file.o and ruby-my/file.o differ
diff -ur ruby/gc.c ruby-my/gc.c
--- ruby/gc.c Fri Apr 19 15:29:48 2002
+++ ruby-my/gc.c Fri Apr 19 00:56:00 2002
@@ -396,8 +396,6 @@
ruby_stack_length(p)
VALUE **p;
{
- int ret;
-
SET_STACK_END;
if (p) *p = STACK_END;
return STACK_LENGTH;
Binary files ruby/gc.o and ruby-my/gc.o differ
diff -ur ruby/io.c ruby-my/io.c
--- ruby/io.c Fri Apr 19 15:43:02 2002
+++ ruby-my/io.c Fri Apr 19 12:27:08 2002
@@ -613,8 +613,7 @@
{
struct stat st;
off_t siz = BUFSIZ;
- long bytes = 0;
- int n;
+ off_t pos;
if (feof(fptr->f)) return 0;
if (fstat(fileno(fptr->f), &st) == 0 && S_ISREG(st.st_mode)
@@ -623,8 +622,6 @@
#endif
)
{
- off_t pos;
-
pos = ftello(fptr->f);
if (st.st_size > pos && pos >= 0) {
siz = st.st_size - pos + 1;
@@ -1003,7 +1000,7 @@
VALUE io;
{
VALUE line, ary;
- VALUE rs, str;
+ VALUE rs;
OpenFile *fptr;
if (argc == 0) {
@@ -3554,8 +3551,6 @@
static VALUE
argf_eof()
{
- int first = first_p;
-
if (!next_argv()) return Qtrue;
if (next_p == 1) {
return Qtrue;
diff -ur ruby/parse.c ruby-my/parse.c
--- ruby/parse.c Fri Apr 19 16:52:18 2002
+++ ruby-my/parse.c Fri Apr 19 01:28:52 2002
@@ -3565,7 +3565,7 @@
case 26:
#line 474 "parse.y"
{
- NODE *tmp, *args = NEW_LIST(yyvsp[0].node);
+ NODE *args = NEW_LIST(yyvsp[0].node);
yyvsp[-3].node = list_append(yyvsp[-3].node, NEW_NIL());
list_concat(args, yyvsp[-3].node);
@@ -4055,7 +4055,7 @@
case 161:
#line 838 "parse.y"
{
- NODE *tmp, *args = NEW_LIST(yyvsp[0].node);
+ NODE *args = NEW_LIST(yyvsp[0].node);
yyvsp[-3].node = list_append(yyvsp[-3].node, NEW_NIL());
list_concat(args, yyvsp[-3].node);
diff -ur ruby/parse.y ruby-my/parse.y
--- ruby/parse.y Fri Apr 19 15:50:35 2002
+++ ruby-my/parse.y Fri Apr 19 01:28:49 2002
@@ -472,7 +472,7 @@
}
| primary_value '[' aref_args ']' tOP_ASGN command_call
{
- NODE *tmp, *args = NEW_LIST($6);
+ NODE *args = NEW_LIST($6);
$3 = list_append($3, NEW_NIL());
list_concat(args, $3);
@@ -836,7 +836,7 @@
}
| primary_value '[' aref_args ']' tOP_ASGN arg
{
- NODE *tmp, *args = NEW_LIST($6);
+ NODE *args = NEW_LIST($6);
$3 = list_append($3, NEW_NIL());
list_concat(args, $3);
diff -ur ruby/range.c ruby-my/range.c
--- ruby/range.c Fri Apr 19 15:29:48 2002
+++ ruby-my/range.c Fri Apr 19 01:06:43 2002
@@ -109,8 +109,6 @@
r_eq(a, b)
VALUE a, b;
{
- VALUE r;
-
if (a == b) return Qtrue;
if (rb_funcall(a, id_cmp, 1, b) == INT2FIX(0))
diff -ur ruby/re.c ruby-my/re.c
--- ruby/re.c Fri Apr 19 07:59:45 2002
+++ ruby-my/re.c Fri Apr 19 01:31:04 2002
@@ -90,8 +90,6 @@
char *p1, *p2;
long len;
{
- int tmp;
-
if (!ruby_ignorecase) {
return memcmp(p1, p2, len);
}
diff -ur ruby/string.c ruby-my/string.c
--- ruby/string.c Fri Apr 19 15:43:02 2002
+++ ruby-my/string.c Fri Apr 19 12:57:35 2002
@@ -293,7 +293,6 @@
int clone;
{
VALUE str2;
- VALUE klass;
int flags;
StringValue(str);
@@ -550,7 +549,7 @@
const char *ptr;
long len;
{
- long i, capa, total;
+ long capa, total;
if (FL_TEST(str, ELTS_SHARED)) {
rb_str_modify(str);
@@ -584,8 +583,6 @@
const char *ptr;
long len;
{
- long i, capa;
-
rb_str_modify(str);
if (len > 0) {
if (!FL_TEST(str, ELTS_SHARED) && !FL_TEST(str, STR_ASSOC)) {
@@ -617,7 +614,7 @@
rb_str_buf_append(str, str2)
VALUE str, str2;
{
- long i, capa, len;
+ long capa, len;
if (FL_TEST(str, ELTS_SHARED)) {
rb_str_modify(str);
@@ -643,7 +640,7 @@
rb_str_append(str, str2)
VALUE str, str2;
{
- long i, capa, len;
+ long len;
StringValue(str2);
rb_str_modify(str);
diff -ur ruby/variable.c ruby-my/variable.c
--- ruby/variable.c Fri Apr 19 15:29:49 2002
+++ ruby-my/variable.c Fri Apr 19 01:15:16 2002
@@ -69,8 +69,6 @@
VALUE value;
struct fc_result *res;
{
- VALUE path;
-
if (!rb_is_const_id(key)) return ST_CONTINUE;
if (value == res->klass) {
@@ -1150,8 +1148,7 @@
rb_id2name(id),
RSTRING(rb_class_path(klass))->ptr);
}
- else {
- global_uninitialized:
+ else { /* global_uninitialized */
rb_name_error(id, "uninitialized constant %s",rb_id2name(id));
}
return Qnil; /* not reached */
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Michal Rokos Czech Technical University, Prague
E-mail:m.rokos / sh.cvut.cz ICQ:36118339 Jabber:majkl / jabber.sh.cvut.cz
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-