From 65f20a2d5a86c8e5044ec0ec8b243d465a1a18d5 Mon Sep 17 00:00:00 2001 From: "peterl%netscape.com" Date: Wed, 2 Sep 1998 01:59:30 +0000 Subject: [PATCH] changed HashCode to HashValue and fixed return type git-svn-id: svn://10.0.0.236/trunk@9082 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/base/src/nsAtomTable.cpp | 4 ++-- mozilla/base/src/nsCRT.cpp | 8 ++++---- mozilla/base/src/nsCRT.h | 4 ++-- mozilla/xpcom/ds/nsAtomTable.cpp | 4 ++-- mozilla/xpcom/ds/nsCRT.cpp | 8 ++++---- mozilla/xpcom/ds/nsCRT.h | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/mozilla/base/src/nsAtomTable.cpp b/mozilla/base/src/nsAtomTable.cpp index 41c5de0282b..71706dafccd 100644 --- a/mozilla/base/src/nsAtomTable.cpp +++ b/mozilla/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/mozilla/base/src/nsCRT.cpp b/mozilla/base/src/nsCRT.cpp index 1caa0ad7cc1..4bf4117fcd1 100644 --- a/mozilla/base/src/nsCRT.cpp +++ b/mozilla/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/mozilla/base/src/nsCRT.h b/mozilla/base/src/nsCRT.h index 0161c67e129..6c7ef58baa3 100644 --- a/mozilla/base/src/nsCRT.h +++ b/mozilla/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/mozilla/xpcom/ds/nsAtomTable.cpp b/mozilla/xpcom/ds/nsAtomTable.cpp index 41c5de0282b..71706dafccd 100644 --- a/mozilla/xpcom/ds/nsAtomTable.cpp +++ b/mozilla/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/mozilla/xpcom/ds/nsCRT.cpp b/mozilla/xpcom/ds/nsCRT.cpp index 1caa0ad7cc1..4bf4117fcd1 100644 --- a/mozilla/xpcom/ds/nsCRT.cpp +++ b/mozilla/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/mozilla/xpcom/ds/nsCRT.h b/mozilla/xpcom/ds/nsCRT.h index 0161c67e129..6c7ef58baa3 100644 --- a/mozilla/xpcom/ds/nsCRT.h +++ b/mozilla/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 );