diff --git a/content/xbl/src/nsXBLDocumentInfo.cpp b/content/xbl/src/nsXBLDocumentInfo.cpp index 375285c1cc1..e6e1a842fa7 100644 --- a/content/xbl/src/nsXBLDocumentInfo.cpp +++ b/content/xbl/src/nsXBLDocumentInfo.cpp @@ -429,7 +429,7 @@ static PRBool IsChromeURI(nsIURI* aURI) /* Implementation file */ -static PRIntn +static PRBool TraverseProtos(nsHashKey *aKey, void *aData, void* aClosure) { nsCycleCollectionTraversalCallback *cb = @@ -439,7 +439,7 @@ TraverseProtos(nsHashKey *aKey, void *aData, void* aClosure) return kHashEnumerateNext; } -static PRIntn +static PRBool UnlinkProtoJSObjects(nsHashKey *aKey, void *aData, void* aClosure) { nsXBLPrototypeBinding *proto = static_cast(aData); @@ -453,7 +453,7 @@ struct ProtoTracer void *mClosure; }; -static PRIntn +static PRBool TraceProtos(nsHashKey *aKey, void *aData, void* aClosure) { ProtoTracer* closure = static_cast(aClosure); diff --git a/content/xbl/src/nsXBLPrototypeBinding.cpp b/content/xbl/src/nsXBLPrototypeBinding.cpp index a1932ed790f..714389bb0d4 100644 --- a/content/xbl/src/nsXBLPrototypeBinding.cpp +++ b/content/xbl/src/nsXBLPrototypeBinding.cpp @@ -328,7 +328,7 @@ PRBool nsXBLPrototypeBinding::CompareBindingURI(nsIURI* aURI) const return equal; } -static PRIntn +static PRBool TraverseInsertionPoint(nsHashKey* aKey, void* aData, void* aClosure) { nsCycleCollectionTraversalCallback &cb = diff --git a/xpcom/ds/nsHashtable.cpp b/xpcom/ds/nsHashtable.cpp index e302ef2b8ca..179ad4651af 100644 --- a/xpcom/ds/nsHashtable.cpp +++ b/xpcom/ds/nsHashtable.cpp @@ -127,12 +127,8 @@ hashEnumerate(PLDHashTable* table, PLDHashEntryHdr* hdr, PRUint32 i, void *arg) _HashEnumerateArgs* thunk = (_HashEnumerateArgs*)arg; HTEntry* entry = static_cast(hdr); - switch (thunk->fn(entry->key, entry->value, thunk->arg)) { - case kHashEnumerateNext: + if (thunk->fn(entry->key, entry->value, thunk->arg)) return PL_DHASH_NEXT; - case kHashEnumerateRemove: - return PL_DHASH_REMOVE; - } return PL_DHASH_STOP; } diff --git a/xpcom/ds/nsHashtable.h b/xpcom/ds/nsHashtable.h index 6b5a14d13e5..5aa9bf812f7 100644 --- a/xpcom/ds/nsHashtable.h +++ b/xpcom/ds/nsHashtable.h @@ -109,11 +109,10 @@ class nsHashKey { // Return values for nsHashtableEnumFunc enum { kHashEnumerateStop = PR_FALSE, - kHashEnumerateNext = PR_TRUE, - kHashEnumerateRemove = 2 + kHashEnumerateNext = PR_TRUE }; -typedef PRIntn +typedef PRBool (* nsHashtableEnumFunc)(nsHashKey *aKey, void *aData, void* aClosure); typedef nsresult @@ -196,8 +195,6 @@ class nsSupportsHashtable : private nsHashtable { public: - typedef PRBool (* EnumFunc) (nsHashKey *aKey, void *aData, void* aClosure); - nsSupportsHashtable(PRUint32 aSize = 16, PRBool threadSafe = PR_FALSE) : nsHashtable(aSize, threadSafe) {} ~nsSupportsHashtable(); @@ -214,7 +211,7 @@ class nsSupportsHashtable nsISupports* Get(nsHashKey *aKey); PRBool Remove(nsHashKey *aKey, nsISupports **value = nsnull); nsHashtable *Clone(); - void Enumerate(EnumFunc aEnumFunc, void* aClosure = NULL) { + void Enumerate(nsHashtableEnumFunc aEnumFunc, void* aClosure = NULL) { nsHashtable::Enumerate(aEnumFunc, aClosure); } void Reset();