[Bug 33254] New: sprintf doesn't respect _set_output_format for E format
http://bugs.winehq.org/show_bug.cgi?id=33254 Bug #: 33254 Summary: sprintf doesn't respect _set_output_format for E format Product: Wine Version: 1.5.26 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt AssignedTo: wine-bugs(a)winehq.org ReportedBy: sebastian.wolff(a)dynardo.at Classification: Unclassified On UNIX systems the printf functions always create an exponent with 2 digits. This is different on Windows, where 3 digits are used for the exponent at least by default. One can, however, justify this default: #include <stdio.h> #include <iostream> int main() { // enforce 2 digits in the exponent of printf() floating point format (Windows uses 3 digits by default, UNIX uses 2) unsigned int old_exponent_format = _set_output_format(_TWO_DIGIT_EXPONENT); char string[80]; int node_id(0); double x(0),y(0),z(0), node_info_1(0), node_info_2(0); int num_written = sprintf(string, "%8d%16.8E%16.8E%16.8E%8d%8d", node_id, x, y, z, node_info_1, node_info_2); std::cout << string << std::endl; // restore number of digits in printf floating point format _set_output_format(old_exponent_format); } On Windows this produces output with 2 digits used for the exponent. On WINE, however, always 3 digits are used. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=33254 Piotr Caban <piotr.caban(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |piotr.caban(a)gmail.com AssignedTo|wine-bugs(a)winehq.org |piotr(a)codeweavers.com -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=33254 Piotr Caban <piotr.caban(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |9c4be83a78c5a105d4e3305d997 | |7c213a4503a84 Status|UNCONFIRMED |RESOLVED Resolution| |FIXED --- Comment #1 from Piotr Caban <piotr.caban(a)gmail.com> 2013-03-27 16:00:24 CDT --- _set_output_format function is now implemented. Marking as fixed. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=33254 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #2 from Alexandre Julliard <julliard(a)winehq.org> 2013-03-29 13:33:07 CDT --- Closing bugs fixed in 1.5.27. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=33254 --- Comment #3 from Sebastian <sebastian.wolff(a)dynardo.at> 2013-04-05 06:35:20 CDT --- Thanks for fixing this! -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
wine-bugs@winehq.org