From b079346b216bbcb0bb4fc1304da776b52b85ee83 Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Tue, 15 Dec 1998 01:34:36 +0000 Subject: [PATCH] Landed a patch from bobg@zanshin.com git-svn-id: svn://10.0.0.236/trunk@16392 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsWebShell.cpp | 2 +- mozilla/webshell/src/nsWebShell.cpp | 2 +- .../webshell/tests/viewer/nsWebCrawler.cpp | 20 +++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index 4b607b307a3..bec83afc853 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -1113,7 +1113,7 @@ nsWebShell::GetDocumentLoader(nsIDocumentLoader*& aResult) #define FILE_PROTOCOL "file:///" -static void convertFileToURL(nsString &aIn, nsString &aOut) +static void convertFileToURL(const nsString &aIn, nsString &aOut) { #ifdef XP_PC char szFile[1000]; diff --git a/mozilla/webshell/src/nsWebShell.cpp b/mozilla/webshell/src/nsWebShell.cpp index 4b607b307a3..bec83afc853 100644 --- a/mozilla/webshell/src/nsWebShell.cpp +++ b/mozilla/webshell/src/nsWebShell.cpp @@ -1113,7 +1113,7 @@ nsWebShell::GetDocumentLoader(nsIDocumentLoader*& aResult) #define FILE_PROTOCOL "file:///" -static void convertFileToURL(nsString &aIn, nsString &aOut) +static void convertFileToURL(const nsString &aIn, nsString &aOut) { #ifdef XP_PC char szFile[1000]; diff --git a/mozilla/webshell/tests/viewer/nsWebCrawler.cpp b/mozilla/webshell/tests/viewer/nsWebCrawler.cpp index fb6bab79074..a9472ea32ad 100644 --- a/mozilla/webshell/tests/viewer/nsWebCrawler.cpp +++ b/mozilla/webshell/tests/viewer/nsWebCrawler.cpp @@ -60,9 +60,9 @@ public: AtomHashTable(); ~AtomHashTable(); - void* Get(nsIAtom* aKey); - void* Put(nsIAtom* aKey, void* aValue); - void* Remove(nsIAtom* aKey); + const void* Get(nsIAtom* aKey); + const void* Put(nsIAtom* aKey, const void* aValue); + const void* Remove(nsIAtom* aKey); protected: PLHashTable* mTable; @@ -92,7 +92,7 @@ AtomHashTable::~AtomHashTable() /** * Get the data associated with a Atom. */ -void* +const void* AtomHashTable::Get(nsIAtom* aKey) { PRInt32 hashCode = (PRInt32) aKey; @@ -109,19 +109,19 @@ AtomHashTable::Get(nsIAtom* aKey) * returns an old association if there was one (or nsnull if there * wasn't). */ -void* -AtomHashTable::Put(nsIAtom* aKey, void* aData) +const void* +AtomHashTable::Put(nsIAtom* aKey, const void* aData) { PRInt32 hashCode = (PRInt32) aKey; PLHashEntry** hep = PL_HashTableRawLookup(mTable, hashCode, aKey); PLHashEntry* he = *hep; if (nsnull != he) { - void* oldValue = he->value; - he->value = aData; + const void* oldValue = he->value; + he->value = NS_CONST_CAST(void*, aData); return oldValue; } NS_ADDREF(aKey); - PL_HashTableRawAdd(mTable, hep, hashCode, aKey, aData); + PL_HashTableRawAdd(mTable, hep, hashCode, aKey, NS_CONST_CAST(void*, aData)); return nsnull; } @@ -129,7 +129,7 @@ AtomHashTable::Put(nsIAtom* aKey, void* aData) * Remove an association between a Atom and it's data. This returns * the old associated data. */ -void* +const void* AtomHashTable::Remove(nsIAtom* aKey) { PRInt32 hashCode = (PRInt32) aKey;