From 95ef24ac8585cbeb5ae6f4362158dfbedb7835ea Mon Sep 17 00:00:00 2001 From: "pavlov%netscape.com" Date: Thu, 22 Mar 2001 10:26:36 +0000 Subject: [PATCH] removing printfs. adding asserts... fixing warnings --- modules/libpr0n/public/ImageLogging.h | 20 ++++++++++---------- modules/libpr0n/src/DummyChannel.h | 3 ++- modules/libpr0n/src/imgContainer.cpp | 22 +++++++--------------- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/modules/libpr0n/public/ImageLogging.h b/modules/libpr0n/public/ImageLogging.h index 6bd75d81501..a06a7e780d6 100644 --- a/modules/libpr0n/public/ImageLogging.h +++ b/modules/libpr0n/public/ImageLogging.h @@ -30,17 +30,17 @@ extern PRLogModuleInfo *gImgLog; class LogScope { public: - LogScope(PRLogModuleInfo *log, void *from, const nsAReadableCString &fn) : - mLog(log), mFrom(from), mFunc(fn) + LogScope(PRLogModuleInfo *aLog, void *from, const nsAReadableCString &fn) : + mLog(aLog), mFrom(from), mFunc(fn) { PR_LOG(mLog, PR_LOG_DEBUG, ("[this=%p] %s {ENTER}\n", mFrom, mFunc.get())); } /* const char * constructor */ - LogScope(PRLogModuleInfo *log, void *from, const nsAReadableCString &fn, + LogScope(PRLogModuleInfo *aLog, void *from, const nsAReadableCString &fn, const nsLiteralCString ¶mName, const char *paramValue) : - mLog(log), mFrom(from), mFunc(fn) + mLog(aLog), mFrom(from), mFunc(fn) { PR_LOG(mLog, PR_LOG_DEBUG, ("[this=%p] %s (%s=\"%s\") {ENTER}\n", mFrom, mFunc.get(), @@ -49,9 +49,9 @@ public: } /* void ptr constructor */ - LogScope(PRLogModuleInfo *log, void *from, const nsAReadableCString &fn, + LogScope(PRLogModuleInfo *aLog, void *from, const nsAReadableCString &fn, const nsLiteralCString ¶mName, const void *paramValue) : - mLog(log), mFrom(from), mFunc(fn) + mLog(aLog), mFrom(from), mFunc(fn) { PR_LOG(mLog, PR_LOG_DEBUG, ("[this=%p] %s (%s=%p) {ENTER}\n", mFrom, mFunc.get(), @@ -60,9 +60,9 @@ public: } /* PRInt32 constructor */ - LogScope(PRLogModuleInfo *log, void *from, const nsAReadableCString &fn, + LogScope(PRLogModuleInfo *aLog, void *from, const nsAReadableCString &fn, const nsLiteralCString ¶mName, PRInt32 paramValue) : - mLog(log), mFrom(from), mFunc(fn) + mLog(aLog), mFrom(from), mFunc(fn) { PR_LOG(mLog, PR_LOG_DEBUG, ("[this=%p] %s (%s=\"%d\") {ENTER}\n", mFrom, mFunc.get(), @@ -71,9 +71,9 @@ public: } /* PRUint32 constructor */ - LogScope(PRLogModuleInfo *log, void *from, const nsAReadableCString &fn, + LogScope(PRLogModuleInfo *aLog, void *from, const nsAReadableCString &fn, const nsLiteralCString ¶mName, PRUint32 paramValue) : - mLog(log), mFrom(from), mFunc(fn) + mLog(aLog), mFrom(from), mFunc(fn) { PR_LOG(mLog, PR_LOG_DEBUG, ("[this=%p] %s (%s=\"%d\") {ENTER}\n", mFrom, mFunc.get(), diff --git a/modules/libpr0n/src/DummyChannel.h b/modules/libpr0n/src/DummyChannel.h index 36a683080fb..5a5231a4d7f 100644 --- a/modules/libpr0n/src/DummyChannel.h +++ b/modules/libpr0n/src/DummyChannel.h @@ -50,4 +50,5 @@ private: nsLoadFlags mLoadFlags; }; -#endif \ No newline at end of file +#endif + diff --git a/modules/libpr0n/src/imgContainer.cpp b/modules/libpr0n/src/imgContainer.cpp index 293e08069c8..cb63a964b8f 100644 --- a/modules/libpr0n/src/imgContainer.cpp +++ b/modules/libpr0n/src/imgContainer.cpp @@ -56,7 +56,7 @@ imgContainer::~imgContainer() NS_IMETHODIMP imgContainer::Init(nscoord aWidth, nscoord aHeight, imgIContainerObserver *aObserver) { if (aWidth <= 0 || aHeight <= 0) { - printf("error - negative image size\n"); + NS_WARNING("error - negative image size\n"); return NS_ERROR_FAILURE; } @@ -245,8 +245,6 @@ NS_IMETHODIMP imgContainer::StartAnimation() if (mTimer) return NS_OK; - printf("imgContainer::StartAnimation()\n"); - PRUint32 numFrames; this->GetNumFrames(&numFrames); @@ -289,10 +287,7 @@ NS_IMETHODIMP imgContainer::StopAnimation() if (!mTimer) return NS_OK; - printf("gfxImageContainer::StopAnimation()\n"); - - if (mTimer) - mTimer->Cancel(); + mTimer->Cancel(); mTimer = nsnull; @@ -319,16 +314,12 @@ NS_IMETHODIMP_(void) imgContainer::Notify(nsITimer *timer) { NS_ASSERTION(mTimer == timer, "uh"); - printf("timer callback\n"); - if(!mAnimating) return; nsCOMPtr nextFrame; PRInt32 timeout = 100; - printf("timer callback\n"); - // If we're done decoding the next frame, go ahead and display it now and reinit // the timer with the next frame's delay time. PRUint32 previousAnimationFrame = mCurrentAnimationFrame; @@ -366,7 +357,7 @@ NS_IMETHODIMP_(void) imgContainer::Notify(nsITimer *timer) nextFrame->GetTimeout(&timeout); } - printf("timer callback; timeout = %d, mCurrentAnimationFrame = %d\n", timeout, mCurrentAnimationFrame); + // printf("timer callback; timeout = %d, mCurrentAnimationFrame = %d\n", timeout, mCurrentAnimationFrame); if(mTimer) mTimer->SetDelay(timeout); //XXX update the composited frame @@ -375,8 +366,9 @@ NS_IMETHODIMP_(void) imgContainer::Notify(nsITimer *timer) nsCOMPtr frameToUse; DoComposite(getter_AddRefs(frameToUse), &dirtyRect, previousAnimationFrame, mCurrentAnimationFrame); - printf("x=%d, y=%d, w=%d, h=%d\n", dirtyRect.x, dirtyRect.y, - dirtyRect.width, dirtyRect.height); + /* printf("x=%d, y=%d, w=%d, h=%d\n", dirtyRect.x, dirtyRect.y, + dirtyRect.width, dirtyRect.height); + */ // do notification to FE to draw this frame, but hand it the compositing frame if (mObserver) @@ -476,4 +468,4 @@ void imgContainer::DoComposite(gfxIImageFrame** aFrameToUse, nsRect* aDirtyRect, nextFrame->GetFrameDisposalMethod(&nextFrameDisposalMethod); //XXX if(nextFrameDisposalMethod == 4) // blit mPreviousCompositeFrame with this frame -} \ No newline at end of file +}