Bug 577915 mark DEBUG only variables as ifdef DEBUG in libjar; r=dveditz a=jst

--HG--
extra : rebase_source : feb129da3b95e7f89487058b050088a74f7ee21b
This commit is contained in:
timeless@mozdev.org 2010-07-11 15:49:52 +03:00
parent 29d9225a9a
commit c6fb533d28
3 changed files with 24 additions and 7 deletions

View File

@ -151,7 +151,10 @@ nsrefcnt nsJAR::Release(void)
return 0; return 0;
} }
else if (1 == count && mCache) { else if (1 == count && mCache) {
nsresult rv = mCache->ReleaseZip(this); #ifdef DEBUG
nsresult rv =
#endif
mCache->ReleaseZip(this);
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to release zip file"); NS_ASSERTION(NS_SUCCEEDED(rv), "failed to release zip file");
} }
return count; return count;
@ -1150,7 +1153,10 @@ nsZipReaderCache::GetZip(nsIFile* zipFile, nsIZipReader* *result)
return rv; return rv;
} }
PRBool collision = mZips.Put(&key, static_cast<nsIZipReader*>(zip)); // AddRefs to 2 #ifdef DEBUG
PRBool collision =
#endif
mZips.Put(&key, static_cast<nsIZipReader*>(zip)); // AddRefs to 2
NS_ASSERTION(!collision, "horked"); NS_ASSERTION(!collision, "horked");
} }
*result = zip; *result = zip;
@ -1304,8 +1310,10 @@ nsZipReaderCache::ReleaseZip(nsJAR* zip)
} }
nsCStringKey key(uri); nsCStringKey key(uri);
PRBool removed; #ifdef DEBUG
removed = mZips.Remove(&key); // Releases PRBool removed =
#endif
mZips.Remove(&key); // Releases
NS_ASSERTION(removed, "botched"); NS_ASSERTION(removed, "botched");
return NS_OK; return NS_OK;
@ -1337,7 +1345,10 @@ nsZipReaderCache::Observe(nsISupports *aSubject,
mZips.Enumerate(FindFlushableZip, &flushable); mZips.Enumerate(FindFlushableZip, &flushable);
if ( ! flushable ) if ( ! flushable )
break; break;
PRBool removed = mZips.Remove(flushable); // Releases #ifdef DEBUG
PRBool removed =
#endif
mZips.Remove(flushable); // Releases
NS_ASSERTION(removed, "botched"); NS_ASSERTION(removed, "botched");
#ifdef xDEBUG_jband #ifdef xDEBUG_jband

View File

@ -94,7 +94,10 @@ public:
, mContentLength(-1) , mContentLength(-1)
{ {
if (fullJarURI) { if (fullJarURI) {
nsresult rv = fullJarURI->GetAsciiSpec(mJarDirSpec); #ifdef DEBUG
nsresult rv =
#endif
fullJarURI->GetAsciiSpec(mJarDirSpec);
NS_ASSERTION(NS_SUCCEEDED(rv), "this shouldn't fail"); NS_ASSERTION(NS_SUCCEEDED(rv), "this shouldn't fail");
} }
} }

View File

@ -1002,7 +1002,10 @@ nsZipCursor::nsZipCursor(nsZipItem *item, nsZipArchive *aZip, PRUint8* aBuf, PRU
mDoCRC(doCRC) mDoCRC(doCRC)
{ {
if (mItem->Compression() == DEFLATED) { if (mItem->Compression() == DEFLATED) {
nsresult status = gZlibInit(&mZs); #ifdef DEBUG
nsresult status =
#endif
gZlibInit(&mZs);
NS_ASSERTION(status == NS_OK, "Zlib failed to initialize"); NS_ASSERTION(status == NS_OK, "Zlib failed to initialize");
NS_ASSERTION(aBuf, "Must pass in a buffer for DEFLATED nsZipItem"); NS_ASSERTION(aBuf, "Must pass in a buffer for DEFLATED nsZipItem");
} }