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
471288f3
Commit
471288f3
authored
Aug 25, 2018
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce integer casting warnings.
parent
d79dbd92
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
14 deletions
+14
-14
include/mruby.h
include/mruby.h
+1
-1
mrbgems/mruby-compiler/core/codegen.c
mrbgems/mruby-compiler/core/codegen.c
+4
-4
mrbgems/mruby-eval/src/eval.c
mrbgems/mruby-eval/src/eval.c
+3
-3
src/codedump.c
src/codedump.c
+3
-3
src/load.c
src/load.c
+2
-2
src/vm.c
src/vm.c
+1
-1
No files found.
include/mruby.h
View file @
471288f3
...
...
@@ -1234,7 +1234,7 @@ MRB_API mrb_value mrb_fiber_alive_p(mrb_state *mrb, mrb_value fib);
* @mrbgem mruby-fiber
*/
#define E_FIBER_ERROR (mrb_exc_get(mrb, "FiberError"))
MRB_API
void
mrb_stack_extend
(
mrb_state
*
,
int
);
MRB_API
void
mrb_stack_extend
(
mrb_state
*
,
mrb_
int
);
/* memory pool implementation */
typedef
struct
mrb_pool
mrb_pool
;
...
...
mrbgems/mruby-compiler/core/codegen.c
View file @
471288f3
...
...
@@ -400,7 +400,7 @@ genjmp2(codegen_scope *s, mrb_code i, uint16_t a, int pc, int val)
}
else
{
gen_B
(
s
,
i
);
gen_B
(
s
,
a
);
gen_B
(
s
,
(
uint8_t
)
a
);
pos
=
s
->
pc
;
gen_S
(
s
,
pc
);
}
...
...
@@ -494,10 +494,10 @@ gen_addsub(codegen_scope *s, uint8_t op, uint16_t dst, uint16_t idx)
if
(
data
.
b
>=
128
)
goto
normal
;
s
->
pc
=
s
->
lastpc
;
if
(
op
==
OP_ADD
)
{
genop_3
(
s
,
OP_ADDI
,
dst
,
idx
,
data
.
b
);
genop_3
(
s
,
OP_ADDI
,
dst
,
idx
,
(
uint8_t
)
data
.
b
);
}
else
{
genop_3
(
s
,
OP_SUBI
,
dst
,
idx
,
data
.
b
);
genop_3
(
s
,
OP_SUBI
,
dst
,
idx
,
(
uint8_t
)
data
.
b
);
}
break
;
default:
...
...
@@ -2441,7 +2441,7 @@ codegen(codegen_scope *s, node *tree, int val)
#endif
if
(
i
==
-
1
)
genop_1
(
s
,
OP_LOADI__1
,
cursp
());
else
if
(
i
>=
-
0xffff
)
{
genop_2
(
s
,
OP_LOADINEG
,
cursp
(),
-
i
);
genop_2
(
s
,
OP_LOADINEG
,
cursp
(),
(
uint16_t
)
-
i
);
}
else
{
int
off
=
new_lit
(
s
,
mrb_fixnum_value
(
i
));
...
...
mrbgems/mruby-eval/src/eval.c
View file @
471288f3
...
...
@@ -154,7 +154,7 @@ patch_irep(mrb_state *mrb, mrb_irep *irep, int bnest, mrb_irep *top)
if
(
arg
!=
0
)
{
/* must replace */
irep
->
iseq
[
i
]
=
insn
=
OP_SETUPVAR
;
irep
->
iseq
[
i
+
1
]
=
b
;
irep
->
iseq
[
i
+
1
]
=
(
mrb_code
)
b
;
irep
->
iseq
[
i
+
2
]
=
arg
>>
8
;
irep
->
iseq
[
i
+
3
]
=
arg
&
0xff
;
}
...
...
@@ -169,7 +169,7 @@ patch_irep(mrb_state *mrb, mrb_irep *irep, int bnest, mrb_irep *top)
int
lev
=
c
+
1
;
mrb_irep
*
tmp
=
search_irep
(
top
,
bnest
,
lev
,
irep
);
if
(
potential_upvar_p
(
tmp
->
lv
,
b
,
irep_argc
(
tmp
),
tmp
->
nlocals
))
{
mrb_code
arg
=
search_variable
(
mrb
,
tmp
->
lv
[
b
-
1
].
name
,
bnest
);
uint16_t
arg
=
search_variable
(
mrb
,
tmp
->
lv
[
b
-
1
].
name
,
bnest
);
if
(
arg
!=
0
)
{
/* must replace */
irep
->
iseq
[
i
]
=
OP_GETUPVAR
;
...
...
@@ -188,7 +188,7 @@ patch_irep(mrb_state *mrb, mrb_irep *irep, int bnest, mrb_irep *top)
int
lev
=
c
+
1
;
mrb_irep
*
tmp
=
search_irep
(
top
,
bnest
,
lev
,
irep
);
if
(
potential_upvar_p
(
tmp
->
lv
,
b
,
irep_argc
(
tmp
),
tmp
->
nlocals
))
{
mrb_code
arg
=
search_variable
(
mrb
,
tmp
->
lv
[
b
-
1
].
name
,
bnest
);
uint16_t
arg
=
search_variable
(
mrb
,
tmp
->
lv
[
b
-
1
].
name
,
bnest
);
if
(
arg
!=
0
)
{
/* must replace */
irep
->
iseq
[
i
]
=
OP_SETUPVAR
;
...
...
src/codedump.c
View file @
471288f3
...
...
@@ -48,7 +48,7 @@ print_lv_ab(mrb_state *mrb, mrb_irep *irep, uint16_t a, uint16_t b)
#endif
static
void
print_header
(
mrb_irep
*
irep
,
in
t
i
)
print_header
(
mrb_irep
*
irep
,
ptrdiff_
t
i
)
{
int32_t
line
;
...
...
@@ -60,7 +60,7 @@ print_header(mrb_irep *irep, int i)
printf
(
"%5d "
,
line
);
}
printf
(
"%03d "
,
i
);
printf
(
"%03d "
,
(
int
)
i
);
}
#define CASE(insn,ops) case insn: FETCH_ ## ops (); L_ ## insn
...
...
@@ -91,7 +91,7 @@ codedump(mrb_state *mrb, mrb_irep *irep)
pc
=
irep
->
iseq
;
pcend
=
pc
+
irep
->
ilen
;
while
(
pc
<
pcend
)
{
in
t
i
;
ptrdiff_
t
i
;
uint32_t
a
;
uint16_t
b
;
uint8_t
c
;
...
...
src/load.c
View file @
471288f3
...
...
@@ -68,7 +68,7 @@ read_irep_record_1(mrb_state *mrb, const uint8_t *bin, size_t *len, uint8_t flag
/* Binary Data Section */
/* ISEQ BLOCK */
irep
->
ilen
=
(
size
_t
)
bin_to_uint32
(
src
);
irep
->
ilen
=
(
uint16
_t
)
bin_to_uint32
(
src
);
src
+=
sizeof
(
uint32_t
);
src
+=
skip_padding
(
src
);
...
...
@@ -157,7 +157,7 @@ read_irep_record_1(mrb_state *mrb, const uint8_t *bin, size_t *len, uint8_t flag
}
/* SYMS BLOCK */
irep
->
slen
=
(
size
_t
)
bin_to_uint32
(
src
);
/* syms length */
irep
->
slen
=
(
uint16
_t
)
bin_to_uint32
(
src
);
/* syms length */
src
+=
sizeof
(
uint32_t
);
if
(
irep
->
slen
>
0
)
{
if
(
SIZE_ERROR_MUL
(
irep
->
slen
,
sizeof
(
mrb_sym
)))
{
...
...
src/vm.c
View file @
471288f3
...
...
@@ -218,7 +218,7 @@ stack_extend_alloc(mrb_state *mrb, int room)
}
MRB_API
void
mrb_stack_extend
(
mrb_state
*
mrb
,
int
room
)
mrb_stack_extend
(
mrb_state
*
mrb
,
mrb_
int
room
)
{
if
(
mrb
->
c
->
stack
+
room
>=
mrb
->
c
->
stend
)
{
stack_extend_alloc
(
mrb
,
room
);
...
...
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