use prefix ++, not postfix ++. Bug 82615, r=heikki, sr=jst

This commit is contained in:
bzbarsky%mit.edu 2002-09-03 22:23:22 +00:00
Родитель a81603a056
Коммит 530b8b7db6
52 изменённых файлов: 228 добавлений и 228 удалений

Просмотреть файл

@ -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.

Просмотреть файл

@ -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));

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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);

Просмотреть файл

@ -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; i<ac; i++) {
for(PRInt32 i=0; i<ac; ++i) {
CAttributeToken* attr=NS_STATIC_CAST(CAttributeToken*,aTokenizer->GetTokenAt(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;theIndex<theCount;theIndex++){
for(theIndex=0;theIndex<theCount;++theIndex){
const nsAString& theKey = aNode.GetKeyAt(theIndex);
if(theKey.Equals(NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
const nsAString& theName=aNode.GetValueAt(theIndex);
@ -1894,7 +1894,7 @@ static void StripWSFollowingTag(eHTMLTags aChildTag,nsITokenizer* aTokenizer,nsT
while(theToken) {
eHTMLTokenTypes theType=eHTMLTokenTypes(theToken->GetTokenType());
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;j<attrCount; j++){
for(PRInt32 j=0;j<attrCount; ++j){
CToken* theAttrToken = (CToken*)mMisplacedContent.PopFront();
if(theAttrToken) {
mTokenizer->PushTokenFront(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;attr<aCount;attr++){
for(attr=0;attr<aCount;++attr){
if((eHTMLTag_unknown!=theSkipTarget) && mSkippedContent.GetSize())
theToken=NS_STATIC_CAST(CToken*,mSkippedContent.PopFront());
else
@ -2448,7 +2448,7 @@ CNavDTD::CollectSkippedContent(PRInt32 aTag, nsAString& aContent, PRInt32 &aLine
PRInt32 i = 0;
PRInt32 tagCount = mSkippedContent.GetSize();
for (i = 0; i< tagCount; i++){
for (i = 0; i< tagCount; ++i){
CHTMLToken* theNextToken = (CHTMLToken*)mSkippedContent.PopFront();
if (theNextToken) {
@ -2932,14 +2932,14 @@ nsresult CNavDTD::OpenTransientStyles(eHTMLTags aChildTag){
}
mFlags &= ~NS_DTD_FLAG_ENABLE_RESIDUAL_STYLE;
for(;theLevel<theCount;theLevel++){
for(;theLevel<theCount;++theLevel){
nsEntryStack* theStack=mBodyContext->GetStylesAt(theLevel);
if(theStack){
PRInt32 sindex=0;
nsTagEntry *theEntry=theStack->mEntries;
for(sindex=0;sindex<theStack->mCount;sindex++){
for(sindex=0;sindex<theStack->mCount;++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;
}

Просмотреть файл

@ -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;theIndex<theCount;theIndex++){
for(theIndex=0;theIndex<theCount;++theIndex){
const nsAString& theKey = aNode.GetKeyAt(theIndex);
if(theKey.Equals(NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
const nsAString& theName=aNode.GetValueAt(theIndex);
@ -662,7 +662,7 @@ nsresult COtherDTD::WillHandleStartTag(CToken* aToken,eHTMLTags aTag,nsIParserNo
switch(aTag) {
case eHTMLTag_newline:
mLineNumber++;
++mLineNumber;
break;
default:
break;
@ -815,7 +815,7 @@ nsresult COtherDTD::CollectAttributes(nsIParserNode& aNode,eHTMLTags aTag,PRInt3
if(aCount<=theAvailTokenCount) {
//gElementTable->mElements[aTag]->GetSkipTarget();
CToken* theToken=0;
for(attr=0;attr<aCount;attr++){
for(attr=0;attr<aCount;++attr){
theToken=mTokenizer->PopToken();
if(theToken) {
// Sanitize the key for it might contain some non-alpha-non-digit characters

Просмотреть файл

@ -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;index<max;index++){
for(index=0;index<max;++index){
mElements[index]=&mDfltElements[index];
}
@ -2465,12 +2465,12 @@ void CElementTable::DebugDumpContainment(CElement* anElement){
int count=0;
int i=0;
for(i=0;i<NS_HTML_TAG_MAX;i++){
for(i=0;i<NS_HTML_TAG_MAX;++i){
CElement* theChild=mElements[i];
if(anElement->CanContain(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;i<NS_HTML_TAG_MAX;i++){
for(i=1;i<NS_HTML_TAG_MAX;++i){
DebugDumpContainment(mElements[i]);
//DebugDumpGroups(mElements[i]);
} //for

Просмотреть файл

@ -77,7 +77,7 @@ PRBool compareFiles(const char* file1,const char* file2,int& failpos) {
if(failpos>4225) {
int x=failpos;
}
failpos++;
++failpos;
char* p=strchr(" \t\r\n\b",ch1);
if(!p)
break;

Просмотреть файл

@ -139,7 +139,7 @@ void nsEntryStack::EnsureCapacityFor(PRInt32 aNewMax,PRInt32 aShiftOffset) {
if(temp){
PRInt32 index=0;
for(index=0;index<mCount;index++) {
for(index=0;index<mCount;++index) {
temp[aShiftOffset+index]=mEntries[index];
}
if(mEntries) delete [] mEntries;
@ -199,7 +199,7 @@ void nsEntryStack::PushFront(const nsCParserNode* aNode,nsEntryStack* aStyleStac
mEntries[0].mParent=aStyleStack;
mEntries[0].mStyles=0;
mCount++;
++mCount;
}
}
@ -215,7 +215,7 @@ void nsEntryStack::Append(nsEntryStack *aStack) {
EnsureCapacityFor(mCount+aStack->mCount,0);
PRInt32 theIndex=0;
for(theIndex=0;theIndex<theCount;theIndex++){
for(theIndex=0;theIndex<theCount;++theIndex){
mEntries[mCount]=aStack->mEntries[theIndex];
mEntries[mCount++].mParent=0;
}
@ -245,7 +245,7 @@ nsCParserNode* nsEntryStack::Remove(PRInt32 anIndex,eHTMLTags aTag) {
PRInt32 theIndex=0;
mCount-=1;
for(theIndex=anIndex;theIndex<mCount;theIndex++){
for(theIndex=anIndex;theIndex<mCount;++theIndex){
mEntries[theIndex]=mEntries[theIndex+1];
}
@ -261,12 +261,12 @@ nsCParserNode* nsEntryStack::Remove(PRInt32 anIndex,eHTMLTags aTag) {
PRUint32 sindex=0;
nsTagEntry *theStyleEntry=theStyleStack->mEntries;
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;theIndex<theCount;theIndex++) {
for(theIndex=0;theIndex<theCount;++theIndex) {
CNamedEntity *theResult=(CNamedEntity*)mEntities.ObjectAt(theIndex);
if(theResult &&
theResult->mName.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;digitPos<len;digitPos++) {
for(digitPos=0;digitPos<len;++digitPos) {
romanPos--;
switch(decStr[digitPos]) {
case '0': break;
@ -747,7 +747,7 @@ public:
case '5': case '6':
case '7': case '8':
aString.Append(digitsB[romanPos]);
for(n=0;n<(decStr[digitPos]-'5');n++)
for(n=0;n<(decStr[digitPos]-'5');++n)
aString.Append(digitsA[romanPos]);
break;
case '9':
@ -795,7 +795,7 @@ public:
repCount=((aValue-1)/seriesLen);
modChar=aValue-(repCount*seriesLen);
for(count=0;count<=repCount;count++) {
for(count=0;count<=repCount;++count) {
aString.Append(PRUnichar(kFootnoteSet[modChar]));
}
}
@ -854,7 +854,7 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
CAbacus::eNumFormat theNumFormat=CAbacus::eDecimal;
for(theIndex=0;theIndex<theCount;theIndex++){
for(theIndex=0;theIndex<theCount;++theIndex){
const nsAString& theKey=aNode.GetKeyAt(theIndex);
const nsAString& theValue=aNode.GetValueAt(theIndex);
@ -1051,7 +1051,7 @@ void nsDTDContext::PushStyle(const nsCParserNode* aNode){
}
if(theStack) {
theStack->Push(aNode);
mResidualStyleCount++;
++mResidualStyleCount;
}
} //if
}
@ -1076,10 +1076,10 @@ void nsDTDContext::PushStyles(nsEntryStack *aStyles){
PRUint32 sindex=0;
theEntry=aStyles->mEntries;
for(sindex=0;sindex<scount;sindex++){
for(sindex=0;sindex<scount;++sindex){
theEntry->mParent=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<eToken_last-1;i++) {
for(i=0;i<eToken_last-1;++i) {
mTotals[i]=0;
}
#endif
@ -1319,7 +1319,7 @@ static int gAllNodeCount=0;
int FindNode(nsCParserNode *aNode) {
int theIndex=0;
for(theIndex=0;theIndex<gAllNodeCount;theIndex++) {
for(theIndex=0;theIndex<gAllNodeCount;++theIndex) {
if(gAllNodes[theIndex]==aNode) {
return theIndex;
}
@ -1402,7 +1402,7 @@ nsCParserNode* nsNodeAllocator::CreateNode(CToken* aToken,
else{
result=nsCParserNode::Create(aToken, aTokenAllocator,this);
#ifdef DEBUG_TRACK_NODES
mCount++;
++mCount;
AddNode(NS_STATIC_CAST(nsCParserNode*,result));
#endif
IF_HOLD(result);
@ -1427,13 +1427,13 @@ void DebugDumpContainmentRules(nsIDTD& theDTD,const char* aFilename,const char*
out << "==================================================";
int i,j=0;
int written;
for(i=1;i<eHTMLTag_text;i++){
for(i=1;i<eHTMLTag_text;++i){
const char* tag=nsHTMLTags::GetCStringValue((eHTMLTags)i);
out << endl << endl << "Tag: <" << tag << ">" << endl;
out << prefix;
written=0;
if(theDTD.IsContainer(i)) {
for(j=1;j<eHTMLTag_text;j++){
for(j=1;j<eHTMLTag_text;++j){
if(15==written) {
out << endl << prefix;
written=0;
@ -1442,7 +1442,7 @@ void DebugDumpContainmentRules(nsIDTD& theDTD,const char* aFilename,const char*
tag=nsHTMLTags::GetCStringValue((eHTMLTags)j);
if(tag) {
out<< tag << ", ";
written++;
++written;
}
}
}//for
@ -1509,10 +1509,10 @@ nsObserverEntry::nsObserverEntry(const nsAString& aTopic) : mTopic(aTopic)
}
nsObserverEntry::~nsObserverEntry() {
for (PRInt32 i = 0; i <= NS_HTML_TAG_MAX; i++){
for (PRInt32 i = 0; i <= NS_HTML_TAG_MAX; ++i){
if (mObservers[i]) {
PRInt32 count = mObservers[i]->Count();
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<nsIChannel> channel;
aParser->GetChannel(getter_AddRefs(channel));
for (index=0;index<theObserversCount;index++) {
for (index=0;index<theObserversCount;++index) {
nsIElementObserver* observer = NS_STATIC_CAST(nsIElementObserver*,theObservers->ElementAt(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);

Просмотреть файл

@ -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<max;index++){
for(index=aStartOffset;index<max;++index){
PRBool result=FindTagInSet(aContext[index],aTagList.mTags,aTagList.mCount);
if(result) {
return index;

Просмотреть файл

@ -2313,7 +2313,7 @@ void nsHTMLElement::DebugDumpContainment(const char* aFilename,const char* aTitl
int i,j=0;
int written;
int linenum=5;
for(i=1;i<eHTMLTag_text;i++){
for(i=1;i<eHTMLTag_text;++i){
const char* tag=nsHTMLTags::GetStringValue((eHTMLTags)i);
out << endl << endl << "Tag: <" << tag << ">" << 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<eHTMLTag_text;j++){
for(j=1;j<eHTMLTag_text;++j){
tag=nsHTMLTags::GetStringValue((eHTMLTags)j);
if(tag) {
if(!startChar)
startChar=tag[0];
if(12==written){
out << endl << prefix;
linenum++;
++linenum;
written=0;
}
if(CanContain((eHTMLTags)i,(eHTMLTags)j)){
if(tag[0]!=startChar){
out << endl << prefix;
linenum++;
++linenum;
written=0;
startChar=tag[0];
}
out<< tag << ", ";
written++;
++written;
}
}//if
@ -2348,7 +2348,7 @@ void nsHTMLElement::DebugDumpContainment(const char* aFilename,const char* aTitl
}
else {
out<<"(not container)" << endl;
linenum++;
++linenum;
}
} //for
#endif
@ -2374,7 +2374,7 @@ void nsHTMLElement::DebugDumpMembership(const char* aFilename){
char* answer[]={".","Y"};
char startChar=0;
for(i=1;i<eHTMLTag_text;i++){
for(i=1;i<eHTMLTag_text;++i){
const char* tag=nsHTMLTags::GetStringValue((eHTMLTags)i);
out << tag;
int len=strlen(tag);
@ -2433,7 +2433,7 @@ void nsHTMLElement::DebugDumpContainType(const char* aFilename){
char* answer[]={".","Y"};
char startChar=0;
for(i=1;i<eHTMLTag_text;i++){
for(i=1;i<eHTMLTag_text;++i){
const char* tag=nsHTMLTags::GetStringValue((eHTMLTags)i);
out << tag;
int len=strlen(tag);

Просмотреть файл

@ -409,7 +409,7 @@ nsExpatDriver::HandleXMLDeclaration(const PRUnichar *aValue,
// <?xml version='a'?>
// 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('^'));

Просмотреть файл

@ -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);

Просмотреть файл

@ -153,7 +153,7 @@ nsHTMLNullSink::~nsHTMLNullSink() {
#ifdef VERBOSE_DEBUG
static void DebugDump(const char* str1,const nsAString& str2,PRInt32 tabs) {
for(PRInt32 i=0;i<tabs;i++) {
for(PRInt32 i=0;i<tabs;++i) {
PR_fprintf(PR_STDOUT, " "); //add some tabbing to debug output...
}

Просмотреть файл

@ -482,7 +482,7 @@ public:
nsHTMLTags::AddRefTable();
// Make sure we can find everything we are supposed to
for (int i = 0; i < NS_HTML_TAG_MAX; i++) {
for (int i = 0; i < NS_HTML_TAG_MAX; ++i) {
tag = kTagUnicodeTable[i];
id = nsHTMLTags::LookupTag(nsDependentString(tag));
NS_ASSERTION(id != eHTMLTag_userdefined, "can't find tag id");

Просмотреть файл

@ -304,7 +304,7 @@ void nsHTMLTokenizer::PrependTokens(nsDeque& aDeque){
//last but not least, let's check the misplaced content list.
//if we find it, then we have to push it all into the body before continuing...
PRInt32 anIndex=0;
for(anIndex=0;anIndex<aCount;anIndex++){
for(anIndex=0;anIndex<aCount;++anIndex){
CToken* theToken=(CToken*)aDeque.Pop();
PushTokenFront(theToken);
}
@ -404,7 +404,7 @@ nsresult nsHTMLTokenizer::ScanDocStructure(PRBool aFinalChunk) {
theRootTag=theTag;
}
theStack.Push(theToken);
theStackDepth++;
++theStackDepth;
break;
case eToken_end:
@ -639,7 +639,7 @@ nsresult nsHTMLTokenizer::ConsumeAttributes(PRUnichar aChar,
aToken->SetEmpty(isUsableAttr);
}
if(isUsableAttr) {
theAttrCount++;
++theAttrCount;
AddToken((CToken*&)theToken,result,&mTokenDeque,theAllocator);
}
else {

Просмотреть файл

@ -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 {

Просмотреть файл

@ -133,7 +133,7 @@ nsLoggingSink::SetOutputStream(PRFileDesc *aStream,PRBool autoDeleteOutput) {
static
void WriteTabs(PRFileDesc * out,int aTabCount) {
int tabs;
for(tabs=0;tabs<aTabCount;tabs++)
for(tabs=0;tabs<aTabCount;++tabs)
PR_fprintf(out, " ");
}
@ -581,7 +581,7 @@ nsLoggingSink::WriteAttributes(const nsIParserNode& aNode) {
WriteTabs(mOutput,1+mLevel);
nsAutoString tmp;
PRInt32 ac = aNode.GetAttributeCount();
for (PRInt32 i = 0; i < ac; i++) {
for (PRInt32 i = 0; i < ac; ++i) {
char* key=nsnull;
char* value=nsnull;
const nsAString& k = aNode.GetKeyAt(i);

Просмотреть файл

@ -629,7 +629,7 @@ public:
case kQuote:
target=*cp;
if (aSkipQuotes) {
cp++;
++cp;
}
done=PR_TRUE;
break;
@ -650,13 +650,13 @@ public:
const CharT *firstcp=cp; //hang onto this...
PRInt32 theDashCount=2;
cp++; //just skip first letter to simplify processing...
++cp; //just skip first letter to simplify processing...
//ok, now find end of this word
while(cp++<mEndBuffer) {
if(kQuote==target) {
if(kQuote==*cp) {
cp++;
++cp;
break; //we found our end...
}
}
@ -664,7 +664,7 @@ public:
//then let's look for SGML comments
if(kMinus==*cp) {
if(4==++theDashCount) {
cp++;
++cp;
break;
}
}
@ -721,7 +721,7 @@ static PRInt32 ParsePS(const nsString& aBuffer, PRInt32 aIndex)
PRUnichar ch = aBuffer.CharAt(aIndex);
if ((ch == PRUnichar(' ')) || (ch == PRUnichar('\t')) ||
(ch == PRUnichar('\n')) || (ch == PRUnichar('\r'))) {
aIndex++;
++aIndex;
} else if (ch == PRUnichar('-')) {
PRInt32 tmpIndex;
if (aBuffer.CharAt(aIndex+1) == PRUnichar('-') &&
@ -2022,7 +2022,7 @@ static PRBool DetectByteOrderMark(const unsigned char* aBytes, PRInt32 aLen, nsS
// <?xml
PRInt32 i;
PRBool versionFound = PR_FALSE, encodingFound = PR_FALSE;
for (i=6; i < aLen && !encodingFound; i++) {
for (i=6; i < aLen && !encodingFound; ++i) {
// end of XML declaration?
if ((((char*)aBytes)[i] == '?') &&
((i+1) < aLen) &&
@ -2041,7 +2041,7 @@ static PRBool DetectByteOrderMark(const unsigned char* aBytes, PRInt32 aLen, nsS
(0 == PL_strncmp("versio", (char*)(aBytes+i-6), 6 ))) {
// Fast forward through version
char q = 0;
for (++i; i < aLen; i++) {
for (++i; i < aLen; ++i) {
char qi = ((char*)aBytes)[i];
if (qi == '\'' || qi == '"') {
if (q && q == qi) {
@ -2067,7 +2067,7 @@ static PRBool DetectByteOrderMark(const unsigned char* aBytes, PRInt32 aLen, nsS
(0 == PL_strncmp("encodin", (char*)(aBytes+i-7), 7 ))) {
PRInt32 encStart = 0;
char q = 0;
for (++i; i < aLen; i++) {
for (++i; i < aLen; ++i) {
char qi = ((char*)aBytes)[i];
if (qi == '\'' || qi == '"') {
if (q && q == qi) {
@ -2580,7 +2580,7 @@ PRBool nsParser::DidTokenize(PRBool aIsFinalChunk){
if(mTokenObserver) {
PRInt32 theCount=theTokenizer->GetCount();
PRInt32 theIndex;
for(theIndex=0;theIndex<theCount;theIndex++){
for(theIndex=0;theIndex<theCount;++theIndex){
if((*mTokenObserver)(theTokenizer->GetTokenAt(theIndex))){
//add code here to pull unwanted tokens out of the stack...
}

Просмотреть файл

@ -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;index<mAttributes->GetSize();index++) {
for(index=0;index<mAttributes->GetSize();++index) {
CAttributeToken *theToken=(CAttributeToken*)mAttributes->ObjectAt(index);
if(theToken) {
theToken->AppendSourceTo(aString);

Просмотреть файл

@ -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);

Просмотреть файл

@ -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<PRUnichar>& aStart,
while(!done && current != end) {
switch(theChar) {
case '\n':
case '\r': aNewlinesSkipped++;
case '\r': ++aNewlinesSkipped;
case ' ' :
case '\b':
case '\t':

Просмотреть файл

@ -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;i<theLen;i++){
for(i=0;i<theLen;++i){
anOutputStream << NS_ConvertUCS2toUTF8(GetStringValue()).get();
}
anOutputStream << " TypeID: " << mTypeID << " AttrCount: " << mAttrCount << nsEndl;

Просмотреть файл

@ -904,7 +904,7 @@ nsresult CViewSourceHTML::WriteAttributes(PRInt32 attrCount) {
CSharedVSContext& theContext=CSharedVSContext::GetSharedContext();
int attr=0;
for(attr=0;attr<attrCount;attr++){
for(attr=0;attr<attrCount;++attr){
CToken* theToken=mTokenizer->PeekToken();
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();

Просмотреть файл

@ -209,7 +209,7 @@ PageGrabber::NextFile(const char* aExtension)
struct stat sb;
int s = stat(cname, &sb);
if (s < 0) {
mFileNum++;
++mFileNum;
break;
}
else {

Просмотреть файл

@ -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){

Просмотреть файл

@ -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.

Просмотреть файл

@ -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));

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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);

Просмотреть файл

@ -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; i<ac; i++) {
for(PRInt32 i=0; i<ac; ++i) {
CAttributeToken* attr=NS_STATIC_CAST(CAttributeToken*,aTokenizer->GetTokenAt(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;theIndex<theCount;theIndex++){
for(theIndex=0;theIndex<theCount;++theIndex){
const nsAString& theKey = aNode.GetKeyAt(theIndex);
if(theKey.Equals(NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
const nsAString& theName=aNode.GetValueAt(theIndex);
@ -1894,7 +1894,7 @@ static void StripWSFollowingTag(eHTMLTags aChildTag,nsITokenizer* aTokenizer,nsT
while(theToken) {
eHTMLTokenTypes theType=eHTMLTokenTypes(theToken->GetTokenType());
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;j<attrCount; j++){
for(PRInt32 j=0;j<attrCount; ++j){
CToken* theAttrToken = (CToken*)mMisplacedContent.PopFront();
if(theAttrToken) {
mTokenizer->PushTokenFront(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;attr<aCount;attr++){
for(attr=0;attr<aCount;++attr){
if((eHTMLTag_unknown!=theSkipTarget) && mSkippedContent.GetSize())
theToken=NS_STATIC_CAST(CToken*,mSkippedContent.PopFront());
else
@ -2448,7 +2448,7 @@ CNavDTD::CollectSkippedContent(PRInt32 aTag, nsAString& aContent, PRInt32 &aLine
PRInt32 i = 0;
PRInt32 tagCount = mSkippedContent.GetSize();
for (i = 0; i< tagCount; i++){
for (i = 0; i< tagCount; ++i){
CHTMLToken* theNextToken = (CHTMLToken*)mSkippedContent.PopFront();
if (theNextToken) {
@ -2932,14 +2932,14 @@ nsresult CNavDTD::OpenTransientStyles(eHTMLTags aChildTag){
}
mFlags &= ~NS_DTD_FLAG_ENABLE_RESIDUAL_STYLE;
for(;theLevel<theCount;theLevel++){
for(;theLevel<theCount;++theLevel){
nsEntryStack* theStack=mBodyContext->GetStylesAt(theLevel);
if(theStack){
PRInt32 sindex=0;
nsTagEntry *theEntry=theStack->mEntries;
for(sindex=0;sindex<theStack->mCount;sindex++){
for(sindex=0;sindex<theStack->mCount;++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;
}

Просмотреть файл

@ -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;theIndex<theCount;theIndex++){
for(theIndex=0;theIndex<theCount;++theIndex){
const nsAString& theKey = aNode.GetKeyAt(theIndex);
if(theKey.Equals(NS_LITERAL_STRING("ENTITY"), nsCaseInsensitiveStringComparator())) {
const nsAString& theName=aNode.GetValueAt(theIndex);
@ -662,7 +662,7 @@ nsresult COtherDTD::WillHandleStartTag(CToken* aToken,eHTMLTags aTag,nsIParserNo
switch(aTag) {
case eHTMLTag_newline:
mLineNumber++;
++mLineNumber;
break;
default:
break;
@ -815,7 +815,7 @@ nsresult COtherDTD::CollectAttributes(nsIParserNode& aNode,eHTMLTags aTag,PRInt3
if(aCount<=theAvailTokenCount) {
//gElementTable->mElements[aTag]->GetSkipTarget();
CToken* theToken=0;
for(attr=0;attr<aCount;attr++){
for(attr=0;attr<aCount;++attr){
theToken=mTokenizer->PopToken();
if(theToken) {
// Sanitize the key for it might contain some non-alpha-non-digit characters

Просмотреть файл

@ -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;index<max;index++){
for(index=0;index<max;++index){
mElements[index]=&mDfltElements[index];
}
@ -2465,12 +2465,12 @@ void CElementTable::DebugDumpContainment(CElement* anElement){
int count=0;
int i=0;
for(i=0;i<NS_HTML_TAG_MAX;i++){
for(i=0;i<NS_HTML_TAG_MAX;++i){
CElement* theChild=mElements[i];
if(anElement->CanContain(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;i<NS_HTML_TAG_MAX;i++){
for(i=1;i<NS_HTML_TAG_MAX;++i){
DebugDumpContainment(mElements[i]);
//DebugDumpGroups(mElements[i]);
} //for

Просмотреть файл

@ -77,7 +77,7 @@ PRBool compareFiles(const char* file1,const char* file2,int& failpos) {
if(failpos>4225) {
int x=failpos;
}
failpos++;
++failpos;
char* p=strchr(" \t\r\n\b",ch1);
if(!p)
break;

Просмотреть файл

@ -139,7 +139,7 @@ void nsEntryStack::EnsureCapacityFor(PRInt32 aNewMax,PRInt32 aShiftOffset) {
if(temp){
PRInt32 index=0;
for(index=0;index<mCount;index++) {
for(index=0;index<mCount;++index) {
temp[aShiftOffset+index]=mEntries[index];
}
if(mEntries) delete [] mEntries;
@ -199,7 +199,7 @@ void nsEntryStack::PushFront(const nsCParserNode* aNode,nsEntryStack* aStyleStac
mEntries[0].mParent=aStyleStack;
mEntries[0].mStyles=0;
mCount++;
++mCount;
}
}
@ -215,7 +215,7 @@ void nsEntryStack::Append(nsEntryStack *aStack) {
EnsureCapacityFor(mCount+aStack->mCount,0);
PRInt32 theIndex=0;
for(theIndex=0;theIndex<theCount;theIndex++){
for(theIndex=0;theIndex<theCount;++theIndex){
mEntries[mCount]=aStack->mEntries[theIndex];
mEntries[mCount++].mParent=0;
}
@ -245,7 +245,7 @@ nsCParserNode* nsEntryStack::Remove(PRInt32 anIndex,eHTMLTags aTag) {
PRInt32 theIndex=0;
mCount-=1;
for(theIndex=anIndex;theIndex<mCount;theIndex++){
for(theIndex=anIndex;theIndex<mCount;++theIndex){
mEntries[theIndex]=mEntries[theIndex+1];
}
@ -261,12 +261,12 @@ nsCParserNode* nsEntryStack::Remove(PRInt32 anIndex,eHTMLTags aTag) {
PRUint32 sindex=0;
nsTagEntry *theStyleEntry=theStyleStack->mEntries;
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;theIndex<theCount;theIndex++) {
for(theIndex=0;theIndex<theCount;++theIndex) {
CNamedEntity *theResult=(CNamedEntity*)mEntities.ObjectAt(theIndex);
if(theResult &&
theResult->mName.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;digitPos<len;digitPos++) {
for(digitPos=0;digitPos<len;++digitPos) {
romanPos--;
switch(decStr[digitPos]) {
case '0': break;
@ -747,7 +747,7 @@ public:
case '5': case '6':
case '7': case '8':
aString.Append(digitsB[romanPos]);
for(n=0;n<(decStr[digitPos]-'5');n++)
for(n=0;n<(decStr[digitPos]-'5');++n)
aString.Append(digitsA[romanPos]);
break;
case '9':
@ -795,7 +795,7 @@ public:
repCount=((aValue-1)/seriesLen);
modChar=aValue-(repCount*seriesLen);
for(count=0;count<=repCount;count++) {
for(count=0;count<=repCount;++count) {
aString.Append(PRUnichar(kFootnoteSet[modChar]));
}
}
@ -854,7 +854,7 @@ PRInt32 nsDTDContext::IncrementCounter(eHTMLTags aTag,nsIParserNode& aNode,nsStr
CAbacus::eNumFormat theNumFormat=CAbacus::eDecimal;
for(theIndex=0;theIndex<theCount;theIndex++){
for(theIndex=0;theIndex<theCount;++theIndex){
const nsAString& theKey=aNode.GetKeyAt(theIndex);
const nsAString& theValue=aNode.GetValueAt(theIndex);
@ -1051,7 +1051,7 @@ void nsDTDContext::PushStyle(const nsCParserNode* aNode){
}
if(theStack) {
theStack->Push(aNode);
mResidualStyleCount++;
++mResidualStyleCount;
}
} //if
}
@ -1076,10 +1076,10 @@ void nsDTDContext::PushStyles(nsEntryStack *aStyles){
PRUint32 sindex=0;
theEntry=aStyles->mEntries;
for(sindex=0;sindex<scount;sindex++){
for(sindex=0;sindex<scount;++sindex){
theEntry->mParent=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<eToken_last-1;i++) {
for(i=0;i<eToken_last-1;++i) {
mTotals[i]=0;
}
#endif
@ -1319,7 +1319,7 @@ static int gAllNodeCount=0;
int FindNode(nsCParserNode *aNode) {
int theIndex=0;
for(theIndex=0;theIndex<gAllNodeCount;theIndex++) {
for(theIndex=0;theIndex<gAllNodeCount;++theIndex) {
if(gAllNodes[theIndex]==aNode) {
return theIndex;
}
@ -1402,7 +1402,7 @@ nsCParserNode* nsNodeAllocator::CreateNode(CToken* aToken,
else{
result=nsCParserNode::Create(aToken, aTokenAllocator,this);
#ifdef DEBUG_TRACK_NODES
mCount++;
++mCount;
AddNode(NS_STATIC_CAST(nsCParserNode*,result));
#endif
IF_HOLD(result);
@ -1427,13 +1427,13 @@ void DebugDumpContainmentRules(nsIDTD& theDTD,const char* aFilename,const char*
out << "==================================================";
int i,j=0;
int written;
for(i=1;i<eHTMLTag_text;i++){
for(i=1;i<eHTMLTag_text;++i){
const char* tag=nsHTMLTags::GetCStringValue((eHTMLTags)i);
out << endl << endl << "Tag: <" << tag << ">" << endl;
out << prefix;
written=0;
if(theDTD.IsContainer(i)) {
for(j=1;j<eHTMLTag_text;j++){
for(j=1;j<eHTMLTag_text;++j){
if(15==written) {
out << endl << prefix;
written=0;
@ -1442,7 +1442,7 @@ void DebugDumpContainmentRules(nsIDTD& theDTD,const char* aFilename,const char*
tag=nsHTMLTags::GetCStringValue((eHTMLTags)j);
if(tag) {
out<< tag << ", ";
written++;
++written;
}
}
}//for
@ -1509,10 +1509,10 @@ nsObserverEntry::nsObserverEntry(const nsAString& aTopic) : mTopic(aTopic)
}
nsObserverEntry::~nsObserverEntry() {
for (PRInt32 i = 0; i <= NS_HTML_TAG_MAX; i++){
for (PRInt32 i = 0; i <= NS_HTML_TAG_MAX; ++i){
if (mObservers[i]) {
PRInt32 count = mObservers[i]->Count();
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<nsIChannel> channel;
aParser->GetChannel(getter_AddRefs(channel));
for (index=0;index<theObserversCount;index++) {
for (index=0;index<theObserversCount;++index) {
nsIElementObserver* observer = NS_STATIC_CAST(nsIElementObserver*,theObservers->ElementAt(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);

Просмотреть файл

@ -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<max;index++){
for(index=aStartOffset;index<max;++index){
PRBool result=FindTagInSet(aContext[index],aTagList.mTags,aTagList.mCount);
if(result) {
return index;

Просмотреть файл

@ -2313,7 +2313,7 @@ void nsHTMLElement::DebugDumpContainment(const char* aFilename,const char* aTitl
int i,j=0;
int written;
int linenum=5;
for(i=1;i<eHTMLTag_text;i++){
for(i=1;i<eHTMLTag_text;++i){
const char* tag=nsHTMLTags::GetStringValue((eHTMLTags)i);
out << endl << endl << "Tag: <" << tag << ">" << 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<eHTMLTag_text;j++){
for(j=1;j<eHTMLTag_text;++j){
tag=nsHTMLTags::GetStringValue((eHTMLTags)j);
if(tag) {
if(!startChar)
startChar=tag[0];
if(12==written){
out << endl << prefix;
linenum++;
++linenum;
written=0;
}
if(CanContain((eHTMLTags)i,(eHTMLTags)j)){
if(tag[0]!=startChar){
out << endl << prefix;
linenum++;
++linenum;
written=0;
startChar=tag[0];
}
out<< tag << ", ";
written++;
++written;
}
}//if
@ -2348,7 +2348,7 @@ void nsHTMLElement::DebugDumpContainment(const char* aFilename,const char* aTitl
}
else {
out<<"(not container)" << endl;
linenum++;
++linenum;
}
} //for
#endif
@ -2374,7 +2374,7 @@ void nsHTMLElement::DebugDumpMembership(const char* aFilename){
char* answer[]={".","Y"};
char startChar=0;
for(i=1;i<eHTMLTag_text;i++){
for(i=1;i<eHTMLTag_text;++i){
const char* tag=nsHTMLTags::GetStringValue((eHTMLTags)i);
out << tag;
int len=strlen(tag);
@ -2433,7 +2433,7 @@ void nsHTMLElement::DebugDumpContainType(const char* aFilename){
char* answer[]={".","Y"};
char startChar=0;
for(i=1;i<eHTMLTag_text;i++){
for(i=1;i<eHTMLTag_text;++i){
const char* tag=nsHTMLTags::GetStringValue((eHTMLTags)i);
out << tag;
int len=strlen(tag);

Просмотреть файл

@ -409,7 +409,7 @@ nsExpatDriver::HandleXMLDeclaration(const PRUnichar *aValue,
// <?xml version='a'?>
// 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('^'));

Просмотреть файл

@ -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);

Просмотреть файл

@ -153,7 +153,7 @@ nsHTMLNullSink::~nsHTMLNullSink() {
#ifdef VERBOSE_DEBUG
static void DebugDump(const char* str1,const nsAString& str2,PRInt32 tabs) {
for(PRInt32 i=0;i<tabs;i++) {
for(PRInt32 i=0;i<tabs;++i) {
PR_fprintf(PR_STDOUT, " "); //add some tabbing to debug output...
}

Просмотреть файл

@ -482,7 +482,7 @@ public:
nsHTMLTags::AddRefTable();
// Make sure we can find everything we are supposed to
for (int i = 0; i < NS_HTML_TAG_MAX; i++) {
for (int i = 0; i < NS_HTML_TAG_MAX; ++i) {
tag = kTagUnicodeTable[i];
id = nsHTMLTags::LookupTag(nsDependentString(tag));
NS_ASSERTION(id != eHTMLTag_userdefined, "can't find tag id");

Просмотреть файл

@ -304,7 +304,7 @@ void nsHTMLTokenizer::PrependTokens(nsDeque& aDeque){
//last but not least, let's check the misplaced content list.
//if we find it, then we have to push it all into the body before continuing...
PRInt32 anIndex=0;
for(anIndex=0;anIndex<aCount;anIndex++){
for(anIndex=0;anIndex<aCount;++anIndex){
CToken* theToken=(CToken*)aDeque.Pop();
PushTokenFront(theToken);
}
@ -404,7 +404,7 @@ nsresult nsHTMLTokenizer::ScanDocStructure(PRBool aFinalChunk) {
theRootTag=theTag;
}
theStack.Push(theToken);
theStackDepth++;
++theStackDepth;
break;
case eToken_end:
@ -639,7 +639,7 @@ nsresult nsHTMLTokenizer::ConsumeAttributes(PRUnichar aChar,
aToken->SetEmpty(isUsableAttr);
}
if(isUsableAttr) {
theAttrCount++;
++theAttrCount;
AddToken((CToken*&)theToken,result,&mTokenDeque,theAllocator);
}
else {

Просмотреть файл

@ -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 {

Просмотреть файл

@ -133,7 +133,7 @@ nsLoggingSink::SetOutputStream(PRFileDesc *aStream,PRBool autoDeleteOutput) {
static
void WriteTabs(PRFileDesc * out,int aTabCount) {
int tabs;
for(tabs=0;tabs<aTabCount;tabs++)
for(tabs=0;tabs<aTabCount;++tabs)
PR_fprintf(out, " ");
}
@ -581,7 +581,7 @@ nsLoggingSink::WriteAttributes(const nsIParserNode& aNode) {
WriteTabs(mOutput,1+mLevel);
nsAutoString tmp;
PRInt32 ac = aNode.GetAttributeCount();
for (PRInt32 i = 0; i < ac; i++) {
for (PRInt32 i = 0; i < ac; ++i) {
char* key=nsnull;
char* value=nsnull;
const nsAString& k = aNode.GetKeyAt(i);

Просмотреть файл

@ -629,7 +629,7 @@ public:
case kQuote:
target=*cp;
if (aSkipQuotes) {
cp++;
++cp;
}
done=PR_TRUE;
break;
@ -650,13 +650,13 @@ public:
const CharT *firstcp=cp; //hang onto this...
PRInt32 theDashCount=2;
cp++; //just skip first letter to simplify processing...
++cp; //just skip first letter to simplify processing...
//ok, now find end of this word
while(cp++<mEndBuffer) {
if(kQuote==target) {
if(kQuote==*cp) {
cp++;
++cp;
break; //we found our end...
}
}
@ -664,7 +664,7 @@ public:
//then let's look for SGML comments
if(kMinus==*cp) {
if(4==++theDashCount) {
cp++;
++cp;
break;
}
}
@ -721,7 +721,7 @@ static PRInt32 ParsePS(const nsString& aBuffer, PRInt32 aIndex)
PRUnichar ch = aBuffer.CharAt(aIndex);
if ((ch == PRUnichar(' ')) || (ch == PRUnichar('\t')) ||
(ch == PRUnichar('\n')) || (ch == PRUnichar('\r'))) {
aIndex++;
++aIndex;
} else if (ch == PRUnichar('-')) {
PRInt32 tmpIndex;
if (aBuffer.CharAt(aIndex+1) == PRUnichar('-') &&
@ -2022,7 +2022,7 @@ static PRBool DetectByteOrderMark(const unsigned char* aBytes, PRInt32 aLen, nsS
// <?xml
PRInt32 i;
PRBool versionFound = PR_FALSE, encodingFound = PR_FALSE;
for (i=6; i < aLen && !encodingFound; i++) {
for (i=6; i < aLen && !encodingFound; ++i) {
// end of XML declaration?
if ((((char*)aBytes)[i] == '?') &&
((i+1) < aLen) &&
@ -2041,7 +2041,7 @@ static PRBool DetectByteOrderMark(const unsigned char* aBytes, PRInt32 aLen, nsS
(0 == PL_strncmp("versio", (char*)(aBytes+i-6), 6 ))) {
// Fast forward through version
char q = 0;
for (++i; i < aLen; i++) {
for (++i; i < aLen; ++i) {
char qi = ((char*)aBytes)[i];
if (qi == '\'' || qi == '"') {
if (q && q == qi) {
@ -2067,7 +2067,7 @@ static PRBool DetectByteOrderMark(const unsigned char* aBytes, PRInt32 aLen, nsS
(0 == PL_strncmp("encodin", (char*)(aBytes+i-7), 7 ))) {
PRInt32 encStart = 0;
char q = 0;
for (++i; i < aLen; i++) {
for (++i; i < aLen; ++i) {
char qi = ((char*)aBytes)[i];
if (qi == '\'' || qi == '"') {
if (q && q == qi) {
@ -2580,7 +2580,7 @@ PRBool nsParser::DidTokenize(PRBool aIsFinalChunk){
if(mTokenObserver) {
PRInt32 theCount=theTokenizer->GetCount();
PRInt32 theIndex;
for(theIndex=0;theIndex<theCount;theIndex++){
for(theIndex=0;theIndex<theCount;++theIndex){
if((*mTokenObserver)(theTokenizer->GetTokenAt(theIndex))){
//add code here to pull unwanted tokens out of the stack...
}

Просмотреть файл

@ -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;index<mAttributes->GetSize();index++) {
for(index=0;index<mAttributes->GetSize();++index) {
CAttributeToken *theToken=(CAttributeToken*)mAttributes->ObjectAt(index);
if(theToken) {
theToken->AppendSourceTo(aString);

Просмотреть файл

@ -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);

Просмотреть файл

@ -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<PRUnichar>& aStart,
while(!done && current != end) {
switch(theChar) {
case '\n':
case '\r': aNewlinesSkipped++;
case '\r': ++aNewlinesSkipped;
case ' ' :
case '\b':
case '\t':

Просмотреть файл

@ -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;i<theLen;i++){
for(i=0;i<theLen;++i){
anOutputStream << NS_ConvertUCS2toUTF8(GetStringValue()).get();
}
anOutputStream << " TypeID: " << mTypeID << " AttrCount: " << mAttrCount << nsEndl;

Просмотреть файл

@ -904,7 +904,7 @@ nsresult CViewSourceHTML::WriteAttributes(PRInt32 attrCount) {
CSharedVSContext& theContext=CSharedVSContext::GetSharedContext();
int attr=0;
for(attr=0;attr<attrCount;attr++){
for(attr=0;attr<attrCount;++attr){
CToken* theToken=mTokenizer->PeekToken();
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();

Просмотреть файл

@ -209,7 +209,7 @@ PageGrabber::NextFile(const char* aExtension)
struct stat sb;
int s = stat(cname, &sb);
if (s < 0) {
mFileNum++;
++mFileNum;
break;
}
else {

Просмотреть файл

@ -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){