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
7e4a7abf
Commit
7e4a7abf
authored
Dec 22, 2015
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3055 from mattn/fix-msvc-warnings
fix build on VS2012
parents
d0727be6
7cc33af2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
9 deletions
+13
-9
mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c
mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c
+2
-2
mrbgems/mruby-math/src/math.c
mrbgems/mruby-math/src/math.c
+1
-1
src/dump.c
src/dump.c
+1
-1
src/fmt_fp.c
src/fmt_fp.c
+3
-3
src/string.c
src/string.c
+6
-2
No files found.
mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c
View file @
7e4a7abf
...
...
@@ -450,7 +450,7 @@ mrb_debug_check_breakpoint_line( mrb_state *mrb, mrb_debug_context *dbg, const c
{
mrb_debug_breakpoint
*
bp
;
mrb_debug_linepoint
*
line_p
;
in
t
i
;
uint32_
t
i
;
if
((
mrb
==
NULL
)
||
(
dbg
==
NULL
)
||
(
file
==
NULL
)
||
(
line
<=
0
))
{
return
MRB_DEBUG_INVALID_ARGUMENT
;
...
...
@@ -488,7 +488,7 @@ mrb_debug_check_breakpoint_method( mrb_state *mrb, mrb_debug_context *dbg, struc
{
mrb_debug_breakpoint
*
bp
;
int32_t
bpno
;
in
t
i
;
uint32_
t
i
;
if
((
mrb
==
NULL
)
||
(
dbg
==
NULL
)
||
(
class_obj
==
NULL
))
{
return
MRB_DEBUG_INVALID_ARGUMENT
;
...
...
mrbgems/mruby-math/src/math.c
View file @
7e4a7abf
...
...
@@ -19,7 +19,7 @@ domain_error(mrb_state *mrb, const char *func)
}
/* math functions not provided by Microsoft Visual C++ 2012 or older */
#if defined _MSC_VER && _MSC_VER < 1700
#if defined _MSC_VER && _MSC_VER <
=
1700
#include <float.h>
...
...
src/dump.c
View file @
7e4a7abf
...
...
@@ -54,7 +54,7 @@ write_irep_header(mrb_state *mrb, mrb_irep *irep, uint8_t *buf)
{
uint8_t
*
cur
=
buf
;
cur
+=
uint32_to_bin
(
get_irep_record_size_1
(
mrb
,
irep
),
cur
);
/* record size */
cur
+=
uint32_to_bin
(
(
uint32_t
)
get_irep_record_size_1
(
mrb
,
irep
),
cur
);
/* record size */
cur
+=
uint16_to_bin
((
uint16_t
)
irep
->
nlocals
,
cur
);
/* number of local variable */
cur
+=
uint16_to_bin
((
uint16_t
)
irep
->
nregs
,
cur
);
/* number of register variable */
cur
+=
uint16_to_bin
((
uint16_t
)
irep
->
rlen
,
cur
);
/* number of child irep */
...
...
src/fmt_fp.c
View file @
7e4a7abf
...
...
@@ -156,7 +156,7 @@ fmt_fp(struct fmt_args *f, long double y, int w, int p, int fl, int t)
s
=
buf
;
do
{
int
x
=
y
;
int
x
=
(
int
)
y
;
*
s
++=
xdigits
[
x
]
|
(
t
&
32
);
y
=
16
*
(
y
-
x
);
if
(
s
-
buf
==
1
&&
(
y
||
p
>
0
||
(
fl
&
ALT_FORM
)))
*
s
++=
'.'
;
...
...
@@ -184,7 +184,7 @@ fmt_fp(struct fmt_args *f, long double y, int w, int p, int fl, int t)
else
a
=
r
=
z
=
big
+
sizeof
(
big
)
/
sizeof
(
*
big
)
-
LDBL_MANT_DIG
-
1
;
do
{
*
z
=
y
;
*
z
=
(
uint32_t
)
y
;
y
=
1000000000
*
(
y
-*
z
++
);
}
while
(
y
);
...
...
@@ -194,7 +194,7 @@ fmt_fp(struct fmt_args *f, long double y, int w, int p, int fl, int t)
for
(
d
=
z
-
1
;
d
>=
a
;
d
--
)
{
uint64_t
x
=
((
uint64_t
)
*
d
<<
sh
)
+
carry
;
*
d
=
x
%
1000000000
;
carry
=
x
/
1000000000
;
carry
=
(
uint32_t
)(
x
/
1000000000
)
;
}
if
(
carry
)
*--
a
=
carry
;
while
(
z
>
a
&&
!
z
[
-
1
])
z
--
;
...
...
src/string.c
View file @
7e4a7abf
...
...
@@ -4,6 +4,10 @@
** See Copyright Notice in mruby.h
*/
#ifdef _MSC_VER
# define _CRT_NONSTDC_NO_DEPRECATE
#endif
#include <float.h>
#include <limits.h>
#include <stddef.h>
...
...
@@ -2170,12 +2174,12 @@ mrb_str_len_to_inum(mrb_state *mrb, const char *str, size_t len, int base, int b
}
n
*=
base
;
n
+=
c
;
if
(
n
>
(
int64_t
)
MRB_INT_MAX
+
(
sign
?
0
:
1
))
{
if
(
n
>
(
u
int64_t
)
MRB_INT_MAX
+
(
sign
?
0
:
1
))
{
mrb_raisef
(
mrb
,
E_ARGUMENT_ERROR
,
"string (%S) too big for integer"
,
mrb_str_new
(
mrb
,
str
,
pend
-
str
));
}
}
val
=
n
;
val
=
(
mrb_int
)
n
;
if
(
badcheck
)
{
if
(
p
==
str
)
goto
bad
;
/* no number */
while
(
p
<
pend
&&
ISSPACE
(
*
p
))
p
++
;
...
...
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