Author: borisk
Date: Wed Jul 16 03:47:17 2008
New Revision: 677233

URL: http://svn.apache.org/viewvc?rev=677233&view=rev
Log:
Cast -1 to XMLSize_t instead of unsigned int.

Modified:
    xerces/c/trunk/src/xercesc/util/RefHash2KeysTableOf.c
    xerces/c/trunk/src/xercesc/util/RefHashTableOf.c
    xerces/c/trunk/src/xercesc/util/RefHashTableOf.hpp

Modified: xerces/c/trunk/src/xercesc/util/RefHash2KeysTableOf.c
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/RefHash2KeysTableOf.c?rev=677233&r1=677232&r2=677233&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/RefHash2KeysTableOf.c (original)
+++ xerces/c/trunk/src/xercesc/util/RefHash2KeysTableOf.c Wed Jul 16 03:47:17 
2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -160,7 +160,7 @@
             // delete curElem;
             // destructor is empty...
             // curElem->~RefHash2KeysTableBucketElem();
-            fMemoryManager->deallocate(curElem);            
+            fMemoryManager->deallocate(curElem);
             fCount--;
             return;
         }
@@ -312,7 +312,7 @@
             }
 
             RefHash2KeysTableBucketElem<TVal>* elemToDelete = curElem;
-            
+
             // Update just curElem; lastElem must stay the same
             curElem = curElem->fNext;
 
@@ -374,7 +374,7 @@
 {
     // Apply 4 load factor to find threshold.
     XMLSize_t threshold = fHashModulus * 4;
-    
+
     // If we've grown too big, expand the table and rehash.
     if (fCount >= threshold)
         rehash();
@@ -478,17 +478,17 @@
 
             const XMLSize_t hashVal = fHash==0?XMLString::hash((const 
XMLCh*)curElem->fKey1, newMod, fMemoryManager) : 
fHash->getHashVal(curElem->fKey1, newMod, fMemoryManager);
             assert(hashVal < newMod);
-            
+
             RefHash2KeysTableBucketElem<TVal>* newHeadElem = 
newBucketList[hashVal];
-            
+
             // Insert at the start of this bucket's list.
             curElem->fNext = newHeadElem;
             newBucketList[hashVal] = curElem;
-            
+
             curElem = nextElem;
         }
     }
-            
+
     RefHash2KeysTableBucketElem<TVal>** const oldBucketList = fBucketList;
 
     // Everything is OK at this point, so update the
@@ -498,7 +498,7 @@
 
     // Delete the old bucket list.
     fMemoryManager->deallocate(oldBucketList);//delete[] oldBucketList;
-    
+
 }
 
 
@@ -510,7 +510,7 @@
 RefHash2KeysTableOfEnumerator(RefHash2KeysTableOf<TVal>* const toEnum
                               , const bool adopt
                               , MemoryManager* const manager)
-    : fAdopted(adopt), fCurElem(0), fCurHash((unsigned int)-1), fToEnum(toEnum)
+    : fAdopted(adopt), fCurElem(0), fCurHash((XMLSize_t)-1), fToEnum(toEnum)
     , fMemoryManager(manager)
     , fLockPrimaryKey(0)
 {
@@ -521,8 +521,8 @@
     //  Find the next available bucket element in the hash table. If it
     //  comes back zero, that just means the table is empty.
     //
-    //  Note that the -1 in the current hash tells it to start from the
-    //  beginning.
+    //  Note that the -1 in the current hash tells it to start
+    //  from the beginning.
     //
     findNext();
 }
@@ -589,6 +589,7 @@
         fCurHash=fToEnum->fHash==0?XMLString::hash((const 
XMLCh*)fLockPrimaryKey, fToEnum->fHashModulus, fMemoryManager) : 
fToEnum->fHash->getHashVal(fLockPrimaryKey, fToEnum->fHashModulus, 
fMemoryManager);
     else
         fCurHash = (XMLSize_t)-1;
+
     fCurElem = 0;
     findNext();
 }
@@ -612,7 +613,7 @@
             fCurElem = fToEnum->fBucketList[fCurHash];
         else
             fCurElem = fCurElem->fNext;
-        while (fCurElem && 
+        while (fCurElem &&
                (fToEnum->fHash==0?!XMLString::equals((const 
XMLCh*)fLockPrimaryKey, (const XMLCh*)fCurElem->fKey1) : 
!fToEnum->fHash->equals(fLockPrimaryKey, fCurElem->fKey1)))
             fCurElem = fCurElem->fNext;
         // if we didn't found it, make so hasMoreElements() returns false

Modified: xerces/c/trunk/src/xercesc/util/RefHashTableOf.c
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/RefHashTableOf.c?rev=677233&r1=677232&r2=677233&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/RefHashTableOf.c (original)
+++ xerces/c/trunk/src/xercesc/util/RefHashTableOf.c Wed Jul 16 03:47:17 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -165,7 +165,7 @@
              // delete curElem;
             // destructor doesn't do anything...
             // curElem->~RefHashTableBucketElem();
-            fMemoryManager->deallocate(curElem);            
+            fMemoryManager->deallocate(curElem);
 
             fCount--;
 
@@ -208,7 +208,7 @@
              // delete curElem;
             // destructor doesn't do anything...
             // curElem->~RefHashTableBucketElem();
-            fMemoryManager->deallocate(curElem);            
+            fMemoryManager->deallocate(curElem);
             curElem = nextElem;
         }
 
@@ -259,7 +259,7 @@
             // delete curElem;
             // destructor doesn't do anything...
             // curElem->~RefHashTableBucketElem();
-            fMemoryManager->deallocate(curElem);            
+            fMemoryManager->deallocate(curElem);
             break;
         }
 
@@ -380,7 +380,7 @@
 {
     // Apply 0.75 load factor to find threshold.
     XMLSize_t threshold = fHashModulus * 3 / 4;
-    
+
     // If we've grown too big, expand the table and rehash.
     if (fCount >= threshold)
         rehash();
@@ -405,7 +405,7 @@
         //newBucket = new (fMemoryManager) RefHashTableBucketElem<TVal>(key, 
valueToAdopt, fBucketList[hashVal]);
         newBucket =
              new 
(fMemoryManager->allocate(sizeof(RefHashTableBucketElem<TVal>)))
-             RefHashTableBucketElem<TVal>(key, valueToAdopt, 
fBucketList[hashVal]);        
+             RefHashTableBucketElem<TVal>(key, valueToAdopt, 
fBucketList[hashVal]);
         fBucketList[hashVal] = newBucket;
         fCount++;
     }
@@ -431,8 +431,8 @@
     ArrayJanitor<RefHashTableBucketElem<TVal>*>  guard(newBucketList, 
fMemoryManager);
 
     memset(newBucketList, 0, newMod * sizeof(newBucketList[0]));
-    
-    
+
+
     // Rehash all existing entries.
     for (XMLSize_t index = 0; index < fHashModulus; index++)
     {
@@ -466,7 +466,7 @@
 
     // Delete the old bucket list.
     fMemoryManager->deallocate(oldBucketList);//delete[] oldBucketList;
-    
+
 }
 
 template <class TVal> RefHashTableBucketElem<TVal>* RefHashTableOf<TVal>::
@@ -515,7 +515,7 @@
 RefHashTableOfEnumerator(RefHashTableOf<TVal>* const toEnum
                          , const bool adopt
                          , MemoryManager* const manager)
-    : fAdopted(adopt), fCurElem(0), fCurHash((unsigned int)-1), fToEnum(toEnum)
+    : fAdopted(adopt), fCurElem(0), fCurHash((XMLSize_t)-1), fToEnum(toEnum)
     , fMemoryManager(manager)
 {
     if (!toEnum)
@@ -525,8 +525,8 @@
     //  Find the next available bucket element in the hash table. If it
     //  comes back zero, that just means the table is empty.
     //
-    //  Note that the -1 in the current hash tells it to start from the
-    //  beginning.
+    //  Note that the -1 in the current hash tells it to start
+    //  from the beginning.
     //
     findNext();
 }

Modified: xerces/c/trunk/src/xercesc/util/RefHashTableOf.hpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/RefHashTableOf.hpp?rev=677233&r1=677232&r2=677233&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/RefHashTableOf.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/RefHashTableOf.hpp Wed Jul 16 03:47:17 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -118,7 +118,7 @@
     // -----------------------------------------------------------------------
     TVal* get(const void* const key);
     const TVal* get(const void* const key) const;
-    MemoryManager* getMemoryManager() const;   
+    MemoryManager* getMemoryManager() const;
     XMLSize_t      getHashModulus()   const;
     XMLSize_t      getCount() const;
 
@@ -237,8 +237,8 @@
     //      This is the current bucket bucket element that we are on.
     //
     //  fCurHash
-    //      The is the current hash buck that we are working on. Once we hit
-    //      the end of the bucket that fCurElem is in, then we have to start
+    //      The current hash buck that we are working on. Once we hit the
+    //      end of the bucket that fCurElem is in, then we have to start
     //      working this one up to the next non-empty bucket.
     //
     //  fToEnum
@@ -258,4 +258,3 @@
 #endif
 
 #endif
-



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to