Ignore:
Timestamp:
Jan 8, 2008, 3:33:49 AM (17 years ago)
Author:
[email protected]
Message:

Turn testIsInteger assertions into compile-time asserts and move them into HashTraits.h where possible.

Reviewed by Maciej Stachowiak.

  • kjs/testkjs.cpp:
  • wtf/HashTraits.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/HashTraits.h

    r27334 r29293  
    2424#define WTF_HashTraits_h
    2525
     26#include "Assertions.h"
    2627#include "HashFunctions.h"
    2728#include <utility>
     
    4748    template<> struct IsInteger<unsigned long long> { static const bool value = true; };
    4849
     50    COMPILE_ASSERT(IsInteger<bool>::value, WTF_IsInteger_bool_true);
     51    COMPILE_ASSERT(IsInteger<char>::value, WTF_IsInteger_char_true);
     52    COMPILE_ASSERT(IsInteger<signed char>::value, WTF_IsInteger_signed_char_true);
     53    COMPILE_ASSERT(IsInteger<unsigned char>::value, WTF_IsInteger_unsigned_char_true);
     54    COMPILE_ASSERT(IsInteger<short>::value, WTF_IsInteger_short_true);
     55    COMPILE_ASSERT(IsInteger<unsigned short>::value, WTF_IsInteger_unsigned_short_true);
     56    COMPILE_ASSERT(IsInteger<int>::value, WTF_IsInteger_int_true);
     57    COMPILE_ASSERT(IsInteger<unsigned int>::value, WTF_IsInteger_unsigned_int_true);
     58    COMPILE_ASSERT(IsInteger<long>::value, WTF_IsInteger_long_true);
     59    COMPILE_ASSERT(IsInteger<unsigned long>::value, WTF_IsInteger_unsigned_long_true);
     60    COMPILE_ASSERT(IsInteger<long long>::value, WTF_IsInteger_long_long_true);
     61    COMPILE_ASSERT(IsInteger<unsigned long long>::value, WTF_IsInteger_unsigned_long_long_true);
     62
     63    COMPILE_ASSERT(!IsInteger<char*>::value, WTF_IsInteger_char_pointer_false);
     64    COMPILE_ASSERT(!IsInteger<const char* >::value, WTF_IsInteger_const_char_pointer_false);
     65    COMPILE_ASSERT(!IsInteger<volatile char* >::value, WTF_IsInteger_volatile_char_pointer__false);
     66    COMPILE_ASSERT(!IsInteger<double>::value, WTF_IsInteger_double_false);
     67    COMPILE_ASSERT(!IsInteger<float>::value, WTF_IsInteger_float_false);
     68
    4969    template<typename T> struct HashTraits;
    5070
Note: See TracChangeset for help on using the changeset viewer.