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
ea7f1953
Unverified
Commit
ea7f1953
authored
May 17, 2021
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `mrb_fixnum_to_str` to `mrb_integer_to_str`.
parent
080fdbf9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
7 deletions
+10
-7
include/mruby/numeric.h
include/mruby/numeric.h
+5
-2
mrbgems/mruby-socket/src/socket.c
mrbgems/mruby-socket/src/socket.c
+1
-1
mrbgems/mruby-sprintf/src/sprintf.c
mrbgems/mruby-sprintf/src/sprintf.c
+1
-1
src/numeric.c
src/numeric.c
+2
-2
src/string.c
src/string.c
+1
-1
No files found.
include/mruby/numeric.h
View file @
ea7f1953
...
...
@@ -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
...
...
mrbgems/mruby-socket/src/socket.c
View file @
ea7f1953
...
...
@@ -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
{
...
...
mrbgems/mruby-sprintf/src/sprintf.c
View file @
ea7f1953
...
...
@@ -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
);
}
...
...
src/numeric.c
View file @
ea7f1953
...
...
@@ -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) */
...
...
src/string.c
View file @
ea7f1953
...
...
@@ -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
:
...
...
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