diff --git a/base/src/nsAtomTable.cpp b/base/src/nsAtomTable.cpp index 41c5de0282b..71706dafccd 100644 --- a/base/src/nsAtomTable.cpp +++ b/base/src/nsAtomTable.cpp @@ -103,7 +103,7 @@ AtomImpl::SizeOf(nsISizeOfHandler* aHandler) const static PLHashNumber HashKey(const PRUnichar* k) { - return (PLHashNumber) nsCRT::HashCode(k); + return (PLHashNumber) nsCRT::HashValue(k); } static PRIntn CompareKeys(const PRUnichar* k1, const PRUnichar* k2) @@ -131,7 +131,7 @@ NS_BASE nsIAtom* NS_NewAtom(const PRUnichar* us) nsnull, nsnull); } PRInt32 uslen; - PRInt32 hashCode = nsCRT::HashCode(us, &uslen); + PRUint32 hashCode = nsCRT::HashValue(us, &uslen); PLHashEntry** hep = PL_HashTableRawLookup(gAtomHashTable, hashCode, us); PLHashEntry* he = *hep; if (nsnull != he) { diff --git a/base/src/nsCRT.cpp b/base/src/nsCRT.cpp index 1caa0ad7cc1..4bf4117fcd1 100644 --- a/base/src/nsCRT.cpp +++ b/base/src/nsCRT.cpp @@ -366,9 +366,9 @@ PRInt32 nsCRT::strncasecmp(const PRUnichar* s1, const char* s2, PRInt32 n) return 0; } -PRInt32 nsCRT::HashCode(const PRUnichar* us) +PRUint32 nsCRT::HashValue(const PRUnichar* us) { - PRInt32 rv = 0; + PRUint32 rv = 0; if(us) { PRUnichar ch; while ((ch = *us++) != 0) { @@ -379,9 +379,9 @@ PRInt32 nsCRT::HashCode(const PRUnichar* us) return rv; } -PRInt32 nsCRT::HashCode(const PRUnichar* us, PRInt32* uslenp) +PRUint32 nsCRT::HashValue(const PRUnichar* us, PRInt32* uslenp) { - PRInt32 rv = 0; + PRUint32 rv = 0; PRInt32 len = 0; PRUnichar ch; while ((ch = *us++) != 0) { diff --git a/base/src/nsCRT.h b/base/src/nsCRT.h index 0161c67e129..6c7ef58baa3 100644 --- a/base/src/nsCRT.h +++ b/base/src/nsCRT.h @@ -99,10 +99,10 @@ public: PRInt32 aMaxLen); /// Compute a hashcode for a ucs2 string - static PRInt32 HashCode(const PRUnichar* s1); + static PRUint32 HashValue(const PRUnichar* s1); /// Same as above except that we return the length in s1len - static PRInt32 HashCode(const PRUnichar* s1, PRInt32* s1len); + static PRUint32 HashValue(const PRUnichar* s1, PRInt32* s1len); /// String to integer. static PRInt32 atoi( const PRUnichar *string ); diff --git a/xpcom/ds/nsAtomTable.cpp b/xpcom/ds/nsAtomTable.cpp index 41c5de0282b..71706dafccd 100644 --- a/xpcom/ds/nsAtomTable.cpp +++ b/xpcom/ds/nsAtomTable.cpp @@ -103,7 +103,7 @@ AtomImpl::SizeOf(nsISizeOfHandler* aHandler) const static PLHashNumber HashKey(const PRUnichar* k) { - return (PLHashNumber) nsCRT::HashCode(k); + return (PLHashNumber) nsCRT::HashValue(k); } static PRIntn CompareKeys(const PRUnichar* k1, const PRUnichar* k2) @@ -131,7 +131,7 @@ NS_BASE nsIAtom* NS_NewAtom(const PRUnichar* us) nsnull, nsnull); } PRInt32 uslen; - PRInt32 hashCode = nsCRT::HashCode(us, &uslen); + PRUint32 hashCode = nsCRT::HashValue(us, &uslen); PLHashEntry** hep = PL_HashTableRawLookup(gAtomHashTable, hashCode, us); PLHashEntry* he = *hep; if (nsnull != he) { diff --git a/xpcom/ds/nsCRT.cpp b/xpcom/ds/nsCRT.cpp index 1caa0ad7cc1..4bf4117fcd1 100644 --- a/xpcom/ds/nsCRT.cpp +++ b/xpcom/ds/nsCRT.cpp @@ -366,9 +366,9 @@ PRInt32 nsCRT::strncasecmp(const PRUnichar* s1, const char* s2, PRInt32 n) return 0; } -PRInt32 nsCRT::HashCode(const PRUnichar* us) +PRUint32 nsCRT::HashValue(const PRUnichar* us) { - PRInt32 rv = 0; + PRUint32 rv = 0; if(us) { PRUnichar ch; while ((ch = *us++) != 0) { @@ -379,9 +379,9 @@ PRInt32 nsCRT::HashCode(const PRUnichar* us) return rv; } -PRInt32 nsCRT::HashCode(const PRUnichar* us, PRInt32* uslenp) +PRUint32 nsCRT::HashValue(const PRUnichar* us, PRInt32* uslenp) { - PRInt32 rv = 0; + PRUint32 rv = 0; PRInt32 len = 0; PRUnichar ch; while ((ch = *us++) != 0) { diff --git a/xpcom/ds/nsCRT.h b/xpcom/ds/nsCRT.h index 0161c67e129..6c7ef58baa3 100644 --- a/xpcom/ds/nsCRT.h +++ b/xpcom/ds/nsCRT.h @@ -99,10 +99,10 @@ public: PRInt32 aMaxLen); /// Compute a hashcode for a ucs2 string - static PRInt32 HashCode(const PRUnichar* s1); + static PRUint32 HashValue(const PRUnichar* s1); /// Same as above except that we return the length in s1len - static PRInt32 HashCode(const PRUnichar* s1, PRInt32* s1len); + static PRUint32 HashValue(const PRUnichar* s1, PRInt32* s1len); /// String to integer. static PRInt32 atoi( const PRUnichar *string );