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
d7986b44
Unverified
Commit
d7986b44
authored
Sep 02, 2020
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change some `int` variables to `mrb_int`.
To silence some warnings. This change cancels part of 7ef3604134.
parent
4970e24a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
21 deletions
+21
-21
include/mruby.h
include/mruby.h
+6
-6
src/vm.c
src/vm.c
+15
-15
No files found.
include/mruby.h
View file @
d7986b44
...
...
@@ -152,8 +152,8 @@ typedef struct {
struct
REnv
*
env
;
const
mrb_code
*
pc
;
/* return address */
const
mrb_code
*
err
;
/* error position */
int
argc
;
int
acc
;
mrb_
int
argc
;
mrb_
int
acc
;
struct
RClass
*
target_class
;
}
mrb_callinfo
;
...
...
@@ -1040,8 +1040,8 @@ MRB_API mrb_value mrb_get_arg1(mrb_state *mrb);
* @param ... Variadic values(not type safe!).
* @return [mrb_value] mruby function value.
*/
MRB_API
mrb_value
mrb_funcall
(
mrb_state
*
mrb
,
mrb_value
val
,
const
char
*
name
,
int
argc
,
...);
MRB_API
mrb_value
mrb_funcall_id
(
mrb_state
*
mrb
,
mrb_value
val
,
mrb_sym
mid
,
int
argc
,
...);
MRB_API
mrb_value
mrb_funcall
(
mrb_state
*
mrb
,
mrb_value
val
,
const
char
*
name
,
mrb_
int
argc
,
...);
MRB_API
mrb_value
mrb_funcall_id
(
mrb_state
*
mrb
,
mrb_value
val
,
mrb_sym
mid
,
mrb_
int
argc
,
...);
/**
* Call existing ruby functions. This is basically the type safe version of mrb_funcall.
*
...
...
@@ -1070,11 +1070,11 @@ MRB_API mrb_value mrb_funcall_id(mrb_state *mrb, mrb_value val, mrb_sym mid, int
* @return [mrb_value] mrb_value mruby function value.
* @see mrb_funcall
*/
MRB_API
mrb_value
mrb_funcall_argv
(
mrb_state
*
mrb
,
mrb_value
val
,
mrb_sym
name
,
int
argc
,
const
mrb_value
*
argv
);
MRB_API
mrb_value
mrb_funcall_argv
(
mrb_state
*
mrb
,
mrb_value
val
,
mrb_sym
name
,
mrb_
int
argc
,
const
mrb_value
*
argv
);
/**
* Call existing ruby functions with a block.
*/
MRB_API
mrb_value
mrb_funcall_with_block
(
mrb_state
*
mrb
,
mrb_value
val
,
mrb_sym
name
,
int
argc
,
const
mrb_value
*
argv
,
mrb_value
block
);
MRB_API
mrb_value
mrb_funcall_with_block
(
mrb_state
*
mrb
,
mrb_value
val
,
mrb_sym
name
,
mrb_
int
argc
,
const
mrb_value
*
argv
,
mrb_value
block
);
/**
* Create a symbol from C string. But usually it's better to use MRB_SYM(sym) and MRB_QSYM(qsym).
*
...
...
src/vm.c
View file @
d7986b44
...
...
@@ -333,7 +333,7 @@ static mrb_value mrb_run(mrb_state *mrb, const struct RProc* proc, mrb_value sel
#endif
MRB_API
mrb_value
mrb_funcall
(
mrb_state
*
mrb
,
mrb_value
self
,
const
char
*
name
,
int
argc
,
...)
mrb_funcall
(
mrb_state
*
mrb
,
mrb_value
self
,
const
char
*
name
,
mrb_
int
argc
,
...)
{
mrb_value
argv
[
MRB_FUNCALL_ARGC_MAX
];
va_list
ap
;
...
...
@@ -353,7 +353,7 @@ mrb_funcall(mrb_state *mrb, mrb_value self, const char *name, int argc, ...)
}
MRB_API
mrb_value
mrb_funcall_id
(
mrb_state
*
mrb
,
mrb_value
self
,
mrb_sym
mid
,
int
argc
,
...)
mrb_funcall_id
(
mrb_state
*
mrb
,
mrb_value
self
,
mrb_sym
mid
,
mrb_
int
argc
,
...)
{
mrb_value
argv
[
MRB_FUNCALL_ARGC_MAX
];
va_list
ap
;
...
...
@@ -396,7 +396,7 @@ ci_nregs(mrb_callinfo *ci)
}
MRB_API
mrb_value
mrb_funcall_with_block
(
mrb_state
*
mrb
,
mrb_value
self
,
mrb_sym
mid
,
int
argc
,
const
mrb_value
*
argv
,
mrb_value
blk
)
mrb_funcall_with_block
(
mrb_state
*
mrb
,
mrb_value
self
,
mrb_sym
mid
,
mrb_
int
argc
,
const
mrb_value
*
argv
,
mrb_value
blk
)
{
mrb_value
val
;
int
ai
=
mrb_gc_arena_save
(
mrb
);
...
...
@@ -497,7 +497,7 @@ mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, int argc, co
}
MRB_API
mrb_value
mrb_funcall_argv
(
mrb_state
*
mrb
,
mrb_value
self
,
mrb_sym
mid
,
int
argc
,
const
mrb_value
*
argv
)
mrb_funcall_argv
(
mrb_state
*
mrb
,
mrb_value
self
,
mrb_sym
mid
,
mrb_
int
argc
,
const
mrb_value
*
argv
)
{
return
mrb_funcall_with_block
(
mrb
,
self
,
mid
,
argc
,
argv
,
mrb_nil_value
());
}
...
...
@@ -849,7 +849,7 @@ argnum_error(mrb_state *mrb, mrb_int num)
{
mrb_value
exc
;
mrb_value
str
;
int
argc
=
mrb
->
c
->
ci
->
argc
;
mrb_
int
argc
=
mrb
->
c
->
ci
->
argc
;
if
(
argc
<
0
)
{
mrb_value
args
=
mrb
->
c
->
stack
[
1
];
...
...
@@ -1568,7 +1568,7 @@ RETRY_TRY_BLOCK:
}
CASE
(
OP_SUPER
,
BB
)
{
int
argc
=
(
b
==
CALL_MAXARGS
)
?
-
1
:
b
;
mrb_
int
argc
=
(
b
==
CALL_MAXARGS
)
?
-
1
:
b
;
int
bidx
=
(
argc
<
0
)
?
a
+
2
:
a
+
b
+
1
;
mrb_method_t
m
;
struct
RClass
*
cls
;
...
...
@@ -1747,22 +1747,22 @@ RETRY_TRY_BLOCK:
}
CASE
(
OP_ENTER
,
W
)
{
int
m1
=
MRB_ASPEC_REQ
(
a
);
int
o
=
MRB_ASPEC_OPT
(
a
);
int
r
=
MRB_ASPEC_REST
(
a
);
int
m2
=
MRB_ASPEC_POST
(
a
);
int
kd
=
(
MRB_ASPEC_KEY
(
a
)
>
0
||
MRB_ASPEC_KDICT
(
a
))
?
1
:
0
;
mrb_
int
m1
=
MRB_ASPEC_REQ
(
a
);
mrb_
int
o
=
MRB_ASPEC_OPT
(
a
);
mrb_
int
r
=
MRB_ASPEC_REST
(
a
);
mrb_
int
m2
=
MRB_ASPEC_POST
(
a
);
mrb_
int
kd
=
(
MRB_ASPEC_KEY
(
a
)
>
0
||
MRB_ASPEC_KDICT
(
a
))
?
1
:
0
;
/* unused
int b = MRB_ASPEC_BLOCK(a);
*/
int
argc
=
mrb
->
c
->
ci
->
argc
;
mrb_
int
argc
=
mrb
->
c
->
ci
->
argc
;
mrb_value
*
argv
=
regs
+
1
;
mrb_value
*
const
argv0
=
argv
;
int
const
len
=
m1
+
o
+
r
+
m2
;
int
const
blk_pos
=
len
+
kd
+
1
;
mrb_
int
const
len
=
m1
+
o
+
r
+
m2
;
mrb_
int
const
blk_pos
=
len
+
kd
+
1
;
mrb_value
*
blk
=
&
argv
[
argc
<
0
?
1
:
argc
];
mrb_value
kdict
=
mrb_nil_value
();
int
kargs
=
kd
;
mrb_
int
kargs
=
kd
;
/* arguments is passed with Array */
if
(
argc
<
0
)
{
...
...
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