Commit c260ef89 authored by Masaki Muranaka's avatar Masaki Muranaka

Rename mrb_fix2str() to mrb_fixnum_to_str(). This is for naming consistency.

parent f4c27c6f
...@@ -20,7 +20,7 @@ extern "C" { ...@@ -20,7 +20,7 @@ extern "C" {
mrb_value mrb_flo_to_fixnum(mrb_state *mrb, mrb_value val); mrb_value mrb_flo_to_fixnum(mrb_state *mrb, mrb_value val);
mrb_value mrb_flo_to_str(mrb_state *mrb, mrb_value flo, int max_digit); mrb_value mrb_flo_to_str(mrb_state *mrb, mrb_value flo, int max_digit);
mrb_value mrb_fix2str(mrb_state *mrb, mrb_value x, int base); mrb_value mrb_fixnum_to_str(mrb_state *mrb, mrb_value x, int base);
mrb_value mrb_fixnum_plus(mrb_state *mrb, mrb_value x, mrb_value y); mrb_value mrb_fixnum_plus(mrb_state *mrb, mrb_value x, mrb_value y);
mrb_value mrb_fixnum_minus(mrb_state *mrb, mrb_value x, mrb_value y); mrb_value mrb_fixnum_minus(mrb_state *mrb, mrb_value x, mrb_value y);
......
...@@ -843,7 +843,7 @@ retry: ...@@ -843,7 +843,7 @@ retry:
dots = 1; dots = 1;
} }
else { else {
val = mrb_fix2str(mrb, mrb_fixnum_value(v), base); val = mrb_fixnum_to_str(mrb, mrb_fixnum_value(v), base);
} }
v = mrb_fixnum(mrb_str_to_inum(mrb, val, 10, 0/*Qfalse*/)); v = mrb_fixnum(mrb_str_to_inum(mrb, val, 10, 0/*Qfalse*/));
} }
......
...@@ -1868,7 +1868,7 @@ codegen(codegen_scope *s, node *tree, int val) ...@@ -1868,7 +1868,7 @@ codegen(codegen_scope *s, node *tree, int val)
mrb_value str = mrb_str_buf_new(mrb, 4); mrb_value str = mrb_str_buf_new(mrb, 4);
mrb_str_buf_cat(mrb, str, "$", 1); mrb_str_buf_cat(mrb, str, "$", 1);
mrb_str_buf_append(mrb, str, mrb_fix2str(mrb, fix, 10)); mrb_str_buf_append(mrb, str, mrb_fixnum_to_str(mrb, fix, 10));
sym = new_sym(s, mrb_intern_str(mrb, str)); sym = new_sym(s, mrb_intern_str(mrb, str));
genop(s, MKOP_ABx(OP_GETGLOBAL, cursp(), sym)); genop(s, MKOP_ABx(OP_GETGLOBAL, cursp(), sym));
push(); push();
......
...@@ -80,7 +80,7 @@ get_pool_block_size(mrb_state *mrb, mrb_irep *irep) ...@@ -80,7 +80,7 @@ get_pool_block_size(mrb_state *mrb, mrb_irep *irep)
switch (mrb_type(irep->pool[pool_no])) { switch (mrb_type(irep->pool[pool_no])) {
case MRB_TT_FIXNUM: case MRB_TT_FIXNUM:
str = mrb_fix2str(mrb, irep->pool[pool_no], 10); str = mrb_fixnum_to_str(mrb, irep->pool[pool_no], 10);
size += RSTRING_LEN(str); size += RSTRING_LEN(str);
break; break;
...@@ -123,7 +123,7 @@ write_pool_block(mrb_state *mrb, mrb_irep *irep, uint8_t *buf) ...@@ -123,7 +123,7 @@ write_pool_block(mrb_state *mrb, mrb_irep *irep, uint8_t *buf)
switch (mrb_type(irep->pool[pool_no])) { switch (mrb_type(irep->pool[pool_no])) {
case MRB_TT_FIXNUM: case MRB_TT_FIXNUM:
str = mrb_fix2str(mrb, irep->pool[pool_no], 10); str = mrb_fixnum_to_str(mrb, irep->pool[pool_no], 10);
char_ptr = RSTRING_PTR(str); char_ptr = RSTRING_PTR(str);
len = RSTRING_LEN(str); len = RSTRING_LEN(str);
break; break;
......
...@@ -1284,7 +1284,7 @@ fix_minus(mrb_state *mrb, mrb_value self) ...@@ -1284,7 +1284,7 @@ fix_minus(mrb_state *mrb, mrb_value self)
mrb_value mrb_value
mrb_fix2str(mrb_state *mrb, mrb_value x, int base) mrb_fixnum_to_str(mrb_state *mrb, mrb_value x, int base)
{ {
char buf[sizeof(mrb_int)*CHAR_BIT+1]; char buf[sizeof(mrb_int)*CHAR_BIT+1];
char *b = buf + sizeof buf; char *b = buf + sizeof buf;
...@@ -1332,7 +1332,7 @@ fix_to_s(mrb_state *mrb, mrb_value self) ...@@ -1332,7 +1332,7 @@ fix_to_s(mrb_state *mrb, mrb_value self)
mrb_int base = 10; mrb_int base = 10;
mrb_get_args(mrb, "|i", &base); mrb_get_args(mrb, "|i", &base);
return mrb_fix2str(mrb, self, base); return mrb_fixnum_to_str(mrb, self, base);
} }
/* 15.2.9.3.6 */ /* 15.2.9.3.6 */
......
...@@ -2537,7 +2537,7 @@ mrb_str_dump(mrb_state *mrb, mrb_value str) ...@@ -2537,7 +2537,7 @@ mrb_str_dump(mrb_state *mrb, mrb_value str)
const char *ptr; const char *ptr;
int len; int len;
chr = mrb_fixnum_value(c & 0xff); chr = mrb_fixnum_value(c & 0xff);
octstr = mrb_fix2str(mrb, chr, 8); octstr = mrb_fixnum_to_str(mrb, chr, 8);
ptr = mrb_str_body(octstr, &len); ptr = mrb_str_body(octstr, &len);
memcpy(q, "\\000", 4); memcpy(q, "\\000", 4);
memcpy(q + 4 - len, ptr, len); memcpy(q + 4 - len, ptr, len);
...@@ -2629,7 +2629,7 @@ mrb_str_inspect(mrb_state *mrb, mrb_value str) ...@@ -2629,7 +2629,7 @@ mrb_str_inspect(mrb_state *mrb, mrb_value str)
const char *ptr; const char *ptr;
int len; int len;
chr = mrb_fixnum_value(c & 0xff); chr = mrb_fixnum_value(c & 0xff);
octstr = mrb_fix2str(mrb, chr, 8); octstr = mrb_fixnum_to_str(mrb, chr, 8);
ptr = mrb_str_body(octstr, &len); ptr = mrb_str_body(octstr, &len);
memcpy(buf, "\\000", 4); memcpy(buf, "\\000", 4);
memcpy(buf + 4 - len, ptr, len); memcpy(buf + 4 - len, ptr, len);
......
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