After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 424897 - Bad code generated for double constants by sfidl
Bad code generated for double constants by sfidl
Status: RESOLVED FIXED
Product: beast
Classification: Other
Component: general
SVN trunk
Other Linux
: Normal normal
: ---
Assigned To: Beast Maintainers
Beast Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-03-31 15:31 UTC by Stefan Westerfeld
Modified: 2007-07-02 12:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix for bad code generation (9.62 KB, patch)
2007-03-31 15:41 UTC, Stefan Westerfeld
none Details | Review
New, improved fix for bad code generatioon (10.07 KB, patch)
2007-04-10 15:27 UTC, Stefan Westerfeld
none Details | Review

Description Stefan Westerfeld 2007-03-31 15:31:38 UTC
For the following idl file:

record RealDivision {
  // computation result should be 3.14
  Sfi::Real pi = ("PI", "", 314.0 / 100.0, 3, 4, 0.1, ":readwrite");
};

sfidl generates code (namely 314 / 100) so that the default for pi will become 3, instead of 3.14. This needs to be fixed for porting the DavOrgan module to C++.
Comment 1 Stefan Westerfeld 2007-03-31 15:41:32 UTC
Created attachment 85613 [details] [review]
Fix for bad code generation

This adds a testcase and fixes the problem (by using %e instead of %g for formatting doubles). For details see the ChangeLog included in the patch.
Comment 2 Stefan Westerfeld 2007-04-04 13:53:52 UTC
Note: this patch is an improved version of the one discussed on the list in December:

http://mail.gnome.org/archives/beast/2006-December/msg00008.html
Comment 3 Stefan Westerfeld 2007-04-10 15:27:40 UTC
Created attachment 86112 [details] [review]
New, improved fix for bad code generatioon

Improved based on comments from IRC review by Tim Janik.
Comment 4 Tim Janik 2007-04-10 15:51:38 UTC
thanks the new patch looks good. and assuming it's tested (you added testcases after all, very good) it can go in.
except for the fact that we should use String (Birnet::String) instead of std::string in our code, so that still needs to be fixed.
Comment 5 Stefan Westerfeld 2007-04-16 11:45:45 UTC
I committed things now, so the sfidl bug is fixed in r4329 are in, and the std::string -> Birnet::String is fixed separately in r4331.