Skip to content
This repository
Browse code

Rename mrb_fix2str() to mrb_fixnum_to_str(). This is for naming consi…

…stency.
  • Loading branch information...
commit c260ef894e5dde74caa2baf8d381292c08c6cff1 1 parent f4c27c6
Masaki Muranaka monaka authored
2  include/mruby/numeric.h
@@ -20,7 +20,7 @@ extern "C" {
20 20 mrb_value mrb_flo_to_fixnum(mrb_state *mrb, mrb_value val);
21 21 mrb_value mrb_flo_to_str(mrb_state *mrb, mrb_value flo, int max_digit);
22 22
23   -mrb_value mrb_fix2str(mrb_state *mrb, mrb_value x, int base);
  23 +mrb_value mrb_fixnum_to_str(mrb_state *mrb, mrb_value x, int base);
24 24
25 25 mrb_value mrb_fixnum_plus(mrb_state *mrb, mrb_value x, mrb_value y);
26 26 mrb_value mrb_fixnum_minus(mrb_state *mrb, mrb_value x, mrb_value y);
2  mrbgems/mruby-sprintf/src/sprintf.c
@@ -843,7 +843,7 @@ mrb_str_format(mrb_state *mrb, int argc, const mrb_value *argv, mrb_value fmt)
843 843 dots = 1;
844 844 }
845 845 else {
846   - val = mrb_fix2str(mrb, mrb_fixnum_value(v), base);
  846 + val = mrb_fixnum_to_str(mrb, mrb_fixnum_value(v), base);
847 847 }
848 848 v = mrb_fixnum(mrb_str_to_inum(mrb, val, 10, 0/*Qfalse*/));
849 849 }
2  src/codegen.c
@@ -1868,7 +1868,7 @@ codegen(codegen_scope *s, node *tree, int val)
1868 1868 mrb_value str = mrb_str_buf_new(mrb, 4);
1869 1869
1870 1870 mrb_str_buf_cat(mrb, str, "$", 1);
1871   - mrb_str_buf_append(mrb, str, mrb_fix2str(mrb, fix, 10));
  1871 + mrb_str_buf_append(mrb, str, mrb_fixnum_to_str(mrb, fix, 10));
1872 1872 sym = new_sym(s, mrb_intern_str(mrb, str));
1873 1873 genop(s, MKOP_ABx(OP_GETGLOBAL, cursp(), sym));
1874 1874 push();
4 src/dump.c
@@ -80,7 +80,7 @@ get_pool_block_size(mrb_state *mrb, mrb_irep *irep)
80 80
81 81 switch (mrb_type(irep->pool[pool_no])) {
82 82 case MRB_TT_FIXNUM:
83   - str = mrb_fix2str(mrb, irep->pool[pool_no], 10);
  83 + str = mrb_fixnum_to_str(mrb, irep->pool[pool_no], 10);
84 84 size += RSTRING_LEN(str);
85 85 break;
86 86
@@ -123,7 +123,7 @@ write_pool_block(mrb_state *mrb, mrb_irep *irep, uint8_t *buf)
123 123
124 124 switch (mrb_type(irep->pool[pool_no])) {
125 125 case MRB_TT_FIXNUM:
126   - str = mrb_fix2str(mrb, irep->pool[pool_no], 10);
  126 + str = mrb_fixnum_to_str(mrb, irep->pool[pool_no], 10);
127 127 char_ptr = RSTRING_PTR(str);
128 128 len = RSTRING_LEN(str);
129 129 break;
4 src/numeric.c
@@ -1284,7 +1284,7 @@ fix_minus(mrb_state *mrb, mrb_value self)
1284 1284
1285 1285
1286 1286 mrb_value
1287   -mrb_fix2str(mrb_state *mrb, mrb_value x, int base)
  1287 +mrb_fixnum_to_str(mrb_state *mrb, mrb_value x, int base)
1288 1288 {
1289 1289 char buf[sizeof(mrb_int)*CHAR_BIT+1];
1290 1290 char *b = buf + sizeof buf;
@@ -1332,7 +1332,7 @@ fix_to_s(mrb_state *mrb, mrb_value self)
1332 1332 mrb_int base = 10;
1333 1333
1334 1334 mrb_get_args(mrb, "|i", &base);
1335   - return mrb_fix2str(mrb, self, base);
  1335 + return mrb_fixnum_to_str(mrb, self, base);
1336 1336 }
1337 1337
1338 1338 /* 15.2.9.3.6 */
4 src/string.c
@@ -2537,7 +2537,7 @@ mrb_str_dump(mrb_state *mrb, mrb_value str)
2537 2537 const char *ptr;
2538 2538 int len;
2539 2539 chr = mrb_fixnum_value(c & 0xff);
2540   - octstr = mrb_fix2str(mrb, chr, 8);
  2540 + octstr = mrb_fixnum_to_str(mrb, chr, 8);
2541 2541 ptr = mrb_str_body(octstr, &len);
2542 2542 memcpy(q, "\\000", 4);
2543 2543 memcpy(q + 4 - len, ptr, len);
@@ -2629,7 +2629,7 @@ mrb_str_inspect(mrb_state *mrb, mrb_value str)
2629 2629 const char *ptr;
2630 2630 int len;
2631 2631 chr = mrb_fixnum_value(c & 0xff);
2632   - octstr = mrb_fix2str(mrb, chr, 8);
  2632 + octstr = mrb_fixnum_to_str(mrb, chr, 8);
2633 2633 ptr = mrb_str_body(octstr, &len);
2634 2634 memcpy(buf, "\\000", 4);
2635 2635 memcpy(buf + 4 - len, ptr, len);

0 comments on commit c260ef8

Please sign in to comment.
Something went wrong with that request. Please try again.