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
d2be1542
Commit
d2be1542
authored
Aug 07, 2013
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1446 from cremno/casts
MSVC: fix warnings
parents
1f5c91d6
123c8875
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
src/class.c
src/class.c
+1
-1
src/numeric.c
src/numeric.c
+2
-2
No files found.
src/class.c
View file @
d2be1542
...
@@ -494,7 +494,7 @@ mrb_get_args(mrb_state *mrb, const char *format, ...)
...
@@ -494,7 +494,7 @@ mrb_get_args(mrb_state *mrb, const char *format, ...)
if
(
i
<
argc
)
{
if
(
i
<
argc
)
{
ss
=
to_str
(
mrb
,
*
sp
++
);
ss
=
to_str
(
mrb
,
*
sp
++
);
s
=
mrb_str_ptr
(
ss
);
s
=
mrb_str_ptr
(
ss
);
if
(
strlen
(
s
->
ptr
)
<
s
->
len
)
{
if
(
(
mrb_int
)
strlen
(
s
->
ptr
)
<
s
->
len
)
{
mrb_raise
(
mrb
,
E_ARGUMENT_ERROR
,
"String contains NUL"
);
mrb_raise
(
mrb
,
E_ARGUMENT_ERROR
,
"String contains NUL"
);
}
}
*
ps
=
s
->
ptr
;
*
ps
=
s
->
ptr
;
...
...
src/numeric.c
View file @
d2be1542
...
@@ -200,7 +200,7 @@ mrb_flo_to_str(mrb_state *mrb, mrb_value flo, int max_digit)
...
@@ -200,7 +200,7 @@ mrb_flo_to_str(mrb_state *mrb, mrb_value flo, int max_digit)
*
(
c
++
)
=
'-'
;
*
(
c
++
)
=
'-'
;
}
}
exp
=
log10
(
n
);
exp
=
(
int
)
log10
(
n
);
if
((
exp
<
0
?
-
exp
:
exp
)
>
max_digit
)
{
if
((
exp
<
0
?
-
exp
:
exp
)
>
max_digit
)
{
/* exponent representation */
/* exponent representation */
...
@@ -223,7 +223,7 @@ mrb_flo_to_str(mrb_state *mrb, mrb_value flo, int max_digit)
...
@@ -223,7 +223,7 @@ mrb_flo_to_str(mrb_state *mrb, mrb_value flo, int max_digit)
/* puts digits */
/* puts digits */
while
(
max_digit
>=
0
)
{
while
(
max_digit
>=
0
)
{
mrb_float
weight
=
pow
(
10
.
0
,
m
);
mrb_float
weight
=
pow
(
10
.
0
,
m
);
digit
=
floor
(
n
/
weight
+
FLT_EPSILON
);
digit
=
(
int
)
floor
(
n
/
weight
+
FLT_EPSILON
);
*
(
c
++
)
=
'0'
+
digit
;
*
(
c
++
)
=
'0'
+
digit
;
n
-=
(
digit
*
weight
);
n
-=
(
digit
*
weight
);
max_digit
--
;
max_digit
--
;
...
...
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