Changeset 206031 in webkit


Ignore:
Timestamp:
Sep 16, 2016 10:46:51 AM (8 years ago)
Author:
andersca@apple.com
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:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r205995 r206031  
     12016-09-16  Anders Carlsson  <andersca@apple.com>
     2
     3        Fix isValidEnum to work with older versions of GCC
     4        https://bugs.webkit.org/show_bug.cgi?id=162065
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Use the ternary operator instead of a more complex function body.
     9
     10        * wtf/EnumTraits.h:
     11
    1122016-09-15  JF Bastien  <jfbastien@apple.com>
    213
  • trunk/Source/WTF/wtf/EnumTraits.h

    r204916 r206031  
    4040    static constexpr bool isValidEnum(T t)
    4141    {
    42         if (static_cast<T>(e) == t)
    43             return true;
    44 
    45         return EnumValueChecker<T, EnumValues<E, es...>>::isValidEnum(t);
     42        return (static_cast<T>(e) == t) ? true : EnumValueChecker<T, EnumValues<E, es...>>::isValidEnum(t);
    4643    }
    4744};
  • trunk/Tools/ChangeLog

    r206021 r206031  
     12016-09-16  Anders Carlsson  <andersca@apple.com>
     2
     3        Fix isValidEnum to work with older versions of GCC
     4        https://bugs.webkit.org/show_bug.cgi?id=162065
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Add EnumTraits.cpp to the CMake build.
     9
     10        * TestWebKitAPI/CMakeLists.txt:
     11
    1122016-09-16  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
    213
  • trunk/Tools/TestWebKitAPI/CMakeLists.txt

    r204864 r206031  
    4949    ${TESTWEBKITAPI_DIR}/Tests/WTF/DateMath.cpp
    5050    ${TESTWEBKITAPI_DIR}/Tests/WTF/Deque.cpp
     51    ${TESTWEBKITAPI_DIR}/Tests/WTF/EnumTraits.cpp
    5152    ${TESTWEBKITAPI_DIR}/Tests/WTF/HashCountedSet.cpp
    5253    ${TESTWEBKITAPI_DIR}/Tests/WTF/HashMap.cpp
Note: See TracChangeset for help on using the changeset viewer.