Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
c260ef89
Commit
c260ef89
authored
Mar 29, 2013
by
Masaki Muranaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename mrb_fix2str() to mrb_fixnum_to_str(). This is for naming consistency.
parent
f4c27c6f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
9 deletions
+9
-9
include/mruby/numeric.h
include/mruby/numeric.h
+1
-1
mrbgems/mruby-sprintf/src/sprintf.c
mrbgems/mruby-sprintf/src/sprintf.c
+1
-1
src/codegen.c
src/codegen.c
+1
-1
src/dump.c
src/dump.c
+2
-2
src/numeric.c
src/numeric.c
+2
-2
src/string.c
src/string.c
+2
-2
No files found.
include/mruby/numeric.h
View file @
c260ef89
...
...
@@ -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_fix
2
str
(
mrb_state
*
mrb
,
mrb_value
x
,
int
base
);
mrb_value
mrb_fix
num_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
);
...
...
mrbgems/mruby-sprintf/src/sprintf.c
View file @
c260ef89
...
...
@@ -843,7 +843,7 @@ retry:
dots
=
1
;
}
else
{
val
=
mrb_fix
2
str
(
mrb
,
mrb_fixnum_value
(
v
),
base
);
val
=
mrb_fix
num_to_
str
(
mrb
,
mrb_fixnum_value
(
v
),
base
);
}
v
=
mrb_fixnum
(
mrb_str_to_inum
(
mrb
,
val
,
10
,
0
/*Qfalse*/
));
}
...
...
src/codegen.c
View file @
c260ef89
...
...
@@ -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_fix
2
str
(
mrb
,
fix
,
10
));
mrb_str_buf_append
(
mrb
,
str
,
mrb_fix
num_to_
str
(
mrb
,
fix
,
10
));
sym
=
new_sym
(
s
,
mrb_intern_str
(
mrb
,
str
));
genop
(
s
,
MKOP_ABx
(
OP_GETGLOBAL
,
cursp
(),
sym
));
push
();
...
...
src/dump.c
View file @
c260ef89
...
...
@@ -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_fix
2
str
(
mrb
,
irep
->
pool
[
pool_no
],
10
);
str
=
mrb_fix
num_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_fix
2
str
(
mrb
,
irep
->
pool
[
pool_no
],
10
);
str
=
mrb_fix
num_to_
str
(
mrb
,
irep
->
pool
[
pool_no
],
10
);
char_ptr
=
RSTRING_PTR
(
str
);
len
=
RSTRING_LEN
(
str
);
break
;
...
...
src/numeric.c
View file @
c260ef89
...
...
@@ -1284,7 +1284,7 @@ fix_minus(mrb_state *mrb, mrb_value self)
mrb_value
mrb_fix
2
str
(
mrb_state
*
mrb
,
mrb_value
x
,
int
base
)
mrb_fix
num_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_fix
2
str
(
mrb
,
self
,
base
);
return
mrb_fix
num_to_
str
(
mrb
,
self
,
base
);
}
/* 15.2.9.3.6 */
...
...
src/string.c
View file @
c260ef89
...
...
@@ -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_fix
2
str
(
mrb
,
chr
,
8
);
octstr
=
mrb_fix
num_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_fix
2
str
(
mrb
,
chr
,
8
);
octstr
=
mrb_fix
num_to_
str
(
mrb
,
chr
,
8
);
ptr
=
mrb_str_body
(
octstr
,
&
len
);
memcpy
(
buf
,
"
\\
000"
,
4
);
memcpy
(
buf
+
4
-
len
,
ptr
,
len
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment