Rename the |static const bool result| member of IsSame, IsPod, and IsPointer to |value| to be consistent with every other type trait. I have no idea how I managed to consistently not notice this during review. Followup to bug 723228, r=typo

This commit is contained in:
Jeff Walden 2013-02-08 22:59:54 -08:00
Родитель d63192594a
Коммит 39b56d89e1
10 изменённых файлов: 41 добавлений и 41 удалений

Просмотреть файл

@ -554,13 +554,13 @@ namespace mozilla {
template <class T>
struct IsPod<js::detail::HashTableEntry<T> >
{
static const bool result = IsPod<T>::result;
static const bool value = IsPod<T>::value;
};
template <class K, class V>
struct IsPod<js::HashMapEntry<K, V> >
{
static const bool result = IsPod<K>::result && IsPod<V>::result;
static const bool value = IsPod<K>::value && IsPod<V>::value;
};
} // namespace mozilla
@ -1250,7 +1250,7 @@ class HashTable : private AllocPolicy
public:
void clear()
{
if (mozilla::IsPod<Entry>::result) {
if (mozilla::IsPod<Entry>::value) {
memset(table, 0, sizeof(*table) * capacity());
} else {
uint32_t tableCapacity = capacity();

Просмотреть файл

@ -185,7 +185,7 @@ class Vector : private AllocPolicy
/* utilities */
static const bool sElemIsPod = mozilla::IsPod<T>::result;
static const bool sElemIsPod = mozilla::IsPod<T>::value;
typedef VectorImpl<T, N, AllocPolicy, sElemIsPod> Impl;
friend struct VectorImpl<T, N, AllocPolicy, sElemIsPod>;

Просмотреть файл

@ -278,7 +278,7 @@ class LifoAlloc
void *mem = alloc(sizeof(T) * count);
if (!mem)
return NULL;
JS_STATIC_ASSERT(mozilla::IsPod<T>::result);
JS_STATIC_ASSERT(mozilla::IsPod<T>::value);
return (T *) mem;
}

Просмотреть файл

@ -27,9 +27,9 @@ ParseMapPool::checkInvariants()
JS_STATIC_ASSERT(sizeof(AtomDefnMap::Entry) == sizeof(AtomDefnListMap::Entry));
JS_STATIC_ASSERT(sizeof(AtomMapT::Entry) == sizeof(AtomDefnListMap::Entry));
/* Ensure that the HasTable::clear goes quickly via memset. */
JS_STATIC_ASSERT(mozilla::IsPod<AtomIndexMap::WordMap::Entry>::result);
JS_STATIC_ASSERT(mozilla::IsPod<AtomDefnListMap::WordMap::Entry>::result);
JS_STATIC_ASSERT(mozilla::IsPod<AtomDefnMap::WordMap::Entry>::result);
JS_STATIC_ASSERT(mozilla::IsPod<AtomIndexMap::WordMap::Entry>::value);
JS_STATIC_ASSERT(mozilla::IsPod<AtomDefnListMap::WordMap::Entry>::value);
JS_STATIC_ASSERT(mozilla::IsPod<AtomDefnMap::WordMap::Entry>::value);
}
void

Просмотреть файл

@ -423,7 +423,7 @@ namespace mozilla {
template <>
struct IsPod<js::frontend::DefinitionList>
{
static const bool result = true;
static const bool value = true;
};
} /* namespace mozilla */

Просмотреть файл

@ -207,7 +207,7 @@ class Handle : public js::HandleBase<T>
/* Create a handle for a NULL pointer. */
Handle(NullPtr) {
typedef typename js::tl::StaticAssert<mozilla::IsPointer<T>::result>::result _;
typedef typename js::tl::StaticAssert<mozilla::IsPointer<T>::value>::result _;
ptr = reinterpret_cast<const T *>(&NullPtr::constNullValue);
}

Просмотреть файл

@ -1293,11 +1293,11 @@ void PrintBytecode(JSContext *cx, HandleScript script, jsbytecode *pc);
namespace mozilla {
template <> struct IsPod<js::analyze::LifetimeVariable> { static const bool result = true; };
template <> struct IsPod<js::analyze::LoopAnalysis> { static const bool result = true; };
template <> struct IsPod<js::analyze::SlotValue> { static const bool result = true; };
template <> struct IsPod<js::analyze::SSAValue> { static const bool result = true; };
template <> struct IsPod<js::analyze::SSAUseChain> { static const bool result = true; };
template <> struct IsPod<js::analyze::LifetimeVariable> { static const bool value = true; };
template <> struct IsPod<js::analyze::LoopAnalysis> { static const bool value = true; };
template <> struct IsPod<js::analyze::SlotValue> { static const bool value = true; };
template <> struct IsPod<js::analyze::SSAValue> { static const bool value = true; };
template <> struct IsPod<js::analyze::SSAUseChain> { static const bool value = true; };
} /* namespace mozilla */

Просмотреть файл

@ -160,7 +160,7 @@ template <typename Target, typename Source> struct BoundsChecker<Target, Source,
}
};
template <typename Target, typename Source, bool SameType = mozilla::IsSame<Target, Source>::result> struct BoundsCheckElider;
template <typename Target, typename Source, bool SameType = mozilla::IsSame<Target, Source>::value> struct BoundsCheckElider;
template <typename Target, typename Source> struct BoundsCheckElider<Target, Source, true> {
static bool inBounds(Source) { return true; }
};

Просмотреть файл

@ -164,7 +164,7 @@ struct Conditional<false, A, B>
* template<typename T>
* class PodVector // vector optimized to store POD (memcpy-able) types
* {
* EnableIf<IsPodType<T>, T>::Type* vector;
* EnableIf<IsPod<T>, T>::Type* vector;
* size_t length;
* ...
* };
@ -192,13 +192,13 @@ struct EnableIf<true, T>
template<typename T, typename U>
struct IsSame
{
static const bool result = false;
static const bool value = false;
};
template<typename T>
struct IsSame<T,T>
struct IsSame<T, T>
{
static const bool result = true;
static const bool value = true;
};
/*
@ -208,24 +208,24 @@ struct IsSame<T,T>
template<typename T>
struct IsPod
{
static const bool result = false;
static const bool value = false;
};
template<> struct IsPod<char> { static const bool result = true; };
template<> struct IsPod<signed char> { static const bool result = true; };
template<> struct IsPod<unsigned char> { static const bool result = true; };
template<> struct IsPod<short> { static const bool result = true; };
template<> struct IsPod<unsigned short> { static const bool result = true; };
template<> struct IsPod<int> { static const bool result = true; };
template<> struct IsPod<unsigned int> { static const bool result = true; };
template<> struct IsPod<long> { static const bool result = true; };
template<> struct IsPod<unsigned long> { static const bool result = true; };
template<> struct IsPod<long long> { static const bool result = true; };
template<> struct IsPod<unsigned long long> { static const bool result = true; };
template<> struct IsPod<bool> { static const bool result = true; };
template<> struct IsPod<float> { static const bool result = true; };
template<> struct IsPod<double> { static const bool result = true; };
template<> struct IsPod<wchar_t> { static const bool result = true; };
template<typename T> struct IsPod<T*> { static const bool result = true; };
template<> struct IsPod<char> { static const bool value = true; };
template<> struct IsPod<signed char> { static const bool value = true; };
template<> struct IsPod<unsigned char> { static const bool value = true; };
template<> struct IsPod<short> { static const bool value = true; };
template<> struct IsPod<unsigned short> { static const bool value = true; };
template<> struct IsPod<int> { static const bool value = true; };
template<> struct IsPod<unsigned int> { static const bool value = true; };
template<> struct IsPod<long> { static const bool value = true; };
template<> struct IsPod<unsigned long> { static const bool value = true; };
template<> struct IsPod<long long> { static const bool value = true; };
template<> struct IsPod<unsigned long long> { static const bool value = true; };
template<> struct IsPod<bool> { static const bool value = true; };
template<> struct IsPod<float> { static const bool value = true; };
template<> struct IsPod<double> { static const bool value = true; };
template<> struct IsPod<wchar_t> { static const bool value = true; };
template<typename T> struct IsPod<T*> { static const bool value = true; };
/**
* IsPointer determines whether a type is a pointer type (but not a pointer-to-
@ -240,12 +240,12 @@ template<typename T> struct IsPod<T*> { static const bool result = true; }
template<typename T>
struct IsPointer
{
static const bool result = false;
static const bool value = false;
};
template<typename T>
struct IsPointer<T*>
{
static const bool result = true;
static const bool value = true;
};
} /* namespace mozilla */

Просмотреть файл

@ -1326,8 +1326,8 @@ protected:
template<class Item>
void AssignRange(index_type start, size_type count,
const Item *values) {
AssignRangeAlgorithm<mozilla::IsPod<Item>::result,
mozilla::IsSame<Item, elem_type>::result>
AssignRangeAlgorithm<mozilla::IsPod<Item>::value,
mozilla::IsSame<Item, elem_type>::value>
::implementation(Elements(), start, count, values);
}