Author: borisk
Date: Sat Jul 19 05:08:55 2008
New Revision: 678144

URL: http://svn.apache.org/viewvc?rev=678144&view=rev
Log:
Get rid of unused MemoryManager argument in hash functions.

Modified:
    xerces/c/trunk/src/xercesc/dom/impl/DOMDeepNodeListPool.c
    xerces/c/trunk/src/xercesc/dom/impl/DOMNodeIDMap.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMStringPool.cpp
    xerces/c/trunk/src/xercesc/internal/WFXMLScanner.cpp
    xerces/c/trunk/src/xercesc/util/HashBase.hpp
    xerces/c/trunk/src/xercesc/util/HashCMStateSet.hpp
    xerces/c/trunk/src/xercesc/util/HashPtr.cpp
    xerces/c/trunk/src/xercesc/util/HashPtr.hpp
    xerces/c/trunk/src/xercesc/util/HashXMLCh.cpp
    xerces/c/trunk/src/xercesc/util/HashXMLCh.hpp
    xerces/c/trunk/src/xercesc/util/RefHash2KeysTableOf.c
    xerces/c/trunk/src/xercesc/util/RefHash3KeysIdPool.c
    xerces/c/trunk/src/xercesc/util/RefHashTableOf.c
    xerces/c/trunk/src/xercesc/util/ValueHashTableOf.c
    xerces/c/trunk/src/xercesc/util/XMLString.cpp
    xerces/c/trunk/src/xercesc/util/XMLString.hpp

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMDeepNodeListPool.c
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/impl/DOMDeepNodeListPool.c?rev=678144&r1=678143&r2=678144&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMDeepNodeListPool.c (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMDeepNodeListPool.c Sat Jul 19 
05:08:55 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.
@@ -119,7 +119,7 @@
     fHash = new HashPtr();
 #else
     fHash = new (fMemoryManager) HashPtr();
-#endif    
+#endif
 
     //
     //  Allocate the initial id pointers array. We don't have to zero them
@@ -370,7 +370,7 @@
 findBucketElem(const void* const key1, const XMLCh* const key2, const XMLCh* 
const key3, XMLSize_t& hashVal)
 {
     // Hash the key
-    hashVal = fHash->getHashVal(key1, fHashModulus, fMemoryManager);
+    hashVal = fHash->getHashVal(key1, fHashModulus);
     assert(hashVal < fHashModulus);
 
     // Search that bucket for the key
@@ -405,9 +405,9 @@
 findBucketElem(const void* const key1, const XMLCh* const key2, const XMLCh* 
const key3, XMLSize_t& hashVal) const
 {
     // Hash the key
-    hashVal = fHash->getHashVal(key1, fHashModulus, fMemoryManager);
+    hashVal = fHash->getHashVal(key1, fHashModulus);
     assert(hashVal < fHashModulus);
-    
+
     // Search that bucket for the key
     const DOMDeepNodeListPoolTableBucketElem<TVal>* curElem = 
fBucketList[hashVal];
     while (curElem)
@@ -436,4 +436,3 @@
 }
 
 XERCES_CPP_NAMESPACE_END
-

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMNodeIDMap.cpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/impl/DOMNodeIDMap.cpp?rev=678144&r1=678143&r2=678144&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMNodeIDMap.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMNodeIDMap.cpp Sat Jul 19 05:08:55 
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.
@@ -50,7 +50,7 @@
         }
     }
 
-    fSize = gPrimes[fSizeIndex];    
+    fSize = gPrimes[fSizeIndex];
     fMaxEntries = (XMLSize_t)(float(fSize) * gMaxFill);
 
     //fTable = new (fDoc) DOMAttr*[fSize];
@@ -78,7 +78,8 @@
        //
        if (fNumEntries >= fMaxEntries)
                growTable();
-    fNumEntries++;
+
+        fNumEntries++;
 
        //
        // Hash the value string from the ID attribute being added to the table
@@ -86,7 +87,7 @@
        //      An initial hash of zero would cause the rehash to fail.
        //
        const XMLCh *id=attr->getValue();
-    XMLSize_t initalHash = XMLString::hash(id, fSize-1, ((DOMDocumentImpl 
*)fDoc)->getMemoryManager());
+        XMLSize_t initalHash = XMLString::hash(id, fSize-1);
        initalHash++;
        XMLSize_t currentHash = initalHash;
 
@@ -119,7 +120,7 @@
        //      An initial hash of zero would cause the rehash to fail.
        //
        const XMLCh *id=attr->getValue();
-    XMLSize_t initalHash = XMLString::hash(id, fSize-1, ((DOMDocumentImpl 
*)fDoc)->getMemoryManager());
+        XMLSize_t initalHash = XMLString::hash(id, fSize-1);
        initalHash++;
        XMLSize_t currentHash = initalHash;
 
@@ -152,7 +153,7 @@
     //
     //  Get the hashcode for the supplied string.
     //
-       XMLSize_t initalHash = XMLString::hash(id, fSize-1, ((DOMDocumentImpl 
*)fDoc)->getMemoryManager());
+    XMLSize_t initalHash = XMLString::hash(id, fSize-1);
        initalHash++;
        XMLSize_t currentHash = initalHash;
 
@@ -227,5 +228,3 @@
 
 
 XERCES_CPP_NAMESPACE_END
-
-

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMStringPool.cpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/impl/DOMStringPool.cpp?rev=678144&r1=678143&r2=678144&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMStringPool.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMStringPool.cpp Sat Jul 19 05:08:55 
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.
@@ -90,7 +90,7 @@
     DOMStringPoolEntry    **pspe;
     DOMStringPoolEntry    *spe;
 
-    XMLSize_t inHash = XMLString::hash(in, fHashTableSize, 
fDoc->getMemoryManager());
+    XMLSize_t inHash = XMLString::hash(in, fHashTableSize);
     pspe = &fHashTable[inHash];
     while (*pspe != 0)
     {
@@ -173,4 +173,3 @@
 }
 
 XERCES_CPP_NAMESPACE_END
-

Modified: xerces/c/trunk/src/xercesc/internal/WFXMLScanner.cpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/internal/WFXMLScanner.cpp?rev=678144&r1=678143&r2=678144&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/internal/WFXMLScanner.cpp (original)
+++ xerces/c/trunk/src/xercesc/internal/WFXMLScanner.cpp Sat Jul 19 05:08:55 
2008
@@ -909,7 +909,7 @@
 
             //  See if this attribute is declared more than one for this 
element.
             const XMLCh* attNameRawBuf = fAttNameBuf.getRawBuffer();
-            XMLSize_t attNameHash = XMLString::hash(attNameRawBuf, 109, 
fMemoryManager);
+            XMLSize_t attNameHash = XMLString::hash(attNameRawBuf, 109);
 
             if (attCount) {
 
@@ -1244,7 +1244,7 @@
 
             //  See if this attribute is declared more than one for this 
element.
             const XMLCh* attNameRawBuf = fAttNameBuf.getRawBuffer();
-            XMLSize_t attNameHash = XMLString::hash(attNameRawBuf, 109, 
fMemoryManager);
+            XMLSize_t attNameHash = XMLString::hash(attNameRawBuf, 109);
             if (attCount) {
 
                 for (XMLSize_t k=0; k < attCount; k++) {

Modified: xerces/c/trunk/src/xercesc/util/HashBase.hpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/HashBase.hpp?rev=678144&r1=678143&r2=678144&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/HashBase.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/HashBase.hpp Sat Jul 19 05:08:55 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.
@@ -38,25 +38,24 @@
 {
 
 public:
-       
-       /**
+
+    /**
       * Returns a hash value based on the key
       *
       * @param key the key to be hashed
-         * @param mod the modulus the hasher should use
+      * @param mod the modulus the hasher should use
       */
-       virtual XMLSize_t getHashVal(const void *const key, XMLSize_t mod
-        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 
0;
+  virtual XMLSize_t getHashVal(const void *const key, XMLSize_t mod) = 0;
 
-       /**
+    /**
       * Compares two keys and determines if they are semantically equal
       *
       * @param key1 the first key to be compared
-         * @param key2 the second key to be compared
-         *
-         * @return true if they are equal
+      * @param key2 the second key to be compared
+      *
+      * @return true if they are equal
       */
-       virtual bool equals(const void *const key1, const void *const key2) = 0;
+  virtual bool equals(const void *const key1, const void *const key2) = 0;
 
     virtual ~HashBase() {};
 
@@ -67,7 +66,7 @@
     //  Unimplemented constructors and operators
     // -----------------------------------------------------------------------
     HashBase(const HashBase&);
-    HashBase& operator=(const HashBase&);    
+    HashBase& operator=(const HashBase&);
 };
 
 XERCES_CPP_NAMESPACE_END

Modified: xerces/c/trunk/src/xercesc/util/HashCMStateSet.hpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/HashCMStateSet.hpp?rev=678144&r1=678143&r2=678144&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/HashCMStateSet.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/HashCMStateSet.hpp Sat Jul 19 05:08:55 2008
@@ -40,8 +40,7 @@
 public:
        HashCMStateSet();
        virtual ~HashCMStateSet();
-       virtual XMLSize_t getHashVal(const void *const key, XMLSize_t mod
-        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
+       virtual XMLSize_t getHashVal(const void *const key, XMLSize_t mod);
        virtual bool equals(const void *const key1, const void *const key2);
 private:
     // -----------------------------------------------------------------------
@@ -59,8 +58,7 @@
 {
 }
 
-inline XMLSize_t HashCMStateSet::getHashVal(const void *const key, XMLSize_t 
mod
-                                               , MemoryManager* const)
+inline XMLSize_t HashCMStateSet::getHashVal(const void *const key, XMLSize_t 
mod)
 {
     const CMStateSet* const pkey = (const CMStateSet*) key;
        return ((pkey->hashCode()) % mod);

Modified: xerces/c/trunk/src/xercesc/util/HashPtr.cpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/HashPtr.cpp?rev=678144&r1=678143&r2=678144&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/HashPtr.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/HashPtr.cpp Sat Jul 19 05:08:55 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.
@@ -27,10 +27,9 @@
 {
 }
 
-XMLSize_t HashPtr::getHashVal(const void *const key, XMLSize_t mod
-                                 , MemoryManager* const)
+XMLSize_t HashPtr::getHashVal(const void *const key, XMLSize_t mod)
 {
- return (((XMLSize_t)key) % mod);
+  return (((XMLSize_t)key) % mod);
 }
 
 bool HashPtr::equals(const void *const key1, const void *const key2)

Modified: xerces/c/trunk/src/xercesc/util/HashPtr.hpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/HashPtr.hpp?rev=678144&r1=678143&r2=678144&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/HashPtr.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/HashPtr.hpp Sat Jul 19 05:08:55 2008
@@ -39,8 +39,7 @@
 public:
        HashPtr();
        virtual ~HashPtr();
-       virtual XMLSize_t getHashVal(const void *const key, XMLSize_t mod
-        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
+       virtual XMLSize_t getHashVal(const void *const key, XMLSize_t mod);
        virtual bool equals(const void *const key1, const void *const key2);
 private:
     // -----------------------------------------------------------------------

Modified: xerces/c/trunk/src/xercesc/util/HashXMLCh.cpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/HashXMLCh.cpp?rev=678144&r1=678143&r2=678144&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/HashXMLCh.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/HashXMLCh.cpp Sat Jul 19 05:08:55 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.
@@ -28,10 +28,9 @@
 {
 }
 
-XMLSize_t HashXMLCh::getHashVal(const void *const key, XMLSize_t mod
-                                   , MemoryManager* const manager)
+XMLSize_t HashXMLCh::getHashVal(const void *const key, XMLSize_t mod)
 {
-       return XMLString::hash((XMLCh*)key, mod, manager);
+       return XMLString::hash((XMLCh*)key, mod);
 }
 
 bool HashXMLCh::equals(const void *const key1, const void *const key2)

Modified: xerces/c/trunk/src/xercesc/util/HashXMLCh.hpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/HashXMLCh.hpp?rev=678144&r1=678143&r2=678144&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/HashXMLCh.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/HashXMLCh.hpp Sat Jul 19 05:08:55 2008
@@ -39,8 +39,7 @@
 public:
        HashXMLCh();
        virtual ~HashXMLCh();
-       virtual XMLSize_t getHashVal(const void *const key, XMLSize_t mod
-        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
+       virtual XMLSize_t getHashVal(const void *const key, XMLSize_t mod);
        virtual bool equals(const void *const key1, const void *const key2);
 private:
     // -----------------------------------------------------------------------

Modified: xerces/c/trunk/src/xercesc/util/RefHash2KeysTableOf.c
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/RefHash2KeysTableOf.c?rev=678144&r1=678143&r2=678144&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/RefHash2KeysTableOf.c (original)
+++ xerces/c/trunk/src/xercesc/util/RefHash2KeysTableOf.c Sat Jul 19 05:08:55 
2008
@@ -127,7 +127,7 @@
 removeKey(const void* const key1, const int key2)
 {
     // Hash the key
-    XMLSize_t hashVal = fHash==0?XMLString::hash((const XMLCh*)key1, 
fHashModulus, fMemoryManager) : fHash->getHashVal(key1, fHashModulus, 
fMemoryManager);
+    XMLSize_t hashVal = fHash==0?XMLString::hash((const XMLCh*)key1, 
fHashModulus) : fHash->getHashVal(key1, fHashModulus);
     assert(hashVal < fHashModulus);
 
     //
@@ -178,7 +178,7 @@
 removeKey(const void* const key1)
 {
     // Hash the key
-    XMLSize_t hashVal = fHash==0?XMLString::hash((const XMLCh*)key1, 
fHashModulus, fMemoryManager) : fHash->getHashVal(key1, fHashModulus, 
fMemoryManager);
+    XMLSize_t hashVal = fHash==0?XMLString::hash((const XMLCh*)key1, 
fHashModulus) : fHash->getHashVal(key1, fHashModulus);
     assert(hashVal < fHashModulus);
 
     //
@@ -266,7 +266,7 @@
 template <class TVal> void RefHash2KeysTableOf<TVal>::transferElement(const 
void* const key1, void* key2)
 {
     // Hash the key
-    XMLSize_t hashVal = fHash==0?XMLString::hash((const XMLCh*)key1, 
fHashModulus, fMemoryManager) : fHash->getHashVal(key1, fHashModulus, 
fMemoryManager);
+    XMLSize_t hashVal = fHash==0?XMLString::hash((const XMLCh*)key1, 
fHashModulus) : fHash->getHashVal(key1, fHashModulus);
     assert(hashVal < fHashModulus);
 
     //
@@ -414,7 +414,7 @@
 findBucketElem(const void* const key1, const int key2, XMLSize_t& hashVal)
 {
     // Hash the key
-    hashVal = fHash==0?XMLString::hash((const XMLCh*)key1, fHashModulus, 
fMemoryManager) : fHash->getHashVal(key1, fHashModulus, fMemoryManager);
+    hashVal = fHash==0?XMLString::hash((const XMLCh*)key1, fHashModulus) : 
fHash->getHashVal(key1, fHashModulus);
     assert(hashVal < fHashModulus);
 
     // Search that bucket for the key
@@ -433,7 +433,7 @@
 findBucketElem(const void* const key1, const int key2, XMLSize_t& hashVal) 
const
 {
     // Hash the key
-    hashVal = fHash==0?XMLString::hash((const XMLCh*)key1, fHashModulus, 
fMemoryManager) : fHash->getHashVal(key1, fHashModulus, fMemoryManager);
+    hashVal = fHash==0?XMLString::hash((const XMLCh*)key1, fHashModulus) : 
fHash->getHashVal(key1, fHashModulus);
     assert(hashVal < fHashModulus);
 
     // Search that bucket for the key
@@ -476,7 +476,7 @@
             // Save the next element before we detach this one
             RefHash2KeysTableBucketElem<TVal>* nextElem = curElem->fNext;
 
-            const XMLSize_t hashVal = fHash==0?XMLString::hash((const 
XMLCh*)curElem->fKey1, newMod, fMemoryManager) : 
fHash->getHashVal(curElem->fKey1, newMod, fMemoryManager);
+            const XMLSize_t hashVal = fHash==0?XMLString::hash((const 
XMLCh*)curElem->fKey1, newMod) : fHash->getHashVal(curElem->fKey1, newMod);
             assert(hashVal < newMod);
 
             RefHash2KeysTableBucketElem<TVal>* newHeadElem = 
newBucketList[hashVal];
@@ -586,7 +586,7 @@
 template <class TVal> void RefHash2KeysTableOfEnumerator<TVal>::Reset()
 {
     if(fLockPrimaryKey)
-        fCurHash=fToEnum->fHash==0?XMLString::hash((const 
XMLCh*)fLockPrimaryKey, fToEnum->fHashModulus, fMemoryManager) : 
fToEnum->fHash->getHashVal(fLockPrimaryKey, fToEnum->fHashModulus, 
fMemoryManager);
+        fCurHash=fToEnum->fHash==0?XMLString::hash((const 
XMLCh*)fLockPrimaryKey, fToEnum->fHashModulus) : 
fToEnum->fHash->getHashVal(fLockPrimaryKey, fToEnum->fHashModulus);
     else
         fCurHash = (XMLSize_t)-1;
 

Modified: xerces/c/trunk/src/xercesc/util/RefHash3KeysIdPool.c
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/RefHash3KeysIdPool.c?rev=678144&r1=678143&r2=678144&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/RefHash3KeysIdPool.c (original)
+++ xerces/c/trunk/src/xercesc/util/RefHash3KeysIdPool.c Sat Jul 19 05:08:55 
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.
@@ -299,7 +299,7 @@
             new 
(fMemoryManager->allocate(sizeof(RefHash3KeysTableBucketElem<TVal>)))
             RefHash3KeysTableBucketElem<TVal>(key1, key2, key3, valueToAdopt, 
fBucketList[hashVal]);
 #endif
-        fBucketList[hashVal] = newBucket;    
+        fBucketList[hashVal] = newBucket;
 
         //
         //  Give this new one the next available id and add to the pointer 
list.
@@ -324,7 +324,7 @@
         }
         retId = ++fIdCounter;
     }
-    
+
     fIdPtrs[retId] = valueToAdopt;
 
     // Set the id on the passed element
@@ -341,7 +341,7 @@
 findBucketElem(const void* const key1, const int key2, const int key3, 
XMLSize_t& hashVal)
 {
     // Hash the key
-    hashVal = fHash==0?XMLString::hash((const XMLCh*)key1, fHashModulus, 
fMemoryManager) : fHash->getHashVal(key1, fHashModulus, fMemoryManager);
+    hashVal = fHash==0?XMLString::hash((const XMLCh*)key1, fHashModulus) : 
fHash->getHashVal(key1, fHashModulus);
     assert(hashVal < fHashModulus);
 
     // Search that bucket for the key
@@ -360,7 +360,7 @@
 findBucketElem(const void* const key1, const int key2, const int key3, 
XMLSize_t& hashVal) const
 {
     // Hash the key
-    hashVal = fHash==0?XMLString::hash((const XMLCh*)key1, fHashModulus, 
fMemoryManager) : fHash->getHashVal(key1, fHashModulus, fMemoryManager);
+    hashVal = fHash==0?XMLString::hash((const XMLCh*)key1, fHashModulus) : 
fHash->getHashVal(key1, fHashModulus);
     assert(hashVal < fHashModulus);
 
     // Search that bucket for the key
@@ -406,7 +406,7 @@
     , fCurIndex(toCopy.fCurIndex)
     , fToEnum(toCopy.fToEnum)
     , fCurElem(toCopy.fCurElem)
-    , fCurHash(toCopy.fCurHash)    
+    , fCurHash(toCopy.fCurHash)
     , fMemoryManager(toCopy.fMemoryManager)
 {
 }

Modified: xerces/c/trunk/src/xercesc/util/RefHashTableOf.c
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/RefHashTableOf.c?rev=678144&r1=678143&r2=678144&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/RefHashTableOf.c (original)
+++ xerces/c/trunk/src/xercesc/util/RefHashTableOf.c Sat Jul 19 05:08:55 2008
@@ -129,7 +129,7 @@
 removeKey(const void* const key)
 {
     // Hash the key
-    XMLSize_t hashVal = fHash==0?XMLString::hash((const XMLCh*)key, 
fHashModulus, fMemoryManager) : fHash->getHashVal(key, fHashModulus, 
fMemoryManager);
+    XMLSize_t hashVal = fHash==0?XMLString::hash((const XMLCh*)key, 
fHashModulus) : fHash->getHashVal(key, fHashModulus);
     assert(hashVal < fHashModulus);
 
     //
@@ -228,7 +228,7 @@
 {
     // Hash the key
     TVal* retVal = 0;
-    XMLSize_t hashVal = fHash==0?XMLString::hash((const XMLCh*)key, 
fHashModulus, fMemoryManager) : fHash->getHashVal(key, fHashModulus, 
fMemoryManager);
+    XMLSize_t hashVal = fHash==0?XMLString::hash((const XMLCh*)key, 
fHashModulus) : fHash->getHashVal(key, fHashModulus);
     assert(hashVal < fHashModulus);
 
     //
@@ -444,7 +444,7 @@
             // Save the next element before we detach this one
             RefHashTableBucketElem<TVal>* const nextElem = curElem->fNext;
 
-            const XMLSize_t hashVal = fHash==0?XMLString::hash((const 
XMLCh*)curElem->fKey, newMod, fMemoryManager) : 
fHash->getHashVal(curElem->fKey, newMod, fMemoryManager);
+            const XMLSize_t hashVal = fHash==0?XMLString::hash((const 
XMLCh*)curElem->fKey, newMod) : fHash->getHashVal(curElem->fKey, newMod);
             assert(hashVal < newMod);
 
             RefHashTableBucketElem<TVal>* const newHeadElem = 
newBucketList[hashVal];
@@ -473,7 +473,7 @@
 findBucketElem(const void* const key, XMLSize_t& hashVal)
 {
     // Hash the key
-    hashVal = fHash==0?XMLString::hash((const XMLCh*)key, fHashModulus, 
fMemoryManager) : fHash->getHashVal(key, fHashModulus, fMemoryManager);
+    hashVal = fHash==0?XMLString::hash((const XMLCh*)key, fHashModulus) : 
fHash->getHashVal(key, fHashModulus);
     assert(hashVal < fHashModulus);
 
     // Search that bucket for the key
@@ -492,7 +492,7 @@
 findBucketElem(const void* const key, XMLSize_t& hashVal) const
 {
     // Hash the key
-    hashVal = fHash==0?XMLString::hash((const XMLCh*)key, fHashModulus, 
fMemoryManager) : fHash->getHashVal(key, fHashModulus, fMemoryManager);
+    hashVal = fHash==0?XMLString::hash((const XMLCh*)key, fHashModulus) : 
fHash->getHashVal(key, fHashModulus);
     assert(hashVal < fHashModulus);
 
     // Search that bucket for the key

Modified: xerces/c/trunk/src/xercesc/util/ValueHashTableOf.c
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/ValueHashTableOf.c?rev=678144&r1=678143&r2=678144&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/ValueHashTableOf.c (original)
+++ xerces/c/trunk/src/xercesc/util/ValueHashTableOf.c Sat Jul 19 05:08:55 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.
@@ -177,7 +177,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();
@@ -197,7 +197,7 @@
     }
      else
     {
-        newBucket =            
+        newBucket =
             new 
(fMemoryManager->allocate(sizeof(ValueHashTableBucketElem<TVal>)))
             ValueHashTableBucketElem<TVal>(key, valueToAdopt, 
fBucketList[hashVal]);
         fBucketList[hashVal] = newBucket;
@@ -225,8 +225,8 @@
     ArrayJanitor<ValueHashTableBucketElem<TVal>*>  guard(newBucketList, 
fMemoryManager);
 
     memset(newBucketList, 0, newMod * sizeof(newBucketList[0]));
-    
-    
+
+
     // Rehash all existing entries.
     for (XMLSize_t index = 0; index < fHashModulus; index++)
     {
@@ -238,7 +238,7 @@
             // Save the next element before we detach this one
             ValueHashTableBucketElem<TVal>* const nextElem = curElem->fNext;
 
-            const XMLSize_t hashVal = fHash->getHashVal(curElem->fKey, newMod, 
fMemoryManager);
+            const XMLSize_t hashVal = fHash->getHashVal(curElem->fKey, newMod);
             assert(hashVal < newMod);
 
             ValueHashTableBucketElem<TVal>* const newHeadElem = 
newBucketList[hashVal];
@@ -260,14 +260,14 @@
 
     // Delete the old bucket list.
     fMemoryManager->deallocate(oldBucketList);//delete[] oldBucketList;
-    
+
 }
 
 template <class TVal> ValueHashTableBucketElem<TVal>* ValueHashTableOf<TVal>::
 findBucketElem(const void* const key, XMLSize_t& hashVal)
 {
     // Hash the key
-    hashVal = fHash->getHashVal(key, fHashModulus, fMemoryManager);
+    hashVal = fHash->getHashVal(key, fHashModulus);
     assert(hashVal < fHashModulus);
 
     // Search that bucket for the key
@@ -286,7 +286,7 @@
 findBucketElem(const void* const key, XMLSize_t& hashVal) const
 {
     // Hash the key
-    hashVal = fHash->getHashVal(key, fHashModulus, fMemoryManager);
+    hashVal = fHash->getHashVal(key, fHashModulus);
     assert(hashVal < fHashModulus);
 
     // Search that bucket for the key
@@ -335,7 +335,7 @@
             // delete curElem;
             // destructor is empty...
             // curElem->~ValueHashTableBucketElem();
-            fMemoryManager->deallocate(curElem);                        
+            fMemoryManager->deallocate(curElem);
 
             fCount--;
 

Modified: xerces/c/trunk/src/xercesc/util/XMLString.cpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/XMLString.cpp?rev=678144&r1=678143&r2=678144&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLString.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLString.cpp Sat Jul 19 05:08:55 2008
@@ -436,11 +436,8 @@
 
 
 XMLSize_t XMLString::hash(   const   char* const    tohash
-                            , const XMLSize_t       hashModulus
-                            , MemoryManager* const)
+                            , const XMLSize_t       hashModulus)
 {
-    assert(hashModulus);
-
     XMLSize_t hashVal = 0;
     if (tohash) {
         const char* curCh = tohash;
@@ -1406,11 +1403,8 @@
 
 XMLSize_t XMLString::hashN(  const   XMLCh* const   tohash
                             , const XMLSize_t       n
-                            , const XMLSize_t       hashModulus
-                            , MemoryManager* const)
+                            , const XMLSize_t       hashModulus)
 {
-    assert(hashModulus);
-
     if (tohash == 0 || *tohash == 0)
         return 0;
 

Modified: xerces/c/trunk/src/xercesc/util/XMLString.hpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/XMLString.hpp?rev=678144&r1=678143&r2=678144&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLString.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLString.hpp Sat Jul 19 05:08:55 2008
@@ -412,28 +412,24 @@
       *
       * @param toHash The string to hash
       * @param hashModulus The divisor to be used for hashing
-      * @param manager The MemoryManager to use to allocate objects
       * @return Returns the hash value
       */
     static XMLSize_t hash
     (
         const   char* const     toHash
         , const XMLSize_t       hashModulus
-        , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
 
     /** Hashes a string given a modulus
       *
       * @param toHash The string to hash
       * @param hashModulus The divisor to be used for hashing
-      * @param manager The MemoryManager to use to allocate objects
       * @return Returns the hash value
       */
     static XMLSize_t hash
     (
         const   XMLCh* const    toHash
         , const XMLSize_t       hashModulus
-        , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
 
     /** Hashes a string given a modulus taking a maximum number of characters
@@ -450,7 +446,6 @@
         const   XMLCh* const    toHash
         , const XMLSize_t       numChars
         , const XMLSize_t       hashModulus
-        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
     );
 
     //@}
@@ -1571,12 +1566,9 @@
     return XMLString::lastIndexOf(ch, toSearch, stringLen(toSearch));
 }
 
-inline XMLSize_t XMLString::hash(   const   XMLCh* const   tohash
-                                , const XMLSize_t          hashModulus
-                                , MemoryManager* const)
+inline XMLSize_t XMLString::hash(const   XMLCh* const   tohash
+                                , const XMLSize_t          hashModulus)
 {
-    assert(hashModulus);
-
     if (tohash == 0 || *tohash == 0)
         return 0;
 



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

Reply via email to