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
fc8885f2
Unverified
Commit
fc8885f2
authored
Sep 03, 2020
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `mrb_int` extensively instead of `int`.
The mixture causes warnings on 64 bit Windows (VC).
parent
fe1ad37b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
24 deletions
+24
-24
src/gc.c
src/gc.c
+2
-2
src/proc.c
src/proc.c
+1
-1
src/vm.c
src/vm.c
+21
-21
No files found.
src/gc.c
View file @
fc8885f2
...
...
@@ -591,11 +591,11 @@ add_gray_list(mrb_state *mrb, mrb_gc *gc, struct RBasic *obj)
gc
->
gray_list
=
obj
;
}
static
int
static
mrb_
int
ci_nregs
(
mrb_callinfo
*
ci
)
{
const
struct
RProc
*
p
=
ci
->
proc
;
int
n
=
0
;
mrb_
int
n
=
0
;
if
(
!
p
)
{
if
(
ci
->
argc
<
0
)
return
3
;
...
...
src/proc.c
View file @
fc8885f2
...
...
@@ -62,7 +62,7 @@ env_new(mrb_state *mrb, mrb_int nlocals)
{
struct
REnv
*
e
;
mrb_callinfo
*
ci
=
mrb
->
c
->
ci
;
int
bidx
;
mrb_
int
bidx
;
e
=
(
struct
REnv
*
)
mrb_obj_alloc
(
mrb
,
MRB_TT_ENV
,
NULL
);
MRB_ENV_SET_LEN
(
e
,
nlocals
);
...
...
src/vm.c
View file @
fc8885f2
...
...
@@ -264,8 +264,8 @@ top_proc(mrb_state *mrb, const struct RProc *proc)
#define CI_ACC_RESUMED -3
static
inline
mrb_callinfo
*
cipush
(
mrb_state
*
mrb
,
const
mrb_code
*
pc
,
int
push_stacks
,
int
acc
,
struct
RClass
*
target_class
,
const
struct
RProc
*
proc
,
mrb_sym
mid
,
int
argc
)
cipush
(
mrb_state
*
mrb
,
const
mrb_code
*
pc
,
mrb_int
push_stacks
,
mrb_
int
acc
,
struct
RClass
*
target_class
,
const
struct
RProc
*
proc
,
mrb_sym
mid
,
mrb_
int
argc
)
{
struct
mrb_context
*
c
=
mrb
->
c
;
mrb_callinfo
*
ci
=
c
->
ci
;
...
...
@@ -371,11 +371,11 @@ mrb_funcall_id(mrb_state *mrb, mrb_value self, mrb_sym mid, mrb_int argc, ...)
return
mrb_funcall_argv
(
mrb
,
self
,
mid
,
argc
,
argv
);
}
static
int
static
mrb_
int
ci_nregs
(
mrb_callinfo
*
ci
)
{
const
struct
RProc
*
p
;
int
n
=
0
;
mrb_
int
n
=
0
;
if
(
!
ci
)
return
3
;
p
=
ci
->
proc
;
...
...
@@ -425,7 +425,7 @@ mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, mrb_int argc
mrb_method_t
m
;
struct
RClass
*
c
;
mrb_callinfo
*
ci
;
int
n
=
ci_nregs
(
mrb
->
c
->
ci
);
mrb_
int
n
=
ci_nregs
(
mrb
->
c
->
ci
);
ptrdiff_t
voff
=
-
1
;
if
(
!
mrb
->
c
->
stack
)
{
...
...
@@ -506,7 +506,7 @@ mrb_value
mrb_exec_irep
(
mrb_state
*
mrb
,
mrb_value
self
,
struct
RProc
*
p
)
{
mrb_callinfo
*
ci
=
mrb
->
c
->
ci
;
int
keep
,
nregs
;
mrb_
int
keep
,
nregs
;
mrb
->
c
->
stack
[
0
]
=
self
;
ci
->
proc
=
p
;
...
...
@@ -691,7 +691,7 @@ mrb_yield_with_class(mrb_state *mrb, mrb_value b, mrb_int argc, const mrb_value
mrb_sym
mid
=
mrb
->
c
->
ci
->
mid
;
mrb_callinfo
*
ci
;
mrb_value
val
;
int
n
;
mrb_
int
n
;
if
(
mrb_nil_p
(
b
))
{
mrb_raise
(
mrb
,
E_ARGUMENT_ERROR
,
"no block given"
);
...
...
@@ -982,13 +982,13 @@ prepare_tagged_break(mrb_state *mrb, uint32_t tag, const struct RProc *proc, mrb
#endif
MRB_API
mrb_value
mrb_vm_run
(
mrb_state
*
mrb
,
const
struct
RProc
*
proc
,
mrb_value
self
,
unsigned
int
stack_keep
)
mrb_vm_run
(
mrb_state
*
mrb
,
const
struct
RProc
*
proc
,
mrb_value
self
,
unsigned
mrb_
int
stack_keep
)
{
const
mrb_irep
*
irep
=
proc
->
body
.
irep
;
mrb_value
result
;
struct
mrb_context
*
c
=
mrb
->
c
;
ptrdiff_t
cioff
=
c
->
ci
-
c
->
cibase
;
unsigned
int
nregs
=
irep
->
nregs
;
unsigned
mrb_
int
nregs
=
irep
->
nregs
;
if
(
!
c
->
stack
)
{
stack_init
(
mrb
);
...
...
@@ -1411,8 +1411,8 @@ RETRY_TRY_BLOCK:
mid
=
syms
[
b
];
L_SENDB_SYM:
{
int
argc
=
(
c
==
CALL_MAXARGS
)
?
-
1
:
c
;
int
bidx
=
(
argc
<
0
)
?
a
+
2
:
a
+
c
+
1
;
mrb_
int
argc
=
(
c
==
CALL_MAXARGS
)
?
-
1
:
c
;
mrb_
int
bidx
=
(
argc
<
0
)
?
a
+
2
:
a
+
c
+
1
;
mrb_method_t
m
;
struct
RClass
*
cls
;
mrb_callinfo
*
ci
=
mrb
->
c
->
ci
;
...
...
@@ -1688,11 +1688,11 @@ RETRY_TRY_BLOCK:
}
CASE
(
OP_ARGARY
,
BS
)
{
int
m1
=
(
b
>>
11
)
&
0x3f
;
int
r
=
(
b
>>
10
)
&
0x1
;
int
m2
=
(
b
>>
5
)
&
0x1f
;
int
kd
=
(
b
>>
4
)
&
0x1
;
int
lv
=
(
b
>>
0
)
&
0xf
;
mrb_
int
m1
=
(
b
>>
11
)
&
0x3f
;
mrb_
int
r
=
(
b
>>
10
)
&
0x1
;
mrb_
int
m2
=
(
b
>>
5
)
&
0x1f
;
mrb_
int
kd
=
(
b
>>
4
)
&
0x1
;
mrb_
int
lv
=
(
b
>>
0
)
&
0xf
;
mrb_value
*
stack
;
if
(
mrb
->
c
->
ci
->
mid
==
0
||
mrb
->
c
->
ci
->
target_class
==
NULL
)
{
...
...
@@ -1717,13 +1717,13 @@ RETRY_TRY_BLOCK:
else
{
mrb_value
*
pp
=
NULL
;
struct
RArray
*
rest
;
int
len
=
0
;
mrb_
int
len
=
0
;
if
(
mrb_array_p
(
stack
[
m1
]))
{
struct
RArray
*
ary
=
mrb_ary_ptr
(
stack
[
m1
]);
pp
=
ARY_PTR
(
ary
);
len
=
(
int
)
ARY_LEN
(
ary
);
len
=
ARY_LEN
(
ary
);
}
regs
[
a
]
=
mrb_ary_new_capa
(
mrb
,
m1
+
len
+
m2
+
kd
);
rest
=
mrb_ary_ptr
(
regs
[
a
]);
...
...
@@ -1814,7 +1814,7 @@ RETRY_TRY_BLOCK:
/* no rest arguments */
if
(
argc
-
kargs
<
len
)
{
int
mlen
=
m2
;
mrb_
int
mlen
=
m2
;
if
(
argc
<
m1
+
m2
)
{
mlen
=
m1
<
argc
?
argc
-
m1
:
0
;
}
...
...
@@ -1844,7 +1844,7 @@ RETRY_TRY_BLOCK:
pc
+=
(
argc
-
kargs
-
m1
-
m2
)
*
3
;
}
else
{
int
rnum
=
0
;
mrb_
int
rnum
=
0
;
if
(
argv0
!=
argv
)
{
regs
[
blk_pos
]
=
*
blk
;
/* move block */
if
(
kd
)
regs
[
len
+
1
]
=
kdict
;
...
...
@@ -2006,7 +2006,7 @@ RETRY_TRY_BLOCK:
pc
=
irep
->
iseq
+
bin_to_uint16
(
ch
->
target
);
}
else
{
int
acc
;
mrb_
int
acc
;
mrb_value
v
;
ci
=
mrb
->
c
->
ci
;
...
...
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