RESOLVED FIXED 30797
ENABLE_FILTERS compile fixes under Windows
https://bugs.webkit.org/show_bug.cgi?id=30797
Summary ENABLE_FILTERS compile fixes under Windows
Brent Fulgham
Reported 2009-10-26 16:47:44 PDT
Differences between the Microsoft and GNU compilers seems to require a few specific casts, as well as ensuring that the M_PI macro is defined in a few places. These changes are in keeping with the use of these macros and casts in other areas of WebKit.
Attachments
Small fixes to get a clean Windows build. (2.24 KB, patch)
2009-10-26 17:00 PDT, Brent Fulgham
mrowe: review-
Second rev. (3.26 KB, patch)
2009-10-26 17:44 PDT, Brent Fulgham
darin: review-
Revision 3 (3.78 KB, patch)
2009-10-26 17:59 PDT, Brent Fulgham
darin: review+
Brent Fulgham
Comment 1 2009-10-26 17:00:32 PDT
Created attachment 41915 [details] Small fixes to get a clean Windows build.
Mark Rowe (bdash)
Comment 2 2009-10-26 17:21:28 PDT
Comment on attachment 41915 [details] Small fixes to get a clean Windows build. Take a look at MathExtras.h for an alternative to defining M_PI in a bunch of places.
Darin Adler
Comment 3 2009-10-26 17:25:54 PDT
Comment on attachment 41915 [details] Small fixes to get a clean Windows build. > unsigned dx, int stride, int strideLine, int effectWidth, int effectHeight, bool alphaImage) > { > - int dxLeft = static_cast<int>(floor(dx / 2)); > + int dxLeft = static_cast<int>(floor(static_cast<float>(dx / 2))); And this should just be dx / 2, no call to floor. There's no need to call floor just to convert an unsigned to an integer. If you were calling floor, you'd cast to double, not float, because floor takes a double. The one that takes a float is named floorf.
Brent Fulgham
Comment 4 2009-10-26 17:44:12 PDT
Created attachment 41922 [details] Second rev. Revised patch to use MathExtras.h and specifically the piDouble constant. Also corrected the use of floor(dx/2) as suggested by Darin.
Darin Adler
Comment 5 2009-10-26 17:49:57 PDT
Comment on attachment 41922 [details] Second rev. > +#include "MathExtras.h" The way to include this is: #include <wtf/MathExtras.h> > - int dxLeft = static_cast<int>(floor(dx / 2)); > + int dxLeft = static_cast<int>(dx / 2); You also don't need the static_cast any more. Please fix the include and consider removing the static_cast. review-
Brent Fulgham
Comment 6 2009-10-26 17:59:06 PDT
Created attachment 41923 [details] Revision 3 * Correct includes of MathExtras. * Get rid of unnecessary static_cast.
Brent Fulgham
Comment 7 2009-10-26 18:13:45 PDT
Note You need to log in before you can comment on or make changes to this bug.