Rename `mrb_fixnum_to_str` to `mrb_integer_to_str`.

parent 080fdbf9
......@@ -30,12 +30,15 @@ MRB_BEGIN_DECL
#endif
#endif
MRB_API mrb_value mrb_fixnum_to_str(mrb_state *mrb, mrb_value x, mrb_int base);
MRB_API mrb_value mrb_num_plus(mrb_state *mrb, mrb_value x, mrb_value y);
MRB_API mrb_value mrb_num_minus(mrb_state *mrb, mrb_value x, mrb_value y);
MRB_API mrb_value mrb_num_mul(mrb_state *mrb, mrb_value x, mrb_value y);
MRB_API mrb_value mrb_integer_to_str(mrb_state *mrb, mrb_value x, mrb_int base);
/* obsolete function(s); will be removed */
#define mrb_fixnum_to_str(mrb, x, base) mrb_integer_to_str(mrb, x, base)
#ifndef __has_builtin
#define __has_builtin(x) 0
#endif
......
......@@ -142,7 +142,7 @@ mrb_addrinfo_getaddrinfo(mrb_state *mrb, mrb_value klass)
if (mrb_string_p(service)) {
servname = RSTRING_CSTR(mrb, service);
} else if (mrb_integer_p(service)) {
servname = RSTRING_PTR(mrb_fixnum_to_str(mrb, service, 10));
servname = RSTRING_PTR(mrb_integer_to_str(mrb, service, 10));
} else if (mrb_nil_p(service)) {
servname = NULL;
} else {
......
......@@ -957,7 +957,7 @@ retry:
val = mrb_fix2binstr(mrb, mrb_int_value(mrb, v), base);
}
else {
val = mrb_fixnum_to_str(mrb, mrb_int_value(mrb, v), base);
val = mrb_integer_to_str(mrb, mrb_int_value(mrb, v), base);
}
strncpy(++s, RSTRING_PTR(val), sizeof(nbuf)-2);
}
......
......@@ -1526,7 +1526,7 @@ int_sub(mrb_state *mrb, mrb_value self)
MRB_API mrb_value
mrb_fixnum_to_str(mrb_state *mrb, mrb_value x, mrb_int base)
mrb_integer_to_str(mrb_state *mrb, mrb_value x, mrb_int base)
{
char buf[MRB_INT_BIT+1];
char *b = buf + sizeof buf;
......@@ -1579,7 +1579,7 @@ int_to_s(mrb_state *mrb, mrb_value self)
mrb_int base = 10;
mrb_get_args(mrb, "|i", &base);
return mrb_fixnum_to_str(mrb, self, base);
return mrb_integer_to_str(mrb, self, base);
}
/* compare two numbers: (1:0:-1; -2 for error) */
......
......@@ -1901,7 +1901,7 @@ mrb_obj_as_string(mrb_state *mrb, mrb_value obj)
case MRB_TT_SYMBOL:
return mrb_sym_str(mrb, mrb_symbol(obj));
case MRB_TT_INTEGER:
return mrb_fixnum_to_str(mrb, obj, 10);
return mrb_integer_to_str(mrb, obj, 10);
case MRB_TT_SCLASS:
case MRB_TT_CLASS:
case MRB_TT_MODULE:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment