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
0903e2a7
Unverified
Commit
0903e2a7
authored
Jan 25, 2021
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Silence 'loss of data' warnings.
parent
efef4541
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
12 deletions
+14
-12
mrbgems/mruby-rational/src/rational.c
mrbgems/mruby-rational/src/rational.c
+2
-2
src/backtrace.c
src/backtrace.c
+4
-2
src/codedump.c
src/codedump.c
+3
-3
src/dump.c
src/dump.c
+1
-1
src/vm.c
src/vm.c
+4
-4
No files found.
mrbgems/mruby-rational/src/rational.c
View file @
0903e2a7
...
...
@@ -166,8 +166,8 @@ rational_new_i(mrb_state *mrb, mrb_int n, mrb_int d)
#include <math.h>
#if defined(MRB_INT32) || defined(MRB_USE_FLOAT32)
#define frexp_rat
frexpf
#define ldexp_rat
ldexpf
#define frexp_rat
(x,exp) frexpf((float)x, exp)
#define ldexp_rat
(x,exp) ldexpf((float)x, exp)
#define RAT_MANT_DIG FLT_MANT_DIG
#define RAT_INT_LIMIT 30
#define RAT_HUGE_VAL HUGE_VALF
...
...
src/backtrace.c
View file @
0903e2a7
...
...
@@ -41,6 +41,7 @@ each_backtrace(mrb_state *mrb, ptrdiff_t ciidx, each_backtrace_func func, void *
mrb_callinfo
*
ci
;
const
mrb_irep
*
irep
;
const
mrb_code
*
pc
;
uint32_t
idx
;
ci
=
&
mrb
->
c
->
cibase
[
i
];
...
...
@@ -57,10 +58,11 @@ each_backtrace(mrb_state *mrb, ptrdiff_t ciidx, each_backtrace_func func, void *
continue
;
}
loc
.
lineno
=
mrb_debug_get_line
(
mrb
,
irep
,
pc
-
irep
->
iseq
);
idx
=
(
uint32_t
)(
pc
-
irep
->
iseq
);
loc
.
lineno
=
mrb_debug_get_line
(
mrb
,
irep
,
idx
);
if
(
loc
.
lineno
==
-
1
)
continue
;
loc
.
filename
=
mrb_debug_get_filename
(
mrb
,
irep
,
pc
-
irep
->
iseq
);
loc
.
filename
=
mrb_debug_get_filename
(
mrb
,
irep
,
idx
);
if
(
!
loc
.
filename
)
{
loc
.
filename
=
"(unknown)"
;
}
...
...
src/codedump.c
View file @
0903e2a7
...
...
@@ -42,7 +42,7 @@ print_lv_ab(mrb_state *mrb, const mrb_irep *irep, uint16_t a, uint16_t b)
}
static
void
print_header
(
mrb_state
*
mrb
,
const
mrb_irep
*
irep
,
ptrdiff
_t
i
)
print_header
(
mrb_state
*
mrb
,
const
mrb_irep
*
irep
,
uint32
_t
i
)
{
int32_t
line
;
...
...
@@ -120,12 +120,12 @@ codedump(mrb_state *mrb, const mrb_irep *irep)
ai
=
mrb_gc_arena_save
(
mrb
);
i
=
pc
-
irep
->
iseq
;
next_file
=
mrb_debug_get_filename
(
mrb
,
irep
,
i
);
next_file
=
mrb_debug_get_filename
(
mrb
,
irep
,
(
uint32_t
)
i
);
if
(
next_file
&&
file
!=
next_file
)
{
printf
(
"file: %s
\n
"
,
next_file
);
file
=
next_file
;
}
print_header
(
mrb
,
irep
,
i
);
print_header
(
mrb
,
irep
,
(
uint32_t
)
i
);
ins
=
READ_B
();
switch
(
ins
)
{
CASE
(
OP_NOP
,
Z
);
...
...
src/dump.c
View file @
0903e2a7
...
...
@@ -1043,7 +1043,7 @@ sym_operator_name(const char *sym_name, mrb_int len)
for
(
start
=
0
;
table_size
!=
0
;
table_size
/=
2
)
{
idx
=
start
+
table_size
/
2
;
op_sym
=
&
operator_table
[
idx
];
cmp
=
len
-
op_sym
->
sym_name_len
;
cmp
=
(
int
)(
len
-
op_sym
->
sym_name_len
)
;
if
(
cmp
==
0
)
{
cmp
=
memcmp
(
sym_name
,
op_sym
->
sym_name
,
len
);
if
(
cmp
==
0
)
return
op_sym
->
name
;
...
...
src/vm.c
View file @
0903e2a7
...
...
@@ -279,8 +279,8 @@ cipush(mrb_state *mrb, mrb_int push_stacks, mrb_int acc,
ci
->
mid
=
mid
;
mrb_vm_ci_proc_set
(
ci
,
proc
);
ci
->
stack
=
ci
[
-
1
].
stack
+
push_stacks
;
ci
->
argc
=
argc
;
ci
->
acc
=
acc
;
ci
->
argc
=
(
int16_t
)
argc
;
ci
->
acc
=
(
int16_t
)
acc
;
ci
->
u
.
target_class
=
target_class
;
return
ci
;
...
...
@@ -1282,7 +1282,7 @@ RETRY_TRY_BLOCK:
}
CASE
(
OP_JMPUW
,
S
)
{
a
=
(
pc
-
irep
->
iseq
)
+
(
int16_t
)
a
;
a
=
(
uint32_t
)((
pc
-
irep
->
iseq
)
+
(
int16_t
)
a
)
;
CHECKPOINT_RESTORE
(
RBREAK_TAG_JUMP
)
{
struct
RBreak
*
brk
=
(
struct
RBreak
*
)
mrb
->
exc
;
mrb_value
target
=
mrb_break_value_get
(
brk
);
...
...
@@ -1855,7 +1855,7 @@ RETRY_TRY_BLOCK:
}
/* format arguments for generated code */
mrb
->
c
->
ci
->
argc
=
len
+
kd
;
mrb
->
c
->
ci
->
argc
=
(
int16_t
)(
len
+
kd
)
;
/* clear local (but non-argument) variables */
if
(
irep
->
nlocals
-
blk_pos
-
1
>
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