From 192449c4bc71476f52f73e703edfdb7c0e8d01d9 Mon Sep 17 00:00:00 2001 From: "rickg%netscape.com" Date: Sat, 25 Jul 1998 02:11:02 +0000 Subject: [PATCH] warning removal git-svn-id: svn://10.0.0.236/trunk@6479 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/base/src/nsBTree.cpp | 3 +- mozilla/base/src/nsBTree.h | 2 +- mozilla/base/src/nsDeque.cpp | 7 ++-- mozilla/base/src/nsRBTree.h | 2 +- mozilla/base/src/nsString.cpp | 9 ++--- mozilla/htmlparser/src/CNavDTD.cpp | 33 +++++++---------- mozilla/htmlparser/src/CNavDTD.h | 4 +-- mozilla/htmlparser/src/COtherDTD.cpp | 20 +++++------ mozilla/htmlparser/src/COtherDTD.h | 4 +-- mozilla/htmlparser/src/CRtfDTD.cpp | 6 ---- mozilla/htmlparser/src/nsDTDDebug.cpp | 2 +- .../src/nsHTMLContentSinkStream.cpp | 35 +++++++++++-------- mozilla/htmlparser/src/nsHTMLNullSink.cpp | 2 +- mozilla/htmlparser/src/nsIDTD.h | 4 +-- mozilla/htmlparser/src/nsParser.cpp | 14 +++----- mozilla/htmlparser/src/nsParser.h | 1 - mozilla/htmlparser/src/nsParserNode.cpp | 4 +-- mozilla/htmlparser/src/nsScanner.cpp | 1 - mozilla/htmlparser/src/nsTokenHandler.cpp | 1 - mozilla/htmlparser/src/nsValidDTD.cpp | 18 +++++----- mozilla/htmlparser/src/nsValidDTD.h | 4 +-- mozilla/htmlparser/src/nsWellFormedDTD.cpp | 18 +++++----- mozilla/htmlparser/src/nsWellFormedDTD.h | 4 +-- mozilla/htmlparser/src/nsXIFDTD.cpp | 13 +++++-- mozilla/htmlparser/src/nsXIFDTD.h | 4 +-- mozilla/parser/htmlparser/src/CNavDTD.cpp | 33 +++++++---------- mozilla/parser/htmlparser/src/CNavDTD.h | 4 +-- mozilla/parser/htmlparser/src/COtherDTD.cpp | 20 +++++------ mozilla/parser/htmlparser/src/COtherDTD.h | 4 +-- mozilla/parser/htmlparser/src/CRtfDTD.cpp | 6 ---- mozilla/parser/htmlparser/src/nsDTDDebug.cpp | 2 +- .../src/nsHTMLContentSinkStream.cpp | 35 +++++++++++-------- .../parser/htmlparser/src/nsHTMLNullSink.cpp | 2 +- mozilla/parser/htmlparser/src/nsIDTD.h | 4 +-- mozilla/parser/htmlparser/src/nsParser.cpp | 14 +++----- mozilla/parser/htmlparser/src/nsParser.h | 1 - .../parser/htmlparser/src/nsParserNode.cpp | 4 +-- mozilla/parser/htmlparser/src/nsScanner.cpp | 1 - .../parser/htmlparser/src/nsTokenHandler.cpp | 1 - mozilla/parser/htmlparser/src/nsValidDTD.cpp | 18 +++++----- mozilla/parser/htmlparser/src/nsValidDTD.h | 4 +-- .../parser/htmlparser/src/nsWellFormedDTD.cpp | 18 +++++----- .../parser/htmlparser/src/nsWellFormedDTD.h | 4 +-- mozilla/parser/htmlparser/src/nsXIFDTD.cpp | 13 +++++-- mozilla/parser/htmlparser/src/nsXIFDTD.h | 4 +-- mozilla/string/obsolete/nsString.cpp | 9 ++--- mozilla/xpcom/ds/nsBTree.cpp | 3 +- mozilla/xpcom/ds/nsBTree.h | 2 +- mozilla/xpcom/ds/nsDeque.cpp | 7 ++-- mozilla/xpcom/ds/nsRBTree.h | 2 +- mozilla/xpcom/ds/nsString.cpp | 9 ++--- mozilla/xpcom/string/obsolete/nsString.cpp | 9 ++--- 52 files changed, 198 insertions(+), 250 deletions(-) diff --git a/mozilla/base/src/nsBTree.cpp b/mozilla/base/src/nsBTree.cpp index a771d94aaac..216a8bd816f 100644 --- a/mozilla/base/src/nsBTree.cpp +++ b/mozilla/base/src/nsBTree.cpp @@ -130,7 +130,6 @@ nsBTree::~nsBTree(){ * @return ptr to added node or NULL */ nsNode* nsBTree::Add(nsNode& aNode){ - PRBool result=PR_TRUE; nsNode* node1=mRoot; //x nsNode* node2=0; //y @@ -225,7 +224,7 @@ nsBTree& nsBTree::Empty(nsNode* aNode) { * @return this */ nsBTree& nsBTree::Erase(nsNode* aNode){ - nsNode* node1 =(aNode) ? aNode : mRoot; +// nsNode* node1 =(aNode) ? aNode : mRoot; if(aNode) { Erase(aNode->mLeft); //begin by walking left side diff --git a/mozilla/base/src/nsBTree.h b/mozilla/base/src/nsBTree.h index 62b79b8b654..88b465bb01c 100644 --- a/mozilla/base/src/nsBTree.h +++ b/mozilla/base/src/nsBTree.h @@ -150,7 +150,7 @@ public: friend class nsBTreeIterator; nsBTree(); - ~nsBTree(); + virtual ~nsBTree(); /** * Add given node reference into our tree. diff --git a/mozilla/base/src/nsDeque.cpp b/mozilla/base/src/nsDeque.cpp index c221ec9aaf3..abeddab7656 100644 --- a/mozilla/base/src/nsDeque.cpp +++ b/mozilla/base/src/nsDeque.cpp @@ -245,8 +245,7 @@ const void* nsDeque::ForEach(nsDequeFunctor& aFunctor) const{ * @param aQueue is the deque object to be iterated * @param anIndex is the starting position for your iteration */ -nsDequeIterator::nsDequeIterator(const nsDeque& aQueue,int anIndex): mDeque(aQueue) { - mIndex=anIndex; +nsDequeIterator::nsDequeIterator(const nsDeque& aQueue,int anIndex): mIndex(anIndex), mDeque(aQueue) { } /** @@ -256,9 +255,7 @@ nsDequeIterator::nsDequeIterator(const nsDeque& aQueue,int anIndex): mDeque(aQue * @param aCopy is another iterator to copy from * @return */ -nsDequeIterator::nsDequeIterator(const nsDequeIterator& aCopy) : - mDeque(aCopy.mDeque), - mIndex(aCopy.mIndex) { +nsDequeIterator::nsDequeIterator(const nsDequeIterator& aCopy) : mIndex(aCopy.mIndex), mDeque(aCopy.mDeque) { } /** diff --git a/mozilla/base/src/nsRBTree.h b/mozilla/base/src/nsRBTree.h index c91241b2bb3..8d423e246ae 100644 --- a/mozilla/base/src/nsRBTree.h +++ b/mozilla/base/src/nsRBTree.h @@ -64,7 +64,7 @@ friend class NS_BASE nsRBTreeIterator; * * @update gess 4/11/98 */ - ~nsRBTree(); + virtual ~nsRBTree(); /** * Given a node, we're supposed to add it into diff --git a/mozilla/base/src/nsString.cpp b/mozilla/base/src/nsString.cpp index b2690e01391..ace4aa346c1 100644 --- a/mozilla/base/src/nsString.cpp +++ b/mozilla/base/src/nsString.cpp @@ -534,7 +534,7 @@ char* nsString::ToCString(char* aBuf, PRInt32 aBufLength) const float nsString::ToFloat(PRInt32* aErrorCode) const { char buf[40]; - if (mLength > sizeof(buf)-1) { + if (mLength > PRInt32(sizeof(buf)-1)) { *aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE; return 0.0f; } @@ -950,8 +950,6 @@ PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) { //Copy rightmost chars, up to offset+aCount... while(first= sizeof(buf)) { + if (len >= PRInt32(sizeof(buf))) { cp = aString.ToNewCString(); } else { aString.ToCString(cp, len + 1); diff --git a/mozilla/htmlparser/src/CNavDTD.cpp b/mozilla/htmlparser/src/CNavDTD.cpp index 19e905c95e1..de5797e5b84 100644 --- a/mozilla/htmlparser/src/CNavDTD.cpp +++ b/mozilla/htmlparser/src/CNavDTD.cpp @@ -43,9 +43,8 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID); static NS_DEFINE_IID(kClassIID, NS_INAVHTML_DTD_IID); -static const char* kNullURL = "Error: Null URL given"; -static const char* kNullFilename= "Error: Null filename given"; -static const char* kNullTokenizer = "Error: Unable to construct tokenizer"; +//static const char* kNullURL = "Error: Null URL given"; +//static const char* kNullFilename= "Error: Null filename given"; static const char* kNullToken = "Error: Null token given"; static const char* kInvalidTagStackPos = "Error: invalid tag stack position"; static const char* kHTMLTextContentType = "text/html"; @@ -335,8 +334,7 @@ static CNavTokenDeallocator gTokenKiller; * @param * @return */ -CNavDTD::CNavDTD() : nsIDTD(), mTokenDeque(gTokenKiller), - mContextStack(), mStyleStack() { +CNavDTD::CNavDTD() : nsIDTD(), mContextStack(), mStyleStack(), mTokenDeque(gTokenKiller) { NS_INIT_REFCNT(); mParser=0; mSink = nsnull; @@ -423,12 +421,12 @@ eAutoDetectResult CNavDTD::AutoDetectContentType(nsString& aBuffer,nsString& aTy * @param * @return */ -nsresult CNavDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel){ +nsresult CNavDTD::WillBuildModel(nsString& aFilename,PRBool aNotifySink){ nsresult result=NS_OK; mFilename=aFilename; - if((1==aLevel) && (mSink)) { + if((aNotifySink) && (mSink)) { mLineNumber=1; result = mSink->WillBuildModel(); } @@ -442,14 +440,14 @@ nsresult CNavDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel){ * @param * @return */ -nsresult CNavDTD::DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel){ +nsresult CNavDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink){ nsresult result= NS_OK; if((kNoError==anErrorCode) && (mContextStack.mCount>0)) { result = CloseContainersTo(0,eHTMLTag_unknown,PR_FALSE); } - if((1==aLevel) && (mSink)) { + if((aNotifySink) && (mSink)) { result = mSink->DidBuildModel(1); } @@ -818,9 +816,7 @@ nsresult CNavDTD::HandleAttributeToken(CToken* aToken) { NS_PRECONDITION(0!=aToken,kNullToken); NS_ERROR("attribute encountered -- this shouldn't happen!"); - CAttributeToken* at = (CAttributeToken*)(aToken); - nsresult result=NS_OK; - return result; + return NS_OK; } /** @@ -872,9 +868,8 @@ nsresult CNavDTD::HandleScriptToken(CToken* aToken, nsCParserNode& aNode) { nsresult CNavDTD::HandleStyleToken(CToken* aToken){ NS_PRECONDITION(0!=aToken,kNullToken); - CStyleToken* st = (CStyleToken*)(aToken); - nsresult result=NS_OK; - return result; +// CStyleToken* st = (CStyleToken*)(aToken); + return NS_OK; } @@ -924,7 +919,6 @@ CITokenHandler* CNavDTD::AddTokenHandler(CITokenHandler* aHandler) { if(aHandler) { eHTMLTokenTypes type=(eHTMLTokenTypes)aHandler->GetTokenType(); if(typeConsume(ch,aScanner); if(result) { diff --git a/mozilla/htmlparser/src/CNavDTD.h b/mozilla/htmlparser/src/CNavDTD.h index ec0805093b5..cdf960f06f8 100644 --- a/mozilla/htmlparser/src/CNavDTD.h +++ b/mozilla/htmlparser/src/CNavDTD.h @@ -221,7 +221,7 @@ CLASS_EXPORT_HTMLPARS CNavDTD : public nsIDTD { * @param aFilename is the name of the file being parsed. * @return error code (almost always 0) */ - NS_IMETHOD WillBuildModel(nsString& aFilename,PRInt32 aLevel); + NS_IMETHOD WillBuildModel(nsString& aFilename,PRBool aNotifySink); /** * The parser uses a code sandwich to wrap the parsing process. Before @@ -231,7 +231,7 @@ CLASS_EXPORT_HTMLPARS CNavDTD : public nsIDTD { * @param anErrorCode contans the last error that occured * @return error code */ - NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel); + NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink); /** * This method is called by the parser, once for each token diff --git a/mozilla/htmlparser/src/COtherDTD.cpp b/mozilla/htmlparser/src/COtherDTD.cpp index 7389cb3d5b2..6c048b9a2b4 100644 --- a/mozilla/htmlparser/src/COtherDTD.cpp +++ b/mozilla/htmlparser/src/COtherDTD.cpp @@ -58,12 +58,12 @@ static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID); static NS_DEFINE_IID(kClassIID, NS_IOtherHTML_DTD_IID); static NS_DEFINE_IID(kBaseClassIID, NS_INAVHTML_DTD_IID); -static const char* kNullURL = "Error: Null URL given"; -static const char* kNullFilename= "Error: Null filename given"; -static const char* kNullTokenizer = "Error: Unable to construct tokenizer"; -static const char* kNullToken = "Error: Null token given"; -static const char* kInvalidTagStackPos = "Error: invalid tag stack position"; -static const char* kHTMLTextContentType = "text/html"; +//static const char* kNullURL = "Error: Null URL given"; +//static const char* kNullFilename= "Error: Null filename given"; +//static const char* kNullTokenizer = "Error: Unable to construct tokenizer"; +//static const char* kNullToken = "Error: Null token given"; +//static const char* kInvalidTagStackPos = "Error: invalid tag stack position"; +//static const char* kHTMLTextContentType = "text/html"; static nsAutoString gEmpty; @@ -189,8 +189,8 @@ eAutoDetectResult COtherDTD::AutoDetectContentType(nsString& aBuffer,nsString& a * @param * @return */ -NS_IMETHODIMP COtherDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel) { - return CNavDTD::WillBuildModel(aFilename, aLevel); +NS_IMETHODIMP COtherDTD::WillBuildModel(nsString& aFilename,PRBool aNotifySink) { + return CNavDTD::WillBuildModel(aFilename, aNotifySink); } /** @@ -199,8 +199,8 @@ NS_IMETHODIMP COtherDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel) { * @param * @return */ -NS_IMETHODIMP COtherDTD::DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel){ - return CNavDTD::DidBuildModel(anErrorCode, aLevel); +NS_IMETHODIMP COtherDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink){ + return CNavDTD::DidBuildModel(anErrorCode, aNotifySink); } /** diff --git a/mozilla/htmlparser/src/COtherDTD.h b/mozilla/htmlparser/src/COtherDTD.h index 77c88a8f8c5..8e77b204855 100644 --- a/mozilla/htmlparser/src/COtherDTD.h +++ b/mozilla/htmlparser/src/COtherDTD.h @@ -97,7 +97,7 @@ class COtherDTD : public CNavDTD { * @param aFilename is the name of the file being parsed. * @return error code (almost always 0) */ - NS_IMETHOD WillBuildModel(nsString& aFilename,PRInt32 aLevel); + NS_IMETHOD WillBuildModel(nsString& aFilename,PRBool aNotifySink); /** * The parser uses a code sandwich to wrap the parsing process. Before @@ -107,7 +107,7 @@ class COtherDTD : public CNavDTD { * @param anErrorCode contans the last error that occured * @return error code */ - NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel); + NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink); /** * diff --git a/mozilla/htmlparser/src/CRtfDTD.cpp b/mozilla/htmlparser/src/CRtfDTD.cpp index 94a5784c9ad..ea4436e794d 100644 --- a/mozilla/htmlparser/src/CRtfDTD.cpp +++ b/mozilla/htmlparser/src/CRtfDTD.cpp @@ -55,11 +55,6 @@ static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID); static NS_DEFINE_IID(kClassIID, NS_RTF_DTD_IID); -static const char* kNullURL = "Error: Null URL given"; -static const char* kNullFilename= "Error: Null filename given"; -static const char* kNullTokenizer = "Error: Unable to construct tokenizer"; -static const char* kNullToken = "Error: Null token given"; -static const char* kInvalidTagStackPos = "Error: invalid tag stack position"; static const char* kRTFTextContentType = "application/rtf"; static const char* kRTFDocHeader= "{\\rtf0"; static nsString gAlphaChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); @@ -119,7 +114,6 @@ static RTFEntry gRTFTable[] = { * @return */ const char* GetTagName(eRTFTags aTag) { - const char* result=0; PRInt32 cnt=sizeof(gRTFTable)/sizeof(RTFEntry); PRInt32 low=0; PRInt32 high=cnt-1; diff --git a/mozilla/htmlparser/src/nsDTDDebug.cpp b/mozilla/htmlparser/src/nsDTDDebug.cpp index 17166904c7f..c207d40d7c4 100644 --- a/mozilla/htmlparser/src/nsDTDDebug.cpp +++ b/mozilla/htmlparser/src/nsDTDDebug.cpp @@ -61,7 +61,7 @@ class CDTDDebug : public nsIDTDDebug { public: CDTDDebug(char * aVerifyDir = 0); - ~CDTDDebug(); + virtual ~CDTDDebug(); NS_DECL_ISUPPORTS diff --git a/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp b/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp index 8f49fda16b2..facb70d18ba 100644 --- a/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp +++ b/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp @@ -560,7 +560,7 @@ void nsHTMLContentSinkStream::AddStartTag(const nsIParserNode& aNode, ostream& a void nsHTMLContentSinkStream::AddEndTag(const nsIParserNode& aNode, ostream& aStream) { eHTMLTags tag = (eHTMLTags)aNode.GetNodeType(); - const nsString& name = aNode.GetText(); +// const nsString& name = aNode.GetText(); nsString tagName; if (tag == eHTMLTag_unknown) @@ -743,7 +743,7 @@ NS_IMETHODIMP nsHTMLContentSinkStream::OpenContainer(const nsIParserNode& aNode){ if(mOutput) { AddStartTag(aNode,*mOutput); - eHTMLTags tag = (eHTMLTags)aNode.GetNodeType(); +// eHTMLTags tag = (eHTMLTags)aNode.GetNodeType(); } return NS_OK; } @@ -884,8 +884,12 @@ PRBool nsHTMLContentSinkStream::IsInline(eHTMLTags aTag) const case eHTMLTag_var: case eHTMLTag_wbr: - result = PR_TRUE; - break; + result = PR_TRUE; + break; + + default: + break; + } return result; } @@ -928,7 +932,11 @@ PRBool nsHTMLContentSinkStream::BreakAfterOpen(eHTMLTags aTag) const { case eHTMLTag_tbody: case eHTMLTag_style: result = PR_TRUE; - break; + break; + + default: + break; + } return result; } @@ -950,7 +958,11 @@ PRBool nsHTMLContentSinkStream::BreakBeforeClose(eHTMLTags aTag) const { case eHTMLTag_tbody: case eHTMLTag_style: result = PR_TRUE; - break; + break; + + default: + break; + } return result; } @@ -984,13 +996,6 @@ PRBool nsHTMLContentSinkStream::IndentChildren(eHTMLTags aTag) const { switch (aTag) { - case eHTMLTag_html: - case eHTMLTag_pre: - case eHTMLTag_body: - case eHTMLTag_style: - result = PR_FALSE; - break; - case eHTMLTag_table: case eHTMLTag_ul: case eHTMLTag_ol: @@ -998,11 +1003,11 @@ PRBool nsHTMLContentSinkStream::IndentChildren(eHTMLTags aTag) const { case eHTMLTag_form: case eHTMLTag_frameset: result = PR_TRUE; - break; + break; default: result = PR_FALSE; - break; + break; } return result; } diff --git a/mozilla/htmlparser/src/nsHTMLNullSink.cpp b/mozilla/htmlparser/src/nsHTMLNullSink.cpp index 67092c4e522..fe39a301a31 100644 --- a/mozilla/htmlparser/src/nsHTMLNullSink.cpp +++ b/mozilla/htmlparser/src/nsHTMLNullSink.cpp @@ -31,7 +31,7 @@ static NS_DEFINE_IID(kIHTMLContentSinkIID, NS_IHTML_CONTENT_SINK_IID); class nsHTMLNullSink : public nsIHTMLContentSink { public: nsHTMLNullSink(); - ~nsHTMLNullSink(); + virtual ~nsHTMLNullSink(); enum eSection {eNone=0,eHTML,eHead,eBody,eContainer}; diff --git a/mozilla/htmlparser/src/nsIDTD.h b/mozilla/htmlparser/src/nsIDTD.h index 833432bea6f..c545b07dd5e 100644 --- a/mozilla/htmlparser/src/nsIDTD.h +++ b/mozilla/htmlparser/src/nsIDTD.h @@ -110,7 +110,7 @@ class nsIDTD : public nsISupports { * @param aFilename--string that contains name of file being parsed (if applicable) * @return */ - NS_IMETHOD WillBuildModel(nsString& aFilename,PRInt32 aLevel)=0; + NS_IMETHOD WillBuildModel(nsString& aFilename,PRBool aNotifySink)=0; /** * Called by the parser after the parsing process has concluded @@ -118,7 +118,7 @@ class nsIDTD : public nsISupports { * @param anErrorCode - contains error code resulting from parse process * @return */ - NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel)=0; + NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink)=0; /** * Called during model building phase of parse process. Each token created during diff --git a/mozilla/htmlparser/src/nsParser.cpp b/mozilla/htmlparser/src/nsParser.cpp index 543b1f49533..06f304b570b 100644 --- a/mozilla/htmlparser/src/nsParser.cpp +++ b/mozilla/htmlparser/src/nsParser.cpp @@ -142,7 +142,6 @@ nsParser::nsParser() { mObserver = 0; mSink=0; mParserContext=0; - mParseLevel=0; } @@ -320,7 +319,7 @@ PRBool FindSuitableDTD( CParserContext& aParserContext) { if(theDTD) { result=theDTD->CanParse(aParserContext.mSourceType,0); if(result){ - nsresult status=theDTD->CreateNewInstance(&aParserContext.mDTD); + theDTD->CreateNewInstance(&aParserContext.mDTD); break; } } @@ -386,7 +385,7 @@ PRInt32 nsParser::WillBuildModel(nsString& aFilename){ if(PR_TRUE==FindSuitableDTD(*mParserContext)) { mParserContext->mDTD->SetParser(this); mParserContext->mDTD->SetContentSink(mSink); - mParserContext->mDTD->WillBuildModel(aFilename,mParseLevel); + mParserContext->mDTD->WillBuildModel(aFilename,PRBool(0==mParserContext->mPrevContext)); } return kNoError; @@ -402,7 +401,7 @@ PRInt32 nsParser::DidBuildModel(PRInt32 anErrorCode) { //One last thing...close any open containers. PRInt32 result=anErrorCode; if(mParserContext->mDTD) { - result=mParserContext->mDTD->DidBuildModel(anErrorCode,mParseLevel); + result=mParserContext->mDTD->DidBuildModel(anErrorCode,PRBool(0==mParserContext->mPrevContext)); } return result; @@ -455,7 +454,6 @@ PRInt32 nsParser::Parse(nsIURL* aURL,nsIStreamObserver* aListener, nsIDTDDebug * NS_PRECONDITION(0!=aURL,kNullURL); PRInt32 status=kBadURL; - mParseLevel++; /* Disable DTD Debug for now... mDTDDebug = aDTDDebug; @@ -481,7 +479,6 @@ PRInt32 nsParser::Parse(nsIURL* aURL,nsIStreamObserver* aListener, nsIDTDDebug * PRInt32 nsParser::Parse(fstream& aStream){ PRInt32 status=kNoError; - mParseLevel++; //ok, time to create our tokenizer and begin the process CParserContext* pc=new CParserContext(new CScanner(kUnknownFilename,aStream,PR_FALSE),&aStream,0); @@ -497,7 +494,6 @@ PRInt32 nsParser::Parse(fstream& aStream){ pc=PopContext(); delete pc; - mParseLevel--; return status; } @@ -515,7 +511,6 @@ PRInt32 nsParser::Parse(fstream& aStream){ */ PRInt32 nsParser::Parse(nsString& aSourceBuffer,PRBool anHTMLString){ PRInt32 result=kNoError; - mParseLevel++; CParserContext* pc=new CParserContext(new CScanner(aSourceBuffer),&aSourceBuffer,0); @@ -529,7 +524,6 @@ PRInt32 nsParser::Parse(nsString& aSourceBuffer,PRBool anHTMLString){ } pc=PopContext(); delete pc; - mParseLevel--; return result; } @@ -853,7 +847,7 @@ PRInt32 nsParser::Tokenize(){ mParserContext->mScanner->RewindToMark(); } } - if(result=kProcessComplete) + if(kProcessComplete==result) result=NS_OK; DidTokenize(); return result; diff --git a/mozilla/htmlparser/src/nsParser.h b/mozilla/htmlparser/src/nsParser.h index 9d55aca6c2f..cd35bcc55a6 100644 --- a/mozilla/htmlparser/src/nsParser.h +++ b/mozilla/htmlparser/src/nsParser.h @@ -294,7 +294,6 @@ protected: CParserContext* mParserContext; PRInt32 mMajorIteration; PRInt32 mMinorIteration; - PRInt32 mParseLevel; nsIStreamObserver* mObserver; nsIContentSink* mSink; diff --git a/mozilla/htmlparser/src/nsParserNode.cpp b/mozilla/htmlparser/src/nsParserNode.cpp index 949f1c0656c..6b4ffca1fc6 100644 --- a/mozilla/htmlparser/src/nsParserNode.cpp +++ b/mozilla/htmlparser/src/nsParserNode.cpp @@ -59,7 +59,7 @@ nsCParserNode::~nsCParserNode() { * @return */ void nsCParserNode::AddAttribute(CToken* aToken) { - NS_PRECONDITION(mAttributeCountWillBuildModel(); } @@ -442,14 +440,14 @@ nsresult CNavDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel){ * @param * @return */ -nsresult CNavDTD::DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel){ +nsresult CNavDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink){ nsresult result= NS_OK; if((kNoError==anErrorCode) && (mContextStack.mCount>0)) { result = CloseContainersTo(0,eHTMLTag_unknown,PR_FALSE); } - if((1==aLevel) && (mSink)) { + if((aNotifySink) && (mSink)) { result = mSink->DidBuildModel(1); } @@ -818,9 +816,7 @@ nsresult CNavDTD::HandleAttributeToken(CToken* aToken) { NS_PRECONDITION(0!=aToken,kNullToken); NS_ERROR("attribute encountered -- this shouldn't happen!"); - CAttributeToken* at = (CAttributeToken*)(aToken); - nsresult result=NS_OK; - return result; + return NS_OK; } /** @@ -872,9 +868,8 @@ nsresult CNavDTD::HandleScriptToken(CToken* aToken, nsCParserNode& aNode) { nsresult CNavDTD::HandleStyleToken(CToken* aToken){ NS_PRECONDITION(0!=aToken,kNullToken); - CStyleToken* st = (CStyleToken*)(aToken); - nsresult result=NS_OK; - return result; +// CStyleToken* st = (CStyleToken*)(aToken); + return NS_OK; } @@ -924,7 +919,6 @@ CITokenHandler* CNavDTD::AddTokenHandler(CITokenHandler* aHandler) { if(aHandler) { eHTMLTokenTypes type=(eHTMLTokenTypes)aHandler->GetTokenType(); if(typeConsume(ch,aScanner); if(result) { diff --git a/mozilla/parser/htmlparser/src/CNavDTD.h b/mozilla/parser/htmlparser/src/CNavDTD.h index ec0805093b5..cdf960f06f8 100644 --- a/mozilla/parser/htmlparser/src/CNavDTD.h +++ b/mozilla/parser/htmlparser/src/CNavDTD.h @@ -221,7 +221,7 @@ CLASS_EXPORT_HTMLPARS CNavDTD : public nsIDTD { * @param aFilename is the name of the file being parsed. * @return error code (almost always 0) */ - NS_IMETHOD WillBuildModel(nsString& aFilename,PRInt32 aLevel); + NS_IMETHOD WillBuildModel(nsString& aFilename,PRBool aNotifySink); /** * The parser uses a code sandwich to wrap the parsing process. Before @@ -231,7 +231,7 @@ CLASS_EXPORT_HTMLPARS CNavDTD : public nsIDTD { * @param anErrorCode contans the last error that occured * @return error code */ - NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel); + NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink); /** * This method is called by the parser, once for each token diff --git a/mozilla/parser/htmlparser/src/COtherDTD.cpp b/mozilla/parser/htmlparser/src/COtherDTD.cpp index 7389cb3d5b2..6c048b9a2b4 100644 --- a/mozilla/parser/htmlparser/src/COtherDTD.cpp +++ b/mozilla/parser/htmlparser/src/COtherDTD.cpp @@ -58,12 +58,12 @@ static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID); static NS_DEFINE_IID(kClassIID, NS_IOtherHTML_DTD_IID); static NS_DEFINE_IID(kBaseClassIID, NS_INAVHTML_DTD_IID); -static const char* kNullURL = "Error: Null URL given"; -static const char* kNullFilename= "Error: Null filename given"; -static const char* kNullTokenizer = "Error: Unable to construct tokenizer"; -static const char* kNullToken = "Error: Null token given"; -static const char* kInvalidTagStackPos = "Error: invalid tag stack position"; -static const char* kHTMLTextContentType = "text/html"; +//static const char* kNullURL = "Error: Null URL given"; +//static const char* kNullFilename= "Error: Null filename given"; +//static const char* kNullTokenizer = "Error: Unable to construct tokenizer"; +//static const char* kNullToken = "Error: Null token given"; +//static const char* kInvalidTagStackPos = "Error: invalid tag stack position"; +//static const char* kHTMLTextContentType = "text/html"; static nsAutoString gEmpty; @@ -189,8 +189,8 @@ eAutoDetectResult COtherDTD::AutoDetectContentType(nsString& aBuffer,nsString& a * @param * @return */ -NS_IMETHODIMP COtherDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel) { - return CNavDTD::WillBuildModel(aFilename, aLevel); +NS_IMETHODIMP COtherDTD::WillBuildModel(nsString& aFilename,PRBool aNotifySink) { + return CNavDTD::WillBuildModel(aFilename, aNotifySink); } /** @@ -199,8 +199,8 @@ NS_IMETHODIMP COtherDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel) { * @param * @return */ -NS_IMETHODIMP COtherDTD::DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel){ - return CNavDTD::DidBuildModel(anErrorCode, aLevel); +NS_IMETHODIMP COtherDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink){ + return CNavDTD::DidBuildModel(anErrorCode, aNotifySink); } /** diff --git a/mozilla/parser/htmlparser/src/COtherDTD.h b/mozilla/parser/htmlparser/src/COtherDTD.h index 77c88a8f8c5..8e77b204855 100644 --- a/mozilla/parser/htmlparser/src/COtherDTD.h +++ b/mozilla/parser/htmlparser/src/COtherDTD.h @@ -97,7 +97,7 @@ class COtherDTD : public CNavDTD { * @param aFilename is the name of the file being parsed. * @return error code (almost always 0) */ - NS_IMETHOD WillBuildModel(nsString& aFilename,PRInt32 aLevel); + NS_IMETHOD WillBuildModel(nsString& aFilename,PRBool aNotifySink); /** * The parser uses a code sandwich to wrap the parsing process. Before @@ -107,7 +107,7 @@ class COtherDTD : public CNavDTD { * @param anErrorCode contans the last error that occured * @return error code */ - NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel); + NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink); /** * diff --git a/mozilla/parser/htmlparser/src/CRtfDTD.cpp b/mozilla/parser/htmlparser/src/CRtfDTD.cpp index 94a5784c9ad..ea4436e794d 100644 --- a/mozilla/parser/htmlparser/src/CRtfDTD.cpp +++ b/mozilla/parser/htmlparser/src/CRtfDTD.cpp @@ -55,11 +55,6 @@ static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID); static NS_DEFINE_IID(kClassIID, NS_RTF_DTD_IID); -static const char* kNullURL = "Error: Null URL given"; -static const char* kNullFilename= "Error: Null filename given"; -static const char* kNullTokenizer = "Error: Unable to construct tokenizer"; -static const char* kNullToken = "Error: Null token given"; -static const char* kInvalidTagStackPos = "Error: invalid tag stack position"; static const char* kRTFTextContentType = "application/rtf"; static const char* kRTFDocHeader= "{\\rtf0"; static nsString gAlphaChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); @@ -119,7 +114,6 @@ static RTFEntry gRTFTable[] = { * @return */ const char* GetTagName(eRTFTags aTag) { - const char* result=0; PRInt32 cnt=sizeof(gRTFTable)/sizeof(RTFEntry); PRInt32 low=0; PRInt32 high=cnt-1; diff --git a/mozilla/parser/htmlparser/src/nsDTDDebug.cpp b/mozilla/parser/htmlparser/src/nsDTDDebug.cpp index 17166904c7f..c207d40d7c4 100644 --- a/mozilla/parser/htmlparser/src/nsDTDDebug.cpp +++ b/mozilla/parser/htmlparser/src/nsDTDDebug.cpp @@ -61,7 +61,7 @@ class CDTDDebug : public nsIDTDDebug { public: CDTDDebug(char * aVerifyDir = 0); - ~CDTDDebug(); + virtual ~CDTDDebug(); NS_DECL_ISUPPORTS diff --git a/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp b/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp index 8f49fda16b2..facb70d18ba 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp +++ b/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp @@ -560,7 +560,7 @@ void nsHTMLContentSinkStream::AddStartTag(const nsIParserNode& aNode, ostream& a void nsHTMLContentSinkStream::AddEndTag(const nsIParserNode& aNode, ostream& aStream) { eHTMLTags tag = (eHTMLTags)aNode.GetNodeType(); - const nsString& name = aNode.GetText(); +// const nsString& name = aNode.GetText(); nsString tagName; if (tag == eHTMLTag_unknown) @@ -743,7 +743,7 @@ NS_IMETHODIMP nsHTMLContentSinkStream::OpenContainer(const nsIParserNode& aNode){ if(mOutput) { AddStartTag(aNode,*mOutput); - eHTMLTags tag = (eHTMLTags)aNode.GetNodeType(); +// eHTMLTags tag = (eHTMLTags)aNode.GetNodeType(); } return NS_OK; } @@ -884,8 +884,12 @@ PRBool nsHTMLContentSinkStream::IsInline(eHTMLTags aTag) const case eHTMLTag_var: case eHTMLTag_wbr: - result = PR_TRUE; - break; + result = PR_TRUE; + break; + + default: + break; + } return result; } @@ -928,7 +932,11 @@ PRBool nsHTMLContentSinkStream::BreakAfterOpen(eHTMLTags aTag) const { case eHTMLTag_tbody: case eHTMLTag_style: result = PR_TRUE; - break; + break; + + default: + break; + } return result; } @@ -950,7 +958,11 @@ PRBool nsHTMLContentSinkStream::BreakBeforeClose(eHTMLTags aTag) const { case eHTMLTag_tbody: case eHTMLTag_style: result = PR_TRUE; - break; + break; + + default: + break; + } return result; } @@ -984,13 +996,6 @@ PRBool nsHTMLContentSinkStream::IndentChildren(eHTMLTags aTag) const { switch (aTag) { - case eHTMLTag_html: - case eHTMLTag_pre: - case eHTMLTag_body: - case eHTMLTag_style: - result = PR_FALSE; - break; - case eHTMLTag_table: case eHTMLTag_ul: case eHTMLTag_ol: @@ -998,11 +1003,11 @@ PRBool nsHTMLContentSinkStream::IndentChildren(eHTMLTags aTag) const { case eHTMLTag_form: case eHTMLTag_frameset: result = PR_TRUE; - break; + break; default: result = PR_FALSE; - break; + break; } return result; } diff --git a/mozilla/parser/htmlparser/src/nsHTMLNullSink.cpp b/mozilla/parser/htmlparser/src/nsHTMLNullSink.cpp index 67092c4e522..fe39a301a31 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLNullSink.cpp +++ b/mozilla/parser/htmlparser/src/nsHTMLNullSink.cpp @@ -31,7 +31,7 @@ static NS_DEFINE_IID(kIHTMLContentSinkIID, NS_IHTML_CONTENT_SINK_IID); class nsHTMLNullSink : public nsIHTMLContentSink { public: nsHTMLNullSink(); - ~nsHTMLNullSink(); + virtual ~nsHTMLNullSink(); enum eSection {eNone=0,eHTML,eHead,eBody,eContainer}; diff --git a/mozilla/parser/htmlparser/src/nsIDTD.h b/mozilla/parser/htmlparser/src/nsIDTD.h index 833432bea6f..c545b07dd5e 100644 --- a/mozilla/parser/htmlparser/src/nsIDTD.h +++ b/mozilla/parser/htmlparser/src/nsIDTD.h @@ -110,7 +110,7 @@ class nsIDTD : public nsISupports { * @param aFilename--string that contains name of file being parsed (if applicable) * @return */ - NS_IMETHOD WillBuildModel(nsString& aFilename,PRInt32 aLevel)=0; + NS_IMETHOD WillBuildModel(nsString& aFilename,PRBool aNotifySink)=0; /** * Called by the parser after the parsing process has concluded @@ -118,7 +118,7 @@ class nsIDTD : public nsISupports { * @param anErrorCode - contains error code resulting from parse process * @return */ - NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel)=0; + NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink)=0; /** * Called during model building phase of parse process. Each token created during diff --git a/mozilla/parser/htmlparser/src/nsParser.cpp b/mozilla/parser/htmlparser/src/nsParser.cpp index 543b1f49533..06f304b570b 100644 --- a/mozilla/parser/htmlparser/src/nsParser.cpp +++ b/mozilla/parser/htmlparser/src/nsParser.cpp @@ -142,7 +142,6 @@ nsParser::nsParser() { mObserver = 0; mSink=0; mParserContext=0; - mParseLevel=0; } @@ -320,7 +319,7 @@ PRBool FindSuitableDTD( CParserContext& aParserContext) { if(theDTD) { result=theDTD->CanParse(aParserContext.mSourceType,0); if(result){ - nsresult status=theDTD->CreateNewInstance(&aParserContext.mDTD); + theDTD->CreateNewInstance(&aParserContext.mDTD); break; } } @@ -386,7 +385,7 @@ PRInt32 nsParser::WillBuildModel(nsString& aFilename){ if(PR_TRUE==FindSuitableDTD(*mParserContext)) { mParserContext->mDTD->SetParser(this); mParserContext->mDTD->SetContentSink(mSink); - mParserContext->mDTD->WillBuildModel(aFilename,mParseLevel); + mParserContext->mDTD->WillBuildModel(aFilename,PRBool(0==mParserContext->mPrevContext)); } return kNoError; @@ -402,7 +401,7 @@ PRInt32 nsParser::DidBuildModel(PRInt32 anErrorCode) { //One last thing...close any open containers. PRInt32 result=anErrorCode; if(mParserContext->mDTD) { - result=mParserContext->mDTD->DidBuildModel(anErrorCode,mParseLevel); + result=mParserContext->mDTD->DidBuildModel(anErrorCode,PRBool(0==mParserContext->mPrevContext)); } return result; @@ -455,7 +454,6 @@ PRInt32 nsParser::Parse(nsIURL* aURL,nsIStreamObserver* aListener, nsIDTDDebug * NS_PRECONDITION(0!=aURL,kNullURL); PRInt32 status=kBadURL; - mParseLevel++; /* Disable DTD Debug for now... mDTDDebug = aDTDDebug; @@ -481,7 +479,6 @@ PRInt32 nsParser::Parse(nsIURL* aURL,nsIStreamObserver* aListener, nsIDTDDebug * PRInt32 nsParser::Parse(fstream& aStream){ PRInt32 status=kNoError; - mParseLevel++; //ok, time to create our tokenizer and begin the process CParserContext* pc=new CParserContext(new CScanner(kUnknownFilename,aStream,PR_FALSE),&aStream,0); @@ -497,7 +494,6 @@ PRInt32 nsParser::Parse(fstream& aStream){ pc=PopContext(); delete pc; - mParseLevel--; return status; } @@ -515,7 +511,6 @@ PRInt32 nsParser::Parse(fstream& aStream){ */ PRInt32 nsParser::Parse(nsString& aSourceBuffer,PRBool anHTMLString){ PRInt32 result=kNoError; - mParseLevel++; CParserContext* pc=new CParserContext(new CScanner(aSourceBuffer),&aSourceBuffer,0); @@ -529,7 +524,6 @@ PRInt32 nsParser::Parse(nsString& aSourceBuffer,PRBool anHTMLString){ } pc=PopContext(); delete pc; - mParseLevel--; return result; } @@ -853,7 +847,7 @@ PRInt32 nsParser::Tokenize(){ mParserContext->mScanner->RewindToMark(); } } - if(result=kProcessComplete) + if(kProcessComplete==result) result=NS_OK; DidTokenize(); return result; diff --git a/mozilla/parser/htmlparser/src/nsParser.h b/mozilla/parser/htmlparser/src/nsParser.h index 9d55aca6c2f..cd35bcc55a6 100644 --- a/mozilla/parser/htmlparser/src/nsParser.h +++ b/mozilla/parser/htmlparser/src/nsParser.h @@ -294,7 +294,6 @@ protected: CParserContext* mParserContext; PRInt32 mMajorIteration; PRInt32 mMinorIteration; - PRInt32 mParseLevel; nsIStreamObserver* mObserver; nsIContentSink* mSink; diff --git a/mozilla/parser/htmlparser/src/nsParserNode.cpp b/mozilla/parser/htmlparser/src/nsParserNode.cpp index 949f1c0656c..6b4ffca1fc6 100644 --- a/mozilla/parser/htmlparser/src/nsParserNode.cpp +++ b/mozilla/parser/htmlparser/src/nsParserNode.cpp @@ -59,7 +59,7 @@ nsCParserNode::~nsCParserNode() { * @return */ void nsCParserNode::AddAttribute(CToken* aToken) { - NS_PRECONDITION(mAttributeCount sizeof(buf)-1) { + if (mLength > PRInt32(sizeof(buf)-1)) { *aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE; return 0.0f; } @@ -950,8 +950,6 @@ PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) { //Copy rightmost chars, up to offset+aCount... while(first= sizeof(buf)) { + if (len >= PRInt32(sizeof(buf))) { cp = aString.ToNewCString(); } else { aString.ToCString(cp, len + 1); diff --git a/mozilla/xpcom/ds/nsBTree.cpp b/mozilla/xpcom/ds/nsBTree.cpp index a771d94aaac..216a8bd816f 100644 --- a/mozilla/xpcom/ds/nsBTree.cpp +++ b/mozilla/xpcom/ds/nsBTree.cpp @@ -130,7 +130,6 @@ nsBTree::~nsBTree(){ * @return ptr to added node or NULL */ nsNode* nsBTree::Add(nsNode& aNode){ - PRBool result=PR_TRUE; nsNode* node1=mRoot; //x nsNode* node2=0; //y @@ -225,7 +224,7 @@ nsBTree& nsBTree::Empty(nsNode* aNode) { * @return this */ nsBTree& nsBTree::Erase(nsNode* aNode){ - nsNode* node1 =(aNode) ? aNode : mRoot; +// nsNode* node1 =(aNode) ? aNode : mRoot; if(aNode) { Erase(aNode->mLeft); //begin by walking left side diff --git a/mozilla/xpcom/ds/nsBTree.h b/mozilla/xpcom/ds/nsBTree.h index 62b79b8b654..88b465bb01c 100644 --- a/mozilla/xpcom/ds/nsBTree.h +++ b/mozilla/xpcom/ds/nsBTree.h @@ -150,7 +150,7 @@ public: friend class nsBTreeIterator; nsBTree(); - ~nsBTree(); + virtual ~nsBTree(); /** * Add given node reference into our tree. diff --git a/mozilla/xpcom/ds/nsDeque.cpp b/mozilla/xpcom/ds/nsDeque.cpp index c221ec9aaf3..abeddab7656 100644 --- a/mozilla/xpcom/ds/nsDeque.cpp +++ b/mozilla/xpcom/ds/nsDeque.cpp @@ -245,8 +245,7 @@ const void* nsDeque::ForEach(nsDequeFunctor& aFunctor) const{ * @param aQueue is the deque object to be iterated * @param anIndex is the starting position for your iteration */ -nsDequeIterator::nsDequeIterator(const nsDeque& aQueue,int anIndex): mDeque(aQueue) { - mIndex=anIndex; +nsDequeIterator::nsDequeIterator(const nsDeque& aQueue,int anIndex): mIndex(anIndex), mDeque(aQueue) { } /** @@ -256,9 +255,7 @@ nsDequeIterator::nsDequeIterator(const nsDeque& aQueue,int anIndex): mDeque(aQue * @param aCopy is another iterator to copy from * @return */ -nsDequeIterator::nsDequeIterator(const nsDequeIterator& aCopy) : - mDeque(aCopy.mDeque), - mIndex(aCopy.mIndex) { +nsDequeIterator::nsDequeIterator(const nsDequeIterator& aCopy) : mIndex(aCopy.mIndex), mDeque(aCopy.mDeque) { } /** diff --git a/mozilla/xpcom/ds/nsRBTree.h b/mozilla/xpcom/ds/nsRBTree.h index c91241b2bb3..8d423e246ae 100644 --- a/mozilla/xpcom/ds/nsRBTree.h +++ b/mozilla/xpcom/ds/nsRBTree.h @@ -64,7 +64,7 @@ friend class NS_BASE nsRBTreeIterator; * * @update gess 4/11/98 */ - ~nsRBTree(); + virtual ~nsRBTree(); /** * Given a node, we're supposed to add it into diff --git a/mozilla/xpcom/ds/nsString.cpp b/mozilla/xpcom/ds/nsString.cpp index b2690e01391..ace4aa346c1 100644 --- a/mozilla/xpcom/ds/nsString.cpp +++ b/mozilla/xpcom/ds/nsString.cpp @@ -534,7 +534,7 @@ char* nsString::ToCString(char* aBuf, PRInt32 aBufLength) const float nsString::ToFloat(PRInt32* aErrorCode) const { char buf[40]; - if (mLength > sizeof(buf)-1) { + if (mLength > PRInt32(sizeof(buf)-1)) { *aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE; return 0.0f; } @@ -950,8 +950,6 @@ PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) { //Copy rightmost chars, up to offset+aCount... while(first= sizeof(buf)) { + if (len >= PRInt32(sizeof(buf))) { cp = aString.ToNewCString(); } else { aString.ToCString(cp, len + 1); diff --git a/mozilla/xpcom/string/obsolete/nsString.cpp b/mozilla/xpcom/string/obsolete/nsString.cpp index b2690e01391..ace4aa346c1 100644 --- a/mozilla/xpcom/string/obsolete/nsString.cpp +++ b/mozilla/xpcom/string/obsolete/nsString.cpp @@ -534,7 +534,7 @@ char* nsString::ToCString(char* aBuf, PRInt32 aBufLength) const float nsString::ToFloat(PRInt32* aErrorCode) const { char buf[40]; - if (mLength > sizeof(buf)-1) { + if (mLength > PRInt32(sizeof(buf)-1)) { *aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE; return 0.0f; } @@ -950,8 +950,6 @@ PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) { //Copy rightmost chars, up to offset+aCount... while(first= sizeof(buf)) { + if (len >= PRInt32(sizeof(buf))) { cp = aString.ToNewCString(); } else { aString.ToCString(cp, len + 1);