From 4f51e5b41ec9bc145adc2a1a972065a26b4856f3 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Tue, 3 Sep 2002 22:23:22 +0000 Subject: [PATCH] use prefix ++, not postfix ++. Bug 82615, r=heikki, sr=jst git-svn-id: svn://10.0.0.236/trunk@128743 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/htmlparser/public/nsToken.h | 2 +- mozilla/htmlparser/robot/nsDebugRobot.cpp | 4 +- mozilla/htmlparser/robot/nsRobotSink.cpp | 6 +- mozilla/htmlparser/robot/test/RobotMain.cpp | 2 +- mozilla/htmlparser/src/CNavDTD.cpp | 28 ++++----- mozilla/htmlparser/src/COtherDTD.cpp | 8 +-- mozilla/htmlparser/src/COtherElements.h | 10 +-- mozilla/htmlparser/src/SelfTest.cpp | 2 +- mozilla/htmlparser/src/nsDTDUtils.cpp | 62 +++++++++---------- mozilla/htmlparser/src/nsDTDUtils.h | 4 +- mozilla/htmlparser/src/nsElementTable.cpp | 16 ++--- mozilla/htmlparser/src/nsExpatDriver.cpp | 4 +- mozilla/htmlparser/src/nsHTMLEntities.cpp | 2 +- mozilla/htmlparser/src/nsHTMLNullSink.cpp | 2 +- mozilla/htmlparser/src/nsHTMLTags.cpp | 2 +- mozilla/htmlparser/src/nsHTMLTokenizer.cpp | 6 +- mozilla/htmlparser/src/nsHTMLTokens.cpp | 6 +- mozilla/htmlparser/src/nsLoggingSink.cpp | 4 +- mozilla/htmlparser/src/nsParser.cpp | 18 +++--- mozilla/htmlparser/src/nsParserNode.cpp | 4 +- mozilla/htmlparser/src/nsParserService.cpp | 4 +- mozilla/htmlparser/src/nsScanner.cpp | 10 +-- mozilla/htmlparser/src/nsToken.cpp | 6 +- mozilla/htmlparser/src/nsViewSourceHTML.cpp | 12 ++-- .../htmlparser/tests/grabpage/grabpage.cpp | 2 +- mozilla/htmlparser/tests/htmlgen/htmlgen.cpp | 2 +- mozilla/parser/htmlparser/public/nsToken.h | 2 +- .../parser/htmlparser/robot/nsDebugRobot.cpp | 4 +- .../parser/htmlparser/robot/nsRobotSink.cpp | 6 +- .../htmlparser/robot/test/RobotMain.cpp | 2 +- mozilla/parser/htmlparser/src/CNavDTD.cpp | 28 ++++----- mozilla/parser/htmlparser/src/COtherDTD.cpp | 8 +-- .../parser/htmlparser/src/COtherElements.h | 10 +-- mozilla/parser/htmlparser/src/SelfTest.cpp | 2 +- mozilla/parser/htmlparser/src/nsDTDUtils.cpp | 62 +++++++++---------- mozilla/parser/htmlparser/src/nsDTDUtils.h | 4 +- .../parser/htmlparser/src/nsElementTable.cpp | 16 ++--- .../parser/htmlparser/src/nsExpatDriver.cpp | 4 +- .../parser/htmlparser/src/nsHTMLEntities.cpp | 2 +- .../parser/htmlparser/src/nsHTMLNullSink.cpp | 2 +- mozilla/parser/htmlparser/src/nsHTMLTags.cpp | 2 +- .../parser/htmlparser/src/nsHTMLTokenizer.cpp | 6 +- .../parser/htmlparser/src/nsHTMLTokens.cpp | 6 +- .../parser/htmlparser/src/nsLoggingSink.cpp | 4 +- mozilla/parser/htmlparser/src/nsParser.cpp | 18 +++--- .../parser/htmlparser/src/nsParserNode.cpp | 4 +- .../parser/htmlparser/src/nsParserService.cpp | 4 +- mozilla/parser/htmlparser/src/nsScanner.cpp | 10 +-- mozilla/parser/htmlparser/src/nsToken.cpp | 6 +- .../htmlparser/src/nsViewSourceHTML.cpp | 12 ++-- .../htmlparser/tests/grabpage/grabpage.cpp | 2 +- .../htmlparser/tests/htmlgen/htmlgen.cpp | 2 +- 52 files changed, 228 insertions(+), 228 deletions(-) diff --git a/mozilla/htmlparser/public/nsToken.h b/mozilla/htmlparser/public/nsToken.h index 32d16413653..985e13519bb 100644 --- a/mozilla/htmlparser/public/nsToken.h +++ b/mozilla/htmlparser/public/nsToken.h @@ -153,7 +153,7 @@ class CToken { * Make a note on number of times you have been referenced * @update harishd 08/02/00 */ - void AddRef() { mUseCount++; } + void AddRef() { ++mUseCount; } /** * Free yourself if no one is holding you. diff --git a/mozilla/htmlparser/robot/nsDebugRobot.cpp b/mozilla/htmlparser/robot/nsDebugRobot.cpp index d5f744969f5..8fe8096b64d 100644 --- a/mozilla/htmlparser/robot/nsDebugRobot.cpp +++ b/mozilla/htmlparser/robot/nsDebugRobot.cpp @@ -112,7 +112,7 @@ NS_IMETHODIMP RobotSinkObserver::ProcessLink(const nsString& aURLSpec) PRInt32 nCount = g_duplicateList->Count(); if (nCount > 0) { - for (PRInt32 n = 0; n < nCount; n++) + for (PRInt32 n = 0; n < nCount; ++n) { nsString * pstr = (nsString *)g_duplicateList->ElementAt(n); if (pstr->Equals(aURLSpec)) { @@ -127,7 +127,7 @@ NS_IMETHODIMP RobotSinkObserver::ProcessLink(const nsString& aURLSpec) str.Truncate(); nsString(aURLSpec).Left(str,5); if (str.Equals(NS_LITERAL_STRING("http:"))) { - g_iProcessed++; + ++g_iProcessed; if (g_iProcessed == (g_iMaxProcess > 0 ? g_iMaxProcess-1 : 0)) g_bHitTop = PR_TRUE; g_workList->AppendElement(new nsString(aURLSpec)); diff --git a/mozilla/htmlparser/robot/nsRobotSink.cpp b/mozilla/htmlparser/robot/nsRobotSink.cpp index 64e43d35c65..24bee627584 100644 --- a/mozilla/htmlparser/robot/nsRobotSink.cpp +++ b/mozilla/htmlparser/robot/nsRobotSink.cpp @@ -144,7 +144,7 @@ RobotSink::~RobotSink() { NS_IF_RELEASE(mDocumentURL); PRInt32 i, n = mObservers.Count(); - for (i = 0; i < n; i++) { + for (i = 0; i < n; ++i) { nsIRobotSinkObserver* cop = (nsIRobotSinkObserver*)mObservers.ElementAt(i); NS_RELEASE(cop); } @@ -249,7 +249,7 @@ NS_IMETHODIMP RobotSink::OpenContainer(const nsIParserNode& aNode) if (tmp.Equals(NS_LITERAL_STRING("a"))) { nsAutoString k, v; PRInt32 ac = aNode.GetAttributeCount(); - for (PRInt32 i = 0; i < ac; i++) { + for (PRInt32 i = 0; i < ac; ++i) { // Get upper-cased key const nsAString& key = aNode.GetKeyAt(i); k.Assign(key); @@ -388,7 +388,7 @@ void RobotSink::ProcessLink(const nsString& aLink) // Now give link to robot observers PRInt32 i, n = mObservers.Count(); - for (i = 0; i < n; i++) { + for (i = 0; i < n; ++i) { nsIRobotSinkObserver* cop = (nsIRobotSinkObserver*)mObservers.ElementAt(i); cop->ProcessLink(absURLSpec); } diff --git a/mozilla/htmlparser/robot/test/RobotMain.cpp b/mozilla/htmlparser/robot/test/RobotMain.cpp index b3b01bef2bf..785054b568d 100644 --- a/mozilla/htmlparser/robot/test/RobotMain.cpp +++ b/mozilla/htmlparser/robot/test/RobotMain.cpp @@ -16,7 +16,7 @@ int main(int argc, char **argv) nsVoidArray * gWorkList = new nsVoidArray(); if(gWorkList) { int i; - for (i = 1; i < argc; i++) { + for (i = 1; i < argc; ++i) { nsString *tempString = new nsString; tempString->AssignWithConversion(argv[i]); gWorkList->AppendElement(tempString); diff --git a/mozilla/htmlparser/src/CNavDTD.cpp b/mozilla/htmlparser/src/CNavDTD.cpp index 69f754b7a6d..62eabf762ad 100644 --- a/mozilla/htmlparser/src/CNavDTD.cpp +++ b/mozilla/htmlparser/src/CNavDTD.cpp @@ -704,7 +704,7 @@ PRBool DoesRequireBody(CToken* aToken,nsITokenizer* aTokenizer) { if(theTag==eHTMLTag_input) { // IE & Nav4x opens up a body for type=text - Bug 66985 PRInt32 ac=aToken->GetAttributeCount(); - for(PRInt32 i=0; iGetTokenAt(i)); const nsAString& name=attr->GetKey(); const nsAString& value=attr->GetValue(); @@ -1032,7 +1032,7 @@ nsresult CNavDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){ if(theCount) { PRInt32 theIndex=0; - for(theIndex=0;theIndexGetTokenType()); switch(theType) { - case eToken_newline: aNewlineCount++; + case eToken_newline: ++aNewlineCount; case eToken_whitespace: theToken=aTokenizer->PopToken(); IF_FREE(theToken, aTokenAllocator); @@ -2071,7 +2071,7 @@ nsresult CNavDTD::HandleSavedTokens(PRInt32 anIndex) { // considered as a leaf. However, in the sink FORM can either // be a container or a leaf. Therefore, we have to check // with the sink -- Ref: Bug 20087. - anIndex++; + ++anIndex; } STOP_TIMER() @@ -2085,7 +2085,7 @@ nsresult CNavDTD::HandleSavedTokens(PRInt32 anIndex) { PRInt32 i=0; nsEntryStack* theChildStyleStack=0; - for(i=0; i<(theTagCount - theTopIndex); i++) { + for(i=0; i<(theTagCount - theTopIndex); ++i) { nsCParserNode* node=mBodyContext->Pop(theChildStyleStack); mTempContext->Push(node); IF_FREE(node, &mNodeAllocator); //release the popped node since push will addref for us. @@ -2098,7 +2098,7 @@ nsresult CNavDTD::HandleSavedTokens(PRInt32 anIndex) { theTag = (eHTMLTags)theToken->GetTypeID(); attrCount = (gHTMLElements[theTag].mSkipTarget)? 0:theToken->GetAttributeCount(); // Put back attributes, which once got popped out, into the tokenizer - for(PRInt32 j=0;jPushTokenFront(theAttrToken); @@ -2128,7 +2128,7 @@ nsresult CNavDTD::HandleSavedTokens(PRInt32 anIndex) { // Bad-contents were successfully processed. Now, itz time to get // back to the original body context state. - for(PRInt32 k=0; k<(theTagCount - theTopIndex); k++) { + for(PRInt32 k=0; k<(theTagCount - theTopIndex); ++k) { nsCParserNode* node=mTempContext->Pop(theChildStyleStack); mBodyContext->Push(node); IF_FREE(node, &mNodeAllocator); @@ -2380,7 +2380,7 @@ nsresult CNavDTD::CollectAttributes(nsIParserNode& aNode,eHTMLTags aTag,PRInt32 if(aCount<=theAvailTokenCount) { CToken* theToken=0; eHTMLTags theSkipTarget=gHTMLElements[aTag].mSkipTarget; - for(attr=0;attrGetStylesAt(theLevel); if(theStack){ PRInt32 sindex=0; nsTagEntry *theEntry=theStack->mEntries; - for(sindex=0;sindexmCount;sindex++){ + for(sindex=0;sindexmCount;++sindex){ nsCParserNode* theNode=(nsCParserNode*)theEntry->mNode; if(1==theNode->mUseCount) { eHTMLTags theNodeTag=(eHTMLTags)theNode->GetNodeType(); @@ -2965,10 +2965,10 @@ nsresult CNavDTD::OpenTransientStyles(eHTMLTags aChildTag){ //if the node tag can't contain the child tag, then remove the child tag from the style stack nsCParserNode* node=theStack->Remove(sindex,theNodeTag); IF_FREE(node, &mNodeAllocator); - theEntry--; //back up by one + --theEntry; //back up by one } } //if - theEntry++; + ++theEntry; } //for } //if } //for @@ -3269,7 +3269,7 @@ nsresult CNavDTD::OpenMap(const nsCParserNode *aNode){ if(NS_OK==result) { mBodyContext->Push(aNode); - mOpenMapCount++; + ++mOpenMapCount; } return result; } diff --git a/mozilla/htmlparser/src/COtherDTD.cpp b/mozilla/htmlparser/src/COtherDTD.cpp index 18e318c2528..068b4cc1579 100644 --- a/mozilla/htmlparser/src/COtherDTD.cpp +++ b/mozilla/htmlparser/src/COtherDTD.cpp @@ -581,7 +581,7 @@ nsresult COtherDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){ if(theNextToken) { eHTMLTokenTypes theType=eHTMLTokenTypes(theNextToken->GetTokenType()); if(eToken_newline==theType){ - mLineNumber++; + ++mLineNumber; mTokenizer->PopToken(); //skip 1st newline inside PRE and LISTING }//if }//if @@ -599,7 +599,7 @@ nsresult COtherDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){ if(theCount) { PRInt32 theIndex=0; - for(theIndex=0;theIndexmElements[aTag]->GetSkipTarget(); CToken* theToken=0; - for(attr=0;attrPopToken(); if(theToken) { // Sanitize the key for it might contain some non-alpha-non-digit characters diff --git a/mozilla/htmlparser/src/COtherElements.h b/mozilla/htmlparser/src/COtherElements.h index c61ae599149..190d6397e6a 100644 --- a/mozilla/htmlparser/src/COtherElements.h +++ b/mozilla/htmlparser/src/COtherElements.h @@ -104,7 +104,7 @@ inline PRBool ListContainsTag(eHTMLTags* aTagList,eHTMLTags aTag) { if(aTag==*theNextTag) { return PR_TRUE; } - theNextTag++; + ++theNextTag; } } return PR_FALSE; @@ -2109,7 +2109,7 @@ void CElementTable::InitializeElements() { int max=sizeof(mElements)/sizeof(mElements[0]); int index=0; - for(index=0;indexCanContain(theChild,0)){ const PRUnichar *t = nsHTMLTags::GetStringValue(theChild->mTag); printf("%s ", NS_ConvertUCS2toUTF8(t).get()); - count++; + ++count; if(18==count) { count=0; printf("\n%s",prefix); @@ -2528,7 +2528,7 @@ void CElementTable::DebugDumpContainment(const char* aTitle){ printf("==================================================\n"); int i=0; - for(i=1;i4225) { int x=failpos; } - failpos++; + ++failpos; char* p=strchr(" \t\r\n\b",ch1); if(!p) break; diff --git a/mozilla/htmlparser/src/nsDTDUtils.cpp b/mozilla/htmlparser/src/nsDTDUtils.cpp index b7f37b9707a..43ddef1a80c 100644 --- a/mozilla/htmlparser/src/nsDTDUtils.cpp +++ b/mozilla/htmlparser/src/nsDTDUtils.cpp @@ -139,7 +139,7 @@ void nsEntryStack::EnsureCapacityFor(PRInt32 aNewMax,PRInt32 aShiftOffset) { if(temp){ PRInt32 index=0; - for(index=0;indexmCount,0); PRInt32 theIndex=0; - for(theIndex=0;theIndexmEntries[theIndex]; mEntries[mCount++].mParent=0; } @@ -245,7 +245,7 @@ nsCParserNode* nsEntryStack::Remove(PRInt32 anIndex,eHTMLTags aTag) { PRInt32 theIndex=0; mCount-=1; - for(theIndex=anIndex;theIndexmEntries; - for(sindex=scount-1;sindex>0;sindex--){ + for(sindex=scount-1;sindex>0;--sindex){ if(theStyleEntry->mTag==aTag) { theStyleEntry->mParent=0; //this tells us that the style is not open at any level break; } - theStyleEntry++; + ++theStyleEntry; } //for } } @@ -299,12 +299,12 @@ nsCParserNode* nsEntryStack::Pop(void) { PRUint32 sindex=0; nsTagEntry *theStyleEntry=theStyleStack->mEntries; - for(sindex=scount-1;sindex>0;sindex--){ + for(sindex=scount-1;sindex>0;--sindex){ if(theStyleEntry->mTag==mEntries[mCount].mTag) { theStyleEntry->mParent=0; //this tells us that the style is not open at any level break; } - theStyleEntry++; + ++theStyleEntry; } //for } } @@ -465,12 +465,12 @@ CNamedEntity* nsDTDContext::GetEntity(const nsAString& aName)const { // skip past leading and trailing quotes/etc if(kQuote==*start) { - start++; + ++start; } if(kSemicolon==theChar || kQuote == theChar) { - end--; + --end; } @@ -478,7 +478,7 @@ CNamedEntity* nsDTDContext::GetEntity(const nsAString& aName)const { PRInt32 theCount=mEntities.GetSize(); PRInt32 theIndex=0; - for(theIndex=0;theIndexmName.Equals(entityName, @@ -592,7 +592,7 @@ public: while(next<=aValue) { // scale up in baseN; exceed current value. root=next; next*=base; - expn++; + ++expn; } while(expn--) { @@ -735,7 +735,7 @@ public: int digitPos=0; int n=0; - for(digitPos=0;digitPosPush(aNode); - mResidualStyleCount++; + ++mResidualStyleCount; } } //if } @@ -1076,10 +1076,10 @@ void nsDTDContext::PushStyles(nsEntryStack *aStyles){ PRUint32 sindex=0; theEntry=aStyles->mEntries; - for(sindex=0;sindexmParent=0; //this tells us that the style is not open at any level - theEntry++; - mResidualStyleCount++; + ++theEntry; + ++mResidualStyleCount; } //for } @@ -1202,7 +1202,7 @@ nsTokenAllocator::nsTokenAllocator() { #ifdef NS_DEBUG int i=0; - for(i=0;i" << endl; out << prefix; written=0; if(theDTD.IsContainer(i)) { - for(j=1;jCount(); - for (PRInt32 j = 0; j < count; j++) { + for (PRInt32 j = 0; j < count; ++j) { nsISupports* obs = (nsISupports*)mObservers[i]->ElementAt(j); NS_IF_RELEASE(obs); } @@ -1550,7 +1550,7 @@ nsObserverEntry::Notify(nsIParserNode* aNode, // least 2 allocations for mImpl, usually more, plus at least 1 per // string (total = 2*(keys+3) + 2(or more) array allocations )). PRInt32 index; - for (index = 0; index < theAttrCount; index++) { + for (index = 0; index < theAttrCount; ++index) { keys.AppendString(aNode->GetKeyAt(index)); values.AppendString(aNode->GetValueAt(index)); } @@ -1570,7 +1570,7 @@ nsObserverEntry::Notify(nsIParserNode* aNode, nsCOMPtr channel; aParser->GetChannel(getter_AddRefs(channel)); - for (index=0;indexElementAt(index)); if (observer) { result = observer->Notify(aWebShell, channel, @@ -1613,7 +1613,7 @@ nsObserverEntry::AddObserver(nsIElementObserver *aObserver, void nsObserverEntry::RemoveObserver(nsIElementObserver *aObserver) { - for (PRInt32 i=0; i <= NS_HTML_TAG_MAX; i++){ + for (PRInt32 i=0; i <= NS_HTML_TAG_MAX; ++i){ if (mObservers[i]) { nsISupports* obs = aObserver; PRBool removed = mObservers[i]->RemoveElement(obs); diff --git a/mozilla/htmlparser/src/nsDTDUtils.h b/mozilla/htmlparser/src/nsDTDUtils.h index 1aaeec4b85b..8b1e4fed585 100644 --- a/mozilla/htmlparser/src/nsDTDUtils.h +++ b/mozilla/htmlparser/src/nsDTDUtils.h @@ -446,7 +446,7 @@ inline PRInt32 IndexOfTagInSet(PRInt32 aTag,const eHTMLTags* aTagSet,PRInt32 aCo if(aTag==*theTag) { return theTag-aTagSet; } - theTag++; + ++theTag; } return kNotFound; @@ -622,7 +622,7 @@ inline PRInt32 LastOf(nsDTDContext& aContext,TagList& aTagList){ inline PRInt32 FirstOf(nsDTDContext& aContext,PRInt32 aStartOffset,TagList& aTagList){ int max = aContext.GetCount(); int index; - for(index=aStartOffset;index" << endl; @@ -2322,25 +2322,25 @@ void nsHTMLElement::DebugDumpContainment(const char* aFilename,const char* aTitl written=0; char startChar=0; if(IsContainer((eHTMLTags)i)) { - for(j=1;j // 0123456789012345678 PRUint32 i = 17; // ?> can start at position 17 at the earliest - for (; i < aLength; i++) { + for (; i < aLength; ++i) { if (aValue[i] == '?') break; } @@ -682,7 +682,7 @@ CreateSourceText(const PRInt32 aColNumber, aSourceString.Append(aSourceLine); aSourceString.Append(PRUnichar('\n')); - for (PRInt32 i = 0; i < errorPosition - 1; i++) { + for (PRInt32 i = 0; i < errorPosition - 1; ++i) { aSourceString.Append(PRUnichar('-')); } aSourceString.Append(PRUnichar('^')); diff --git a/mozilla/htmlparser/src/nsHTMLEntities.cpp b/mozilla/htmlparser/src/nsHTMLEntities.cpp index 329c2bce27c..1153cc8d00b 100644 --- a/mozilla/htmlparser/src/nsHTMLEntities.cpp +++ b/mozilla/htmlparser/src/nsHTMLEntities.cpp @@ -235,7 +235,7 @@ public: nsHTMLEntities::AddRefTable(); // Make sure we can find everything we are supposed to - for (int i = 0; i < NS_HTML_ENTITY_COUNT; i++) { + for (int i = 0; i < NS_HTML_ENTITY_COUNT; ++i) { nsAutoString entity; entity.AssignWithConversion(gEntityArray[i].mStr); value = nsHTMLEntities::EntityToUnicode(entity); diff --git a/mozilla/htmlparser/src/nsHTMLNullSink.cpp b/mozilla/htmlparser/src/nsHTMLNullSink.cpp index 8edfbdf9e42..b7227edda0b 100644 --- a/mozilla/htmlparser/src/nsHTMLNullSink.cpp +++ b/mozilla/htmlparser/src/nsHTMLNullSink.cpp @@ -153,7 +153,7 @@ nsHTMLNullSink::~nsHTMLNullSink() { #ifdef VERBOSE_DEBUG static void DebugDump(const char* str1,const nsAString& str2,PRInt32 tabs) { - for(PRInt32 i=0;iSetEmpty(isUsableAttr); } if(isUsableAttr) { - theAttrCount++; + ++theAttrCount; AddToken((CToken*&)theToken,result,&mTokenDeque,theAllocator); } else { diff --git a/mozilla/htmlparser/src/nsHTMLTokens.cpp b/mozilla/htmlparser/src/nsHTMLTokens.cpp index 46b64c47674..6d007e6cbb2 100644 --- a/mozilla/htmlparser/src/nsHTMLTokens.cpp +++ b/mozilla/htmlparser/src/nsHTMLTokens.cpp @@ -1013,7 +1013,7 @@ static PRBool IsCommentEnd( return PR_TRUE; } if (*current == PRUnichar('-')) { - dashes++; + ++dashes; } else { dashes = 0; } @@ -2028,9 +2028,9 @@ CEntityToken::ConsumeEntity(PRUnichar aChar, aString.Append(aChar); if(aChar==kRightBrace) - rightBraceCount++; + ++rightBraceCount; else if(aChar==kLeftBrace) - leftBraceCount++; + ++leftBraceCount; } while(leftBraceCount!=rightBraceCount); } //if else { diff --git a/mozilla/htmlparser/src/nsLoggingSink.cpp b/mozilla/htmlparser/src/nsLoggingSink.cpp index d0a90ae1f8a..463be53af52 100644 --- a/mozilla/htmlparser/src/nsLoggingSink.cpp +++ b/mozilla/htmlparser/src/nsLoggingSink.cpp @@ -133,7 +133,7 @@ nsLoggingSink::SetOutputStream(PRFileDesc *aStream,PRBool autoDeleteOutput) { static void WriteTabs(PRFileDesc * out,int aTabCount) { int tabs; - for(tabs=0;tabsGetCount(); PRInt32 theIndex; - for(theIndex=0;theIndexGetTokenAt(theIndex))){ //add code here to pull unwanted tokens out of the stack... } diff --git a/mozilla/htmlparser/src/nsParserNode.cpp b/mozilla/htmlparser/src/nsParserNode.cpp index 874765982bb..169df3fc469 100644 --- a/mozilla/htmlparser/src/nsParserNode.cpp +++ b/mozilla/htmlparser/src/nsParserNode.cpp @@ -86,7 +86,7 @@ nsCParserNode::nsCParserNode(CToken* aToken, MOZ_COUNT_CTOR(nsCParserNode); static int theNodeCount=0; - theNodeCount++; + ++theNodeCount; mAttributes=0; mToken=aToken; IF_HOLD(mToken); @@ -327,7 +327,7 @@ void nsCParserNode::GetSource(nsString& aString) { } if(mAttributes) { int index=0; - for(index=0;indexGetSize();index++) { + for(index=0;indexGetSize();++index) { CAttributeToken *theToken=(CAttributeToken*)mAttributes->ObjectAt(index); if(theToken) { theToken->AppendSourceTo(aString); diff --git a/mozilla/htmlparser/src/nsParserService.cpp b/mozilla/htmlparser/src/nsParserService.cpp index 4ffd43b00c9..aeba847bd0d 100644 --- a/mozilla/htmlparser/src/nsParserService.cpp +++ b/mozilla/htmlparser/src/nsParserService.cpp @@ -148,7 +148,7 @@ nsParserService::RegisterObserver(nsIElementObserver* aObserver, if(*aTags != eHTMLTag_userdefined && *aTags <= NS_HTML_TAG_MAX) { entry->AddObserver(aObserver,*aTags); } - aTags++; + ++aTags; } return result; @@ -160,7 +160,7 @@ nsParserService::UnregisterObserver(nsIElementObserver* aObserver, { PRInt32 count = mEntries.GetSize(); - for (PRInt32 i=0; i < count; i++) { + for (PRInt32 i=0; i < count; ++i) { nsObserverEntry* entry = NS_STATIC_CAST(nsObserverEntry*,mEntries.ObjectAt(i)); if (entry && entry->Matches(aTopic)) { entry->RemoveObserver(aObserver); diff --git a/mozilla/htmlparser/src/nsScanner.cpp b/mozilla/htmlparser/src/nsScanner.cpp index 4ffdcdce0ce..29d7b140e07 100644 --- a/mozilla/htmlparser/src/nsScanner.cpp +++ b/mozilla/htmlparser/src/nsScanner.cpp @@ -356,7 +356,7 @@ nsresult nsScanner::Append(const char* aBuffer, PRUint32 aLen){ srcLength = aLen; } else { - srcLength++; + ++srcLength; } aBuffer += srcLength; @@ -480,7 +480,7 @@ nsresult nsScanner::GetChar(PRUnichar& aChar) { if(NS_OK == result){ aChar=*mCurrentPosition++; - mCountRemaining--; + --mCountRemaining; } return result; } @@ -581,7 +581,7 @@ nsresult nsScanner::SkipWhitespace(PRInt32& aNewlinesSkipped) { while (!done && current != mEndPosition) { switch(theChar) { case '\n': - case '\r': aNewlinesSkipped++; + case '\r': ++aNewlinesSkipped; case ' ' : case '\b': case '\t': @@ -1048,7 +1048,7 @@ nsresult nsScanner::ReadWhitespace(nsString& aString, while(!done && current != end) { switch(theChar) { case '\n': - case '\r': aNewlinesSkipped++; + case '\r': ++aNewlinesSkipped; case ' ' : case '\b': case '\t': @@ -1102,7 +1102,7 @@ nsresult nsScanner::ReadWhitespace(nsReadingIterator& aStart, while(!done && current != end) { switch(theChar) { case '\n': - case '\r': aNewlinesSkipped++; + case '\r': ++aNewlinesSkipped; case ' ' : case '\b': case '\t': diff --git a/mozilla/htmlparser/src/nsToken.cpp b/mozilla/htmlparser/src/nsToken.cpp index 09bf7d66b90..2eedff1650b 100644 --- a/mozilla/htmlparser/src/nsToken.cpp +++ b/mozilla/htmlparser/src/nsToken.cpp @@ -77,7 +77,7 @@ CToken::CToken(PRInt32 aTag) { mUseCount=1; #ifdef NS_DEBUG - TokenCount++; + ++TokenCount; #endif } @@ -92,7 +92,7 @@ CToken::~CToken() { #ifdef MATCH_CTOR_DTOR MOZ_COUNT_DTOR(CToken); #endif - DelTokenCount++; + ++DelTokenCount; mUseCount=0; } @@ -124,7 +124,7 @@ void CToken::DebugDumpToken(nsOutputStream& anOutputStream) { anOutputStream << "[" << GetClassName() << "] "; PRUint32 i=0; PRUint32 theLen=GetStringValue().Length(); - for(i=0;iPeekToken(); if(theToken) { eHTMLTokenTypes theType=eHTMLTokenTypes(theToken->GetTokenType()); @@ -1047,7 +1047,7 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) { case eToken_start: { - mTagCount++; + ++mTagCount; const nsAString& startValue = aToken->GetStringValue(); result=WriteTag(mStartTag,startValue,aToken->GetAttributeCount(),PR_TRUE); @@ -1107,9 +1107,9 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) { case eToken_newline: { const nsAString& newlineValue = aToken->GetStringValue(); - mLineNumber++; + ++mLineNumber; result=WriteTag(mText,newlineValue,0,PR_FALSE); - mTokenCount++; + ++mTokenCount; if (NS_VIEWSOURCE_TOKENS_PER_BLOCK > 0 && mTokenCount > NS_VIEWSOURCE_TOKENS_PER_BLOCK) StartNewPreBlock(); @@ -1120,7 +1120,7 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) { { const nsAString& wsValue = aToken->GetStringValue(); result=WriteTag(mText,wsValue,0,PR_FALSE); - mTokenCount++; + ++mTokenCount; if (NS_VIEWSOURCE_TOKENS_PER_BLOCK > 0 && mTokenCount > NS_VIEWSOURCE_TOKENS_PER_BLOCK && !wsValue.IsEmpty()) { @@ -1135,7 +1135,7 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) { { const nsAString& str = aToken->GetStringValue(); result=WriteTag(mText,str,aToken->GetAttributeCount(),PR_TRUE); - mTokenCount++; + ++mTokenCount; if (NS_VIEWSOURCE_TOKENS_PER_BLOCK > 0 && mTokenCount > NS_VIEWSOURCE_TOKENS_PER_BLOCK && !str.IsEmpty()) { PRUnichar ch = str.Last(); diff --git a/mozilla/htmlparser/tests/grabpage/grabpage.cpp b/mozilla/htmlparser/tests/grabpage/grabpage.cpp index 1c412e4d3b8..37b6e65a0c1 100644 --- a/mozilla/htmlparser/tests/grabpage/grabpage.cpp +++ b/mozilla/htmlparser/tests/grabpage/grabpage.cpp @@ -209,7 +209,7 @@ PageGrabber::NextFile(const char* aExtension) struct stat sb; int s = stat(cname, &sb); if (s < 0) { - mFileNum++; + ++mFileNum; break; } else { diff --git a/mozilla/htmlparser/tests/htmlgen/htmlgen.cpp b/mozilla/htmlparser/tests/htmlgen/htmlgen.cpp index 91409cfaf24..de426e7fd46 100644 --- a/mozilla/htmlparser/tests/htmlgen/htmlgen.cpp +++ b/mozilla/htmlparser/tests/htmlgen/htmlgen.cpp @@ -388,7 +388,7 @@ void expandMacros(char* aBuffer,CMacros& aMacroSet){ while(aBuffer[++rPos]){ if('$'==aBuffer[rPos]){ temp[wPos]=0; - rPos++; //skip the $... + ++rPos; //skip the $... int theIndex=aBuffer[rPos]-'0'; char* theMacro=aMacroSet.getMacro(theIndex); if(theMacro){ diff --git a/mozilla/parser/htmlparser/public/nsToken.h b/mozilla/parser/htmlparser/public/nsToken.h index 32d16413653..985e13519bb 100644 --- a/mozilla/parser/htmlparser/public/nsToken.h +++ b/mozilla/parser/htmlparser/public/nsToken.h @@ -153,7 +153,7 @@ class CToken { * Make a note on number of times you have been referenced * @update harishd 08/02/00 */ - void AddRef() { mUseCount++; } + void AddRef() { ++mUseCount; } /** * Free yourself if no one is holding you. diff --git a/mozilla/parser/htmlparser/robot/nsDebugRobot.cpp b/mozilla/parser/htmlparser/robot/nsDebugRobot.cpp index d5f744969f5..8fe8096b64d 100644 --- a/mozilla/parser/htmlparser/robot/nsDebugRobot.cpp +++ b/mozilla/parser/htmlparser/robot/nsDebugRobot.cpp @@ -112,7 +112,7 @@ NS_IMETHODIMP RobotSinkObserver::ProcessLink(const nsString& aURLSpec) PRInt32 nCount = g_duplicateList->Count(); if (nCount > 0) { - for (PRInt32 n = 0; n < nCount; n++) + for (PRInt32 n = 0; n < nCount; ++n) { nsString * pstr = (nsString *)g_duplicateList->ElementAt(n); if (pstr->Equals(aURLSpec)) { @@ -127,7 +127,7 @@ NS_IMETHODIMP RobotSinkObserver::ProcessLink(const nsString& aURLSpec) str.Truncate(); nsString(aURLSpec).Left(str,5); if (str.Equals(NS_LITERAL_STRING("http:"))) { - g_iProcessed++; + ++g_iProcessed; if (g_iProcessed == (g_iMaxProcess > 0 ? g_iMaxProcess-1 : 0)) g_bHitTop = PR_TRUE; g_workList->AppendElement(new nsString(aURLSpec)); diff --git a/mozilla/parser/htmlparser/robot/nsRobotSink.cpp b/mozilla/parser/htmlparser/robot/nsRobotSink.cpp index 64e43d35c65..24bee627584 100644 --- a/mozilla/parser/htmlparser/robot/nsRobotSink.cpp +++ b/mozilla/parser/htmlparser/robot/nsRobotSink.cpp @@ -144,7 +144,7 @@ RobotSink::~RobotSink() { NS_IF_RELEASE(mDocumentURL); PRInt32 i, n = mObservers.Count(); - for (i = 0; i < n; i++) { + for (i = 0; i < n; ++i) { nsIRobotSinkObserver* cop = (nsIRobotSinkObserver*)mObservers.ElementAt(i); NS_RELEASE(cop); } @@ -249,7 +249,7 @@ NS_IMETHODIMP RobotSink::OpenContainer(const nsIParserNode& aNode) if (tmp.Equals(NS_LITERAL_STRING("a"))) { nsAutoString k, v; PRInt32 ac = aNode.GetAttributeCount(); - for (PRInt32 i = 0; i < ac; i++) { + for (PRInt32 i = 0; i < ac; ++i) { // Get upper-cased key const nsAString& key = aNode.GetKeyAt(i); k.Assign(key); @@ -388,7 +388,7 @@ void RobotSink::ProcessLink(const nsString& aLink) // Now give link to robot observers PRInt32 i, n = mObservers.Count(); - for (i = 0; i < n; i++) { + for (i = 0; i < n; ++i) { nsIRobotSinkObserver* cop = (nsIRobotSinkObserver*)mObservers.ElementAt(i); cop->ProcessLink(absURLSpec); } diff --git a/mozilla/parser/htmlparser/robot/test/RobotMain.cpp b/mozilla/parser/htmlparser/robot/test/RobotMain.cpp index b3b01bef2bf..785054b568d 100644 --- a/mozilla/parser/htmlparser/robot/test/RobotMain.cpp +++ b/mozilla/parser/htmlparser/robot/test/RobotMain.cpp @@ -16,7 +16,7 @@ int main(int argc, char **argv) nsVoidArray * gWorkList = new nsVoidArray(); if(gWorkList) { int i; - for (i = 1; i < argc; i++) { + for (i = 1; i < argc; ++i) { nsString *tempString = new nsString; tempString->AssignWithConversion(argv[i]); gWorkList->AppendElement(tempString); diff --git a/mozilla/parser/htmlparser/src/CNavDTD.cpp b/mozilla/parser/htmlparser/src/CNavDTD.cpp index 69f754b7a6d..62eabf762ad 100644 --- a/mozilla/parser/htmlparser/src/CNavDTD.cpp +++ b/mozilla/parser/htmlparser/src/CNavDTD.cpp @@ -704,7 +704,7 @@ PRBool DoesRequireBody(CToken* aToken,nsITokenizer* aTokenizer) { if(theTag==eHTMLTag_input) { // IE & Nav4x opens up a body for type=text - Bug 66985 PRInt32 ac=aToken->GetAttributeCount(); - for(PRInt32 i=0; iGetTokenAt(i)); const nsAString& name=attr->GetKey(); const nsAString& value=attr->GetValue(); @@ -1032,7 +1032,7 @@ nsresult CNavDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){ if(theCount) { PRInt32 theIndex=0; - for(theIndex=0;theIndexGetTokenType()); switch(theType) { - case eToken_newline: aNewlineCount++; + case eToken_newline: ++aNewlineCount; case eToken_whitespace: theToken=aTokenizer->PopToken(); IF_FREE(theToken, aTokenAllocator); @@ -2071,7 +2071,7 @@ nsresult CNavDTD::HandleSavedTokens(PRInt32 anIndex) { // considered as a leaf. However, in the sink FORM can either // be a container or a leaf. Therefore, we have to check // with the sink -- Ref: Bug 20087. - anIndex++; + ++anIndex; } STOP_TIMER() @@ -2085,7 +2085,7 @@ nsresult CNavDTD::HandleSavedTokens(PRInt32 anIndex) { PRInt32 i=0; nsEntryStack* theChildStyleStack=0; - for(i=0; i<(theTagCount - theTopIndex); i++) { + for(i=0; i<(theTagCount - theTopIndex); ++i) { nsCParserNode* node=mBodyContext->Pop(theChildStyleStack); mTempContext->Push(node); IF_FREE(node, &mNodeAllocator); //release the popped node since push will addref for us. @@ -2098,7 +2098,7 @@ nsresult CNavDTD::HandleSavedTokens(PRInt32 anIndex) { theTag = (eHTMLTags)theToken->GetTypeID(); attrCount = (gHTMLElements[theTag].mSkipTarget)? 0:theToken->GetAttributeCount(); // Put back attributes, which once got popped out, into the tokenizer - for(PRInt32 j=0;jPushTokenFront(theAttrToken); @@ -2128,7 +2128,7 @@ nsresult CNavDTD::HandleSavedTokens(PRInt32 anIndex) { // Bad-contents were successfully processed. Now, itz time to get // back to the original body context state. - for(PRInt32 k=0; k<(theTagCount - theTopIndex); k++) { + for(PRInt32 k=0; k<(theTagCount - theTopIndex); ++k) { nsCParserNode* node=mTempContext->Pop(theChildStyleStack); mBodyContext->Push(node); IF_FREE(node, &mNodeAllocator); @@ -2380,7 +2380,7 @@ nsresult CNavDTD::CollectAttributes(nsIParserNode& aNode,eHTMLTags aTag,PRInt32 if(aCount<=theAvailTokenCount) { CToken* theToken=0; eHTMLTags theSkipTarget=gHTMLElements[aTag].mSkipTarget; - for(attr=0;attrGetStylesAt(theLevel); if(theStack){ PRInt32 sindex=0; nsTagEntry *theEntry=theStack->mEntries; - for(sindex=0;sindexmCount;sindex++){ + for(sindex=0;sindexmCount;++sindex){ nsCParserNode* theNode=(nsCParserNode*)theEntry->mNode; if(1==theNode->mUseCount) { eHTMLTags theNodeTag=(eHTMLTags)theNode->GetNodeType(); @@ -2965,10 +2965,10 @@ nsresult CNavDTD::OpenTransientStyles(eHTMLTags aChildTag){ //if the node tag can't contain the child tag, then remove the child tag from the style stack nsCParserNode* node=theStack->Remove(sindex,theNodeTag); IF_FREE(node, &mNodeAllocator); - theEntry--; //back up by one + --theEntry; //back up by one } } //if - theEntry++; + ++theEntry; } //for } //if } //for @@ -3269,7 +3269,7 @@ nsresult CNavDTD::OpenMap(const nsCParserNode *aNode){ if(NS_OK==result) { mBodyContext->Push(aNode); - mOpenMapCount++; + ++mOpenMapCount; } return result; } diff --git a/mozilla/parser/htmlparser/src/COtherDTD.cpp b/mozilla/parser/htmlparser/src/COtherDTD.cpp index 18e318c2528..068b4cc1579 100644 --- a/mozilla/parser/htmlparser/src/COtherDTD.cpp +++ b/mozilla/parser/htmlparser/src/COtherDTD.cpp @@ -581,7 +581,7 @@ nsresult COtherDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){ if(theNextToken) { eHTMLTokenTypes theType=eHTMLTokenTypes(theNextToken->GetTokenType()); if(eToken_newline==theType){ - mLineNumber++; + ++mLineNumber; mTokenizer->PopToken(); //skip 1st newline inside PRE and LISTING }//if }//if @@ -599,7 +599,7 @@ nsresult COtherDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){ if(theCount) { PRInt32 theIndex=0; - for(theIndex=0;theIndexmElements[aTag]->GetSkipTarget(); CToken* theToken=0; - for(attr=0;attrPopToken(); if(theToken) { // Sanitize the key for it might contain some non-alpha-non-digit characters diff --git a/mozilla/parser/htmlparser/src/COtherElements.h b/mozilla/parser/htmlparser/src/COtherElements.h index c61ae599149..190d6397e6a 100644 --- a/mozilla/parser/htmlparser/src/COtherElements.h +++ b/mozilla/parser/htmlparser/src/COtherElements.h @@ -104,7 +104,7 @@ inline PRBool ListContainsTag(eHTMLTags* aTagList,eHTMLTags aTag) { if(aTag==*theNextTag) { return PR_TRUE; } - theNextTag++; + ++theNextTag; } } return PR_FALSE; @@ -2109,7 +2109,7 @@ void CElementTable::InitializeElements() { int max=sizeof(mElements)/sizeof(mElements[0]); int index=0; - for(index=0;indexCanContain(theChild,0)){ const PRUnichar *t = nsHTMLTags::GetStringValue(theChild->mTag); printf("%s ", NS_ConvertUCS2toUTF8(t).get()); - count++; + ++count; if(18==count) { count=0; printf("\n%s",prefix); @@ -2528,7 +2528,7 @@ void CElementTable::DebugDumpContainment(const char* aTitle){ printf("==================================================\n"); int i=0; - for(i=1;i4225) { int x=failpos; } - failpos++; + ++failpos; char* p=strchr(" \t\r\n\b",ch1); if(!p) break; diff --git a/mozilla/parser/htmlparser/src/nsDTDUtils.cpp b/mozilla/parser/htmlparser/src/nsDTDUtils.cpp index b7f37b9707a..43ddef1a80c 100644 --- a/mozilla/parser/htmlparser/src/nsDTDUtils.cpp +++ b/mozilla/parser/htmlparser/src/nsDTDUtils.cpp @@ -139,7 +139,7 @@ void nsEntryStack::EnsureCapacityFor(PRInt32 aNewMax,PRInt32 aShiftOffset) { if(temp){ PRInt32 index=0; - for(index=0;indexmCount,0); PRInt32 theIndex=0; - for(theIndex=0;theIndexmEntries[theIndex]; mEntries[mCount++].mParent=0; } @@ -245,7 +245,7 @@ nsCParserNode* nsEntryStack::Remove(PRInt32 anIndex,eHTMLTags aTag) { PRInt32 theIndex=0; mCount-=1; - for(theIndex=anIndex;theIndexmEntries; - for(sindex=scount-1;sindex>0;sindex--){ + for(sindex=scount-1;sindex>0;--sindex){ if(theStyleEntry->mTag==aTag) { theStyleEntry->mParent=0; //this tells us that the style is not open at any level break; } - theStyleEntry++; + ++theStyleEntry; } //for } } @@ -299,12 +299,12 @@ nsCParserNode* nsEntryStack::Pop(void) { PRUint32 sindex=0; nsTagEntry *theStyleEntry=theStyleStack->mEntries; - for(sindex=scount-1;sindex>0;sindex--){ + for(sindex=scount-1;sindex>0;--sindex){ if(theStyleEntry->mTag==mEntries[mCount].mTag) { theStyleEntry->mParent=0; //this tells us that the style is not open at any level break; } - theStyleEntry++; + ++theStyleEntry; } //for } } @@ -465,12 +465,12 @@ CNamedEntity* nsDTDContext::GetEntity(const nsAString& aName)const { // skip past leading and trailing quotes/etc if(kQuote==*start) { - start++; + ++start; } if(kSemicolon==theChar || kQuote == theChar) { - end--; + --end; } @@ -478,7 +478,7 @@ CNamedEntity* nsDTDContext::GetEntity(const nsAString& aName)const { PRInt32 theCount=mEntities.GetSize(); PRInt32 theIndex=0; - for(theIndex=0;theIndexmName.Equals(entityName, @@ -592,7 +592,7 @@ public: while(next<=aValue) { // scale up in baseN; exceed current value. root=next; next*=base; - expn++; + ++expn; } while(expn--) { @@ -735,7 +735,7 @@ public: int digitPos=0; int n=0; - for(digitPos=0;digitPosPush(aNode); - mResidualStyleCount++; + ++mResidualStyleCount; } } //if } @@ -1076,10 +1076,10 @@ void nsDTDContext::PushStyles(nsEntryStack *aStyles){ PRUint32 sindex=0; theEntry=aStyles->mEntries; - for(sindex=0;sindexmParent=0; //this tells us that the style is not open at any level - theEntry++; - mResidualStyleCount++; + ++theEntry; + ++mResidualStyleCount; } //for } @@ -1202,7 +1202,7 @@ nsTokenAllocator::nsTokenAllocator() { #ifdef NS_DEBUG int i=0; - for(i=0;i" << endl; out << prefix; written=0; if(theDTD.IsContainer(i)) { - for(j=1;jCount(); - for (PRInt32 j = 0; j < count; j++) { + for (PRInt32 j = 0; j < count; ++j) { nsISupports* obs = (nsISupports*)mObservers[i]->ElementAt(j); NS_IF_RELEASE(obs); } @@ -1550,7 +1550,7 @@ nsObserverEntry::Notify(nsIParserNode* aNode, // least 2 allocations for mImpl, usually more, plus at least 1 per // string (total = 2*(keys+3) + 2(or more) array allocations )). PRInt32 index; - for (index = 0; index < theAttrCount; index++) { + for (index = 0; index < theAttrCount; ++index) { keys.AppendString(aNode->GetKeyAt(index)); values.AppendString(aNode->GetValueAt(index)); } @@ -1570,7 +1570,7 @@ nsObserverEntry::Notify(nsIParserNode* aNode, nsCOMPtr channel; aParser->GetChannel(getter_AddRefs(channel)); - for (index=0;indexElementAt(index)); if (observer) { result = observer->Notify(aWebShell, channel, @@ -1613,7 +1613,7 @@ nsObserverEntry::AddObserver(nsIElementObserver *aObserver, void nsObserverEntry::RemoveObserver(nsIElementObserver *aObserver) { - for (PRInt32 i=0; i <= NS_HTML_TAG_MAX; i++){ + for (PRInt32 i=0; i <= NS_HTML_TAG_MAX; ++i){ if (mObservers[i]) { nsISupports* obs = aObserver; PRBool removed = mObservers[i]->RemoveElement(obs); diff --git a/mozilla/parser/htmlparser/src/nsDTDUtils.h b/mozilla/parser/htmlparser/src/nsDTDUtils.h index 1aaeec4b85b..8b1e4fed585 100644 --- a/mozilla/parser/htmlparser/src/nsDTDUtils.h +++ b/mozilla/parser/htmlparser/src/nsDTDUtils.h @@ -446,7 +446,7 @@ inline PRInt32 IndexOfTagInSet(PRInt32 aTag,const eHTMLTags* aTagSet,PRInt32 aCo if(aTag==*theTag) { return theTag-aTagSet; } - theTag++; + ++theTag; } return kNotFound; @@ -622,7 +622,7 @@ inline PRInt32 LastOf(nsDTDContext& aContext,TagList& aTagList){ inline PRInt32 FirstOf(nsDTDContext& aContext,PRInt32 aStartOffset,TagList& aTagList){ int max = aContext.GetCount(); int index; - for(index=aStartOffset;index" << endl; @@ -2322,25 +2322,25 @@ void nsHTMLElement::DebugDumpContainment(const char* aFilename,const char* aTitl written=0; char startChar=0; if(IsContainer((eHTMLTags)i)) { - for(j=1;j // 0123456789012345678 PRUint32 i = 17; // ?> can start at position 17 at the earliest - for (; i < aLength; i++) { + for (; i < aLength; ++i) { if (aValue[i] == '?') break; } @@ -682,7 +682,7 @@ CreateSourceText(const PRInt32 aColNumber, aSourceString.Append(aSourceLine); aSourceString.Append(PRUnichar('\n')); - for (PRInt32 i = 0; i < errorPosition - 1; i++) { + for (PRInt32 i = 0; i < errorPosition - 1; ++i) { aSourceString.Append(PRUnichar('-')); } aSourceString.Append(PRUnichar('^')); diff --git a/mozilla/parser/htmlparser/src/nsHTMLEntities.cpp b/mozilla/parser/htmlparser/src/nsHTMLEntities.cpp index 329c2bce27c..1153cc8d00b 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLEntities.cpp +++ b/mozilla/parser/htmlparser/src/nsHTMLEntities.cpp @@ -235,7 +235,7 @@ public: nsHTMLEntities::AddRefTable(); // Make sure we can find everything we are supposed to - for (int i = 0; i < NS_HTML_ENTITY_COUNT; i++) { + for (int i = 0; i < NS_HTML_ENTITY_COUNT; ++i) { nsAutoString entity; entity.AssignWithConversion(gEntityArray[i].mStr); value = nsHTMLEntities::EntityToUnicode(entity); diff --git a/mozilla/parser/htmlparser/src/nsHTMLNullSink.cpp b/mozilla/parser/htmlparser/src/nsHTMLNullSink.cpp index 8edfbdf9e42..b7227edda0b 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLNullSink.cpp +++ b/mozilla/parser/htmlparser/src/nsHTMLNullSink.cpp @@ -153,7 +153,7 @@ nsHTMLNullSink::~nsHTMLNullSink() { #ifdef VERBOSE_DEBUG static void DebugDump(const char* str1,const nsAString& str2,PRInt32 tabs) { - for(PRInt32 i=0;iSetEmpty(isUsableAttr); } if(isUsableAttr) { - theAttrCount++; + ++theAttrCount; AddToken((CToken*&)theToken,result,&mTokenDeque,theAllocator); } else { diff --git a/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp b/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp index 46b64c47674..6d007e6cbb2 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp +++ b/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp @@ -1013,7 +1013,7 @@ static PRBool IsCommentEnd( return PR_TRUE; } if (*current == PRUnichar('-')) { - dashes++; + ++dashes; } else { dashes = 0; } @@ -2028,9 +2028,9 @@ CEntityToken::ConsumeEntity(PRUnichar aChar, aString.Append(aChar); if(aChar==kRightBrace) - rightBraceCount++; + ++rightBraceCount; else if(aChar==kLeftBrace) - leftBraceCount++; + ++leftBraceCount; } while(leftBraceCount!=rightBraceCount); } //if else { diff --git a/mozilla/parser/htmlparser/src/nsLoggingSink.cpp b/mozilla/parser/htmlparser/src/nsLoggingSink.cpp index d0a90ae1f8a..463be53af52 100644 --- a/mozilla/parser/htmlparser/src/nsLoggingSink.cpp +++ b/mozilla/parser/htmlparser/src/nsLoggingSink.cpp @@ -133,7 +133,7 @@ nsLoggingSink::SetOutputStream(PRFileDesc *aStream,PRBool autoDeleteOutput) { static void WriteTabs(PRFileDesc * out,int aTabCount) { int tabs; - for(tabs=0;tabsGetCount(); PRInt32 theIndex; - for(theIndex=0;theIndexGetTokenAt(theIndex))){ //add code here to pull unwanted tokens out of the stack... } diff --git a/mozilla/parser/htmlparser/src/nsParserNode.cpp b/mozilla/parser/htmlparser/src/nsParserNode.cpp index 874765982bb..169df3fc469 100644 --- a/mozilla/parser/htmlparser/src/nsParserNode.cpp +++ b/mozilla/parser/htmlparser/src/nsParserNode.cpp @@ -86,7 +86,7 @@ nsCParserNode::nsCParserNode(CToken* aToken, MOZ_COUNT_CTOR(nsCParserNode); static int theNodeCount=0; - theNodeCount++; + ++theNodeCount; mAttributes=0; mToken=aToken; IF_HOLD(mToken); @@ -327,7 +327,7 @@ void nsCParserNode::GetSource(nsString& aString) { } if(mAttributes) { int index=0; - for(index=0;indexGetSize();index++) { + for(index=0;indexGetSize();++index) { CAttributeToken *theToken=(CAttributeToken*)mAttributes->ObjectAt(index); if(theToken) { theToken->AppendSourceTo(aString); diff --git a/mozilla/parser/htmlparser/src/nsParserService.cpp b/mozilla/parser/htmlparser/src/nsParserService.cpp index 4ffd43b00c9..aeba847bd0d 100644 --- a/mozilla/parser/htmlparser/src/nsParserService.cpp +++ b/mozilla/parser/htmlparser/src/nsParserService.cpp @@ -148,7 +148,7 @@ nsParserService::RegisterObserver(nsIElementObserver* aObserver, if(*aTags != eHTMLTag_userdefined && *aTags <= NS_HTML_TAG_MAX) { entry->AddObserver(aObserver,*aTags); } - aTags++; + ++aTags; } return result; @@ -160,7 +160,7 @@ nsParserService::UnregisterObserver(nsIElementObserver* aObserver, { PRInt32 count = mEntries.GetSize(); - for (PRInt32 i=0; i < count; i++) { + for (PRInt32 i=0; i < count; ++i) { nsObserverEntry* entry = NS_STATIC_CAST(nsObserverEntry*,mEntries.ObjectAt(i)); if (entry && entry->Matches(aTopic)) { entry->RemoveObserver(aObserver); diff --git a/mozilla/parser/htmlparser/src/nsScanner.cpp b/mozilla/parser/htmlparser/src/nsScanner.cpp index 4ffdcdce0ce..29d7b140e07 100644 --- a/mozilla/parser/htmlparser/src/nsScanner.cpp +++ b/mozilla/parser/htmlparser/src/nsScanner.cpp @@ -356,7 +356,7 @@ nsresult nsScanner::Append(const char* aBuffer, PRUint32 aLen){ srcLength = aLen; } else { - srcLength++; + ++srcLength; } aBuffer += srcLength; @@ -480,7 +480,7 @@ nsresult nsScanner::GetChar(PRUnichar& aChar) { if(NS_OK == result){ aChar=*mCurrentPosition++; - mCountRemaining--; + --mCountRemaining; } return result; } @@ -581,7 +581,7 @@ nsresult nsScanner::SkipWhitespace(PRInt32& aNewlinesSkipped) { while (!done && current != mEndPosition) { switch(theChar) { case '\n': - case '\r': aNewlinesSkipped++; + case '\r': ++aNewlinesSkipped; case ' ' : case '\b': case '\t': @@ -1048,7 +1048,7 @@ nsresult nsScanner::ReadWhitespace(nsString& aString, while(!done && current != end) { switch(theChar) { case '\n': - case '\r': aNewlinesSkipped++; + case '\r': ++aNewlinesSkipped; case ' ' : case '\b': case '\t': @@ -1102,7 +1102,7 @@ nsresult nsScanner::ReadWhitespace(nsReadingIterator& aStart, while(!done && current != end) { switch(theChar) { case '\n': - case '\r': aNewlinesSkipped++; + case '\r': ++aNewlinesSkipped; case ' ' : case '\b': case '\t': diff --git a/mozilla/parser/htmlparser/src/nsToken.cpp b/mozilla/parser/htmlparser/src/nsToken.cpp index 09bf7d66b90..2eedff1650b 100644 --- a/mozilla/parser/htmlparser/src/nsToken.cpp +++ b/mozilla/parser/htmlparser/src/nsToken.cpp @@ -77,7 +77,7 @@ CToken::CToken(PRInt32 aTag) { mUseCount=1; #ifdef NS_DEBUG - TokenCount++; + ++TokenCount; #endif } @@ -92,7 +92,7 @@ CToken::~CToken() { #ifdef MATCH_CTOR_DTOR MOZ_COUNT_DTOR(CToken); #endif - DelTokenCount++; + ++DelTokenCount; mUseCount=0; } @@ -124,7 +124,7 @@ void CToken::DebugDumpToken(nsOutputStream& anOutputStream) { anOutputStream << "[" << GetClassName() << "] "; PRUint32 i=0; PRUint32 theLen=GetStringValue().Length(); - for(i=0;iPeekToken(); if(theToken) { eHTMLTokenTypes theType=eHTMLTokenTypes(theToken->GetTokenType()); @@ -1047,7 +1047,7 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) { case eToken_start: { - mTagCount++; + ++mTagCount; const nsAString& startValue = aToken->GetStringValue(); result=WriteTag(mStartTag,startValue,aToken->GetAttributeCount(),PR_TRUE); @@ -1107,9 +1107,9 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) { case eToken_newline: { const nsAString& newlineValue = aToken->GetStringValue(); - mLineNumber++; + ++mLineNumber; result=WriteTag(mText,newlineValue,0,PR_FALSE); - mTokenCount++; + ++mTokenCount; if (NS_VIEWSOURCE_TOKENS_PER_BLOCK > 0 && mTokenCount > NS_VIEWSOURCE_TOKENS_PER_BLOCK) StartNewPreBlock(); @@ -1120,7 +1120,7 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) { { const nsAString& wsValue = aToken->GetStringValue(); result=WriteTag(mText,wsValue,0,PR_FALSE); - mTokenCount++; + ++mTokenCount; if (NS_VIEWSOURCE_TOKENS_PER_BLOCK > 0 && mTokenCount > NS_VIEWSOURCE_TOKENS_PER_BLOCK && !wsValue.IsEmpty()) { @@ -1135,7 +1135,7 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) { { const nsAString& str = aToken->GetStringValue(); result=WriteTag(mText,str,aToken->GetAttributeCount(),PR_TRUE); - mTokenCount++; + ++mTokenCount; if (NS_VIEWSOURCE_TOKENS_PER_BLOCK > 0 && mTokenCount > NS_VIEWSOURCE_TOKENS_PER_BLOCK && !str.IsEmpty()) { PRUnichar ch = str.Last(); diff --git a/mozilla/parser/htmlparser/tests/grabpage/grabpage.cpp b/mozilla/parser/htmlparser/tests/grabpage/grabpage.cpp index 1c412e4d3b8..37b6e65a0c1 100644 --- a/mozilla/parser/htmlparser/tests/grabpage/grabpage.cpp +++ b/mozilla/parser/htmlparser/tests/grabpage/grabpage.cpp @@ -209,7 +209,7 @@ PageGrabber::NextFile(const char* aExtension) struct stat sb; int s = stat(cname, &sb); if (s < 0) { - mFileNum++; + ++mFileNum; break; } else { diff --git a/mozilla/parser/htmlparser/tests/htmlgen/htmlgen.cpp b/mozilla/parser/htmlparser/tests/htmlgen/htmlgen.cpp index 91409cfaf24..de426e7fd46 100644 --- a/mozilla/parser/htmlparser/tests/htmlgen/htmlgen.cpp +++ b/mozilla/parser/htmlparser/tests/htmlgen/htmlgen.cpp @@ -388,7 +388,7 @@ void expandMacros(char* aBuffer,CMacros& aMacroSet){ while(aBuffer[++rPos]){ if('$'==aBuffer[rPos]){ temp[wPos]=0; - rPos++; //skip the $... + ++rPos; //skip the $... int theIndex=aBuffer[rPos]-'0'; char* theMacro=aMacroSet.getMacro(theIndex); if(theMacro){