diff --git a/xpcom/ds/nsVoidBTree.cpp b/xpcom/ds/nsVoidBTree.cpp index 38bbe0182c4..463ce0e71bb 100644 --- a/xpcom/ds/nsVoidBTree.cpp +++ b/xpcom/ds/nsVoidBTree.cpp @@ -749,7 +749,7 @@ nsVoidBTree::Dump(Node* aNode, PRInt32 aIndent) // nsVoidBTree::ConstIterator and Iterator methods // -PRWord nsVoidBTree::kDummyLast; +void* nsVoidBTree::kDummyLast; void nsVoidBTree::ConstIterator::Next() diff --git a/xpcom/ds/nsVoidBTree.h b/xpcom/ds/nsVoidBTree.h index 90f748c46f5..f2d0eddd9f2 100644 --- a/xpcom/ds/nsVoidBTree.h +++ b/xpcom/ds/nsVoidBTree.h @@ -367,7 +367,7 @@ public: class Iterator : public ConstIterator { protected: - PRWord* mElementRef; + void** mElementRef; public: Iterator& operator++() { @@ -389,9 +389,10 @@ public: return temp; } void*& operator*() const { - return mIsSingleton - ? NS_REINTERPRET_CAST(void*&, !mIsExhausted ? *mElementRef : kDummyLast) - : mPath.TopNode()->GetElementAt(mPath.TopIndex()); } + if (mIsSingleton) + return !mIsExhausted ? *mElementRef : kDummyLast; + else + return mPath.TopNode()->GetElementAt(mPath.TopIndex()); } PRBool operator==(const Iterator& aOther) const { return mIsSingleton @@ -407,7 +408,7 @@ public: Iterator(PRWord* aElementRef, PRBool aIsExhausted) : ConstIterator(*aElementRef, aIsExhausted), - mElementRef(aElementRef) {} + mElementRef(NS_REINTERPRET_CAST(void**, aElementRef)) {} friend class nsVoidBTree; }; @@ -422,7 +423,7 @@ protected: const Path LeftMostPath() const; const Path RightMostPath() const; - static PRWord kDummyLast; + static void* kDummyLast; };