Skip to content
Browse files

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

…stency.
  • Loading branch information...
1 parent f4c27c6 commit c260ef894e5dde74caa2baf8d381292c08c6cff1 @monaka monaka committed Mar 29, 2013
Showing with 9 additions and 9 deletions.
  1. +1 −1 include/mruby/numeric.h
  2. +1 −1 mrbgems/mruby-sprintf/src/sprintf.c
  3. +1 −1 src/codegen.c
  4. +2 −2 src/dump.c
  5. +2 −2 src/numeric.c
  6. +2 −2 src/string.c
View
2 include/mruby/numeric.h
@@ -20,7 +20,7 @@ extern "C" {
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_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_minus(mrb_state *mrb, mrb_value x, mrb_value y);
View
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)
dots = 1;
}
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*/));
}
View
2 src/codegen.c
@@ -1868,7 +1868,7 @@ codegen(codegen_scope *s, node *tree, int val)
mrb_value str = mrb_str_buf_new(mrb, 4);
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));
genop(s, MKOP_ABx(OP_GETGLOBAL, cursp(), sym));
push();
View
4 src/dump.c
@@ -80,7 +80,7 @@ get_pool_block_size(mrb_state *mrb, mrb_irep *irep)
switch (mrb_type(irep->pool[pool_no])) {
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);
break;
@@ -123,7 +123,7 @@ write_pool_block(mrb_state *mrb, mrb_irep *irep, uint8_t *buf)
switch (mrb_type(irep->pool[pool_no])) {
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);
len = RSTRING_LEN(str);
break;
View
4 src/numeric.c
@@ -1284,7 +1284,7 @@ fix_minus(mrb_state *mrb, mrb_value self)
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 *b = buf + sizeof buf;
@@ -1332,7 +1332,7 @@ fix_to_s(mrb_state *mrb, mrb_value self)
mrb_int base = 10;
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 */
View
4 src/string.c
@@ -2537,7 +2537,7 @@ mrb_str_dump(mrb_state *mrb, mrb_value str)
const char *ptr;
int len;
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);
memcpy(q, "\\000", 4);
memcpy(q + 4 - len, ptr, len);
@@ -2629,7 +2629,7 @@ mrb_str_inspect(mrb_state *mrb, mrb_value str)
const char *ptr;
int len;
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);
memcpy(buf, "\\000", 4);
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.