eliminate plain int except for a few cases like arena_index

This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-04-25 04:01:57 +09:00
parent 8a04dd8493
commit 83c1399af0
9 changed files with 54 additions and 71 deletions
+5 -13
View File
@@ -1351,8 +1351,7 @@ static mrb_value
mrb_str_index_m(mrb_state *mrb, mrb_value str)
{
mrb_value *argv;
int argc;
mrb_int argc;
mrb_value sub;
mrb_int pos;
@@ -1695,7 +1694,7 @@ static mrb_value
mrb_str_rindex_m(mrb_state *mrb, mrb_value str)
{
mrb_value *argv;
int argc;
mrb_int argc;
mrb_value sub;
mrb_value vpos;
mrb_int pos, len = RSTRING_LEN(str);
@@ -2104,7 +2103,7 @@ mrb_string_value_cstr(mrb_state *mrb, mrb_value *ptr)
}
mrb_value
mrb_str_to_inum(mrb_state *mrb, mrb_value str, int base, mrb_bool badcheck)
mrb_str_to_inum(mrb_state *mrb, mrb_value str, mrb_int base, mrb_bool badcheck)
{
char *s;
mrb_int len;
@@ -2150,16 +2149,9 @@ mrb_str_to_inum(mrb_state *mrb, mrb_value str, int base, mrb_bool badcheck)
static mrb_value
mrb_str_to_i(mrb_state *mrb, mrb_value self)
{
mrb_value *argv;
int argc;
int base;
mrb_get_args(mrb, "*", &argv, &argc);
if (argc == 0)
base = 10;
else
base = mrb_fixnum(argv[0]);
mrb_int base = 10;
mrb_get_args(mrb, "|i", &base);
if (base < 0) {
mrb_raisef(mrb, E_ARGUMENT_ERROR, "illegal radix %S", mrb_fixnum_value(base));
}