Bug 47207. Changing printf to PRINTF to use new logging facility. r=valeski,sr=waterson
git-svn-id: svn://10.0.0.236/trunk@81885 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -37,6 +37,11 @@
|
||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsParserCIID.h"
|
||||
#include "nslog.h"
|
||||
|
||||
NS_IMPL_LOG(nsDebugRobotLog)
|
||||
#define PRINTF NS_LOG_PRINTF(nsDebugRobotLog)
|
||||
#define FLUSH NS_LOG_FLUSH(nsDebugRobotLog)
|
||||
|
||||
static NS_DEFINE_IID(kIRobotSinkObserverIID, NS_IROBOTSINKOBSERVER_IID);
|
||||
|
||||
@@ -260,9 +265,9 @@ extern "C" NS_EXPORT int DebugRobot(
|
||||
rv = uri->QueryInterface(NS_GET_IID(nsIURI), (void**)&url);
|
||||
NS_RELEASE(uri);
|
||||
if (NS_OK != rv) {
|
||||
printf("invalid URL: '");
|
||||
PRINTF("invalid URL: '");
|
||||
fputs(*urlName, stdout);
|
||||
printf("'\n");
|
||||
PRINTF("'\n");
|
||||
NS_RELEASE(myObserver);
|
||||
return -1;
|
||||
}
|
||||
@@ -288,7 +293,7 @@ extern "C" NS_EXPORT int DebugRobot(
|
||||
(void **)&parser);
|
||||
|
||||
if (NS_OK != rv) {
|
||||
printf("can't make parser\n");
|
||||
PRINTF("can't make parser\n");
|
||||
NS_RELEASE(myObserver);
|
||||
return -1;
|
||||
}
|
||||
@@ -296,7 +301,7 @@ extern "C" NS_EXPORT int DebugRobot(
|
||||
nsIRobotSink* sink;
|
||||
rv = NS_NewRobotSink(&sink);
|
||||
if (NS_OK != rv) {
|
||||
printf("can't make parser\n");
|
||||
PRINTF("can't make parser\n");
|
||||
NS_RELEASE(myObserver);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,11 @@
|
||||
#include "nsVoidArray.h"
|
||||
|
||||
#include "prmem.h"
|
||||
#include "nslog.h"
|
||||
|
||||
NS_IMPL_LOG(CNavDTDLog)
|
||||
#define PRINTF NS_LOG_PRINTF(CNavDTDLog)
|
||||
#define FLUSH NS_LOG_FLUSH(CNavDTDLog)
|
||||
|
||||
static NS_DEFINE_IID(kIHTMLContentSinkIID, NS_IHTML_CONTENT_SINK_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
@@ -474,9 +478,9 @@ nsresult CNavDTD::BuildModel(nsIParser* aParser,nsITokenizer* aTokenizer,nsIToke
|
||||
if(n>50) n=50;
|
||||
for(int i=0;i<n;i++){
|
||||
CToken* theToken=aTokenizer->GetTokenAt(i);
|
||||
printf("\nToken[%i],%p",i,theToken);
|
||||
PRINTF("\nToken[%i],%p",i,theToken);
|
||||
}
|
||||
printf("\n");
|
||||
PRINTF("\n");
|
||||
#endif
|
||||
|
||||
if(mDTDState!=NS_ERROR_HTMLPARSER_STOPPARSING) {
|
||||
@@ -578,11 +582,11 @@ nsresult CNavDTD::DidBuildModel(nsresult anErrorCode,PRBool aNotifySink,nsIParse
|
||||
if(2==gShowCRC) {
|
||||
if(mComputedCRC32!=mExpectedCRC32) {
|
||||
if(mExpectedCRC32!=0) {
|
||||
printf("CRC Computed: %u Expected CRC: %u\n,",mComputedCRC32,mExpectedCRC32);
|
||||
PRINTF("CRC Computed: %u Expected CRC: %u\n,",mComputedCRC32,mExpectedCRC32);
|
||||
result = aSink->DidBuildModel(2);
|
||||
}
|
||||
else {
|
||||
printf("Computed CRC: %u.\n",mComputedCRC32);
|
||||
PRINTF("Computed CRC: %u.\n",mComputedCRC32);
|
||||
result = aSink->DidBuildModel(3);
|
||||
}
|
||||
}
|
||||
@@ -642,7 +646,7 @@ nsresult CNavDTD::HandleToken(CToken* aToken,nsIParser* aParser){
|
||||
---------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
// printf("token: %p\n",aToken);
|
||||
// PRINTF("token: %p\n",aToken);
|
||||
|
||||
if(mSkipTarget){ //handle a preexisting target...
|
||||
if((theTag==mSkipTarget) && (eToken_end==theType)){
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
|
||||
#include "prmem.h"
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kIHTMLContentSinkIID, NS_IHTML_CONTENT_SINK_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID);
|
||||
@@ -234,7 +233,7 @@ COtherDTD::~COtherDTD(){
|
||||
#if 0
|
||||
PRInt32 count=gNodeCount-mSharedNodes.GetSize();
|
||||
if(count) {
|
||||
printf("%i of %i nodes leaked!\n",count,gNodeCount);
|
||||
PRINTF("%i of %i nodes leaked!\n",count,gNodeCount);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -34,6 +34,11 @@
|
||||
#define _COTHERELEMENTS_
|
||||
|
||||
#include "nsDTDUtils.h"
|
||||
#include "nslog.h"
|
||||
|
||||
NS_IMPL_LOG(COtherElementsLog)
|
||||
#define PRINTF NS_LOG_PRINTF(COtherElementsLog)
|
||||
#define FLUSH NS_LOG_FLUSH(COtherElementsLog)
|
||||
|
||||
/************************************************************************
|
||||
This union is a bitfield which describes the group membership
|
||||
@@ -2363,88 +2368,88 @@ void CElementTable::DebugDumpGroups(CElement* aTag){
|
||||
|
||||
const char* tag=nsHTMLTags::GetStringValue(aTag->mTag);
|
||||
const char* prefix=" ";
|
||||
printf("\n\nTag: <%s>\n",tag);
|
||||
printf(prefix);
|
||||
PRINTF("\n\nTag: <%s>\n",tag);
|
||||
PRINTF(prefix);
|
||||
|
||||
if(aTag->IsContainer()) {
|
||||
if(aTag->mContainsGroups.mBits.mHead) printf("head ");
|
||||
if(aTag->mContainsGroups.mBits.mHeadMisc) printf("headmisc ");
|
||||
if(aTag->mContainsGroups.mBits.mHeadContent) printf("headcontent ");
|
||||
if(aTag->mContainsGroups.mBits.mTable) printf("table ");
|
||||
if(aTag->mContainsGroups.mBits.mTextContainer) printf("text ");
|
||||
if(aTag->mContainsGroups.mBits.mTopLevel) printf("toplevel ");
|
||||
if(aTag->mContainsGroups.mBits.mDTDInternal) printf("internal ");
|
||||
if(aTag->mContainsGroups.mBits.mHead) PRINTF("head ");
|
||||
if(aTag->mContainsGroups.mBits.mHeadMisc) PRINTF("headmisc ");
|
||||
if(aTag->mContainsGroups.mBits.mHeadContent) PRINTF("headcontent ");
|
||||
if(aTag->mContainsGroups.mBits.mTable) PRINTF("table ");
|
||||
if(aTag->mContainsGroups.mBits.mTextContainer) PRINTF("text ");
|
||||
if(aTag->mContainsGroups.mBits.mTopLevel) PRINTF("toplevel ");
|
||||
if(aTag->mContainsGroups.mBits.mDTDInternal) PRINTF("internal ");
|
||||
|
||||
if(aTag->mContainsGroups.mBits.mFlowEntity) {
|
||||
printf("block inline ");
|
||||
PRINTF("block inline ");
|
||||
}
|
||||
else {
|
||||
|
||||
if (aTag->mContainsGroups.mBits.mBlockEntity) {
|
||||
printf("blockEntity ");
|
||||
PRINTF("blockEntity ");
|
||||
}
|
||||
|
||||
if (aTag->mContainsGroups.mBits.mBlock) {
|
||||
printf("block ");
|
||||
PRINTF("block ");
|
||||
}
|
||||
|
||||
if(aTag->mContainsGroups.mBits.mInlineEntity) {
|
||||
printf("inline ");
|
||||
PRINTF("inline ");
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
if(aTag->mContainsGroups.mBits.mFontStyle ) printf("fontstyle ");
|
||||
if(aTag->mContainsGroups.mBits.mPhrase) printf("phrase ");
|
||||
if(aTag->mContainsGroups.mBits.mSpecial) printf("special ");
|
||||
if(aTag->mContainsGroups.mBits.mFormControl) printf("form ");
|
||||
if(aTag->mContainsGroups.mBits.mHeading) printf("heading ");
|
||||
if(aTag->mContainsGroups.mBits.mFrame) printf("frame ");
|
||||
if(aTag->mContainsGroups.mBits.mList) printf("list ");
|
||||
if(aTag->mContainsGroups.mBits.mPreformatted) printf("pre ");
|
||||
if(aTag->mContainsGroups.mBits.mSelf) printf("self ");
|
||||
if(aTag->mContainsGroups.mBits.mLeaf) printf("leaf ");
|
||||
if(aTag->mContainsGroups.mBits.mWhiteSpace) printf("ws ");
|
||||
if(aTag->mContainsGroups.mBits.mComment) printf("comment ");
|
||||
if(aTag->mContainsGroups.mBits.mFontStyle ) PRINTF("fontstyle ");
|
||||
if(aTag->mContainsGroups.mBits.mPhrase) PRINTF("phrase ");
|
||||
if(aTag->mContainsGroups.mBits.mSpecial) PRINTF("special ");
|
||||
if(aTag->mContainsGroups.mBits.mFormControl) PRINTF("form ");
|
||||
if(aTag->mContainsGroups.mBits.mHeading) PRINTF("heading ");
|
||||
if(aTag->mContainsGroups.mBits.mFrame) PRINTF("frame ");
|
||||
if(aTag->mContainsGroups.mBits.mList) PRINTF("list ");
|
||||
if(aTag->mContainsGroups.mBits.mPreformatted) PRINTF("pre ");
|
||||
if(aTag->mContainsGroups.mBits.mSelf) PRINTF("self ");
|
||||
if(aTag->mContainsGroups.mBits.mLeaf) PRINTF("leaf ");
|
||||
if(aTag->mContainsGroups.mBits.mWhiteSpace) PRINTF("ws ");
|
||||
if(aTag->mContainsGroups.mBits.mComment) PRINTF("comment ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(aTag->mIncludeKids) {
|
||||
printf("\n%s",prefix);
|
||||
PRINTF("\n%s",prefix);
|
||||
eHTMLTags *theKid=aTag->mIncludeKids;
|
||||
printf("+ ");
|
||||
PRINTF("+ ");
|
||||
while(eHTMLTag_unknown!=*theKid){
|
||||
tag=nsHTMLTags::GetCStringValue(*theKid++);
|
||||
printf("%s ",tag);
|
||||
PRINTF("%s ",tag);
|
||||
}
|
||||
}
|
||||
|
||||
if(aTag->mExcludeKids) {
|
||||
printf("\n%s",prefix);
|
||||
PRINTF("\n%s",prefix);
|
||||
eHTMLTags *theKid=aTag->mExcludeKids;
|
||||
printf("- ");
|
||||
PRINTF("- ");
|
||||
while(eHTMLTag_unknown!=*theKid){
|
||||
tag=nsHTMLTags::GetCStringValue(*theKid++);
|
||||
printf("%s ",tag);
|
||||
PRINTF("%s ",tag);
|
||||
}
|
||||
}
|
||||
|
||||
if(!aTag->mContainsGroups.mBits.mSelf){
|
||||
printf("\n%s - self",prefix);
|
||||
PRINTF("\n%s - self",prefix);
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
printf("empty\n");
|
||||
PRINTF("empty\n");
|
||||
}
|
||||
}
|
||||
|
||||
void CElementTable::DebugDumpContainment(CElement* anElement){
|
||||
const char* tag=nsHTMLTags::GetStringValue(anElement->mTag);
|
||||
const char* prefix=" ";
|
||||
printf("\n\nTag: <%s>\n",tag);
|
||||
printf(prefix);
|
||||
PRINTF("\n\nTag: <%s>\n",tag);
|
||||
PRINTF(prefix);
|
||||
|
||||
int count=0;
|
||||
int i=0;
|
||||
@@ -2452,11 +2457,11 @@ void CElementTable::DebugDumpContainment(CElement* anElement){
|
||||
CElement* theChild=mElements[i];
|
||||
if(anElement->CanContain(theChild,0)){
|
||||
tag=nsHTMLTags::GetCStringValue(theChild->mTag);
|
||||
printf("%s ",tag);
|
||||
PRINTF("%s ",tag);
|
||||
count++;
|
||||
if(18==count) {
|
||||
count=0;
|
||||
printf("\n%s",prefix);
|
||||
PRINTF("\n%s",prefix);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2466,14 +2471,14 @@ void CElementTable::DebugDumpInlineElements(const char* aTitle) {
|
||||
PRInt32 theTagID=eHTMLTag_unknown;
|
||||
PRBool result=PR_FALSE;
|
||||
|
||||
printf("Inline Elements -- %s: \n",aTitle);
|
||||
PRINTF("Inline Elements -- %s: \n",aTitle);
|
||||
while(theTagID<=eHTMLTag_userdefined) {
|
||||
CElement *theTag=GetElement((eHTMLTags)theTagID);
|
||||
if(theTag) {
|
||||
result=theTag->IsInlineElement(eHTMLTag_unknown);
|
||||
if(result) {
|
||||
const char* theName=nsHTMLTags::GetCStringValue(theTag->mTag);
|
||||
printf(" %s\n",theName);
|
||||
PRINTF(" %s\n",theName);
|
||||
}
|
||||
}
|
||||
theTagID++;
|
||||
@@ -2484,14 +2489,14 @@ void CElementTable::DebugDumpBlockElements(const char* aTitle) {
|
||||
PRInt32 theTagID=eHTMLTag_unknown;
|
||||
PRBool result=PR_FALSE;
|
||||
|
||||
printf("Block Elements -- %s: \n",aTitle);
|
||||
PRINTF("Block Elements -- %s: \n",aTitle);
|
||||
while(theTagID<=eHTMLTag_userdefined) {
|
||||
CElement *theTag=GetElement((eHTMLTags)theTagID);
|
||||
if(theTag) {
|
||||
result=theTag->IsBlockElement(eHTMLTag_unknown);
|
||||
if(result) {
|
||||
const char* theName=nsHTMLTags::GetCStringValue(theTag->mTag);
|
||||
printf(" %s\n",theName);
|
||||
PRINTF(" %s\n",theName);
|
||||
}
|
||||
}
|
||||
theTagID++;
|
||||
@@ -2503,12 +2508,12 @@ void CElementTable::DebugDumpContainment(const char* aTitle){
|
||||
DebugDumpContainment(mElements[eHTMLTag_head]);
|
||||
DebugDumpContainment(mElements[eHTMLTag_html]);
|
||||
DebugDumpContainment(mElements[eHTMLTag_table]);
|
||||
printf("\n");
|
||||
PRINTF("\n");
|
||||
#endif
|
||||
|
||||
printf("==================================================\n");
|
||||
printf("%s\n",aTitle);
|
||||
printf("==================================================\n");
|
||||
PRINTF("==================================================\n");
|
||||
PRINTF("%s\n",aTitle);
|
||||
PRINTF("==================================================\n");
|
||||
int i=0;
|
||||
|
||||
for(i=1;i<NS_HTML_TAG_MAX;i++){
|
||||
|
||||
@@ -47,6 +47,11 @@
|
||||
#include "nsDebug.h"
|
||||
|
||||
#include "prmem.h"
|
||||
#include "nslog.h"
|
||||
|
||||
NS_IMPL_LOG(CRtfDTDLog)
|
||||
#define PRINTF NS_LOG_PRINTF(CRtfDTDLog)
|
||||
#define FLUSH NS_LOG_FLUSH(CRtfDTDLog)
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kIHTMLContentSinkIID, NS_IHTML_CONTENT_SINK_IID);
|
||||
@@ -411,9 +416,9 @@ NS_IMETHODIMP CRtfDTD::BuildModel(nsIParser* aParser,nsITokenizer* aTokenizer,ns
|
||||
if(n>50) n=50;
|
||||
for(int i=0;i<n;i++){
|
||||
CToken* theToken=aTokenizer->GetTokenAt(i);
|
||||
printf("\nToken[%i],%p",i,theToken);
|
||||
PRINTF("\nToken[%i],%p",i,theToken);
|
||||
}
|
||||
printf("\n");
|
||||
PRINTF("\n");
|
||||
#endif
|
||||
|
||||
CToken* theToken=mTokenizer->PopToken();
|
||||
|
||||
@@ -29,6 +29,11 @@
|
||||
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nslog.h"
|
||||
|
||||
NS_IMPL_LOG(nsDTDUtilsLog)
|
||||
#define PRINTF NS_LOG_PRINTF(nsDTDUtilsLog)
|
||||
#define FLUSH NS_LOG_FLUSH(nsDTDUtilsLog)
|
||||
|
||||
MOZ_DECL_CTOR_COUNTER(nsEntryStack);
|
||||
MOZ_DECL_CTOR_COUNTER(nsDTDContext);
|
||||
@@ -1337,7 +1342,7 @@ CNodeRecycler::~CNodeRecycler() {
|
||||
#if 1
|
||||
PRInt32 count=gNodeCount-mSharedNodes.GetSize();
|
||||
if(count) {
|
||||
printf("%i of %i nodes leaked!\n",count,gNodeCount);
|
||||
PRINTF("%i of %i nodes leaked!\n",count,gNodeCount);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -47,6 +47,11 @@
|
||||
#include "nsFileStream.h"
|
||||
|
||||
#include "nsNetUtil.h" // for NS_MakeAbsoluteURI
|
||||
#include "nslog.h"
|
||||
|
||||
NS_IMPL_LOG(nsHTMLContentSinkStreamLog)
|
||||
#define PRINTF NS_LOG_PRINTF(nsHTMLContentSinkStreamLog)
|
||||
#define FLUSH NS_LOG_FLUSH(nsHTMLContentSinkStreamLog)
|
||||
|
||||
static NS_DEFINE_CID(kSaveAsCharsetCID, NS_SAVEASCHARSET_CID);
|
||||
static NS_DEFINE_CID(kEntityConverterCID, NS_ENTITYCONVERTER_CID);
|
||||
@@ -655,7 +660,7 @@ void nsHTMLContentSinkStream::AddStartTag(const nsIParserNode& aNode)
|
||||
|
||||
#ifdef DEBUG_prettyprint
|
||||
if (isDirty)
|
||||
printf("AddStartTag(%s): BBO=%d, BAO=%d, BBC=%d, BAC=%d\n",
|
||||
PRINTF("AddStartTag(%s): BBO=%d, BAO=%d, BBC=%d, BAC=%d\n",
|
||||
name.ToNewCString(),
|
||||
BreakBeforeOpen(tag),
|
||||
BreakAfterOpen(tag),
|
||||
@@ -721,7 +726,7 @@ void nsHTMLContentSinkStream::AddEndTag(const nsIParserNode& aNode)
|
||||
|
||||
#ifdef DEBUG_prettyprint
|
||||
if (isDirty)
|
||||
printf("AddEndTag(%s): BBO=%d, BAO=%d, BBC=%d, BAC=%d\n",
|
||||
PRINTF("AddEndTag(%s): BBO=%d, BAO=%d, BBC=%d, BAC=%d\n",
|
||||
aNode.GetText().ToNewCString(),
|
||||
BreakBeforeOpen(tag),
|
||||
BreakAfterOpen(tag),
|
||||
|
||||
@@ -52,6 +52,13 @@
|
||||
#include "nsIOutputStream.h"
|
||||
#include "nsFileStream.h"
|
||||
#include "nsIPref.h"
|
||||
#include "nslog.h"
|
||||
#undef PRINTF
|
||||
#undef FLUSH
|
||||
|
||||
NS_IMPL_LOG(nsHTMLToTXTSinkStreamLog)
|
||||
#define PRINTF NS_LOG_PRINTF(nsHTMLToTXTSinkStreamLog)
|
||||
#define FLUSH NS_LOG_FLUSH(nsHTMLToTXTSinkStreamLog)
|
||||
|
||||
static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
|
||||
static NS_DEFINE_CID(kLWBrkCID, NS_LWBRK_CID);
|
||||
@@ -551,7 +558,7 @@ nsHTMLToTXTSinkStream::OpenContainer(const nsIParserNode& aNode)
|
||||
if (-1 != style.Find("-moz-pre-wrap", PR_TRUE, whitespace))
|
||||
{
|
||||
#ifdef DEBUG_preformatted
|
||||
printf("Set mPreFormatted based on style moz-pre-wrap\n");
|
||||
PRINTF("Set mPreFormatted based on style moz-pre-wrap\n");
|
||||
#endif
|
||||
mPreFormatted = PR_TRUE;
|
||||
mCacheLine = PR_TRUE;
|
||||
@@ -574,7 +581,7 @@ nsHTMLToTXTSinkStream::OpenContainer(const nsIParserNode& aNode)
|
||||
{
|
||||
SetWrapColumn((PRUint32)col);
|
||||
#ifdef DEBUG_preformatted
|
||||
printf("Set wrap column to %d based on style\n", mWrapColumn);
|
||||
PRINTF("Set wrap column to %d based on style\n", mWrapColumn);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -582,7 +589,7 @@ nsHTMLToTXTSinkStream::OpenContainer(const nsIParserNode& aNode)
|
||||
else if (-1 != style.Find("pre", PR_TRUE, whitespace))
|
||||
{
|
||||
#ifdef DEBUG_preformatted
|
||||
printf("Set mPreFormatted based on style pre\n");
|
||||
PRINTF("Set mPreFormatted based on style pre\n");
|
||||
#endif
|
||||
mPreFormatted = PR_TRUE;
|
||||
mCacheLine = PR_TRUE;
|
||||
@@ -1396,7 +1403,7 @@ nsHTMLToTXTSinkStream::Write(const nsString& aString)
|
||||
{
|
||||
#ifdef DEBUG_wrapping
|
||||
char* foo = aString.ToNewCString();
|
||||
printf("Write(%s): wrap col = %d, mColPos = %d\n", foo, mWrapColumn, mColPos);
|
||||
PRINTF("Write(%s): wrap col = %d, mColPos = %d\n", foo, mWrapColumn, mColPos);
|
||||
nsMemory::Free(foo);
|
||||
#endif
|
||||
|
||||
@@ -1455,7 +1462,7 @@ nsHTMLToTXTSinkStream::Write(const nsString& aString)
|
||||
}
|
||||
|
||||
#ifdef DEBUG_wrapping
|
||||
printf("No wrapping: newline is %d, totLen is %d; leaving mColPos = %d\n",
|
||||
PRINTF("No wrapping: newline is %d, totLen is %d; leaving mColPos = %d\n",
|
||||
newline, totLen, mColPos);
|
||||
#endif
|
||||
return;
|
||||
@@ -1475,8 +1482,8 @@ nsHTMLToTXTSinkStream::Write(const nsString& aString)
|
||||
nsString remaining;
|
||||
aString.Right(remaining, totLen - bol);
|
||||
foo = remaining.ToNewCString();
|
||||
// printf("Next line: bol = %d, newlinepos = %d, totLen = %d, string = '%s'\n",
|
||||
// bol, nextpos, totLen, foo);
|
||||
// PRINTF("Next line: bol = %d, newlinepos = %d, totLen = %d, string = '%s'\n",
|
||||
// bol, nextpos, totLen, foo));
|
||||
nsMemory::Free(foo);
|
||||
#endif
|
||||
|
||||
@@ -1546,7 +1553,7 @@ nsHTMLToTXTSinkStream::Write(const nsString& aString)
|
||||
}
|
||||
}
|
||||
}
|
||||
} // Continue looping over the string
|
||||
}// Continue looping over the string
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,6 +48,12 @@
|
||||
#include "prenv.h"
|
||||
#include "nsParserCIID.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nslog.h"
|
||||
|
||||
NS_IMPL_LOG(nsParserLog)
|
||||
#define PRINTF NS_LOG_PRINTF(nsParserLog)
|
||||
#define FLUSH NS_LOG_FLUSH(nsParserLog)
|
||||
|
||||
//#define rickgdebug
|
||||
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
@@ -1536,7 +1542,7 @@ nsresult nsParser::EnableParser(PRBool aState){
|
||||
mParserContext->mParserEnabled=aState;
|
||||
if(aState) {
|
||||
|
||||
//printf(" Re-enable parser\n");
|
||||
//PRINTF(" Re-enable parser\n");
|
||||
|
||||
result=ResumeParse();
|
||||
if(result!=NS_OK)
|
||||
@@ -1709,7 +1715,7 @@ aMimeType,PRBool aVerifyEnabled,PRBool aLastCall,nsDTDMode aMode){
|
||||
pc->SetMimeType(aMimeType);
|
||||
mUnusedInput.Truncate(0);
|
||||
|
||||
//printf("Parse(string) iterate: %i",PR_FALSE);
|
||||
//PRINTF("Parse(string) iterate: %i",PR_FALSE);
|
||||
pc->mScanner->Append(aSourceBuffer);
|
||||
result=ResumeParse(PR_FALSE);
|
||||
|
||||
@@ -1869,7 +1875,7 @@ nsresult nsParser::ParseFragment(const nsAReadableString& aSourceBuffer,void* aK
|
||||
*/
|
||||
nsresult nsParser::ResumeParse(PRBool allowIteration, PRBool aIsFinalChunk) {
|
||||
|
||||
//printf(" Resume %i, prev-context: %p\n",allowIteration,mParserContext->mPrevContext);
|
||||
//PRINTF(" Resume %i, prev-context: %p\n",allowIteration,mParserContext->mPrevContext);
|
||||
|
||||
|
||||
nsresult result=NS_OK;
|
||||
@@ -2311,7 +2317,7 @@ theContext->mTransferBufferSize;
|
||||
theNumRead, guess, guessSource))
|
||||
{
|
||||
#ifdef DEBUG_XMLENCODING
|
||||
printf("xmlencoding detect- %s\n", guess.ToNewCString());
|
||||
PRINTF("xmlencoding detect- %s\n", guess.ToNewCString());
|
||||
#endif
|
||||
this->SetDocumentCharset(guess, guessSource);
|
||||
}
|
||||
@@ -2324,7 +2330,7 @@ theContext->mTransferBufferSize;
|
||||
unsigned int index=0;
|
||||
for(index=0;index<theNumRead;index++) {
|
||||
if(0==theContext->mTransferBuffer[index]){
|
||||
printf("\nNull found at buffer[%i] provided by netlib...\n",index);
|
||||
PRINTF("\nNull found at buffer[%i] provided by netlib...\n",index);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2334,7 +2340,7 @@ theContext->mTransferBufferSize;
|
||||
static int dump=0;
|
||||
if(dump) {
|
||||
theContext->mTransferBuffer[theNumRead]=0;
|
||||
printf("\n\n-----------------------------------------------------%s\n",theContext->mTransferBuffer);
|
||||
PRINTF("\n\n-----------------------------------------------------%s\n",theContext->mTransferBuffer);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -45,6 +45,11 @@
|
||||
#include "nsExpatTokenizer.h"
|
||||
#include "nsIParserService.h"
|
||||
#include "nsElementTable.h"
|
||||
#include "nslog.h"
|
||||
|
||||
NS_IMPL_LOG(nsParserModuleLog)
|
||||
#define PRINTF NS_LOG_PRINTF(nsParserModuleLog)
|
||||
#define FLUSH NS_LOG_FLUSH(nsParserModuleLog)
|
||||
|
||||
static NS_DEFINE_IID(kIParserServiceIID, NS_IPARSERSERVICE_IID);
|
||||
|
||||
@@ -393,10 +398,8 @@ nsParserModule::RegisterSelf(nsIComponentManager *aCompMgr,
|
||||
rv = aCompMgr->RegisterComponentSpec(*cp->mCID, cp->mDescription,
|
||||
nsnull, aPath, PR_TRUE, PR_TRUE);
|
||||
if (NS_FAILED(rv)) {
|
||||
#ifdef DEBUG
|
||||
printf("nsParserModule: unable to register %s component => %x\n",
|
||||
PRINTF("nsParserModule: unable to register %s component => %x\n",
|
||||
cp->mDescription, rv);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
cp++;
|
||||
@@ -414,10 +417,8 @@ nsParserModule::UnregisterSelf(nsIComponentManager *aCompMgr,
|
||||
while (cp < end) {
|
||||
nsresult rv = aCompMgr->UnregisterComponentSpec(*cp->mCID, aPath);
|
||||
if (NS_FAILED(rv)) {
|
||||
#ifdef DEBUG
|
||||
printf("nsParserModule: unable to unregister %s component => %x\n",
|
||||
PRINTF("nsParserModule: unable to unregister %s component => %x\n",
|
||||
cp->mDescription, rv);
|
||||
#endif
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,11 @@ static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
|
||||
#include "plstr.h"
|
||||
|
||||
#include "prmem.h"
|
||||
#include "nslog.h"
|
||||
|
||||
NS_IMPL_LOG(nsViewSourceHTMLLog)
|
||||
#define PRINTF NS_LOG_PRINTF(nsViewSourceHTMLLog)
|
||||
#define FLUSH NS_LOG_FLUSH(nsViewSourceHTMLLog)
|
||||
|
||||
#ifdef RAPTOR_PERF_METRICS
|
||||
#include "stopwatch.h"
|
||||
@@ -642,9 +646,9 @@ NS_IMETHODIMP CViewSourceHTML::DidBuildModel(nsresult anErrorCode,PRBool aNotify
|
||||
|
||||
#ifdef RAPTOR_PERF_METRICS
|
||||
NS_STOP_STOPWATCH(vsTimer);
|
||||
printf("viewsource timer: ");
|
||||
PRINTF("viewsource timer: ");
|
||||
vsTimer.Print();
|
||||
printf("\n");
|
||||
PRINTF("\n");
|
||||
#endif
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user