object.c: rename `mrb_to_int` to `mrb_to_integer`.
Consistent naming: `integer` to represent integer packed in `mrb_value`
instead of `int`.
MODIFY
include/mruby.h
include/mruby.h
@@ -1379,8 +1379,9 @@ MRB_API mrb_value mrb_check_string_type(mrb_state *mrb, mrb_value str);
#define mrb_to_str(mrb, str) mrb_ensure_string_type(mrb,str)
/* obsolete: use mrb_obj_as_string() instead */
#define mrb_str_to_str(mrb, str) mrb_obj_as_string(mrb, str)
-MRB_API mrb_value mrb_to_int(mrb_state *mrb, mrb_value val);
-#define mrb_as_int(mrb, val) mrb_integer(mrb_to_int(mrb, val))
+MRB_API mrb_value mrb_to_integer(mrb_state *mrb, mrb_value val);
+#define mrb_to_int(mrb, val) mrb_to_integer(mrb, val)
+#define mrb_as_int(mrb, val) mrb_integer(mrb_to_integer(mrb, val))
/* string type checking (contrary to the name, it doesn't convert) */
MRB_API void mrb_check_type(mrb_state *mrb, mrb_value x, enum mrb_vtype t);

MODIFY
mrbgems/mruby-kernel-ext/src/kernel.c
mrbgems/mruby-kernel-ext/src/kernel.c
@@ -166,7 +166,7 @@ arg_error:
mrb_raise(mrb, E_ARGUMENT_ERROR, "base specified for non string value");
}
/* to raise TypeError */
- return mrb_to_int(mrb, val);
+ return mrb_to_integer(mrb, val);
}
#ifndef MRB_NO_FLOAT

MODIFY
mrbgems/mruby-pack/src/pack.c
mrbgems/mruby-pack/src/pack.c
@@ -1384,7 +1384,7 @@ mrb_pack_pack(mrb_state *mrb, mrb_value ary)
o = mrb_ary_ref(mrb, ary, aidx);
if (type == PACK_TYPE_INTEGER) {
- o = mrb_to_int(mrb, o);
+ o = mrb_to_integer(mrb, o);
}
#ifndef MRB_NO_FLOAT
else if (type == PACK_TYPE_FLOAT) {

MODIFY
src/kernel.c
src/kernel.c
@@ -651,7 +651,7 @@ mrb_init_kernel(mrb_state *mrb)
mrb_define_method(mrb, krn, "respond_to?", obj_respond_to, MRB_ARGS_ARG(1,1)); /* 15.3.1.3.43 */
mrb_define_method(mrb, krn, "to_s", mrb_any_to_s, MRB_ARGS_NONE()); /* 15.3.1.3.46 */
mrb_define_method(mrb, krn, "__case_eqq", mrb_obj_ceqq, MRB_ARGS_REQ(1)); /* internal */
- mrb_define_method(mrb, krn, "__to_int", mrb_to_int, MRB_ARGS_NONE()); /* internal */
+ mrb_define_method(mrb, krn, "__to_int", mrb_to_integer, MRB_ARGS_NONE()); /* internal */
mrb_include_module(mrb, mrb->object_class, mrb->kernel_module);
}

MODIFY
src/object.c
src/object.c
@@ -478,7 +478,7 @@ mrb_obj_is_kind_of(mrb_state *mrb, mrb_value obj, struct RClass *c)
}
MRB_API mrb_value
-mrb_to_int(mrb_state *mrb, mrb_value val)
+mrb_to_integer(mrb_state *mrb, mrb_value val)
{
if (!mrb_integer_p(val)) {

MODIFY
src/string.c
src/string.c
@@ -1123,7 +1123,7 @@ str_convert_range(mrb_state *mrb, mrb_value str, mrb_value indx, mrb_value alen,
goto range_arg;
default:
- indx = mrb_to_int(mrb, indx);
+ indx = mrb_to_integer(mrb, indx);
if (mrb_integer_p(indx)) {
*beg = mrb_integer(indx);
*len = 1;
@@ -2830,7 +2830,7 @@ mrb_str_byteslice(mrb_state *mrb, mrb_value str)
}
}
else {
- beg = mrb_integer(mrb_to_int(mrb, a1));
+ beg = mrb_integer(mrb_to_integer(mrb, a1));
len = 1;
empty = FALSE;
}

object.c: rename `mrb_to_int` to `mrb_to_integer`.

Consistent naming: `integer` to represent integer packed in `mrb_value`
instead of `int`.