Remove the unused #define _USE_MATH_DEFINES
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Dec 2015 20:47:50 +0000 (20:47 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Dec 2015 20:47:50 +0000 (20:47 +0000)
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194416 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp
Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp
Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp

index e3edc8a..70a21e3 100644 (file)
@@ -1,3 +1,17 @@
+2015-12-24  Simon Fraser  <simon.fraser@apple.com>
+
+        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  <beidson@apple.com>
 
         Modern IDB: Don't open any new connections until after version change transactions are completely handled.
index 60299ba..5bc1b45 100644 (file)
@@ -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"
 
index bfcea28..ef76b86 100644 (file)
@@ -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"
 
index e9e534c..5dc9f80 100644 (file)
@@ -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)
index ad1557b..3882ba0 100644 (file)
@@ -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)
index 6217e05..3e34e9e 100644 (file)
@@ -1,3 +1,15 @@
+2015-12-24  Simon Fraser  <simon.fraser@apple.com>
+
+        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  <youenn.fablet@crf.canon.fr>
 
         Python SCM should be able to retrieve untracked files - Generic changes
index 248fa33..2386143 100644 (file)
  * 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,13 +172,15 @@ TEST(WTF, MediaTime)
     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());