summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-12 15:10:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-12 15:10:04 +0000
commita176b065d2e19f64c7425c2928829f5280532cce (patch)
tree9f036cf815edd2df3cd27c4d04d3ad1e3c5d3bbd
parentcea3919ae61ae16e04a5ee5c5394970c3960a0af (diff)
* io.c (rb_io_ctl), parse.y (LVAR_USED): suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--io.c2
-rw-r--r--parse.y2
2 files changed, 2 insertions, 2 deletions
diff --git a/io.c b/io.c
index 21d6d12c9c..8838bba7e0 100644
--- a/io.c
+++ b/io.c
@@ -7456,7 +7456,7 @@ rb_io_ctl(VALUE io, VALUE req, VALUE arg, int io_p)
rb_str_resize(arg, len+1);
}
RSTRING_PTR(arg)[len] = 17; /* a little sanity check here */
- narg = (long)RSTRING_PTR(arg);
+ narg = (long)(SIGNED_VALUE)RSTRING_PTR(arg);
}
}
GetOpenFile(io, fptr);
diff --git a/parse.y b/parse.y
index 1cb37b41b8..71359a347b 100644
--- a/parse.y
+++ b/parse.y
@@ -8921,7 +8921,7 @@ new_args_gen(struct parser_params *parser, NODE *m, NODE *o, ID r, NODE *p, ID b
}
#endif /* !RIPPER */
-#define LVAR_USED (1UL << (sizeof(ID) * CHAR_BIT - 1))
+#define LVAR_USED ((ID)1 << (sizeof(ID) * CHAR_BIT - 1))
static void
warn_unused_var(struct parser_params *parser, struct local_vars *local)