msvcrt: Use Dragon4 algorithm to fix inconsistent rounding behaviour for sprintf and add tests.

Zhenbo Li litimetal at gmail.com
Thu Feb 26 19:32:42 CST 2015


Hi, YongHao,
Quite a huge patch lol

I tried your patch.

$ patch -p1 <0012-msvcrt-Use-Dragon4-algorithm-to-fix-inconsistent-round.txt
(Stripping trailing CRs from patch; use --binary to disable.)
patching file dlls/msvcrt/dragon4.h
(Stripping trailing CRs from patch; use --binary to disable.)
patching file dlls/msvcrt/printf.h
(Stripping trailing CRs from patch; use --binary to disable.)
patching file dlls/msvcrt/tests/printf.c
(Stripping trailing CRs from patch; use --binary to disable.)
patching file dlls/msvcrt/wine_printfloat.h

Is this critical?

Also, your patch failed to compile on my computer.

dragon4.h:10:0: error: unterminated #ifndef
 #ifndef __WINE_STDIO_H

Why is it necessary here?

And then, wine_printfloat.h:26:15: error: unknown type name 'uint32_t'
It seems that you're using C99 types? It is not allowed in wine code[1]

Finally, you've created two files with ZLIB license. Is it better to move all
the ZLIB license code to one file? I'm not sure about that. Could someone
have a check to avoid legal problems?


[1]: wiki.winehq.org/Developers-Hints

2015-02-26 23:13 GMT+08:00 YongHao Hu <christopherwuy at gmail.com>:
> Fix bug https://bugs.winehq.org/show_bug.cgi?id=37913 .
> The Dragon4 algorithm implementation is based on
> http://www.ryanjuckett.com/programming/printing-floating-point-numbers/.
>
> ---
>  dlls/msvcrt/dragon4.h         | 670
> ++++++++++++++++++++++++++++++++++++++++++
>  dlls/msvcrt/printf.h          |  43 +--
>  dlls/msvcrt/tests/printf.c    |  83 +++++-
>  dlls/msvcrt/wine_printfloat.h | 248 ++++++++++++++++
>  4 files changed, 1026 insertions(+), 18 deletions(-)
>  create mode 100644 dlls/msvcrt/dragon4.h
>  create mode 100644 dlls/msvcrt/wine_printfloat.h
>
>
>
>
>



-- 
Have a nice day!
Zhenbo Li



More information about the wine-devel mailing list