Title: [194416] trunk
Revision
194416
Author
[email protected]
Date
2015-12-24 12:47:50 -0800 (Thu, 24 Dec 2015)

Log Message

Remove the unused #define _USE_MATH_DEFINES
https://bugs.webkit.org/show_bug.cgi?id=152034

Reviewed by Tim Horton.

Source/WebCore:

_USE_MATH_DEFINES was added in r123968 but no longer does anything.

* platform/graphics/cg/GraphicsContextCG.cpp:
* platform/graphics/cg/PDFDocumentImage.cpp:
* rendering/mathml/RenderMathMLMenclose.cpp:
* rendering/mathml/RenderMathMLOperator.cpp:

Tools:

Update this test to use piDouble from MathExtras.h, and
std::numeric_limits<>.

* TestWebKitAPI/Tests/WTF/MediaTime.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (194415 => 194416)


--- trunk/Source/WebCore/ChangeLog	2015-12-24 10:42:53 UTC (rev 194415)
+++ trunk/Source/WebCore/ChangeLog	2015-12-24 20:47:50 UTC (rev 194416)
@@ -1,3 +1,17 @@
+2015-12-24  Simon Fraser  <[email protected]>
+
+        Remove the unused #define _USE_MATH_DEFINES
+        https://bugs.webkit.org/show_bug.cgi?id=152034
+
+        Reviewed by Tim Horton.
+        
+        _USE_MATH_DEFINES was added in r123968 but no longer does anything.
+
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        * platform/graphics/cg/PDFDocumentImage.cpp:
+        * rendering/mathml/RenderMathMLMenclose.cpp:
+        * rendering/mathml/RenderMathMLOperator.cpp:
+
 2015-12-23  Brady Eidson  <[email protected]>
 
         Modern IDB: Don't open any new connections until after version change transactions are completely handled.

Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (194415 => 194416)


--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp	2015-12-24 10:42:53 UTC (rev 194415)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp	2015-12-24 20:47:50 UTC (rev 194416)
@@ -24,7 +24,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#define _USE_MATH_DEFINES 1
 #include "config.h"
 #include "GraphicsContextCG.h"
 

Modified: trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp (194415 => 194416)


--- trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp	2015-12-24 10:42:53 UTC (rev 194415)
+++ trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp	2015-12-24 20:47:50 UTC (rev 194416)
@@ -23,7 +23,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#define _USE_MATH_DEFINES 1
 #include "config.h"
 #include "PDFDocumentImage.h"
 

Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp (194415 => 194416)


--- trunk/Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp	2015-12-24 10:42:53 UTC (rev 194415)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp	2015-12-24 20:47:50 UTC (rev 194416)
@@ -23,7 +23,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#define _USE_MATH_DEFINES 1
 #include "config.h"
 
 #if ENABLE(MATHML)

Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp (194415 => 194416)


--- trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp	2015-12-24 10:42:53 UTC (rev 194415)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp	2015-12-24 20:47:50 UTC (rev 194416)
@@ -25,7 +25,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#define _USE_MATH_DEFINES 1
 #include "config.h"
 
 #if ENABLE(MATHML)

Modified: trunk/Tools/ChangeLog (194415 => 194416)


--- trunk/Tools/ChangeLog	2015-12-24 10:42:53 UTC (rev 194415)
+++ trunk/Tools/ChangeLog	2015-12-24 20:47:50 UTC (rev 194416)
@@ -1,3 +1,15 @@
+2015-12-24  Simon Fraser  <[email protected]>
+
+        Remove the unused #define _USE_MATH_DEFINES
+        https://bugs.webkit.org/show_bug.cgi?id=152034
+
+        Reviewed by Tim Horton.
+        
+        Update this test to use piDouble from MathExtras.h, and
+        std::numeric_limits<>.
+
+        * TestWebKitAPI/Tests/WTF/MediaTime.cpp:
+
 2015-12-24  Youenn Fablet  <[email protected]>
 
         Python SCM should be able to retrieve untracked files - Generic changes

Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp (194415 => 194416)


--- trunk/Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp	2015-12-24 10:42:53 UTC (rev 194415)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp	2015-12-24 20:47:50 UTC (rev 194416)
@@ -26,9 +26,10 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#define _USE_MATH_DEFINES 1
 #include "config.h"
 
+#include <limits>
+#include <wtf/MathExtras.h>
 #include <wtf/MediaTime.h>
 
 using namespace std;
@@ -171,14 +172,16 @@
     EXPECT_EQ(MediaTime(3, 2).toDouble(), 1.5);
     EXPECT_EQ(MediaTime(1, 1 << 16).toFloat(), 1 / pow(2.0f, 16.0f));
     EXPECT_EQ(MediaTime(1, 1 << 30).toDouble(), 1 / pow(2.0, 30.0));
-    EXPECT_EQ(MediaTime::createWithDouble(M_PI, 1 << 30), MediaTime(3373259426U, 1 << 30));
-    EXPECT_EQ(MediaTime::createWithFloat(INFINITY), MediaTime::positiveInfiniteTime());
-    EXPECT_EQ(MediaTime::createWithFloat(-INFINITY), MediaTime::negativeInfiniteTime());
-    EXPECT_EQ(MediaTime::createWithFloat(NAN), MediaTime::invalidTime());
-    EXPECT_EQ(MediaTime::createWithDouble(INFINITY), MediaTime::positiveInfiniteTime());
-    EXPECT_EQ(MediaTime::createWithDouble(-INFINITY), MediaTime::negativeInfiniteTime());
-    EXPECT_EQ(MediaTime::createWithDouble(NAN), MediaTime::invalidTime());
+    EXPECT_EQ(MediaTime::createWithDouble(piDouble, 1 << 30), MediaTime(3373259426U, 1 << 30));
 
+    EXPECT_EQ(MediaTime::createWithFloat(std::numeric_limits<float>::infinity()), MediaTime::positiveInfiniteTime());
+    EXPECT_EQ(MediaTime::createWithFloat(-std::numeric_limits<float>::infinity()), MediaTime::negativeInfiniteTime());
+    EXPECT_EQ(MediaTime::createWithFloat(std::numeric_limits<float>::quiet_NaN()), MediaTime::invalidTime());
+
+    EXPECT_EQ(MediaTime::createWithDouble(std::numeric_limits<double>::infinity()), MediaTime::positiveInfiniteTime());
+    EXPECT_EQ(MediaTime::createWithDouble(-std::numeric_limits<double>::infinity()), MediaTime::negativeInfiniteTime());
+    EXPECT_EQ(MediaTime::createWithDouble(std::numeric_limits<double>::quiet_NaN()), MediaTime::invalidTime());
+
     // Floating Point Round Trip
     EXPECT_EQ(10.0123456789f, MediaTime::createWithFloat(10.0123456789f).toFloat());
     EXPECT_EQ(10.0123456789, MediaTime::createWithDouble(10.0123456789).toDouble());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to