GNOME Bugzilla – Bug 680651
GtkLevelBar doesn't build on non-C99 compilers
Last modified: 2012-08-16 05:44:47 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?"
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!
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.
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.
Review of attachment 221233 [details] [review]: Looks good to me, thanks!
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 :/