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
authorJeff Walden <jwalden@mit.edu>
Fri, 08 Feb 2013 22:59:54 -0800
changeset 121429 0d1a3f041a8fcac54307c4f033a58eb4387d3d71
parent 121428 b27ce57600632a018de7a0d5432fa6bde555221b
child 121430 ddedb68b1cc6aef962c16ac9d9a1ae50909734d1
child 121437 08388ff940dfe3e9b8fe4d23818ab991e1617332
push id22728
push userjwalden@mit.edu
push dateSat, 09 Feb 2013 07:01:18 +0000
treeherdermozilla-inbound@0d1a3f041a8f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstypo
bugs723228
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
js/public/HashTable.h
js/public/Vector.h
js/src/ds/LifoAlloc.h
js/src/frontend/ParseMaps.cpp
js/src/frontend/ParseMaps.h
js/src/gc/Root.h
js/src/jsanalyze.h
js/src/yarr/CheckedArithmetic.h
mfbt/TypeTraits.h
xpcom/glue/nsTArray.h
--- a/js/public/HashTable.h
+++ b/js/public/HashTable.h
@@ -549,23 +549,23 @@ class HashMapEntry
 
 } // namespace js
 
 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
 
 namespace js {
 
 namespace detail {
 
@@ -1245,17 +1245,17 @@ class HashTable : private AllocPolicy
         // collision bits correctly on a subsequent pass or skipping the rehash
         // unless we are totally filled with tombstones: benchmark to find out
         // which approach is best.
     }
 
   public:
     void clear()
     {
-        if (mozilla::IsPod<Entry>::result) {
+        if (mozilla::IsPod<Entry>::value) {
             memset(table, 0, sizeof(*table) * capacity());
         } else {
             uint32_t tableCapacity = capacity();
             for (Entry *e = table, *end = table + tableCapacity; e < end; ++e)
                 e->clear();
         }
         removedCount = 0;
         entryCount = 0;
--- a/js/public/Vector.h
+++ b/js/public/Vector.h
@@ -180,17 +180,17 @@ struct VectorImpl<T, N, AP, true>
  */
 template <class T, size_t N, class AllocPolicy>
 class Vector : private AllocPolicy
 {
     // typedef typename tl::StaticAssert<!tl::IsPostBarrieredType<T>::result>::result _;
 
     /* 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>;
 
     bool calculateNewCapacity(size_t curLength, size_t lengthInc, size_t &newCap);
     bool growStorageBy(size_t lengthInc);
     bool growHeapStorageBy(size_t lengthInc);
     bool convertToHeapStorage(size_t lengthInc);
 
--- a/js/src/ds/LifoAlloc.h
+++ b/js/src/ds/LifoAlloc.h
@@ -273,17 +273,17 @@ class LifoAlloc
         return true;
     }
 
     template <typename T>
     T *newArray(size_t count) {
         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;
     }
 
     /*
      * Create an array with uninitialized elements of type |T|.
      * The caller is responsible for initialization.
      */
     template <typename T>
--- a/js/src/frontend/ParseMaps.cpp
+++ b/js/src/frontend/ParseMaps.cpp
@@ -22,19 +22,19 @@ ParseMapPool::checkInvariants()
      * allocated space for each of the map types.
      */
     JS_STATIC_ASSERT(sizeof(Definition *) == sizeof(jsatomid));
     JS_STATIC_ASSERT(sizeof(Definition *) == sizeof(DefinitionList));
     JS_STATIC_ASSERT(sizeof(AtomDefnMap::Entry) == sizeof(AtomIndexMap::Entry));
     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
 ParseMapPool::purgeAll()
 {
     for (void **it = all.begin(), **end = all.end(); it != end; ++it)
         js_delete<AtomMapT>(asAtomMap(*it));
 
--- a/js/src/frontend/ParseMaps.h
+++ b/js/src/frontend/ParseMaps.h
@@ -418,14 +418,14 @@ typedef AtomDefnListMap::Range  AtomDefn
 
 } /* namespace js */
 
 namespace mozilla {
 
 template <>
 struct IsPod<js::frontend::DefinitionList>
 {
-    static const bool result = true;
+    static const bool value = true;
 };
 
 } /* namespace mozilla */
 
 #endif
--- a/js/src/gc/Root.h
+++ b/js/src/gc/Root.h
@@ -202,17 +202,17 @@ class Handle : public js::HandleBase<T>
     Handle(Handle<S> handle,
            typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0)
     {
         ptr = reinterpret_cast<const T *>(handle.address());
     }
 
     /* 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);
     }
 
     Handle(MutableHandle<T> handle) {
         ptr = handle.address();
     }
 
     /*
--- a/js/src/jsanalyze.h
+++ b/js/src/jsanalyze.h
@@ -1288,17 +1288,17 @@ class CrossScriptSSA
 void PrintBytecode(JSContext *cx, HandleScript script, jsbytecode *pc);
 #endif
 
 } /* namespace analyze */
 } /* namespace js */
 
 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 */
 
 #endif // jsanalyze_h___
--- a/js/src/yarr/CheckedArithmetic.h
+++ b/js/src/yarr/CheckedArithmetic.h
@@ -155,17 +155,17 @@ template <typename Target, typename Sour
         if (sizeof(Target) <= sizeof(Source)) 
             return value <= static_cast<Source>(::std::numeric_limits<Target>::max());
         // Target is Wider than Source so we're guaranteed to fit any value in
         // unsigned Source
         return true;
     }
 };
 
-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; }
 };
 template <typename Target, typename Source> struct BoundsCheckElider<Target, Source, false> : public BoundsChecker<Target, Source> {
 };
 
 template <typename Target, typename Source> static inline bool isInBounds(Source value)
 {
--- a/mfbt/TypeTraits.h
+++ b/mfbt/TypeTraits.h
@@ -159,17 +159,17 @@ struct Conditional<false, A, B>
  *
  * Use this template to implement SFINAE-style (Substitution Failure Is not An
  * Error) requirements.  For example, you might use it to impose a restriction
  * on a template parameter:
  *
  *   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;
  *      ...
  *   };
  */
 template<bool B, typename T = void>
 struct EnableIf
 {};
 
@@ -187,67 +187,67 @@ struct EnableIf<true, T>
  * mozilla::IsSame<int, unsigned int>::value is false;
  * mozilla::IsSame<void, void>::value is true;
  * mozilla::IsSame<const int, int>::value is false;
  * mozilla::IsSame<struct S, struct S>::value is true.
  */
 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;
 };
 
 /*
  * Traits class for identifying POD types. Until C++0x, there is no automatic
  * way to detect PODs, so for the moment it is done manually.
  */
 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-
  * member type).
  *
  * mozilla::IsPointer<struct S*>::value is true;
  * mozilla::IsPointer<int**>::value is true;
  * mozilla::IsPointer<void (*)(void)>::value is true;
  * mozilla::IsPointer<int>::value is false;
  * mozilla::IsPointer<struct S>::value is false.
  */
 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 */
 
 #endif  /* mozilla_TypeTraits_h_ */
--- a/xpcom/glue/nsTArray.h
+++ b/xpcom/glue/nsTArray.h
@@ -1321,18 +1321,18 @@ protected:
 
   // This method invokes elem_type's copy-constructor on a range of elements.
   // @param start   The index of the first element to construct.
   // @param count   The number of elements to construct. 
   // @param values  The array of elements to copy. 
   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);
   }
 
   // This method sifts an item down to its proper place in a binary heap
   // @param index The index of the node to start sifting down from
   // @param comp  The Comparator used to sift down
   template<class Comparator>
   void SiftDown(index_type index, const Comparator& comp) {