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
9248cdd6
Commit
9248cdd6
authored
Feb 16, 2015
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
silence warnings in fmt_fp.c
parent
a88a20d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
src/fmt_fp.c
src/fmt_fp.c
+7
-6
No files found.
src/fmt_fp.c
View file @
9248cdd6
...
...
@@ -3,7 +3,7 @@
Most code in this file originates from musl (src/stdio/vfprintf.c)
which, just like mruby itself, is licensed under the MIT license.
Copyright
©
2005-2014 Rich Felker, et al.
Copyright
(c)
2005-2014 Rich Felker, et al.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
...
...
@@ -59,15 +59,16 @@ out(struct fmt_args *f, const char *s, size_t l)
mrb_str_cat
(
f
->
mrb
,
f
->
str
,
s
,
l
);
}
#define PAD_SIZE 256
static
void
pad
(
struct
fmt_args
*
f
,
char
c
,
int
w
,
int
l
,
int
fl
)
{
char
pad
[
256
];
char
pad
[
PAD_SIZE
];
if
(
fl
&
(
LEFT_ADJ
|
ZERO_PAD
)
||
l
>=
w
)
return
;
l
=
w
-
l
;
memset
(
pad
,
c
,
l
>
sizeof
pad
?
sizeof
pad
:
l
);
for
(;
l
>=
sizeof
pad
;
l
-=
sizeof
pad
)
out
(
f
,
pad
,
sizeof
pad
);
memset
(
pad
,
c
,
l
>
PAD_SIZE
?
PAD_SIZE
:
l
);
for
(;
l
>=
PAD_SIZE
;
l
-=
PAD_SIZE
)
out
(
f
,
pad
,
PAD_SIZE
);
out
(
f
,
pad
,
l
);
}
...
...
@@ -203,7 +204,7 @@ fmt_fp(struct fmt_args *f, long double y, int w, int p, int fl, int t)
uint32_t
carry
=
0
,
*
b
;
int
sh
=
MIN
(
9
,
-
e2
),
need
=
1
+
(
p
+
LDBL_MANT_DIG
/
3
+
8
)
/
9
;
for
(
d
=
a
;
d
<
z
;
d
++
)
{
uint32_t
rm
=
*
d
&
(
1
<<
sh
)
-
1
;
uint32_t
rm
=
*
d
&
(
(
1
<<
sh
)
-
1
)
;
*
d
=
(
*
d
>>
sh
)
+
carry
;
carry
=
(
1000000000
>>
sh
)
*
rm
;
}
...
...
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