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
5a681874
Commit
5a681874
authored
Jan 26, 2013
by
Yuichiro MASUI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
defined printf macro for mrb_int
parent
688cf040
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
include/mrbconf.h
include/mrbconf.h
+6
-3
src/cdump.c
src/cdump.c
+1
-5
No files found.
include/mrbconf.h
View file @
5a681874
...
...
@@ -76,7 +76,8 @@
typedef
int32_t
mrb_int
;
# define MRB_INT_MIN INT32_MIN
# define MRB_INT_MAX INT32_MAX
# define mrb_int_to_str(buf, i) sprintf((buf), "%" PRId32, (i))
# define MRB_INT_FORMAT PRId32
# define mrb_int_to_str(buf, i) sprintf((buf), "%" MRB_INT_FORMAT, (i))
# define str_to_mrb_int(buf) (mrb_int)strtol((buf), NULL, 10)
# endif
#else
...
...
@@ -84,13 +85,15 @@
typedef
int64_t
mrb_int
;
# define MRB_INT_MIN INT64_MIN
# define MRB_INT_MAX INT64_MAX
# define mrb_int_to_str(buf, i) sprintf((buf), "%" PRId64, (i))
# define MRB_INT_FORMAT PRId64
# define mrb_int_to_str(buf, i) sprintf((buf), "%" MRB_INT_FORMAT, (i))
# define str_to_mrb_int(buf) (mrb_int)strtoll((buf), NULL, 10)
# else
typedef
int32_t
mrb_int
;
# define MRB_INT_MIN INT32_MIN
# define MRB_INT_MAX INT32_MAX
# define mrb_int_to_str(buf, i) sprintf((buf), "%" PRId32, (i))
# define MRB_INT_FORMAT PRId32
# define mrb_int_to_str(buf, i) sprintf((buf), "%" MRB_INT_FORMAT, (i))
# define str_to_mrb_int(buf) (mrb_int)strtol((buf), NULL, 10)
# endif
#endif
...
...
src/cdump.c
View file @
5a681874
...
...
@@ -145,11 +145,7 @@ make_cdump_irep(mrb_state *mrb, int irep_no, FILE *f)
case
MRB_TT_FLOAT
:
SOURCE_CODE
(
" irep->pool[%d] = mrb_float_value(%.16e);"
,
n
,
mrb_float
(
irep
->
pool
[
n
]));
break
;
case
MRB_TT_FIXNUM
:
{
char
num_buf
[
64
];
mrb_int_to_str
(
num_buf
,
mrb_fixnum
(
irep
->
pool
[
n
]));
SOURCE_CODE
(
" irep->pool[%d] = mrb_fixnum_value(%s);"
,
n
,
num_buf
);
break
;
}
SOURCE_CODE
(
" irep->pool[%d] = mrb_fixnum_value(%"
MRB_INT_FORMAT
");"
,
n
,
mrb_fixnum
(
irep
->
pool
[
n
]));
break
;
case
MRB_TT_STRING
:
str_len
=
str_format_len
(
irep
->
pool
[
n
])
+
1
;
if
(
str_len
>
buf_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