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 680651 - GtkLevelBar doesn't build on non-C99 compilers
GtkLevelBar doesn't build on non-C99 compilers
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.5.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-07-26 13:45 UTC by Cosimo Cecchi
Modified: 2012-08-16 05:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix build on non C99 compilers (1.07 KB, patch)
2012-07-27 08:19 UTC, Fan, Chun-wei
needs-work Details | Review
Fix compilation of gtk/gtklevelbar.c on non-C99 compilers (1.22 KB, patch)
2012-08-15 07:54 UTC, Fan, Chun-wei
accepted-commit_now Details | Review

Description Cosimo Cecchi 2012-07-26 13:45:42 UTC
From bug 667892 - 

"The commit 68acf78 (level-bar: introduce GtkLevelBar) broke the build on
non-C99 compilers due to the usage of round() and strtof().  One can include
the (gtk/)fallback-c89.c for the round() function, but there isn't currently a
fallback for strtof().  So, just wondering, whether one can use strtod() in
place of the strtof() call?"
Comment 1 Fan, Chun-wei 2012-07-27 08:19:41 UTC
Created attachment 219723 [details] [review]
Fix build on non C99 compilers

Hi,

This is the patch for gtk/gtklevelbar.c to include fallback-c89.c for round() and use strtod() instead of strtof().  I have checked the patch on Ubuntu and Windows to ensure that the GtkLevelBar test passes.

Or, perhaps I should do the patch with a wrapper to strtof()?

Thank you, with blessings!
Comment 2 Matthias Clasen 2012-07-27 08:52:52 UTC
Review of attachment 219723 [details] [review]:

This should use g_ascii_strtod instead, since we are not dealing with user input here, so we don't want locale-dependent parsing.
Comment 3 Fan, Chun-wei 2012-08-15 07:54:48 UTC
Created attachment 221233 [details] [review]
Fix compilation of gtk/gtklevelbar.c on non-C99 compilers

Yeah, I should have noticed about the g_ascii_strtod() function provided by GLib, which, so I updated the patch.

Thanks for the note, and sorry I did not get back to this earlier as somehow I did not receive notification of the review.

With blessings.
Comment 4 Cosimo Cecchi 2012-08-15 11:19:32 UTC
Review of attachment 221233 [details] [review]:

Looks good to me, thanks!
Comment 5 Fan, Chun-wei 2012-08-16 05:44:47 UTC
Hi,

I've committed the patch as 628892bc.

With blessings, thanks! :)

p.s. Somehow I still didn't receive notice of the review, but anyways :/