From: SourceForge.net <no...@so...> - 2008-02-09 19:52:57
|
Patches item #1889311, was opened at 2008-02-08 13:50 Message generated for change (Comment added) made by dannysmith You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=302435&aid=1889311&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: runtime Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Danny Smith (dannysmith) Assigned to: Nobody/Anonymous (nobody) Summary: Fix decimal point in snprintf Initial Comment: This fixes the bug recently reported to mingw-users. 2008-02-08 Danny Smith <dan...@us...> * mingwex/gdtoa/gdtoaimp.h (USE_LOCALE): Define. Index: mingwex/gdtoa/gdtoaimp.h =================================================================== RCS file: /cvs/src/src/winsup/mingw/mingwex/gdtoa/gdtoaimp.h,v retrieving revision 1.2 diff -c -3 -p -r1.2 gdtoaimp.h *** mingwex/gdtoa/gdtoaimp.h 6 Sep 2006 22:03:16 -0000 1.2 --- mingwex/gdtoa/gdtoaimp.h 8 Feb 2008 00:42:53 -0000 *************** THIS SOFTWARE. *** 172,177 **** --- 172,178 ---- #define INFNAN_CHECK 1 #define MULTIPLE_THREADS 1 + #define USE_LOCALE 1 #ifdef DEBUG #include <stdio.h> ---------------------------------------------------------------------- >Comment By: Danny Smith (dannysmith) Date: 2008-02-10 08:52 Message: Logged In: YES user_id=11494 Originator: YES Thanks Tor, Revised version attached: 2008-02-08 Danny Smith <dan...@us...> * mingwex/gdtoa/gdtoaimp.h (USE_LOCALE): Define. * mingwex/gdtoa/mingw_snprintf.c: [USE_LOCALE] Include locale.h. (x_sprintf): [USE_LOCALE] Use *localeconv()->decimal_point. File Added: gdtoa.diff ---------------------------------------------------------------------- Comment By: Tor Lillqvist (tml1024) Date: 2008-02-08 21:52 Message: Logged In: YES user_id=126952 Originator: NO Ah ok. The code in mingw_snprintf.c doesn't look at the locale's decimal_point even with USE_LOCALE, though, it seems to hardcode '.' in x_sprintf(), which if I understand correctly is what actually implements the snpritnf() in libmingwex. USE_LOCALE is checked and the locale-specific decimal point is used only in g__fmt.c, gethex.c and strtodg.c. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=302435&aid=1889311&group_id=2435 |