Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
04de6fe3
Commit
04de6fe3
authored
Aug 06, 2020
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ucrtbase: Fix away from 0 rounding in %a format.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e475d045
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
printf.h
dlls/msvcrt/printf.h
+2
-2
printf.c
dlls/ucrtbase/tests/printf.c
+7
-4
No files found.
dlls/msvcrt/printf.h
View file @
04de6fe3
...
...
@@ -446,10 +446,10 @@ static inline int FUNC_NAME(pf_output_hex_fp)(FUNC_NAME(puts_clbk) pf_puts, void
mant
>>=
4
;
}
if
(
!
flags
->
Precision
)
{
if
(
p
[
0
]
>
'8'
)
p
[
-
2
]
++
;
if
(
p
[
0
]
>
=
'8'
)
p
[
-
2
]
++
;
if
(
!
flags
->
Alternate
)
p
--
;
}
else
if
(
flags
->
Precision
>
0
&&
flags
->
Precision
<
MANT_BITS
/
4
)
{
BOOL
round_up
=
(
p
[
flags
->
Precision
]
>
'8'
);
BOOL
round_up
=
(
p
[
flags
->
Precision
]
>
=
'8'
);
for
(
r
=
flags
->
Precision
-
1
;
r
>=
0
&&
round_up
;
r
--
)
{
round_up
=
FALSE
;
if
(
p
[
r
]
==
'f'
||
p
[
r
]
==
'F'
)
{
...
...
dlls/ucrtbase/tests/printf.c
View file @
04de6fe3
...
...
@@ -747,18 +747,21 @@ static void test_printf_fp(void)
{
"%.a"
,
0.1e-20
,
{
"0x1p-70"
}},
{
"%a"
,
0.1e-20
,
{
"0x1.2e3b40a0e9b4fp-70"
}},
{
"%a"
,
4.9406564584124654e-324
,
{
"0x0.0000000000001p-1022"
}},
{
"%.0a"
,
-
1
.
5
,
{
"-0x1p+0"
}},
{
"%.0a"
,
-
1
.
5
,
{
"-0x
2p+0"
},
{
"-0x
1p+0"
}},
{
"%.0a"
,
-
0
.
5
,
{
"-0x1p-1"
}},
{
"%.0a"
,
0
.
5
,
{
"0x1p-1"
}},
{
"%.0a"
,
1
.
5
,
{
"0x1p+0"
}},
{
"%.0a"
,
1
.
5
,
{
"0x
2p+0"
},
{
"0x
1p+0"
}},
{
"%.0a"
,
1
.
99
,
{
"0x2p+0"
}},
{
"%.0a"
,
2
,
{
"0x1p+1"
}},
{
"%.0a"
,
9
.
5
,
{
"0x1p+3"
}},
{
"%.0a"
,
10
.
5
,
{
"0x1p+3"
}},
{
"%#.0a"
,
-
1
.
5
,
{
"-0x1.p+0"
}},
{
"%#.0a"
,
-
1
.
5
,
{
"-0x
2.p+0"
},
{
"-0x
1.p+0"
}},
{
"%#.0a"
,
-
0
.
5
,
{
"-0x1.p-1"
}},
{
"%#.0a"
,
0
.
5
,
{
"0x1.p-1"
}},
{
"%#.0a"
,
1
.
5
,
{
"0x1.p+0"
}},
{
"%#.0a"
,
1
.
5
,
{
"0x2.p+0"
},
{
"0x1.p+0"
}},
{
"%#.1a"
,
1
.
03125
,
{
"0x1.1p+0"
},
{
"0x1.0p+0"
}},
{
"%#.1a"
,
1
.
09375
,
{
"0x1.2p+0"
},
{
"0x1.1p+0"
}},
{
"%#.1a"
,
1
.
15625
,
{
"0x1.3p+0"
},
{
"0x1.2p+0"
}},
{
"%f"
,
0
,
{
"0.000000"
}},
{
"%e"
,
0
,
{
"0.000000e+00"
,
NULL
,
"0.000000e+000"
}},
...
...
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