From 8d4f1935a6dffaf2296d4030d0dafd4e247b062b Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Fri, 4 Apr 2003 15:10:37 +0000 Subject: [PATCH] fix for bug 195298 - pldhash ops tables should be const.. r=dougt, sr=sfraser git-svn-id: svn://10.0.0.236/trunk@140696 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/base/nsTraceRefcnt.cpp | 6 +++--- mozilla/xpcom/base/nsTraceRefcntImpl.cpp | 6 +++--- mozilla/xpcom/components/nsComponentManager.cpp | 6 +++--- mozilla/xpcom/ds/nsAtomTable.cpp | 2 +- mozilla/xpcom/ds/nsHashtable.cpp | 2 +- mozilla/xpcom/ds/nsPersistentProperties.cpp | 2 +- mozilla/xpcom/ds/nsStaticNameTable.cpp | 2 +- mozilla/xpcom/io/nsFastLoadFile.cpp | 6 +++--- mozilla/xpcom/reflect/xptinfo/src/xptiWorkingSet.cpp | 4 ++-- mozilla/xpcom/threads/nsAutoLock.cpp | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/mozilla/xpcom/base/nsTraceRefcnt.cpp b/mozilla/xpcom/base/nsTraceRefcnt.cpp index ac0a29c96d3..ca06b068ff6 100644 --- a/mozilla/xpcom/base/nsTraceRefcnt.cpp +++ b/mozilla/xpcom/base/nsTraceRefcnt.cpp @@ -203,12 +203,12 @@ TypesToLogFreeEntry(void *pool, PLHashEntry *he, PRUintn flag) } } -static PLHashAllocOps serialNumberHashAllocOps = { +static const PLHashAllocOps serialNumberHashAllocOps = { DefaultAllocTable, DefaultFreeTable, DefaultAllocEntry, SerialNumberFreeEntry }; -static PLHashAllocOps typesToLogHashAllocOps = { +static const PLHashAllocOps typesToLogHashAllocOps = { DefaultAllocTable, DefaultFreeTable, DefaultAllocEntry, TypesToLogFreeEntry }; @@ -430,7 +430,7 @@ BloatViewFreeEntry(void *pool, PLHashEntry *he, PRUintn flag) } } -static PLHashAllocOps bloatViewHashAllocOps = { +const static PLHashAllocOps bloatViewHashAllocOps = { DefaultAllocTable, DefaultFreeTable, DefaultAllocEntry, BloatViewFreeEntry }; diff --git a/mozilla/xpcom/base/nsTraceRefcntImpl.cpp b/mozilla/xpcom/base/nsTraceRefcntImpl.cpp index ac0a29c96d3..ca06b068ff6 100644 --- a/mozilla/xpcom/base/nsTraceRefcntImpl.cpp +++ b/mozilla/xpcom/base/nsTraceRefcntImpl.cpp @@ -203,12 +203,12 @@ TypesToLogFreeEntry(void *pool, PLHashEntry *he, PRUintn flag) } } -static PLHashAllocOps serialNumberHashAllocOps = { +static const PLHashAllocOps serialNumberHashAllocOps = { DefaultAllocTable, DefaultFreeTable, DefaultAllocEntry, SerialNumberFreeEntry }; -static PLHashAllocOps typesToLogHashAllocOps = { +static const PLHashAllocOps typesToLogHashAllocOps = { DefaultAllocTable, DefaultFreeTable, DefaultAllocEntry, TypesToLogFreeEntry }; @@ -430,7 +430,7 @@ BloatViewFreeEntry(void *pool, PLHashEntry *he, PRUintn flag) } } -static PLHashAllocOps bloatViewHashAllocOps = { +const static PLHashAllocOps bloatViewHashAllocOps = { DefaultAllocTable, DefaultFreeTable, DefaultAllocEntry, BloatViewFreeEntry }; diff --git a/mozilla/xpcom/components/nsComponentManager.cpp b/mozilla/xpcom/components/nsComponentManager.cpp index 665e0ab8ec8..e20e5da7007 100644 --- a/mozilla/xpcom/components/nsComponentManager.cpp +++ b/mozilla/xpcom/components/nsComponentManager.cpp @@ -127,7 +127,7 @@ static const char gIDFormat[] = // Nonexistent factory entry // This is used to mark non-existent contractid mappings -static nsFactoryEntry * kNonExistentContractID = (nsFactoryEntry*) 1; +static const nsFactoryEntry * const kNonExistentContractID = (nsFactoryEntry*) 1; #define NS_EMPTY_IID \ @@ -303,7 +303,7 @@ factory_ClearEntry(PLDHashTable *aTable, PLDHashEntryHdr *aHdr) PL_DHashClearEntryStub(aTable, aHdr); } -static PLDHashTableOps factory_DHashTableOps = { +static const PLDHashTableOps factory_DHashTableOps = { PL_DHashAllocTable, PL_DHashFreeTable, factory_GetKey, @@ -352,7 +352,7 @@ contractID_ClearEntry(PLDHashTable *aTable, PLDHashEntryHdr *aHdr) PL_DHashClearEntryStub(aTable, aHdr); } -static PLDHashTableOps contractID_DHashTableOps = { +static const PLDHashTableOps contractID_DHashTableOps = { PL_DHashAllocTable, PL_DHashFreeTable, contractID_GetKey, diff --git a/mozilla/xpcom/ds/nsAtomTable.cpp b/mozilla/xpcom/ds/nsAtomTable.cpp index 0340c40183e..cecc7f307f1 100644 --- a/mozilla/xpcom/ds/nsAtomTable.cpp +++ b/mozilla/xpcom/ds/nsAtomTable.cpp @@ -209,7 +209,7 @@ AtomTableClearEntry(PLDHashTable *table, PLDHashEntryHdr *entry) he->ClearAtom(); } -static PLDHashTableOps AtomTableOps = { +static const PLDHashTableOps AtomTableOps = { PL_DHashAllocTable, PL_DHashFreeTable, AtomTableGetKey, diff --git a/mozilla/xpcom/ds/nsHashtable.cpp b/mozilla/xpcom/ds/nsHashtable.cpp index d875c391adb..bd73f9b7402 100644 --- a/mozilla/xpcom/ds/nsHashtable.cpp +++ b/mozilla/xpcom/ds/nsHashtable.cpp @@ -84,7 +84,7 @@ clearHashEntry(PLDHashTable* table, PLDHashEntryHdr* entry) } -static PLDHashTableOps hashtableOps = { +static const PLDHashTableOps hashtableOps = { PL_DHashAllocTable, PL_DHashFreeTable, PL_DHashGetKeyStub, diff --git a/mozilla/xpcom/ds/nsPersistentProperties.cpp b/mozilla/xpcom/ds/nsPersistentProperties.cpp index 8c6665cdd92..e04c847e794 100644 --- a/mozilla/xpcom/ds/nsPersistentProperties.cpp +++ b/mozilla/xpcom/ds/nsPersistentProperties.cpp @@ -105,7 +105,7 @@ getPropertyKey(PLDHashTable*, PLDHashEntryHdr* aHdr) return entry->mKey; } -struct PLDHashTableOps property_HashTableOps = { +static const struct PLDHashTableOps property_HashTableOps = { PL_DHashAllocTable, PL_DHashFreeTable, getPropertyKey, diff --git a/mozilla/xpcom/ds/nsStaticNameTable.cpp b/mozilla/xpcom/ds/nsStaticNameTable.cpp index 81f769ea8cb..3526e24ad19 100644 --- a/mozilla/xpcom/ds/nsStaticNameTable.cpp +++ b/mozilla/xpcom/ds/nsStaticNameTable.cpp @@ -89,7 +89,7 @@ getNameKey(PLDHashTable*, PLDHashEntryHdr* aHdr) return entry->mKey; } -struct PLDHashTableOps nametable_CaseInsensitiveHashTableOps = { +static const struct PLDHashTableOps nametable_CaseInsensitiveHashTableOps = { PL_DHashAllocTable, PL_DHashFreeTable, getNameKey, diff --git a/mozilla/xpcom/io/nsFastLoadFile.cpp b/mozilla/xpcom/io/nsFastLoadFile.cpp index 840b2fa4022..ffe4e2ad08e 100644 --- a/mozilla/xpcom/io/nsFastLoadFile.cpp +++ b/mozilla/xpcom/io/nsFastLoadFile.cpp @@ -345,7 +345,7 @@ strmap_ClearEntry(PLDHashTable *aTable, PLDHashEntryHdr *aHdr) PL_DHashClearEntryStub(aTable, aHdr); } -static PLDHashTableOps strmap_DHashTableOps = { +static const PLDHashTableOps strmap_DHashTableOps = { PL_DHashAllocTable, PL_DHashFreeTable, PL_DHashGetKeyStub, @@ -381,7 +381,7 @@ objmap_ClearEntry(PLDHashTable *aTable, PLDHashEntryHdr *aHdr) PL_DHashClearEntryStub(aTable, aHdr); } -static PLDHashTableOps objmap_DHashTableOps = { +static const PLDHashTableOps objmap_DHashTableOps = { PL_DHashAllocTable, PL_DHashFreeTable, PL_DHashGetKeyStub, @@ -1212,7 +1212,7 @@ idmap_MatchEntry(PLDHashTable *aTable, return memcmp(&entry->mSlowID, idp, sizeof(nsID)) == 0; } -static PLDHashTableOps idmap_DHashTableOps = { +static const PLDHashTableOps idmap_DHashTableOps = { PL_DHashAllocTable, PL_DHashFreeTable, idmap_GetKey, diff --git a/mozilla/xpcom/reflect/xptinfo/src/xptiWorkingSet.cpp b/mozilla/xpcom/reflect/xptinfo/src/xptiWorkingSet.cpp index 72b682fe254..7707b919a5c 100644 --- a/mozilla/xpcom/reflect/xptinfo/src/xptiWorkingSet.cpp +++ b/mozilla/xpcom/reflect/xptinfo/src/xptiWorkingSet.cpp @@ -71,7 +71,7 @@ IIDMatch(PLDHashTable *table, return iid1 == iid2 || iid1->Equals(*iid2); } -static struct PLDHashTableOps IIDTableOps = +const static struct PLDHashTableOps IIDTableOps = { PL_DHashAllocTable, PL_DHashFreeTable, @@ -101,7 +101,7 @@ NameMatch(PLDHashTable *table, return str1 == str2 || 0 == PL_strcmp(str1, str2); } -static struct PLDHashTableOps NameTableOps = +static const struct PLDHashTableOps NameTableOps = { PL_DHashAllocTable, PL_DHashFreeTable, diff --git a/mozilla/xpcom/threads/nsAutoLock.cpp b/mozilla/xpcom/threads/nsAutoLock.cpp index 58802062a52..72eb1dff39f 100644 --- a/mozilla/xpcom/threads/nsAutoLock.cpp +++ b/mozilla/xpcom/threads/nsAutoLock.cpp @@ -50,7 +50,7 @@ static PRUintn LockStackTPI = (PRUintn)-1; static PLHashTable* OrderTable = 0; static PRLock* OrderTableLock = 0; -static const char* LockTypeNames[] = {"Lock", "Monitor", "CMonitor"}; +static const char* const LockTypeNames[] = {"Lock", "Monitor", "CMonitor"}; struct nsNamedVector : public nsVoidArray { const char* mName; @@ -110,7 +110,7 @@ _hash_free_entry(void *pool, PLHashEntry *entry, PRUintn flag) delete entry; } -static PLHashAllocOps _hash_alloc_ops = { +static const PLHashAllocOps _hash_alloc_ops = { _hash_alloc_table, _hash_free_table, _hash_alloc_entry, _hash_free_entry };