Title: [206031] trunk
Revision
206031
Author
ander...@apple.com
Date
2016-09-16 10:46:51 -0700 (Fri, 16 Sep 2016)

Log Message

Fix isValidEnum to work with older versions of GCC
https://bugs.webkit.org/show_bug.cgi?id=162065

Reviewed by Michael Catanzaro.

Source/WTF:

Use the ternary operator instead of a more complex function body.

* wtf/EnumTraits.h:

Tools:

Add EnumTraits.cpp to the CMake build.

* TestWebKitAPI/CMakeLists.txt:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (206030 => 206031)


--- trunk/Source/WTF/ChangeLog	2016-09-16 17:35:32 UTC (rev 206030)
+++ trunk/Source/WTF/ChangeLog	2016-09-16 17:46:51 UTC (rev 206031)
@@ -1,3 +1,14 @@
+2016-09-16  Anders Carlsson  <ander...@apple.com>
+
+        Fix isValidEnum to work with older versions of GCC
+        https://bugs.webkit.org/show_bug.cgi?id=162065
+
+        Reviewed by Michael Catanzaro.
+
+        Use the ternary operator instead of a more complex function body.
+
+        * wtf/EnumTraits.h:
+
 2016-09-15  JF Bastien  <jfbast...@apple.com>
 
         TextBreakIterator: unconvolute character break cache

Modified: trunk/Source/WTF/wtf/EnumTraits.h (206030 => 206031)


--- trunk/Source/WTF/wtf/EnumTraits.h	2016-09-16 17:35:32 UTC (rev 206030)
+++ trunk/Source/WTF/wtf/EnumTraits.h	2016-09-16 17:46:51 UTC (rev 206031)
@@ -39,10 +39,7 @@
 struct EnumValueChecker<T, EnumValues<E, e, es...>> {
     static constexpr bool isValidEnum(T t)
     {
-        if (static_cast<T>(e) == t)
-            return true;
-
-        return EnumValueChecker<T, EnumValues<E, es...>>::isValidEnum(t);
+        return (static_cast<T>(e) == t) ? true : EnumValueChecker<T, EnumValues<E, es...>>::isValidEnum(t);
     }
 };
 

Modified: trunk/Tools/ChangeLog (206030 => 206031)


--- trunk/Tools/ChangeLog	2016-09-16 17:35:32 UTC (rev 206030)
+++ trunk/Tools/ChangeLog	2016-09-16 17:46:51 UTC (rev 206031)
@@ -1,3 +1,14 @@
+2016-09-16  Anders Carlsson  <ander...@apple.com>
+
+        Fix isValidEnum to work with older versions of GCC
+        https://bugs.webkit.org/show_bug.cgi?id=162065
+
+        Reviewed by Michael Catanzaro.
+
+        Add EnumTraits.cpp to the CMake build.
+
+        * TestWebKitAPI/CMakeLists.txt:
+
 2016-09-16  Nael Ouedraogo  <nael.ouedra...@crf.canon.fr>
 
         Unreviewed: Change my primary address for auto-complete in bugzilla.

Modified: trunk/Tools/TestWebKitAPI/CMakeLists.txt (206030 => 206031)


--- trunk/Tools/TestWebKitAPI/CMakeLists.txt	2016-09-16 17:35:32 UTC (rev 206030)
+++ trunk/Tools/TestWebKitAPI/CMakeLists.txt	2016-09-16 17:46:51 UTC (rev 206031)
@@ -48,6 +48,7 @@
     ${TESTWEBKITAPI_DIR}/Tests/WTF/Condition.cpp
     ${TESTWEBKITAPI_DIR}/Tests/WTF/DateMath.cpp
     ${TESTWEBKITAPI_DIR}/Tests/WTF/Deque.cpp
+    ${TESTWEBKITAPI_DIR}/Tests/WTF/EnumTraits.cpp
     ${TESTWEBKITAPI_DIR}/Tests/WTF/HashCountedSet.cpp
     ${TESTWEBKITAPI_DIR}/Tests/WTF/HashMap.cpp
     ${TESTWEBKITAPI_DIR}/Tests/WTF/HashSet.cpp
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to