Use unsigned for HashSet size.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Mar 2015 21:54:21 +0000 (21:54 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Mar 2015 21:54:21 +0000 (21:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=142518

Patch by Alex Christensen <achristensen@webkit.org> on 2015-03-10
Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

* dfg/DFGAvailabilityMap.cpp:
(JSC::DFG::AvailabilityMap::prune):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* heap/MarkedBlockSet.h:
(JSC::MarkedBlockSet::remove):
* runtime/WeakMapData.h:

Source/WebCore:

* Modules/websockets/WebSocketDeflateFramer.cpp:
(WebCore::WebSocketExtensionDeflateFrame::processResponse):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::checkForDuplicate):
(WebCore::CloneSerializer::writeConstantPoolIndex):
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::~ScriptRunner):
* loader/ResourceLoadScheduler.h:
* platform/graphics/Font.cpp:
(WebCore::Font::systemFallbackFontForCharacter):
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::purgeInactiveFontDataIfNeeded):
(WebCore::FontCache::purgeInactiveFontData):
* platform/graphics/FontCache.h:
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::FontCache::systemFallbackForCharacters):
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::FontCache::getSystemFontFallbackForCharacters):
(WebCore::FontCache::systemFallbackForCharacters):
(WebCore::FontCache::similarFont):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::shouldAutoActivateFontIfNeeded):
(WebCore::FontCache::systemFallbackForCharacters):
(WebCore::FontCache::similarFont):
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::systemFallbackForCharacters):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::FlexBoxIterator::next):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::computeOverflowFromCells):

Source/WTF:

* wtf/HashCountedSet.h:
(WTF::Traits>::size):
(WTF::Traits>::capacity):
* wtf/HashMap.h:
(WTF::X>::size):
(WTF::X>::capacity):
* wtf/HashSet.h:
(WTF::V>::size):
(WTF::V>::capacity):
* wtf/HashTable.h:
(WTF::HashTable::Stats::recordCollisionAtCount):
(WTF::HashTable::Stats::dumpStats):
(WTF::HashTable::size):
(WTF::HashTable::capacity):
(WTF::KeyTraits>::deallocateTable):
(WTF::KeyTraits>::checkTableConsistencyExceptSize):
* wtf/HashTraits.h:
* wtf/ListHashSet.h:
(WTF::U>::size):
(WTF::U>::capacity):

Tools:

* TestWebKitAPI/Tests/WTF/HashMap.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/HashSet.cpp:
(TestWebKitAPI::testInitialCapacity):
* TestWebKitAPI/Tests/WTF/ListHashSet.cpp:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181348 268f45cc-cd09-0410-ab3c-d52691b4dbfc

30 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGAvailabilityMap.cpp
Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp
Source/JavaScriptCore/heap/MarkedBlockSet.h
Source/JavaScriptCore/runtime/WeakMapData.h
Source/WTF/ChangeLog
Source/WTF/wtf/HashCountedSet.h
Source/WTF/wtf/HashMap.h
Source/WTF/wtf/HashSet.h
Source/WTF/wtf/HashTable.h
Source/WTF/wtf/HashTraits.h
Source/WTF/wtf/ListHashSet.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/websockets/WebSocketDeflateFramer.cpp
Source/WebCore/bindings/js/SerializedScriptValue.cpp
Source/WebCore/dom/ScriptRunner.cpp
Source/WebCore/loader/ResourceLoadScheduler.h
Source/WebCore/platform/graphics/Font.cpp
Source/WebCore/platform/graphics/FontCache.cpp
Source/WebCore/platform/graphics/FontCache.h
Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp
Source/WebCore/platform/graphics/ios/FontCacheIOS.mm
Source/WebCore/platform/graphics/mac/FontCacheMac.mm
Source/WebCore/platform/graphics/win/FontCacheWin.cpp
Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
Source/WebCore/rendering/RenderTableSection.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp
Tools/TestWebKitAPI/Tests/WTF/HashSet.cpp
Tools/TestWebKitAPI/Tests/WTF/ListHashSet.cpp

index d3d8248c63501c5732a36921f78e3cc561aadbd9..28e4618c6e2ae0618e9e657a83780c4118545995 100644 (file)
@@ -1,3 +1,18 @@
+2015-03-10  Alex Christensen  <achristensen@webkit.org>
+
+        Use unsigned for HashSet size.
+        https://bugs.webkit.org/show_bug.cgi?id=142518
+
+        Reviewed by Benjamin Poulain.
+
+        * dfg/DFGAvailabilityMap.cpp:
+        (JSC::DFG::AvailabilityMap::prune):
+        * ftl/FTLOSRExitCompiler.cpp:
+        (JSC::FTL::compileStub):
+        * heap/MarkedBlockSet.h:
+        (JSC::MarkedBlockSet::remove):
+        * runtime/WeakMapData.h:
+
 2015-03-10  Mark Lam  <mark.lam@apple.com>
 
         Use std::numeric_limits<unsigned>::max() instead of (unsigned)-1.
index ce08e0a3d66a06dd0b792c0aa9492f1e0df942e0..655f1783652860fabb5d6eda5e661aa7ea58e53e 100644 (file)
@@ -45,7 +45,7 @@ void AvailabilityMap::prune()
             possibleNodes.add(m_locals[i].node());
     }
 
-    int oldPossibleNodesSize;
+    unsigned oldPossibleNodesSize;
     do {
         oldPossibleNodesSize = possibleNodes.size();
         for (auto pair : m_heap) {
index c387bf95ef7ecbf768780a8bda917ccf5d450127..597ab9725f7db20ed934078cb7daf8880ca7b48d 100644 (file)
@@ -236,7 +236,7 @@ static void compileStub(
         toMaterialize.add(materialization);
     
     while (!toMaterialize.isEmpty()) {
-        int previousToMaterializeSize = toMaterialize.size();
+        unsigned previousToMaterializeSize = toMaterialize.size();
         
         Vector<ExitTimeObjectMaterialization*> worklist;
         worklist.appendRange(toMaterialize.begin(), toMaterialize.end());
index 022a173899570888760e03b79138201b27e769a0..9cf19088ccd25e7bd12e18dcc2b94e32cda22db2 100644 (file)
@@ -57,7 +57,7 @@ inline void MarkedBlockSet::add(MarkedBlock* block)
 
 inline void MarkedBlockSet::remove(MarkedBlock* block)
 {
-    int oldCapacity = m_set.capacity();
+    unsigned oldCapacity = m_set.capacity();
     m_set.remove(block);
     if (m_set.capacity() != oldCapacity) // Indicates we've removed a lot of blocks.
         recomputeFilter();
index 45336c2a59de6a9129f8e150eabc781911394978..d1c91f286e224344f45df774d688180bfcd8d680 100644 (file)
@@ -84,7 +84,7 @@ private:
     private:
         virtual void visitWeakReferences(SlotVisitor&) override;
         virtual void finalizeUnconditionally() override;
-        int m_liveKeyCount;
+        unsigned m_liveKeyCount;
         WeakMapData* m_target;
     };
     DeadKeyCleaner m_deadKeyCleaner;
index 5ab30f2df1b35b79bb63214601157b94e71728c0..dae7205bbbddd6cca1d102fa2943c2df1aafdcfa 100644 (file)
@@ -1,3 +1,31 @@
+2015-03-10  Alex Christensen  <achristensen@webkit.org>
+
+        Use unsigned for HashSet size.
+        https://bugs.webkit.org/show_bug.cgi?id=142518
+
+        Reviewed by Benjamin Poulain.
+
+        * wtf/HashCountedSet.h:
+        (WTF::Traits>::size):
+        (WTF::Traits>::capacity):
+        * wtf/HashMap.h:
+        (WTF::X>::size):
+        (WTF::X>::capacity):
+        * wtf/HashSet.h:
+        (WTF::V>::size):
+        (WTF::V>::capacity):
+        * wtf/HashTable.h:
+        (WTF::HashTable::Stats::recordCollisionAtCount):
+        (WTF::HashTable::Stats::dumpStats):
+        (WTF::HashTable::size):
+        (WTF::HashTable::capacity):
+        (WTF::KeyTraits>::deallocateTable):
+        (WTF::KeyTraits>::checkTableConsistencyExceptSize):
+        * wtf/HashTraits.h:
+        * wtf/ListHashSet.h:
+        (WTF::U>::size):
+        (WTF::U>::capacity):
+
 2015-03-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
 
         Remove PassRefPtr from svg/properties classes.
index 601b1e115df19950fe76f9613cd368675faebe34..01a7b1dbc80674e476aa37e1356111e594f466b0 100644 (file)
@@ -40,8 +40,8 @@ namespace WTF {
         
         void swap(HashCountedSet&);
         
-        int size() const;
-        int capacity() const;
+        unsigned size() const;
+        unsigned capacity() const;
         bool isEmpty() const;
         
         // Iterators iterate over pairs of values and counts.
@@ -84,13 +84,13 @@ namespace WTF {
     }
     
     template<typename Value, typename HashFunctions, typename Traits>
-    inline int HashCountedSet<Value, HashFunctions, Traits>::size() const
+    inline unsigned HashCountedSet<Value, HashFunctions, Traits>::size() const
     {
         return m_impl.size(); 
     }
     
     template<typename Value, typename HashFunctions, typename Traits>
-    inline int HashCountedSet<Value, HashFunctions, Traits>::capacity() const
+    inline unsigned HashCountedSet<Value, HashFunctions, Traits>::capacity() const
     {
         return m_impl.capacity(); 
     }
index e02e415434db529ee230bb80eacaebf9a70fb9c0..02359282c6b63096fa80f7ee23689cedef35b9f5 100644 (file)
@@ -81,8 +81,8 @@ public:
 
     void swap(HashMap&);
 
-    int size() const;
-    int capacity() const;
+    unsigned size() const;
+    unsigned capacity() const;
     bool isEmpty() const;
 
     // iterators iterate over pairs of keys and values
@@ -195,13 +195,13 @@ inline void HashMap<T, U, V, W, X>::swap(HashMap& other)
 }
 
 template<typename T, typename U, typename V, typename W, typename X>
-inline int HashMap<T, U, V, W, X>::size() const
+inline unsigned HashMap<T, U, V, W, X>::size() const
 {
     return m_impl.size(); 
 }
 
 template<typename T, typename U, typename V, typename W, typename X>
-inline int HashMap<T, U, V, W, X>::capacity() const
+inline unsigned HashMap<T, U, V, W, X>::capacity() const
 { 
     return m_impl.capacity(); 
 }
index 830a08c37cd0f4c064a3a9b0f1b5aacca830ad12..6b0c9271a5753021d4c4ff47a631e70d6983c116 100644 (file)
@@ -63,8 +63,8 @@ namespace WTF {
 
         void swap(HashSet&);
 
-        int size() const;
-        int capacity() const;
+        unsigned size() const;
+        unsigned capacity() const;
         bool isEmpty() const;
 
         iterator begin() const;
@@ -149,13 +149,13 @@ namespace WTF {
     }
 
     template<typename T, typename U, typename V>
-    inline int HashSet<T, U, V>::size() const
+    inline unsigned HashSet<T, U, V>::size() const
     {
         return m_impl.size(); 
     }
 
     template<typename T, typename U, typename V>
-    inline int HashSet<T, U, V>::capacity() const
+    inline unsigned HashSet<T, U, V>::capacity() const
     {
         return m_impl.capacity(); 
     }
index 2c0811e54b6836b44957dca576e19073f38b2bca..8e28b24197075c3a8acbe98d1e31f3ca9499358d 100644 (file)
@@ -313,16 +313,16 @@ namespace WTF {
             {
             }
 
-            int numAccesses;
-            int numRehashes;
-            int numRemoves;
-            int numReinserts;
+            unsigned numAccesses;
+            unsigned numRehashes;
+            unsigned numRemoves;
+            unsigned numReinserts;
 
-            int maxCollisions;
-            int numCollisions;
-            int collisionGraph[4096];
+            unsigned maxCollisions;
+            unsigned numCollisions;
+            unsigned collisionGraph[4096];
 
-            void recordCollisionAtCount(int count)
+            void recordCollisionAtCount(unsigned count)
             {
                 if (count > maxCollisions)
                     maxCollisions = count;
@@ -336,7 +336,7 @@ namespace WTF {
                 dataLogF("%d accesses\n", numAccesses);
                 dataLogF("%d total collisions, average %.2f probes per access\n", numCollisions, 1.0 * (numAccesses + numCollisions) / numAccesses);
                 dataLogF("longest collision chain: %d\n", maxCollisions);
-                for (int i = 1; i <= maxCollisions; i++) {
+                for (unsigned i = 1; i <= maxCollisions; i++) {
                     dataLogF("  %d lookups with exactly %d collisions (%.2f%% , %.2f%% with this many or more)\n", collisionGraph[i], i, 100.0 * (collisionGraph[i] - collisionGraph[i+1]) / numAccesses, 100.0 * collisionGraph[i] / numAccesses);
                 }
                 dataLogF("%d rehashes\n", numRehashes);
@@ -371,8 +371,8 @@ namespace WTF {
         const_iterator begin() const { return isEmpty() ? end() : makeConstIterator(m_table); }
         const_iterator end() const { return makeKnownGoodConstIterator(m_table + m_tableSize); }
 
-        int size() const { return m_keyCount; }
-        int capacity() const { return m_tableSize; }
+        unsigned size() const { return m_keyCount; }
+        unsigned capacity() const { return m_tableSize; }
         bool isEmpty() const { return !m_keyCount; }
 
         AddResult add(const ValueType& value) { return add<IdentityTranslatorType>(Extractor::extract(value), value); }
@@ -421,8 +421,8 @@ namespace WTF {
 #endif
 
     private:
-        static ValueType* allocateTable(int size);
-        static void deallocateTable(ValueType* table, int size);
+        static ValueType* allocateTable(unsigned size);
+        static void deallocateTable(ValueType* table, unsigned size);
 
         typedef std::pair<ValueType*, bool> LookupType;
         typedef std::pair<LookupType, unsigned> FullLookupType;
@@ -443,7 +443,7 @@ namespace WTF {
         ValueType* expand(ValueType* entry = nullptr);
         void shrink() { rehash(m_tableSize / 2, nullptr); }
 
-        ValueType* rehash(int newTableSize, ValueType* entry);
+        ValueType* rehash(unsigned newTableSize, ValueType* entry);
         ValueType* reinsert(ValueType&&);
 
         static void initializeBucket(ValueType& bucket);
@@ -469,14 +469,14 @@ namespace WTF {
         static void invalidateIterators() { }
 #endif
 
-        static const int m_maxLoad = 2;
-        static const int m_minLoad = 6;
+        static const unsigned m_maxLoad = 2;
+        static const unsigned m_minLoad = 6;
 
         ValueType* m_table;
-        int m_tableSize;
-        int m_tableSizeMask;
-        int m_keyCount;
-        int m_deletedCount;
+        unsigned m_tableSize;
+        unsigned m_tableSizeMask;
+        unsigned m_keyCount;
+        unsigned m_deletedCount;
 
 #if CHECK_HASHTABLE_ITERATORS
     public:
@@ -526,7 +526,7 @@ namespace WTF {
     struct HashTableCapacityForSize {
         static const unsigned value = HashTableCapacityForSizeSplitter<size, !(size & (size - 1))>::value;
         COMPILE_ASSERT(size > 0, HashTableNonZeroMinimumCapacity);
-        COMPILE_ASSERT(!static_cast<int>(value >> 31), HashTableNoCapacityOverflow);
+        COMPILE_ASSERT(!static_cast<unsigned>(value >> 31), HashTableNoCapacityOverflow);
         COMPILE_ASSERT(value > (2 * size), HashTableCapacityHoldsContentSize);
     };
 
@@ -589,11 +589,11 @@ namespace WTF {
     {
         checkKey<HashTranslator>(key);
 
-        int k = 0;
-        int sizeMask = m_tableSizeMask;
+        unsigned k = 0;
+        unsigned sizeMask = m_tableSizeMask;
         ValueType* table = m_table;
         unsigned h = HashTranslator::hash(key);
-        int i = h & sizeMask;
+        unsigned i = h & sizeMask;
 
         if (!table)
             return 0;
@@ -646,15 +646,15 @@ namespace WTF {
         ASSERT(m_table);
         checkKey<HashTranslator>(key);
 
-        int k = 0;
+        unsigned k = 0;
         ValueType* table = m_table;
-        int sizeMask = m_tableSizeMask;
+        unsigned sizeMask = m_tableSizeMask;
         unsigned h = HashTranslator::hash(key);
-        int i = h & sizeMask;
+        unsigned i = h & sizeMask;
 
 #if DUMP_HASHTABLE_STATS
         ++HashTableStats::numAccesses;
-        int probeCount = 0;
+        unsigned probeCount = 0;
 #endif
 
 #if DUMP_HASHTABLE_STATS_PER_TABLE
@@ -707,11 +707,11 @@ namespace WTF {
         ASSERT(m_table);
         checkKey<HashTranslator>(key);
 
-        int k = 0;
+        unsigned k = 0;
         ValueType* table = m_table;
-        int sizeMask = m_tableSizeMask;
+        unsigned sizeMask = m_tableSizeMask;
         unsigned h = HashTranslator::hash(key);
-        int i = h & sizeMask;
+        unsigned i = h & sizeMask;
 
 #if DUMP_HASHTABLE_STATS
         ++HashTableStats::numAccesses;
@@ -801,11 +801,11 @@ namespace WTF {
 
         ASSERT(m_table);
 
-        int k = 0;
+        unsigned k = 0;
         ValueType* table = m_table;
-        int sizeMask = m_tableSizeMask;
+        unsigned sizeMask = m_tableSizeMask;
         unsigned h = HashTranslator::hash(key);
-        int i = h & sizeMask;
+        unsigned i = h & sizeMask;
 
 #if DUMP_HASHTABLE_STATS
         ++HashTableStats::numAccesses;
@@ -1058,22 +1058,22 @@ namespace WTF {
     }
 
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
-    auto HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::allocateTable(int size) -> ValueType*
+    auto HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::allocateTable(unsigned size) -> ValueType*
     {
         // would use a template member function with explicit specializations here, but
         // gcc doesn't appear to support that
         if (Traits::emptyValueIsZero)
             return static_cast<ValueType*>(fastZeroedMalloc(size * sizeof(ValueType)));
         ValueType* result = static_cast<ValueType*>(fastMalloc(size * sizeof(ValueType)));
-        for (int i = 0; i < size; i++)
+        for (unsigned i = 0; i < size; i++)
             initializeBucket(result[i]);
         return result;
     }
 
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
-    void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::deallocateTable(ValueType* table, int size)
+    void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::deallocateTable(ValueType* table, unsigned size)
     {
-        for (int i = 0; i < size; ++i) {
+        for (unsigned i = 0; i < size; ++i) {
             if (!isDeletedBucket(table[i]))
                 table[i].~ValueType();
         }
@@ -1083,7 +1083,7 @@ namespace WTF {
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
     auto HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::expand(ValueType* entry) -> ValueType*
     {
-        int newSize;
+        unsigned newSize;
         if (m_tableSize == 0)
             newSize = KeyTraits::minimumTableSize;
         else if (mustRehashInPlace())
@@ -1095,11 +1095,11 @@ namespace WTF {
     }
 
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
-    auto HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::rehash(int newTableSize, ValueType* entry) -> ValueType*
+    auto HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::rehash(unsigned newTableSize, ValueType* entry) -> ValueType*
     {
         internalCheckTableConsistencyExceptSize();
 
-        int oldTableSize = m_tableSize;
+        unsigned oldTableSize = m_tableSize;
         ValueType* oldTable = m_table;
 
 #if DUMP_HASHTABLE_STATS
@@ -1117,7 +1117,7 @@ namespace WTF {
         m_table = allocateTable(newTableSize);
 
         Value* newEntry = nullptr;
-        for (int i = 0; i != oldTableSize; ++i) {
+        for (unsigned i = 0; i != oldTableSize; ++i) {
             if (isEmptyOrDeletedBucket(oldTable[i])) {
                 ASSERT(&oldTable[i] != entry);
                 continue;
@@ -1254,9 +1254,9 @@ namespace WTF {
         if (!m_table)
             return;
 
-        int count = 0;
-        int deletedCount = 0;
-        for (int j = 0; j < m_tableSize; ++j) {
+        unsigned count = 0;
+        unsigned deletedCount = 0;
+        for (unsigned j = 0; j < m_tableSize; ++j) {
             ValueType* entry = m_table + j;
             if (isEmptyBucket(*entry))
                 continue;
index e5feca95fdf3aff9a5039940fa324de70348dc1d..c9321ebd5666bb187cb83cf8bc12628ec98b2641 100644 (file)
@@ -48,7 +48,7 @@ template<typename T> struct GenericHashTraitsBase<false, T> {
 
     // The starting table size. Can be overridden when we know beforehand that
     // a hash table will have at least N entries.
-    static const int minimumTableSize = 8;
+    static const unsigned minimumTableSize = 8;
 };
 
 // Default integer traits disallow both 0 and -1 as keys (max value instead of -1 for unsigned).
@@ -167,7 +167,7 @@ struct PairHashTraits : GenericHashTraits<std::pair<typename FirstTraitsArg::Tra
     static const bool emptyValueIsZero = FirstTraits::emptyValueIsZero && SecondTraits::emptyValueIsZero;
     static EmptyValueType emptyValue() { return std::make_pair(FirstTraits::emptyValue(), SecondTraits::emptyValue()); }
 
-    static const int minimumTableSize = FirstTraits::minimumTableSize;
+    static const unsigned minimumTableSize = FirstTraits::minimumTableSize;
 
     static void constructDeletedValue(TraitType& slot) { FirstTraits::constructDeletedValue(slot.first); }
     static bool isDeletedValue(const TraitType& value) { return FirstTraits::isDeletedValue(value.first); }
@@ -212,7 +212,7 @@ struct KeyValuePairHashTraits : GenericHashTraits<KeyValuePair<typename KeyTrait
     static const bool emptyValueIsZero = KeyTraits::emptyValueIsZero && ValueTraits::emptyValueIsZero;
     static EmptyValueType emptyValue() { return KeyValuePair<typename KeyTraits::EmptyValueType, typename ValueTraits::EmptyValueType>(KeyTraits::emptyValue(), ValueTraits::emptyValue()); }
 
-    static const int minimumTableSize = KeyTraits::minimumTableSize;
+    static const unsigned minimumTableSize = KeyTraits::minimumTableSize;
 
     static void constructDeletedValue(TraitType& slot) { KeyTraits::constructDeletedValue(slot.key); }
     static bool isDeletedValue(const TraitType& value) { return KeyTraits::isDeletedValue(value.key); }
index 0a43210d87323deadf71ac686cd0eced9e986e57..82364fd202b0fd007489710315c87362e5a59309 100644 (file)
@@ -78,8 +78,8 @@ public:
 
     void swap(ListHashSet&);
 
-    int size() const;
-    int capacity() const;
+    unsigned size() const;
+    unsigned capacity() const;
     bool isEmpty() const;
 
     iterator begin() { return makeIterator(m_head); }
@@ -347,13 +347,13 @@ inline ListHashSet<T, U>::~ListHashSet()
 }
 
 template<typename T, typename U>
-inline int ListHashSet<T, U>::size() const
+inline unsigned ListHashSet<T, U>::size() const
 {
     return m_impl.size(); 
 }
 
 template<typename T, typename U>
-inline int ListHashSet<T, U>::capacity() const
+inline unsigned ListHashSet<T, U>::capacity() const
 {
     return m_impl.capacity(); 
 }
index 1e0dfc3ee0c70b6dfbad0c0dc74088532d97d9a5..33515067f8ca2b53caeaa5402d2a1066b16c5e48 100644 (file)
@@ -1,3 +1,41 @@
+2015-03-10  Alex Christensen  <achristensen@webkit.org>
+
+        Use unsigned for HashSet size.
+        https://bugs.webkit.org/show_bug.cgi?id=142518
+
+        Reviewed by Benjamin Poulain.
+
+        * Modules/websockets/WebSocketDeflateFramer.cpp:
+        (WebCore::WebSocketExtensionDeflateFrame::processResponse):
+        * bindings/js/SerializedScriptValue.cpp:
+        (WebCore::CloneSerializer::checkForDuplicate):
+        (WebCore::CloneSerializer::writeConstantPoolIndex):
+        * dom/ScriptRunner.cpp:
+        (WebCore::ScriptRunner::~ScriptRunner):
+        * loader/ResourceLoadScheduler.h:
+        * platform/graphics/Font.cpp:
+        (WebCore::Font::systemFallbackFontForCharacter):
+        * platform/graphics/FontCache.cpp:
+        (WebCore::FontCache::purgeInactiveFontDataIfNeeded):
+        (WebCore::FontCache::purgeInactiveFontData):
+        * platform/graphics/FontCache.h:
+        * platform/graphics/freetype/FontCacheFreeType.cpp:
+        (WebCore::FontCache::systemFallbackForCharacters):
+        * platform/graphics/ios/FontCacheIOS.mm:
+        (WebCore::FontCache::getSystemFontFallbackForCharacters):
+        (WebCore::FontCache::systemFallbackForCharacters):
+        (WebCore::FontCache::similarFont):
+        * platform/graphics/mac/FontCacheMac.mm:
+        (WebCore::shouldAutoActivateFontIfNeeded):
+        (WebCore::FontCache::systemFallbackForCharacters):
+        (WebCore::FontCache::similarFont):
+        * platform/graphics/win/FontCacheWin.cpp:
+        (WebCore::FontCache::systemFallbackForCharacters):
+        * rendering/RenderDeprecatedFlexibleBox.cpp:
+        (WebCore::FlexBoxIterator::next):
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::computeOverflowFromCells):
+
 2015-03-10  Eric Carlson  <eric.carlson@apple.com>
 
         [Mac] Refactor media controls code
index 9453628c6ea8d467d164bfbfbd135dbd933faf9d..c6a3a595822283a6366124219dc3dc8fb7c64f95 100644 (file)
@@ -79,7 +79,7 @@ bool WebSocketExtensionDeflateFrame::processResponse(const HashMap<String, Strin
     }
     m_responseProcessed = true;
 
-    int expectedNumParameters = 0;
+    unsigned expectedNumParameters = 0;
     int windowBits = 15;
     HashMap<String, String>::const_iterator parameter = serverParameters.find("max_window_bits");
     if (parameter != serverParameters.end()) {
index dca5603f9c399618338af7e0db31adf10cb6b6f9..9f9f259ce67928424789a3d34bef392a5789acae 100644 (file)
@@ -575,7 +575,7 @@ private:
         // Handle duplicate references
         if (found != m_objectPool.end()) {
             write(ObjectReferenceTag);
-            ASSERT(static_cast<int32_t>(found->value) < m_objectPool.size());
+            ASSERT(found->value < m_objectPool.size());
             writeObjectIndex(found->value);
             return true;
         }
@@ -965,7 +965,7 @@ private:
 
     template <class T> void writeConstantPoolIndex(const T& constantPool, unsigned i)
     {
-        ASSERT(static_cast<int32_t>(i) < constantPool.size());
+        ASSERT(i < constantPool.size());
         if (constantPool.size() <= 0xFF)
             write(static_cast<uint8_t>(i));
         else if (constantPool.size() <= 0xFFFF)
index c46b78e0ffe3c81836047eca3a07ab9ced13af04..d628a2c83a25a9d0e26d2aa08dddfecfc39af2a0 100644 (file)
@@ -46,7 +46,7 @@ ScriptRunner::~ScriptRunner()
         m_document.decrementLoadEventDelayCount();
     for (size_t i = 0; i < m_scriptsToExecuteInOrder.size(); ++i)
         m_document.decrementLoadEventDelayCount();
-    for (int i = 0; i < m_pendingAsyncScripts.size(); ++i)
+    for (unsigned i = 0; i < m_pendingAsyncScripts.size(); ++i)
         m_document.decrementLoadEventDelayCount();
 }
 
index 9c67b7783194547c84566d2d05422104bd90c631..0c4dca3e8312f95a71879a5cf19fc6b06f29f7ff 100644 (file)
@@ -107,7 +107,7 @@ private:
         typedef HashSet<RefPtr<ResourceLoader>> RequestMap;
         RequestMap m_requestsLoading;
         const String m_name;
-        const int m_maxRequestsInFlight;
+        const unsigned m_maxRequestsInFlight;
     };
 
     enum CreateHostPolicy {
index 549da8757dffaf8c197cd59da48611ad59bc9589..b62d41d67e24dc3db6581ad017b7e3ee67e8f61c 100644 (file)
@@ -422,7 +422,7 @@ RefPtr<Font> Font::systemFallbackFontForCharacter(UChar32 character, const FontD
 
     if (!fallbackFont) {
         UChar codeUnits[2];
-        int codeUnitsLength;
+        unsigned codeUnitsLength;
         if (U_IS_BMP(character)) {
             codeUnits[0] = FontCascade::normalizeSpaces(character);
             codeUnitsLength = 1;
index 18d6727c6879271c02e1827fe7eccf50dab8831d..31b9cf63e0b7652e953804d7d0378e3e5af85c2e 100644 (file)
@@ -368,15 +368,15 @@ static FontDataCache& cachedFonts()
 
 
 #if PLATFORM(IOS)
-const int cMaxInactiveFontData = 120;
-const int cTargetInactiveFontData = 100;
+const unsigned cMaxInactiveFontData = 120;
+const unsigned cTargetInactiveFontData = 100;
 #else
-const int cMaxInactiveFontData = 225;
-const int cTargetInactiveFontData = 200;
+const unsigned cMaxInactiveFontData = 225;
+const unsigned cTargetInactiveFontData = 200;
 #endif
 
-const int cMaxUnderMemoryPressureInactiveFontData = 50;
-const int cTargetUnderMemoryPressureInactiveFontData = 30;
+const unsigned cMaxUnderMemoryPressureInactiveFontData = 50;
+const unsigned cTargetUnderMemoryPressureInactiveFontData = 30;
 
 RefPtr<Font> FontCache::fontForFamily(const FontDescription& fontDescription, const AtomicString& family, bool checkingAlternateName)
 {
@@ -411,19 +411,19 @@ void FontCache::purgeTimerFired()
 void FontCache::purgeInactiveFontDataIfNeeded()
 {
     bool underMemoryPressure = MemoryPressureHandler::singleton().isUnderMemoryPressure();
-    int inactiveFontDataLimit = underMemoryPressure ? cMaxUnderMemoryPressureInactiveFontData : cMaxInactiveFontData;
+    unsigned inactiveFontDataLimit = underMemoryPressure ? cMaxUnderMemoryPressureInactiveFontData : cMaxInactiveFontData;
 
     if (cachedFonts().size() < inactiveFontDataLimit)
         return;
-    int inactiveCount = inactiveFontCount();
+    unsigned inactiveCount = inactiveFontCount();
     if (inactiveCount <= inactiveFontDataLimit)
         return;
 
-    int targetFontDataLimit = underMemoryPressure ? cTargetUnderMemoryPressureInactiveFontData : cTargetInactiveFontData;
+    unsigned targetFontDataLimit = underMemoryPressure ? cTargetUnderMemoryPressureInactiveFontData : cTargetInactiveFontData;
     purgeInactiveFontData(inactiveCount - targetFontDataLimit);
 }
 
-void FontCache::purgeInactiveFontData(int purgeCount)
+void FontCache::purgeInactiveFontData(unsigned purgeCount)
 {
     pruneUnreferencedEntriesFromFontCascadeCache();
     pruneSystemFallbackFonts();
index eb9e3138faafc4c8e8a086e7ce672e2844d130dd..c4eded2b89c52a6eceda7621d55b119d0b1fc989 100644 (file)
@@ -110,7 +110,7 @@ public:
     WEBCORE_EXPORT static FontCache& singleton();
 
     // This method is implemented by the platform.
-    RefPtr<Font> systemFallbackForCharacters(const FontDescription&, const Font* originalFontData, bool isPlatformFont, const UChar* characters, int length);
+    RefPtr<Font> systemFallbackForCharacters(const FontDescription&, const Font* originalFontData, bool isPlatformFont, const UChar* characters, unsigned length);
 
     // Also implemented by the platform.
     void platformInit();
@@ -140,7 +140,7 @@ public:
 
     WEBCORE_EXPORT size_t fontCount();
     WEBCORE_EXPORT size_t inactiveFontCount();
-    WEBCORE_EXPORT void purgeInactiveFontData(int count = INT_MAX);
+    WEBCORE_EXPORT void purgeInactiveFontData(unsigned count = UINT_MAX);
 
 #if PLATFORM(WIN)
     RefPtr<Font> fontFromDescriptionAndLogFont(const FontDescription&, const LOGFONT&, AtomicString& outFontFamilyName);
@@ -165,7 +165,7 @@ private:
     // These methods are implemented by each platform.
 #if PLATFORM(IOS)
     FontPlatformData* getCustomFallbackFont(const UInt32, const FontDescription&);
-    PassRefPtr<Font> getSystemFontFallbackForCharacters(const FontDescription&, const Font*, const UChar* characters, int length);
+    PassRefPtr<Font> getSystemFontFallbackForCharacters(const FontDescription&, const Font*, const UChar* characters, unsigned length);
 #endif
     std::unique_ptr<FontPlatformData> createFontPlatformData(const FontDescription&, const AtomicString& family);
 
index 1848a36deb6b4d42357d7a0001876597362a2cf5..e4838485d7ac05c0263ab64ac0ef8fe0eb1f12ed 100644 (file)
@@ -80,7 +80,7 @@ FcPattern* findBestFontGivenFallbacks(const FontPlatformData& fontData, FcPatter
     return FcFontSetMatch(0, sets, 1, pattern, &fontConfigResult);
 }
 
-RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& description, const Font* originalFontData, bool, const UChar* characters, int length)
+RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& description, const Font* originalFontData, bool, const UChar* characters, unsigned length)
 {
     RefPtr<FcPattern> pattern = adoptRef(createFontConfigPatternForCharacters(characters, length));
     const FontPlatformData& fontData = originalFontData->platformData();
index 35ac270b858e5b71d7f690ec55fc17fca009a107..7f4b2d58c70ff89c5bfe2b6eab16ff1c50d73c31 100644 (file)
@@ -73,7 +73,7 @@ static CFCharacterSetRef phoneFallbackCharacterSet()
     return characterSet;
 }
 
-PassRefPtr<Font> FontCache::getSystemFontFallbackForCharacters(const FontDescription& description, const Font* originalFontData, const UChar* characters, int length)
+PassRefPtr<Font> FontCache::getSystemFontFallbackForCharacters(const FontDescription& description, const Font* originalFontData, const UChar* characters, unsigned length)
 {
     const FontPlatformData& platformData = originalFontData->platformData();
     CTFontRef ctFont = platformData.font();
@@ -194,11 +194,11 @@ static LanguageSpecificFont languageSpecificFallbackFont(UChar32 c)
     return LanguageSpecificFont::None;
 }
 
-RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& description, const Font* originalFontData, bool, const UChar* characters, int length)
+RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& description, const Font* originalFontData, bool, const UChar* characters, unsigned length)
 {
     // Unlike OS X, our fallback font on iPhone is Arial Unicode, which doesn't have some apple-specific glyphs like F8FF.
     // Fall back to the Apple Fallback font in this case.
-    if (length > 0 && requiresCustomFallbackFont(*characters)) {
+    if (length && requiresCustomFallbackFont(*characters)) {
         auto* fallback = getCustomFallbackFont(*characters, description);
         if (!fallback)
             return nullptr;
@@ -217,7 +217,7 @@ RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& descr
     }
 
     LanguageSpecificFont languageSpecificFont = LanguageSpecificFont::None;
-    if (length > 0)
+    if (length)
         languageSpecificFont = languageSpecificFallbackFont(c);
 
     RefPtr<Font> font;
@@ -479,7 +479,7 @@ RefPtr<Font> FontCache::similarFont(const FontDescription& description)
         static String* matchWords[3] = { &arabic.get(), &pashto.get(), &urdu.get() };
         static NeverDestroyed<AtomicString> geezaPlain("GeezaPro", AtomicString::ConstructFromLiteral);
         static NeverDestroyed<AtomicString> geezaBold("GeezaPro-Bold", AtomicString::ConstructFromLiteral);
-        for (int j = 0; j < 3 && !font; ++j) {
+        for (unsigned j = 0; j < 3 && !font; ++j) {
             if (family.contains(*matchWords[j], false))
                 font = fontForFamily(description, isFontWeightBold(description.weight()) ? geezaBold : geezaPlain);
         }
index d0af4db3ca4b0d030bc3c39f36344ebd7811e9f4..ea3be013eb40a99cabeb35d0d67035ee46e18003 100644 (file)
@@ -325,7 +325,7 @@ static bool shouldAutoActivateFontIfNeeded(const AtomicString& family)
 #endif
 
     static NeverDestroyed<HashSet<AtomicString>> knownFamilies;
-    static const int maxCacheSize = 128;
+    static const unsigned maxCacheSize = 128;
     ASSERT(knownFamilies.get().size() <= maxCacheSize);
     if (knownFamilies.get().size() == maxCacheSize)
         knownFamilies.get().remove(knownFamilies.get().begin());
@@ -334,7 +334,7 @@ static bool shouldAutoActivateFontIfNeeded(const AtomicString& family)
     return knownFamilies.get().add(family).isNewEntry;
 }
 
-RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& description, const Font* originalFontData, bool isPlatformFont, const UChar* characters, int length)
+RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& description, const Font* originalFontData, bool isPlatformFont, const UChar* characters, unsigned length)
 {
     UChar32 character;
     U16_GET(characters, 0, 0, length, character);
@@ -414,7 +414,7 @@ RefPtr<Font> FontCache::similarFont(const FontDescription& description)
             continue;
         static String* matchWords[3] = { new String("Arabic"), new String("Pashto"), new String("Urdu") };
         DEPRECATED_DEFINE_STATIC_LOCAL(AtomicString, geezaStr, ("Geeza Pro", AtomicString::ConstructFromLiteral));
-        for (int j = 0; j < 3 && !font; ++j) {
+        for (unsigned j = 0; j < 3 && !font; ++j) {
             if (family.contains(*matchWords[j], false))
                 font = fontForFamily(description, geezaStr);
         }
index 3350f1516898ce853a936150d94e92ca234284f0..479cb856e1e8124d52f3b5ad3701911b046b55e1 100644 (file)
@@ -199,7 +199,7 @@ static HFONT createMLangFont(IMLangFontLinkType* langFontLink, HDC hdc, DWORD co
     return hfont;
 }
 
-RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& description, const Font* originalFontData, bool, const UChar* characters, int length)
+RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& description, const Font* originalFontData, bool, const UChar* characters, unsigned length)
 {
     UChar character = characters[0];
     RefPtr<Font> fontData;
index 80faf367a359fa91059911c098cbede3c04da732..2c1a507a49923dbb55eaa847c01ab75c7b2ed9ef 100644 (file)
@@ -78,7 +78,7 @@ public:
                 if (!m_ordinalIteration)
                     m_currentOrdinal = m_forward ? 1 : m_largestOrdinal;
                 else {
-                    if (m_ordinalIteration >= m_ordinalValues.size() + 1)
+                    if (m_ordinalIteration > m_ordinalValues.size())
                         return 0;
 
                     // Only copy+sort the values once per layout even if the iterator is reset.
@@ -110,11 +110,11 @@ private:
     RenderDeprecatedFlexibleBox* m_box;
     RenderBox* m_currentChild;
     bool m_forward;
-    unsigned int m_currentOrdinal;
-    unsigned int m_largestOrdinal;
-    HashSet<unsigned int> m_ordinalValues;
-    Vector<unsigned int> m_sortedOrdinalValues;
-    int m_ordinalIteration;
+    unsigned m_currentOrdinal;
+    unsigned m_largestOrdinal;
+    HashSet<unsigned> m_ordinalValues;
+    Vector<unsigned> m_sortedOrdinalValues;
+    unsigned m_ordinalIteration;
 };
 
 RenderDeprecatedFlexibleBox::RenderDeprecatedFlexibleBox(Element& element, Ref<RenderStyle>&& style)
index c16759e6e21f4cd6c0ef02e787f6f14b7295f228..016206d3c3f928fa014e2da8e52cdb62718d9fb4 100644 (file)
@@ -677,7 +677,7 @@ void RenderTableSection::computeOverflowFromCells(unsigned totalRows, unsigned n
     clearOverflow();
     m_overflowingCells.clear();
     unsigned totalCellsCount = nEffCols * totalRows;
-    int maxAllowedOverflowingCellsCount = totalCellsCount < gMinTableSizeToUseFastPaintPathWithOverflowingCell ? 0 : gMaxAllowedOverflowingCellRatioForFastPaintPath * totalCellsCount;
+    unsigned maxAllowedOverflowingCellsCount = totalCellsCount < gMinTableSizeToUseFastPaintPathWithOverflowingCell ? 0 : gMaxAllowedOverflowingCellRatioForFastPaintPath * totalCellsCount;
 
 #ifndef NDEBUG
     bool hasOverflowingCell = false;
index 9f99ddebaf6cd042c48dd1fa5723b31eb593c4ef..45e84b62cb494e25ef4c102f9e266974cbfa6e43 100644 (file)
@@ -1,3 +1,17 @@
+2015-03-10  Alex Christensen  <achristensen@webkit.org>
+
+        Use unsigned for HashSet size.
+        https://bugs.webkit.org/show_bug.cgi?id=142518
+
+        Reviewed by Benjamin Poulain.
+
+        * TestWebKitAPI/Tests/WTF/HashMap.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WTF/HashSet.cpp:
+        (TestWebKitAPI::testInitialCapacity):
+        * TestWebKitAPI/Tests/WTF/ListHashSet.cpp:
+        (TestWebKitAPI::TEST):
+
 2015-03-10  Daniel Bates  <dabates@apple.com>
 
         [iOS] Add WebKitSystemInterface for iOS 8.2
index 5e1b9e5eb1fb0eaa86383cabb207d09c543512f1..236e46995d18a4d67557e02b743d15e1d90529c6 100644 (file)
@@ -143,7 +143,7 @@ TEST(WTF_HashMap, InitializerList)
         { 4, "four" },
     };
 
-    EXPECT_EQ(4, map.size());
+    EXPECT_EQ(4u, map.size());
 
     EXPECT_EQ("one", map.get(1));
     EXPECT_EQ("two", map.get(2));
index 64c6d3d5a6b8ba22daede54138ceeff55bf10d38..3155bc07a223bab4ea7d3614ffa314b77c8ee259 100644 (file)
@@ -45,7 +45,7 @@ void testInitialCapacity()
     HashSet<int, DefaultHash<int>::Hash, InitialCapacityTestHashTraits<initialCapacity> > testSet;
 
     // Initial capacity is null.
-    ASSERT_EQ(0, testSet.capacity());
+    ASSERT_EQ(0u, testSet.capacity());
 
     // Adding items up to size should never change the capacity.
     for (size_t i = 0; i < size; ++i) {
index a550a845bf19e89223f0f9dc0139d22926539a3e..d81dcfcfed87ee35bd0804ec97291d20dceb4a64 100644 (file)
@@ -78,7 +78,7 @@ TEST(WTF_ListHashSet, AppendOrMoveToLastNewItems)
     result = list.appendOrMoveToLast(3);
     ASSERT_TRUE(result.isNewEntry);
 
-    ASSERT_EQ(list.size(), 3);
+    ASSERT_EQ(list.size(), 3u);
 
     // The list should be in order 1, 2, 3.
     ListHashSet<int>::iterator iterator = list.begin();
@@ -99,11 +99,11 @@ TEST(WTF_ListHashSet, AppendOrMoveToLastWithDuplicates)
     ASSERT_TRUE(result.isNewEntry);
     result = list.appendOrMoveToLast(1);
     ASSERT_FALSE(result.isNewEntry);
-    ASSERT_EQ(1, list.size());
+    ASSERT_EQ(1u, list.size());
 
     list.add(2);
     list.add(3);
-    ASSERT_EQ(3, list.size());
+    ASSERT_EQ(3u, list.size());
 
     // Appending 2 move it to the end.
     ASSERT_EQ(3, list.last());
@@ -118,7 +118,7 @@ TEST(WTF_ListHashSet, AppendOrMoveToLastWithDuplicates)
     ASSERT_FALSE(result.isNewEntry);
     result = list.appendOrMoveToLast(1);
     ASSERT_FALSE(result.isNewEntry);
-    ASSERT_EQ(3, list.size());
+    ASSERT_EQ(3u, list.size());
 
     ListHashSet<int>::iterator iterator = list.begin();
     ASSERT_EQ(3, *iterator);
@@ -139,7 +139,7 @@ TEST(WTF_ListHashSet, PrependOrMoveToLastNewItems)
     result = list.prependOrMoveToFirst(3);
     ASSERT_TRUE(result.isNewEntry);
 
-    ASSERT_EQ(list.size(), 3);
+    ASSERT_EQ(list.size(), 3u);
 
     // The list should be in order 3, 1, 2.
     ListHashSet<int>::iterator iterator = list.begin();
@@ -160,11 +160,11 @@ TEST(WTF_ListHashSet, PrependOrMoveToLastWithDuplicates)
     ASSERT_TRUE(result.isNewEntry);
     result = list.prependOrMoveToFirst(1);
     ASSERT_FALSE(result.isNewEntry);
-    ASSERT_EQ(1, list.size());
+    ASSERT_EQ(1u, list.size());
 
     list.add(2);
     list.add(3);
-    ASSERT_EQ(3, list.size());
+    ASSERT_EQ(3u, list.size());
 
     // Prepending 2 move it to the beginning.
     ASSERT_EQ(1, list.first());
@@ -179,7 +179,7 @@ TEST(WTF_ListHashSet, PrependOrMoveToLastWithDuplicates)
     ASSERT_FALSE(result.isNewEntry);
     result = list.prependOrMoveToFirst(3);
     ASSERT_FALSE(result.isNewEntry);
-    ASSERT_EQ(3, list.size());
+    ASSERT_EQ(3u, list.size());
 
     ListHashSet<int>::iterator iterator = list.begin();
     ASSERT_EQ(3, *iterator);