From 70deb5f58dac84c56a4b44ffef7953e553befc3e Mon Sep 17 00:00:00 2001 From: "darin%meer.net" Date: Thu, 30 Mar 2006 18:40:56 +0000 Subject: [PATCH] fixes bug 328925 "Replace NS_WARN_IF_FALSE with NS_ASSERTION (where appropriate)" r=dbaron git-svn-id: svn://10.0.0.236/trunk@193272 18797224-902f-48f8-a5cc-f745e15eee43 --- .../src/atk/nsMaiInterfaceEditableText.cpp | 24 +++++++++---------- .../accessible/src/atk/nsMaiInterfaceText.cpp | 4 ++-- mozilla/caps/src/nsPrincipal.cpp | 2 +- mozilla/content/base/src/nsContentUtils.cpp | 2 +- mozilla/content/base/src/nsFrameLoader.cpp | 4 ++-- .../base/src/nsPlainTextSerializer.cpp | 2 +- .../events/src/nsEventStateManager.cpp | 4 ++-- .../content/events/src/nsPrivateTextRange.cpp | 2 +- .../html/content/src/nsHTMLFormElement.cpp | 2 +- .../html/content/src/nsHTMLImageElement.cpp | 2 +- .../html/document/src/nsHTMLContentSink.cpp | 6 ++--- .../html/document/src/nsHTMLDocument.cpp | 6 ++--- .../xml/document/src/nsXMLDocument.cpp | 2 +- .../xul/document/src/nsXULDocument.cpp | 2 +- .../docshell/base/nsDSURIContentListener.cpp | 2 +- mozilla/docshell/base/nsDocShell.cpp | 2 +- mozilla/dom/src/base/nsDOMClassInfo.cpp | 2 +- mozilla/dom/src/base/nsDOMWindowList.cpp | 4 ++-- mozilla/dom/src/base/nsGlobalWindow.cpp | 6 ++--- .../activex/src/control/HelperAppDlg.cpp | 8 +++---- .../browser/gtk/src/EmbedPrivate.cpp | 2 +- .../source/CTextInputEventHandling.cpp | 4 ++-- .../browser/qt/src/qgeckoglobals.cpp | 4 ++-- .../extensions/python/xpcom/src/PyGBase.cpp | 6 ++--- .../python/xpcom/src/VariantUtils.cpp | 8 +++---- .../extensions/python/xpcom/src/dllmain.cpp | 2 +- .../python/xpcom/src/module/_xpcom.cpp | 2 +- .../extensions/webdav/src/nsWebDAVService.cpp | 6 ++--- mozilla/extensions/xforms/nsXFormsUtils.cpp | 2 +- mozilla/gfx/src/psshared/nsPaperPS.h | 2 +- mozilla/js/src/xpconnect/src/nsXPConnect.cpp | 4 ++-- mozilla/js/src/xpconnect/src/xpcprivate.h | 2 +- .../js/src/xpconnect/src/xpcwrappednative.cpp | 4 ++-- mozilla/layout/base/nsDocumentViewer.cpp | 8 +++---- mozilla/layout/generic/nsTextFrame.cpp | 2 +- .../tables/BasicTableLayoutStrategy.cpp | 8 +++---- .../layout/tables/nsTableRowGroupFrame.cpp | 4 ++-- .../layout/xul/base/src/nsMenuPopupFrame.cpp | 6 ++--- .../mime/src/nsSimpleMimeConverterStub.cpp | 2 +- .../plugin/base/src/nsPluginHostImpl.cpp | 2 +- mozilla/parser/htmlparser/src/nsDTDUtils.cpp | 4 ++-- .../parser/htmlparser/src/nsExpatDriver.cpp | 2 +- mozilla/widget/src/mac/nsMimeMapper.cpp | 2 +- mozilla/widget/src/mac/nsWindow.cpp | 4 ++-- mozilla/xpcom/base/nsExceptionService.cpp | 6 ++--- mozilla/xpcom/base/nsTraceRefcntImpl.cpp | 2 +- mozilla/xpcom/build/nsOS2VACLegacy.cpp | 4 ++-- mozilla/xpcom/build/nsXPComInit.cpp | 2 +- mozilla/xpcom/ds/nsTimelineService.cpp | 6 ++--- mozilla/xpcom/glue/nsBaseHashtable.h | 2 +- mozilla/xpcom/glue/nsCOMPtr.cpp | 4 ++-- mozilla/xpcom/obsolete/nsFileSpec.cpp | 2 +- mozilla/xpcom/stub/nsOS2VACLegacy.cpp | 4 ++-- mozilla/xpfe/appshell/src/nsXULWindow.cpp | 2 +- .../appleevents/nsAEApplicationClass.cpp | 4 ++-- .../components/winhooks/nsWindowsHooks.cpp | 2 +- .../winhooks/nsWindowsHooksUtil.cpp | 4 ++-- 57 files changed, 112 insertions(+), 112 deletions(-) diff --git a/mozilla/accessible/src/atk/nsMaiInterfaceEditableText.cpp b/mozilla/accessible/src/atk/nsMaiInterfaceEditableText.cpp index e07cae421ca..7b79613efab 100644 --- a/mozilla/accessible/src/atk/nsMaiInterfaceEditableText.cpp +++ b/mozilla/accessible/src/atk/nsMaiInterfaceEditableText.cpp @@ -145,8 +145,8 @@ setTextContentsCB(AtkEditableText *aText, const gchar *aString) NS_ConvertUTF8toUTF16 strContent(aString); nsresult rv = accText->SetTextContents(strContent); - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), - "MaiInterfaceEditableText::SetTextContents, failed\n"); + NS_ASSERTION(NS_SUCCEEDED(rv), + "MaiInterfaceEditableText::SetTextContents, failed\n"); } void @@ -172,8 +172,8 @@ insertTextCB(AtkEditableText *aText, // *aPosition = pos; nsresult rv = accText->InsertText(strContent, *aPosition); - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), - "MaiInterfaceEditableText::InsertText, failed\n"); + NS_ASSERTION(NS_SUCCEEDED(rv), + "MaiInterfaceEditableText::InsertText, failed\n"); MAI_LOG_DEBUG(("EditableText: insert aString=%s, aLength=%d, aPosition=%d", aString, aLength, *aPosition)); @@ -195,8 +195,8 @@ copyTextCB(AtkEditableText *aText, gint aStartPos, gint aEndPos) MAI_LOG_DEBUG(("EditableText: copyTextCB, aStartPos=%d, aEndPos=%d", aStartPos, aEndPos)); nsresult rv = accText->CopyText(aStartPos, aEndPos); - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), - "MaiInterfaceEditableText::CopyText, failed\n"); + NS_ASSERTION(NS_SUCCEEDED(rv), + "MaiInterfaceEditableText::CopyText, failed\n"); } void @@ -214,8 +214,8 @@ cutTextCB(AtkEditableText *aText, gint aStartPos, gint aEndPos) MAI_LOG_DEBUG(("EditableText: cutTextCB, aStartPos=%d, aEndPos=%d", aStartPos, aEndPos)); nsresult rv = accText->CutText(aStartPos, aEndPos); - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), - "MaiInterfaceEditableText::CutText, failed\n"); + NS_ASSERTION(NS_SUCCEEDED(rv), + "MaiInterfaceEditableText::CutText, failed\n"); } void @@ -234,8 +234,8 @@ deleteTextCB(AtkEditableText *aText, gint aStartPos, gint aEndPos) MAI_LOG_DEBUG(("EditableText: deleteTextCB, aStartPos=%d, aEndPos=%d", aStartPos, aEndPos)); nsresult rv = accText->DeleteText(aStartPos, aEndPos); - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), - "MaiInterfaceEditableText::DeleteText, failed\n"); + NS_ASSERTION(NS_SUCCEEDED(rv), + "MaiInterfaceEditableText::DeleteText, failed\n"); } void @@ -253,6 +253,6 @@ pasteTextCB(AtkEditableText *aText, gint aPosition) MAI_LOG_DEBUG(("EditableText: pasteTextCB, aPosition=%d", aPosition)); nsresult rv = accText->PasteText(aPosition); - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), - "MaiInterfaceEditableText::PasteText, failed\n"); + NS_ASSERTION(NS_SUCCEEDED(rv), + "MaiInterfaceEditableText::PasteText, failed\n"); } diff --git a/mozilla/accessible/src/atk/nsMaiInterfaceText.cpp b/mozilla/accessible/src/atk/nsMaiInterfaceText.cpp index b9c25dd5604..6479d61a884 100644 --- a/mozilla/accessible/src/atk/nsMaiInterfaceText.cpp +++ b/mozilla/accessible/src/atk/nsMaiInterfaceText.cpp @@ -370,8 +370,8 @@ getCharacterExtentsCB(AtkText *aText, gint aOffset, *aY = extY; *aWidth = extWidth; *aHeight = extHeight; - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), - "MaiInterfaceText::GetCharacterExtents, failed\n"); + NS_ASSERTION(NS_SUCCEEDED(rv), + "MaiInterfaceText::GetCharacterExtents, failed\n"); } gint diff --git a/mozilla/caps/src/nsPrincipal.cpp b/mozilla/caps/src/nsPrincipal.cpp index 1366eed77b7..f97aa8202e5 100755 --- a/mozilla/caps/src/nsPrincipal.cpp +++ b/mozilla/caps/src/nsPrincipal.cpp @@ -130,7 +130,7 @@ nsPrincipal::Init(const nsACString& aCertFingerprint, } } - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "nsPrincipal::Init() failed"); + NS_ASSERTION(NS_SUCCEEDED(rv), "nsPrincipal::Init() failed"); return rv; } diff --git a/mozilla/content/base/src/nsContentUtils.cpp b/mozilla/content/base/src/nsContentUtils.cpp index 10884fe867f..33fa6bbfcce 100644 --- a/mozilla/content/base/src/nsContentUtils.cpp +++ b/mozilla/content/base/src/nsContentUtils.cpp @@ -2025,7 +2025,7 @@ nsContentUtils::LoadImage(nsIURI* aURI, nsIDocument* aLoadingDocument, } nsCOMPtr loadGroup = aLoadingDocument->GetDocumentLoadGroup(); - NS_WARN_IF_FALSE(loadGroup, "Could not get loadgroup; onload may fire too early"); + NS_ASSERTION(loadGroup, "Could not get loadgroup; onload may fire too early"); nsIURI *documentURI = aLoadingDocument->GetDocumentURI(); diff --git a/mozilla/content/base/src/nsFrameLoader.cpp b/mozilla/content/base/src/nsFrameLoader.cpp index 9b497b11654..4f550661f24 100644 --- a/mozilla/content/base/src/nsFrameLoader.cpp +++ b/mozilla/content/base/src/nsFrameLoader.cpp @@ -410,8 +410,8 @@ nsFrameLoader::EnsureDocShell() // enclosing chrome shell. chromeEventHandler = do_QueryInterface(mOwnerContent); - NS_WARN_IF_FALSE(chromeEventHandler, - "This mContent should implement this."); + NS_ASSERTION(chromeEventHandler, + "This mContent should implement this."); } else { nsCOMPtr parentShell(do_QueryInterface(parentAsNode)); diff --git a/mozilla/content/base/src/nsPlainTextSerializer.cpp b/mozilla/content/base/src/nsPlainTextSerializer.cpp index c9a559c65cf..fba28425b84 100644 --- a/mozilla/content/base/src/nsPlainTextSerializer.cpp +++ b/mozilla/content/base/src/nsPlainTextSerializer.cpp @@ -1588,7 +1588,7 @@ nsPlainTextSerializer::Write(const nsAString& aString) // This mustn't be mixed with intelligent wrapping without clearing // the mCurrentLine buffer before!!! - NS_WARN_IF_FALSE(mCurrentLine.IsEmpty(), + NS_ASSERTION(mCurrentLine.IsEmpty(), "Mixed wrapping data and nonwrapping data on the same line"); if (!mCurrentLine.IsEmpty()) { FlushLine(); diff --git a/mozilla/content/events/src/nsEventStateManager.cpp b/mozilla/content/events/src/nsEventStateManager.cpp index 6ab480d116b..2091d997491 100644 --- a/mozilla/content/events/src/nsEventStateManager.cpp +++ b/mozilla/content/events/src/nsEventStateManager.cpp @@ -800,7 +800,7 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext, if (!focusedWindow) focusedWindow = win; - NS_WARN_IF_FALSE(focusedWindow,"check why focusedWindow is null!!!"); + NS_ASSERTION(focusedWindow,"check why focusedWindow is null!!!"); // Focus the DOM window. if (focusedWindow) { @@ -1462,7 +1462,7 @@ void nsEventStateManager::GenerateDragGesture(nsPresContext* aPresContext, nsMouseEvent *aEvent) { - NS_WARN_IF_FALSE(aPresContext, "This shouldn't happen."); + NS_ASSERTION(aPresContext, "This shouldn't happen."); if ( IsTrackingDragGesture() ) { mCurrentTarget = aPresContext->GetPresShell()->GetPrimaryFrameFor(mGestureDownFrameOwner); diff --git a/mozilla/content/events/src/nsPrivateTextRange.cpp b/mozilla/content/events/src/nsPrivateTextRange.cpp index 16a7b204ccb..07d2cf636ec 100644 --- a/mozilla/content/events/src/nsPrivateTextRange.cpp +++ b/mozilla/content/events/src/nsPrivateTextRange.cpp @@ -93,7 +93,7 @@ nsPrivateTextRangeList::nsPrivateTextRangeList(PRUint16 aLength, : mLength(aLength), mList(aList) { if(! aList) { - NS_WARN_IF_FALSE(!aLength, "Geez, this deosn't make sense"); + NS_ASSERTION(!aLength, "Geez, this deosn't make sense"); mLength = 0; } diff --git a/mozilla/content/html/content/src/nsHTMLFormElement.cpp b/mozilla/content/html/content/src/nsHTMLFormElement.cpp index 546ffc8e8c6..657c98f03cb 100644 --- a/mozilla/content/html/content/src/nsHTMLFormElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLFormElement.cpp @@ -1863,7 +1863,7 @@ nsFormControlList::NamedItem(const nsAString& aName, if (!*aReturn) { // If not, we check if it's a node list. nsCOMPtr nodeList(do_QueryInterface(supports)); - NS_WARN_IF_FALSE(nodeList, "Huh, what's going one here?"); + NS_ASSERTION(nodeList, "Huh, what's going one here?"); if (nodeList) { // And since we're only asking for one node here, we return the first diff --git a/mozilla/content/html/content/src/nsHTMLImageElement.cpp b/mozilla/content/html/content/src/nsHTMLImageElement.cpp index 0d47022691d..fee39199131 100644 --- a/mozilla/content/html/content/src/nsHTMLImageElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLImageElement.cpp @@ -338,7 +338,7 @@ nsHTMLImageElement::GetWidthHeight() if (imageFrame) { CallQueryInterface(imageFrame, &frame); - NS_WARN_IF_FALSE(frame,"Should not happen - image frame is not frame"); + NS_ASSERTION(frame,"Should not happen - image frame is not frame"); } if (frame) { diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp index a2c7344c90c..b16d5d6dfe7 100644 --- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp @@ -1315,8 +1315,8 @@ SinkContext::CloseContainer(const nsHTMLTag aTag, PRBool aMalformed) "SinkContext::CloseContainer", aTag, mStackPos - 1, mSink); - NS_WARN_IF_FALSE(mStackPos > 0, - "stack out of bounds. wrong context probably!"); + NS_ASSERTION(mStackPos > 0, + "stack out of bounds. wrong context probably!"); if (mStackPos <= 0) { return NS_OK; // Fix crash - Ref. bug 45975 or 45007 @@ -2052,7 +2052,7 @@ HTMLContentSink::Init(nsIDocument* aDoc, service->GetTopicObservers(NS_LITERAL_STRING("text/html"), getter_AddRefs(mObservers)); - NS_WARN_IF_FALSE(mDocShell, "oops no docshell!"); + NS_ASSERTION(mDocShell, "oops no docshell!"); // Find out if subframes are enabled if (mDocShell) { diff --git a/mozilla/content/html/document/src/nsHTMLDocument.cpp b/mozilla/content/html/document/src/nsHTMLDocument.cpp index 1b2e1ea013e..d5339dd8ff7 100644 --- a/mozilla/content/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/content/html/document/src/nsHTMLDocument.cpp @@ -2449,8 +2449,8 @@ nsHTMLDocument::GetElementById(const nsAString& aElementId, return GetElementById(aElementId, aReturn); } - NS_WARN_IF_FALSE(!aElementId.IsEmpty(), - "getElementById(\"\") called, fix caller?"); + NS_ASSERTION(!aElementId.IsEmpty(), + "getElementById(\"\") called, fix caller?"); if (mRootContent && !aElementId.IsEmpty()) { e = nsContentUtils::MatchElementId(mRootContent, idAtom); @@ -3534,7 +3534,7 @@ nsHTMLDocument::CreateAndAddWyciwygChannel(void) channel->SetOriginalURI(wcwgURI); rv = loadGroup->AddRequest(mWyciwygChannel, nsnull); - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Failed to add request to load group."); + NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to add request to load group."); } return rv; diff --git a/mozilla/content/xml/document/src/nsXMLDocument.cpp b/mozilla/content/xml/document/src/nsXMLDocument.cpp index f002e112198..4f20722ec03 100644 --- a/mozilla/content/xml/document/src/nsXMLDocument.cpp +++ b/mozilla/content/xml/document/src/nsXMLDocument.cpp @@ -764,7 +764,7 @@ nsXMLDocument::GetElementById(const nsAString& aElementId, NS_ENSURE_ARG_POINTER(aReturn); *aReturn = nsnull; - NS_WARN_IF_FALSE(!aElementId.IsEmpty(), "getElementById(\"\"), fix caller?"); + NS_ASSERTION(!aElementId.IsEmpty(), "getElementById(\"\"), fix caller?"); if (aElementId.IsEmpty()) return NS_OK; diff --git a/mozilla/content/xul/document/src/nsXULDocument.cpp b/mozilla/content/xul/document/src/nsXULDocument.cpp index e2ebad8dc2c..2a444a391af 100644 --- a/mozilla/content/xul/document/src/nsXULDocument.cpp +++ b/mozilla/content/xul/document/src/nsXULDocument.cpp @@ -1622,7 +1622,7 @@ nsXULDocument::GetElementById(const nsAString& aId, NS_ENSURE_ARG_POINTER(aReturn); *aReturn = nsnull; - NS_WARN_IF_FALSE(!aId.IsEmpty(),"getElementById(\"\"), fix caller?"); + NS_ASSERTION(!aId.IsEmpty(),"getElementById(\"\"), fix caller?"); if (aId.IsEmpty()) return NS_OK; diff --git a/mozilla/docshell/base/nsDSURIContentListener.cpp b/mozilla/docshell/base/nsDSURIContentListener.cpp index cd9fa4bbc79..67d9af474b4 100644 --- a/mozilla/docshell/base/nsDSURIContentListener.cpp +++ b/mozilla/docshell/base/nsDSURIContentListener.cpp @@ -66,7 +66,7 @@ nsDSURIContentListener::Init() { nsresult rv; mNavInfo = do_GetService(NS_WEBNAVIGATION_INFO_CONTRACTID, &rv); - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Failed to get webnav info"); + NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to get webnav info"); return rv; } diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index c55d1030a81..e5ec5743404 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -357,7 +357,7 @@ nsDocShell::DestroyChildren() PRInt32 n = mChildList.Count(); for (PRInt32 i = 0; i < n; i++) { shell = do_QueryInterface(ChildAt(i)); - NS_WARN_IF_FALSE(shell, "docshell has null child"); + NS_ASSERTION(shell, "docshell has null child"); if (shell) { shell->SetTreeOwner(nsnull); diff --git a/mozilla/dom/src/base/nsDOMClassInfo.cpp b/mozilla/dom/src/base/nsDOMClassInfo.cpp index 076f5a9141e..7b55d13b946 100644 --- a/mozilla/dom/src/base/nsDOMClassInfo.cpp +++ b/mozilla/dom/src/base/nsDOMClassInfo.cpp @@ -3845,7 +3845,7 @@ nsWindowSH::PreCreate(nsISupports *nativeObj, JSContext *cx, // after the wrapper is found. nsCOMPtr sgo(do_QueryInterface(nativeObj)); - NS_WARN_IF_FALSE(sgo, "nativeObj not a global object!"); + NS_ASSERTION(sgo, "nativeObj not a global object!"); if (sgo) { *parentObj = sgo->GetGlobalJSObject(); diff --git a/mozilla/dom/src/base/nsDOMWindowList.cpp b/mozilla/dom/src/base/nsDOMWindowList.cpp index 3914218f894..2a5b85d827f 100644 --- a/mozilla/dom/src/base/nsDOMWindowList.cpp +++ b/mozilla/dom/src/base/nsDOMWindowList.cpp @@ -140,8 +140,8 @@ nsDOMWindowList::Item(PRUint32 aIndex, nsIDOMWindow** aReturn) mDocShellNode->GetChildAt(aIndex, getter_AddRefs(item)); nsCOMPtr globalObject(do_GetInterface(item)); - NS_WARN_IF_FALSE(!item || (item && globalObject), - "Couldn't get to the globalObject"); + NS_ASSERTION(!item || (item && globalObject), + "Couldn't get to the globalObject"); if (globalObject) { CallQueryInterface(globalObject, aReturn); diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index 322fdcb2a30..111c8f5129b 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -837,8 +837,8 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument, PRBool aClearScopeHint, PRBool aIsInternalCall) { - NS_WARN_IF_FALSE(mDocumentPrincipal == nsnull, - "mDocumentPrincipal prematurely set!"); + NS_ASSERTION(mDocumentPrincipal == nsnull, + "mDocumentPrincipal prematurely set!"); #ifdef PR_LOGGING if (IsInnerWindow() && aDocument && gDOMLeakPRLog && PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) { @@ -3089,7 +3089,7 @@ nsGlobalWindow::MakeScriptDialogTitle(const nsAString &aInTitle, // right thing for javascript: and data: documents. nsresult rv = NS_OK; - NS_WARN_IF_FALSE(sSecMan, "Global Window has no security manager!"); + NS_ASSERTION(sSecMan, "Global Window has no security manager!"); if (sSecMan) { nsCOMPtr principal; rv = sSecMan->GetSubjectPrincipal(getter_AddRefs(principal)); diff --git a/mozilla/embedding/browser/activex/src/control/HelperAppDlg.cpp b/mozilla/embedding/browser/activex/src/control/HelperAppDlg.cpp index eb3596a37ed..b918509f9cc 100644 --- a/mozilla/embedding/browser/activex/src/control/HelperAppDlg.cpp +++ b/mozilla/embedding/browser/activex/src/control/HelperAppDlg.cpp @@ -189,7 +189,7 @@ AppLauncherDlg::LaunchProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam if (uMsg == WM_INITDIALOG) { pThis = (AppLauncherDlg *) lParam; - NS_WARN_IF_FALSE(pThis, "need a pointer to this!"); + NS_ASSERTION(pThis, "need a pointer to this!"); pThis->mHwndDlg = hwndDlg; SetWindowLong(hwndDlg, DWL_USER, lParam); } @@ -205,7 +205,7 @@ AppLauncherDlg::LaunchProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam case WM_COMMAND: if (HIWORD(wParam) == BN_CLICKED) { - NS_WARN_IF_FALSE(pThis, "Should be non-null!"); + NS_ASSERTION(pThis, "Should be non-null!"); switch (LOWORD(wParam)) { case IDC_CHOOSE: @@ -348,13 +348,13 @@ ProgressDlg::ProgressProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) switch (uMsg) { case WM_INITDIALOG: - NS_WARN_IF_FALSE(pThis, "Should be non-null!"); + NS_ASSERTION(pThis, "Should be non-null!"); pThis->OnInitDialog(); return TRUE; case WM_COMMAND: if (HIWORD(wParam) == BN_CLICKED) { - NS_WARN_IF_FALSE(pThis, "Should be non-null!"); + NS_ASSERTION(pThis, "Should be non-null!"); switch (LOWORD(wParam)) { case IDCANCEL: diff --git a/mozilla/embedding/browser/gtk/src/EmbedPrivate.cpp b/mozilla/embedding/browser/gtk/src/EmbedPrivate.cpp index 1bdda9fba58..5306a85ba42 100644 --- a/mozilla/embedding/browser/gtk/src/EmbedPrivate.cpp +++ b/mozilla/embedding/browser/gtk/src/EmbedPrivate.cpp @@ -567,7 +567,7 @@ EmbedPrivate::PushStartup(void) XRE_NotifyProfile(); rv = RegisterAppComponents(); - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Warning: Failed to register app components.\n"); + NS_ASSERTION(NS_SUCCEEDED(rv), "Warning: Failed to register app components.\n"); // XXX startup appshell service? // XXX create offscreen window for appshell service? diff --git a/mozilla/embedding/browser/powerplant/source/CTextInputEventHandling.cpp b/mozilla/embedding/browser/powerplant/source/CTextInputEventHandling.cpp index d1af408c4ab..87de027623a 100644 --- a/mozilla/embedding/browser/powerplant/source/CTextInputEventHandling.cpp +++ b/mozilla/embedding/browser/powerplant/source/CTextInputEventHandling.cpp @@ -185,13 +185,13 @@ OSStatus CTextInputEventHandler::HandleUpdateActiveInputArea( if (noErr == err) { TextRangeArray* pt = (TextRangeArray*)::malloc(rngSize); - NS_WARN_IF_FALSE( (pt), "Cannot malloc for hiliteRng") ; + NS_ASSERTION( (pt), "Cannot malloc for hiliteRng") ; if (pt) { hiliteRng = pt; err = ::GetEventParameter(inEvent, kEventParamTextInputSendHiliteRng, typeTextRangeArray, NULL, rngSize, &rngSize, hiliteRng); - NS_WARN_IF_FALSE( (noErr == err), "Cannot get hiliteRng") ; + NS_ASSERTION( (noErr == err), "Cannot get hiliteRng") ; } } // printf("call HandleUpdateActiveInputArea textlength = %d ",text.Length()); diff --git a/mozilla/embedding/browser/qt/src/qgeckoglobals.cpp b/mozilla/embedding/browser/qt/src/qgeckoglobals.cpp index 0fa81b2d62a..c24f46c7be9 100644 --- a/mozilla/embedding/browser/qt/src/qgeckoglobals.cpp +++ b/mozilla/embedding/browser/qt/src/qgeckoglobals.cpp @@ -122,10 +122,10 @@ QGeckoGlobals::pushStartup() } rv = startupProfile(); - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Warning: Failed to start up profiles.\n"); + NS_ASSERTION(NS_SUCCEEDED(rv), "Warning: Failed to start up profiles.\n"); rv = registerAppComponents(); - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Warning: Failed to register app components.\n"); + NS_ASSERTION(NS_SUCCEEDED(rv), "Warning: Failed to register app components.\n"); // XXX startup appshell service? diff --git a/mozilla/extensions/python/xpcom/src/PyGBase.cpp b/mozilla/extensions/python/xpcom/src/PyGBase.cpp index 626f1491731..65c085e8c34 100644 --- a/mozilla/extensions/python/xpcom/src/PyGBase.cpp +++ b/mozilla/extensions/python/xpcom/src/PyGBase.cpp @@ -264,7 +264,7 @@ PyG_Base::MakeInterfaceParam(nsISupports *pis, // But if it ever triggers, the poor Python code has no real hope // of returning something useful, so we should at least do our // best to provide the useful data. - NS_WARN_IF_FALSE( ((piid != NULL) ^ (d != NULL)) == 1, "No information on the interface available - Python's gunna have a hard time doing much with it!"); + NS_ASSERTION( ((piid != NULL) ^ (d != NULL)) == 1, "No information on the interface available - Python's gunna have a hard time doing much with it!"); PyObject *obIID = NULL; PyObject *obISupports = NULL; PyObject *obParamDesc = NULL; @@ -306,7 +306,7 @@ PyG_Base::MakeInterfaceParam(nsISupports *pis, paramIndex); done: if (PyErr_Occurred()) { - NS_WARN_IF_FALSE(result==NULL, "Have an error, but also a result!"); + NS_ASSERTION(result==NULL, "Have an error, but also a result!"); PyXPCOM_LogError("Wrapping an interface object for the gateway failed\n"); } Py_XDECREF(obIID); @@ -389,7 +389,7 @@ PyG_Base::QueryInterface(REFNSIID iid, void** ppv) Py_DECREF(result); } else { NS_ABORT_IF_FALSE(PyErr_Occurred(), "Got NULL result, but no Python error flagged!"); - NS_WARN_IF_FALSE(!supports, "Have failure with success flag set!"); + NS_ASSERTION(!supports, "Have failure with success flag set!"); PyXPCOM_LogError("The _QueryInterface_ processing failed.\n"); // supports remains false. // We have reported the error, and are returning to COM, diff --git a/mozilla/extensions/python/xpcom/src/VariantUtils.cpp b/mozilla/extensions/python/xpcom/src/VariantUtils.cpp index 345b2a1d010..7b7dd3e8f3b 100644 --- a/mozilla/extensions/python/xpcom/src/VariantUtils.cpp +++ b/mozilla/extensions/python/xpcom/src/VariantUtils.cpp @@ -1188,7 +1188,7 @@ PRBool PyXPCOM_InterfaceVariantHelper::FillInVariant(const PythonTypeDescriptor NS_ABORT_IF_FALSE(!td.is_auto_in, "Param is 'auto-in', but we are filling it normally!"); PyObject *val_use = NULL; // a temp object converters can use, and will be DECREF'd PyObject *val = PySequence_GetItem(m_pyparams, param_index); - NS_WARN_IF_FALSE(val, "Have an 'in' param, but no Python value!"); + NS_ASSERTION(val, "Have an 'in' param, but no Python value!"); if (val==NULL) { PyErr_Format(PyExc_ValueError, "Param %d is marked as 'in', but no value was given", value_index); return PR_FALSE; @@ -1397,7 +1397,7 @@ PRBool PyXPCOM_InterfaceVariantHelper::FillInVariant(const PythonTypeDescriptor case nsXPTType::T_INTERFACE_IS: { nsIID iid; nsXPTCVariant &ns_viid = m_var_array[td.argnum]; - NS_WARN_IF_FALSE(XPT_TDP_TAG(ns_viid.type)==nsXPTType::T_IID, "The INTERFACE_IS iid describer isn't an IID!"); + NS_ASSERTION(XPT_TDP_TAG(ns_viid.type)==nsXPTType::T_IID, "The INTERFACE_IS iid describer isn't an IID!"); // This is a pretty serious problem, but not Python's fault! // Just return an nsISupports and hope the caller does whatever // QI they need before using it. @@ -1718,7 +1718,7 @@ PyObject *PyXPCOM_InterfaceVariantHelper::MakeSinglePythonResult(int index) case nsXPTType::T_INTERFACE_IS: { nsIID iid; nsXPTCVariant &ns_viid = m_var_array[td.argnum]; - NS_WARN_IF_FALSE(XPT_TDP_TAG(ns_viid.type)==nsXPTType::T_IID, "The INTERFACE_IS iid describer isn't an IID!"); + NS_ASSERTION(XPT_TDP_TAG(ns_viid.type)==nsXPTType::T_IID, "The INTERFACE_IS iid describer isn't an IID!"); if (XPT_TDP_TAG(ns_viid.type)==nsXPTType::T_IID) { nsIID *piid = (nsIID *)ns_viid.val.p; if (piid==NULL) @@ -2173,7 +2173,7 @@ PRBool PyXPCOM_GatewayVariantHelper::GetIIDForINTERFACE_ID(int index, const nsII // in or out, so we will allow it. nsXPTParamInfo *pi = (nsXPTParamInfo *)m_info->params+index; nsXPTType typ = pi->GetType(); - NS_WARN_IF_FALSE(XPT_TDP_TAG(typ) == nsXPTType::T_IID, "INTERFACE_IS IID param isn't an IID!"); + NS_ASSERTION(XPT_TDP_TAG(typ) == nsXPTType::T_IID, "INTERFACE_IS IID param isn't an IID!"); NS_ABORT_IF_FALSE(typ.IsPointer(), "Expecting to re-fill a pointer value."); if (XPT_TDP_TAG(typ) != nsXPTType::T_IID) *ppret = &NS_GET_IID(nsISupports); diff --git a/mozilla/extensions/python/xpcom/src/dllmain.cpp b/mozilla/extensions/python/xpcom/src/dllmain.cpp index 17bf3d34966..94c8866775d 100644 --- a/mozilla/extensions/python/xpcom/src/dllmain.cpp +++ b/mozilla/extensions/python/xpcom/src/dllmain.cpp @@ -234,7 +234,7 @@ void pyxpcom_construct(void) #ifndef PYXPCOM_USE_PYGILSTATE PRStatus status; status = PR_NewThreadPrivateIndex( &tlsIndex, NULL ); - NS_WARN_IF_FALSE(status==0, "Could not allocate TLS storage"); + NS_ASSERTION(status==0, "Could not allocate TLS storage"); if (NS_FAILED(status)) { PR_DestroyLock(g_lockMain); return; // PR_FALSE; diff --git a/mozilla/extensions/python/xpcom/src/module/_xpcom.cpp b/mozilla/extensions/python/xpcom/src/module/_xpcom.cpp index d03fe424efc..e395feacf72 100644 --- a/mozilla/extensions/python/xpcom/src/module/_xpcom.cpp +++ b/mozilla/extensions/python/xpcom/src/module/_xpcom.cpp @@ -148,7 +148,7 @@ PyXPCOMMethod_XPTC_InvokeByIndex(PyObject *self, PyObject *args) // We no longer rely on PyErr_Occurred() for our error state, // but keeping this assertion can't hurt - it should still always be true! - NS_WARN_IF_FALSE(!PyErr_Occurred(), "Should be no pending Python error!"); + NS_ASSERTION(!PyErr_Occurred(), "Should be no pending Python error!"); if (!PyArg_ParseTuple(args, "OiO", &obIS, &index, &obParams)) return NULL; diff --git a/mozilla/extensions/webdav/src/nsWebDAVService.cpp b/mozilla/extensions/webdav/src/nsWebDAVService.cpp index d56b3073c9f..976b1b22bec 100644 --- a/mozilla/extensions/webdav/src/nsWebDAVService.cpp +++ b/mozilla/extensions/webdav/src/nsWebDAVService.cpp @@ -274,9 +274,9 @@ nsWebDAVService::ChannelFromResource(nsIWebDAVResource *aResource, if (NS_SUCCEEDED(rv)) { rv = baseChannel->SetLoadFlags(loadFlags | nsIRequest::VALIDATE_ALWAYS); - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), - "nsWebDavService::ChannelFromResource(): " - "Couldn't set loadflags on channel"); + NS_ASSERTION(NS_SUCCEEDED(rv), + "nsWebDavService::ChannelFromResource(): " + "Couldn't set loadflags on channel"); } rv = CallQueryInterface(baseChannel, aChannel); diff --git a/mozilla/extensions/xforms/nsXFormsUtils.cpp b/mozilla/extensions/xforms/nsXFormsUtils.cpp index 6f4095a999e..ea346817921 100644 --- a/mozilla/extensions/xforms/nsXFormsUtils.cpp +++ b/mozilla/extensions/xforms/nsXFormsUtils.cpp @@ -986,7 +986,7 @@ nsXFormsUtils::EventHandlingAllowed(nsIDOMEvent* aEvent, nsIDOMNode* aTarget) } } } - NS_WARN_IF_FALSE(allow, "Event handling not allowed!"); + NS_ASSERTION(allow, "Event handling not allowed!"); return allow; } diff --git a/mozilla/gfx/src/psshared/nsPaperPS.h b/mozilla/gfx/src/psshared/nsPaperPS.h index 088a25d8783..d84754fcb5b 100644 --- a/mozilla/gfx/src/psshared/nsPaperPS.h +++ b/mozilla/gfx/src/psshared/nsPaperPS.h @@ -74,7 +74,7 @@ class NS_PSSHARED nsPaperSizePS { * @return VOID */ void Next() { - NS_WARN_IF_FALSE(!AtEnd(), "Invalid current item"); + NS_ASSERTION(!AtEnd(), "Invalid current item"); mCurrent++; } diff --git a/mozilla/js/src/xpconnect/src/nsXPConnect.cpp b/mozilla/js/src/xpconnect/src/nsXPConnect.cpp index 0ccbbebb66b..01afe8d1942 100644 --- a/mozilla/js/src/xpconnect/src/nsXPConnect.cpp +++ b/mozilla/js/src/xpconnect/src/nsXPConnect.cpp @@ -1054,8 +1054,8 @@ nsXPConnect::RestoreWrappedNativePrototype(JSContext * aJSContext, // This code should do the right thing even if we're // restoring the current proto, but warn in that case // since doing that is pointless. - NS_WARN_IF_FALSE(proto != oldProto, - "Restoring current prototype, fix caller!"); + NS_ASSERTION(proto != oldProto, + "Restoring current prototype, fix caller!"); } map->Add(aClassInfo, proto); diff --git a/mozilla/js/src/xpconnect/src/xpcprivate.h b/mozilla/js/src/xpconnect/src/xpcprivate.h index ac40a465fd3..2d7d4376e9f 100644 --- a/mozilla/js/src/xpconnect/src/xpcprivate.h +++ b/mozilla/js/src/xpconnect/src/xpcprivate.h @@ -763,7 +763,7 @@ public: nsIXPCSecurityManager* GetAppropriateSecurityManager(PRUint16 flags) const { - NS_WARN_IF_FALSE(CallerTypeIsKnown(),"missing caller type set somewhere"); + NS_ASSERTION(CallerTypeIsKnown(),"missing caller type set somewhere"); if(!CallerTypeIsJavaScript()) return nsnull; if(mSecurityManager) diff --git a/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp b/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp index c2ddcf1f1e0..9f4d2ae038e 100644 --- a/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp +++ b/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp @@ -1496,7 +1496,7 @@ XPCWrappedNative::InitTearOff(XPCCallContext& ccx, proto = JS_GetPrototype(ccx, jso); - NS_WARN_IF_FALSE(proto && proto != our_proto, + NS_ASSERTION(proto && proto != our_proto, "!!! xpconnect/xbl check - wrapper has no special proto"); PRBool found_our_proto = PR_FALSE; @@ -1506,7 +1506,7 @@ XPCWrappedNative::InitTearOff(XPCCallContext& ccx, found_our_proto = proto == our_proto; } - NS_WARN_IF_FALSE(found_our_proto, + NS_ASSERTION(found_our_proto, "!!! xpconnect/xbl check - wrapper has extra proto"); } else diff --git a/mozilla/layout/base/nsDocumentViewer.cpp b/mozilla/layout/base/nsDocumentViewer.cpp index 6b68d88679e..13ebfc98b20 100644 --- a/mozilla/layout/base/nsDocumentViewer.cpp +++ b/mozilla/layout/base/nsDocumentViewer.cpp @@ -756,7 +756,7 @@ DocumentViewerImpl::InitPresentationStuff(PRBool aDoInitialReflow) // get the DOM event receiver nsCOMPtr erP(do_QueryInterface(mDocument)); - NS_WARN_IF_FALSE(erP, "No event receiver in document!"); + NS_ASSERTION(erP, "No event receiver in document!"); if (erP) { rv = erP->AddEventListenerByIID(mFocusListener, @@ -1298,7 +1298,7 @@ DocumentViewerImpl::Open(nsISupports *aState, nsISHEntry *aSHEntry) if (mFocusListener) { // get the DOM event receiver nsCOMPtr erP(do_QueryInterface(mDocument)); - NS_WARN_IF_FALSE(erP, "No event receiver in document!"); + NS_ASSERTION(erP, "No event receiver in document!"); if (erP) { erP->AddEventListenerByIID(mFocusListener, @@ -1360,7 +1360,7 @@ DocumentViewerImpl::Close(nsISHEntry *aSHEntry) if (mFocusListener) { // get the DOM event receiver nsCOMPtr erP(do_QueryInterface(mDocument)); - NS_WARN_IF_FALSE(erP, "No event receiver in document!"); + NS_ASSERTION(erP, "No event receiver in document!"); if (erP) { erP->RemoveEventListenerByIID(mFocusListener, @@ -1687,7 +1687,7 @@ DocumentViewerImpl::SetDOMDocument(nsIDOMDocument *aDocument) // Register the focus listener on the new document nsCOMPtr erP = do_QueryInterface(mDocument, &rv); - NS_WARN_IF_FALSE(erP, "No event receiver in document!"); + NS_ASSERTION(erP, "No event receiver in document!"); if (erP) { rv = erP->AddEventListenerByIID(mFocusListener, diff --git a/mozilla/layout/generic/nsTextFrame.cpp b/mozilla/layout/generic/nsTextFrame.cpp index ef950ab91b0..5a6107d39c2 100644 --- a/mozilla/layout/generic/nsTextFrame.cpp +++ b/mozilla/layout/generic/nsTextFrame.cpp @@ -5315,7 +5315,7 @@ nsTextFrame::MeasureText(nsPresContext* aPresContext, if (isWhitespace) { if ('\n' == firstChar) { // We hit a newline. Stop looping. - NS_WARN_IF_FALSE(aTs.mPreformatted, "newline w/o ts.mPreformatted"); + NS_ASSERTION(aTs.mPreformatted, "newline w/o ts.mPreformatted"); prevOffset = aTextData.mOffset; aTextData.mOffset++; endsInWhitespace = PR_TRUE; diff --git a/mozilla/layout/tables/BasicTableLayoutStrategy.cpp b/mozilla/layout/tables/BasicTableLayoutStrategy.cpp index facac6fb48a..c8c33e10840 100644 --- a/mozilla/layout/tables/BasicTableLayoutStrategy.cpp +++ b/mozilla/layout/tables/BasicTableLayoutStrategy.cpp @@ -320,7 +320,7 @@ BasicTableLayoutStrategy::BalanceColumnWidths(const nsHTMLReflowState& aReflowSt if (totalCounts[PCT] > 0) { if (totalAllocated + totalWidths[PCT] - dupedWidths[PCT] <= maxWidth) { AllocateFully(totalAllocated, allocTypes, PCT); - //NS_WARN_IF_FALSE(totalAllocated <= maxWidth, "over allocated"); + //NS_ASSERTION(totalAllocated <= maxWidth, "over allocated"); } else { AllocateConstrained(maxWidth - totalAllocated, PCT, PR_FALSE, allocTypes, p2t); @@ -331,7 +331,7 @@ BasicTableLayoutStrategy::BalanceColumnWidths(const nsHTMLReflowState& aReflowSt if ((totalAllocated < maxWidth) && (totalCounts[FIX] > 0)) { if (totalAllocated + totalWidths[FIX] - dupedWidths[FIX] <= maxWidth) { AllocateFully(totalAllocated, allocTypes, FIX); - //NS_WARN_IF_FALSE(totalAllocated <= maxWidth, "over allocated"); + //NS_ASSERTION(totalAllocated <= maxWidth, "over allocated"); } else { AllocateConstrained(maxWidth - totalAllocated, FIX, PR_TRUE, allocTypes, p2t); @@ -342,7 +342,7 @@ BasicTableLayoutStrategy::BalanceColumnWidths(const nsHTMLReflowState& aReflowSt if ((totalAllocated < maxWidth) && (totalCounts[FIX_ADJ] > 0)) { if (totalAllocated + totalWidths[FIX_ADJ] - dupedWidths[FIX_ADJ] <= maxWidth) { AllocateFully(totalAllocated, allocTypes, FIX_ADJ); - //NS_WARN_IF_FALSE(totalAllocated <= maxWidth, "over allocated"); + //NS_ASSERTION(totalAllocated <= maxWidth, "over allocated"); } else { AllocateConstrained(maxWidth - totalAllocated, FIX_ADJ, PR_TRUE, allocTypes, p2t); @@ -355,7 +355,7 @@ BasicTableLayoutStrategy::BalanceColumnWidths(const nsHTMLReflowState& aReflowSt if (totalAllocated + totalWidths[MIN_PRO] - dupedWidths[MIN_PRO] + totalWidths[DES_CON] - dupedWidths[DES_CON] <= maxWidth) { AllocateFully(totalAllocated, allocTypes, DES_CON); - //NS_WARN_IF_FALSE(totalAllocated <= maxWidth, "over allocated"); + //NS_ASSERTION(totalAllocated <= maxWidth, "over allocated"); } else { AllocateConstrained(maxWidth - totalAllocated, DES_CON, PR_TRUE, allocTypes, p2t); diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.cpp b/mozilla/layout/tables/nsTableRowGroupFrame.cpp index 1705358c562..b37289c0d47 100644 --- a/mozilla/layout/tables/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableRowGroupFrame.cpp @@ -1061,8 +1061,8 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext, if ((rowMetrics.height <= rowReflowState.availableHeight) || isTopOfPage) { // The row stays on this page because either it split ok or we're on the top of page. // If top of page and the height exceeded the avail height, then there will be data loss - NS_WARN_IF_FALSE(rowMetrics.height <= rowReflowState.availableHeight, - "data loss - incomplete row needed more height than available, on top of page"); + NS_ASSERTION(rowMetrics.height <= rowReflowState.availableHeight, + "data loss - incomplete row needed more height than available, on top of page"); CreateContinuingRowFrame(*aPresContext, *rowFrame, (nsIFrame**)&contRow); if (contRow) { aDesiredSize.height += rowMetrics.height; diff --git a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp index 8727639a33f..af88e2d9c0d 100644 --- a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp @@ -483,7 +483,7 @@ nsMenuPopupFrame::AdjustClientXYForNestedDocuments ( nsIDOMXULDocument* inPopupD if ( rootView ) popupDocumentWidget = rootView->GetNearestWidget(nsnull); } - NS_WARN_IF_FALSE(popupDocumentWidget, "ACK, BAD WIDGET"); + NS_ASSERTION(popupDocumentWidget, "ACK, BAD WIDGET"); // Find the widget associated with the target's document. // For tooltips, we check the document's tooltipNode (which is set by @@ -496,7 +496,7 @@ nsMenuPopupFrame::AdjustClientXYForNestedDocuments ( nsIDOMXULDocument* inPopupD else inPopupDoc->TrustedGetPopupNode(getter_AddRefs(targetNode)); - //NS_WARN_IF_FALSE(targetNode, "no popup/tooltip node on document!"); + //NS_ASSERTION(targetNode, "no popup/tooltip node on document!"); nsCOMPtr targetAsContent ( do_QueryInterface(targetNode) ); nsIWidget* targetDocumentWidget = nsnull; if ( targetAsContent ) { @@ -529,7 +529,7 @@ nsMenuPopupFrame::AdjustClientXYForNestedDocuments ( nsIDOMXULDocument* inPopupD } } } - //NS_WARN_IF_FALSE(targetDocumentWidget, "ACK, BAD TARGET"); + //NS_ASSERTION(targetDocumentWidget, "ACK, BAD TARGET"); // the offset we need is the difference between the upper left corner of the two widgets. Use // screen coordinates to find the global offset between them. diff --git a/mozilla/mailnews/mime/src/nsSimpleMimeConverterStub.cpp b/mozilla/mailnews/mime/src/nsSimpleMimeConverterStub.cpp index 50264c7cc74..b72e69bc29b 100644 --- a/mozilla/mailnews/mime/src/nsSimpleMimeConverterStub.cpp +++ b/mozilla/mailnews/mime/src/nsSimpleMimeConverterStub.cpp @@ -119,7 +119,7 @@ EndGather(MimeObject *obj, PRBool abort_p) *ssobj->buffer, asHTML); if (NS_FAILED(rv)) { - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "converter failure"); + NS_ASSERTION(NS_SUCCEEDED(rv), "converter failure"); return -1; } diff --git a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp index 7dbe5c43871..b1dce0a8ded 100644 --- a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp +++ b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -5157,7 +5157,7 @@ nsresult nsPluginHostImpl::FindPlugins(PRBool aCreatePluginList, PRBool * aPlugi // Failure here is not a show-stopper so just warn. rv = EnsurePrivateDirServiceProvider(); - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Failed to register dir service provider."); + NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to register dir service provider."); nsCOMPtr dirService(do_GetService(kDirectoryServiceContractID, &rv)); if (NS_FAILED(rv)) diff --git a/mozilla/parser/htmlparser/src/nsDTDUtils.cpp b/mozilla/parser/htmlparser/src/nsDTDUtils.cpp index 31f2abfcf93..f7106d4c6af 100644 --- a/mozilla/parser/htmlparser/src/nsDTDUtils.cpp +++ b/mozilla/parser/htmlparser/src/nsDTDUtils.cpp @@ -104,10 +104,10 @@ nsEntryStack::~nsEntryStack() { void nsEntryStack::ReleaseAll(nsNodeAllocator* aNodeAllocator) { - NS_WARN_IF_FALSE(aNodeAllocator,"no allocator? - potential leak!"); + NS_ASSERTION(aNodeAllocator,"no allocator? - potential leak!"); if(aNodeAllocator) { - NS_WARN_IF_FALSE(mCount >= 0,"count should not be negative"); + NS_ASSERTION(mCount >= 0,"count should not be negative"); while(mCount > 0) { nsCParserNode* node=this->Pop(); IF_FREE(node,aNodeAllocator); diff --git a/mozilla/parser/htmlparser/src/nsExpatDriver.cpp b/mozilla/parser/htmlparser/src/nsExpatDriver.cpp index 7f95d8d8395..ee22913ff1c 100644 --- a/mozilla/parser/htmlparser/src/nsExpatDriver.cpp +++ b/mozilla/parser/htmlparser/src/nsExpatDriver.cpp @@ -842,7 +842,7 @@ nsresult nsExpatDriver::HandleError() { PRInt32 code = XML_GetErrorCode(mExpatParser); - NS_WARN_IF_FALSE(code > XML_ERROR_NONE, "unexpected XML error code"); + NS_ASSERTION(code > XML_ERROR_NONE, "unexpected XML error code"); // Map Expat error code to an error string // XXX Deal with error returns. diff --git a/mozilla/widget/src/mac/nsMimeMapper.cpp b/mozilla/widget/src/mac/nsMimeMapper.cpp index 404b4dce834..c1f213251fb 100644 --- a/mozilla/widget/src/mac/nsMimeMapper.cpp +++ b/mozilla/widget/src/mac/nsMimeMapper.cpp @@ -240,7 +240,7 @@ nsMimeMapperMac::ParseMappings ( const char* inMappings ) char* nsMimeMapperMac::ExportMapping ( short * outLength ) const { - NS_WARN_IF_FALSE ( outLength, "No out param provided" ); + NS_ASSERTION ( outLength, "No out param provided" ); if ( outLength ) *outLength = 0; diff --git a/mozilla/widget/src/mac/nsWindow.cpp b/mozilla/widget/src/mac/nsWindow.cpp index 98121d795b8..be5ff3e6fda 100644 --- a/mozilla/widget/src/mac/nsWindow.cpp +++ b/mozilla/widget/src/mac/nsWindow.cpp @@ -2398,11 +2398,11 @@ NS_IMETHODIMP nsWindow::ResetInputState() // currently, the nsMacEventHandler is owned by nsMacWindow, which is the top level window // we delegate this call to its parent nsIWidget* parent = GetParent(); - NS_WARN_IF_FALSE(parent, "cannot get parent"); + NS_ASSERTION(parent, "cannot get parent"); if (parent) { nsCOMPtr kb = do_QueryInterface(parent); - NS_WARN_IF_FALSE(kb, "cannot get parent"); + NS_ASSERTION(kb, "cannot get parent"); if (kb) { return kb->ResetInputState(); } diff --git a/mozilla/xpcom/base/nsExceptionService.cpp b/mozilla/xpcom/base/nsExceptionService.cpp index 41a82e89ed6..14c77ba94e4 100644 --- a/mozilla/xpcom/base/nsExceptionService.cpp +++ b/mozilla/xpcom/base/nsExceptionService.cpp @@ -163,14 +163,14 @@ nsExceptionService::nsExceptionService() if (tlsIndex == BAD_TLS_INDEX) { PRStatus status; status = PR_NewThreadPrivateIndex( &tlsIndex, ThreadDestruct ); - NS_WARN_IF_FALSE(status==0, "ScriptErrorService could not allocate TLS storage."); + NS_ASSERTION(status==0, "ScriptErrorService could not allocate TLS storage."); } lock = PR_NewLock(); - NS_WARN_IF_FALSE(lock, "Error allocating ExceptionService lock"); + NS_ASSERTION(lock, "Error allocating ExceptionService lock"); // observe XPCOM shutdown. nsCOMPtr observerService = do_GetService("@mozilla.org/observer-service;1"); - NS_WARN_IF_FALSE(observerService, "Could not get observer service!"); + NS_ASSERTION(observerService, "Could not get observer service!"); if (observerService) observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, PR_FALSE); } diff --git a/mozilla/xpcom/base/nsTraceRefcntImpl.cpp b/mozilla/xpcom/base/nsTraceRefcntImpl.cpp index 98054138b7c..4dd7b437e6e 100644 --- a/mozilla/xpcom/base/nsTraceRefcntImpl.cpp +++ b/mozilla/xpcom/base/nsTraceRefcntImpl.cpp @@ -145,7 +145,7 @@ struct nsTraceRefcntStats { // I hope to turn this on for everybody once we hit it a little less. #define ASSERT_ACTIVITY_IS_LEGAL \ - NS_WARN_IF_FALSE(gActivityTLS != BAD_TLS_INDEX && \ + NS_ASSERTION(gActivityTLS != BAD_TLS_INDEX && \ NS_PTR_TO_INT32(PR_GetThreadPrivate(gActivityTLS)) == 0, \ "XPCOM objects created/destroyed from static ctor/dtor"); diff --git a/mozilla/xpcom/build/nsOS2VACLegacy.cpp b/mozilla/xpcom/build/nsOS2VACLegacy.cpp index 164ea3acc10..e899a0f47f1 100644 --- a/mozilla/xpcom/build/nsOS2VACLegacy.cpp +++ b/mozilla/xpcom/build/nsOS2VACLegacy.cpp @@ -539,7 +539,7 @@ __cl__16nsQueryInterfaceCFRC4nsIDPPv proc mov [ebp-04h],eax; status ; 48 #ifdef NSCAP_FEATURE_TEST_NONNULL_QUERY_SUCCEEDS -; 49 NS_WARN_IF_FALSE(NS_SUCCEEDED(status), "interface not found---were you expecting that?"); +; 49 NS_ASSERTION(NS_SUCCEEDED(status), "interface not found---were you expecting that?"); ; 50 #endif ; 51 } jmp @BLBL2 @@ -583,7 +583,7 @@ nsQueryInterface::operator()( const nsIID& aIID, void** answer ) const { status = mRawPtr->QueryInterface(aIID, answer); #ifdef NSCAP_FEATURE_TEST_NONNULL_QUERY_SUCCEEDS - NS_WARN_IF_FALSE(NS_SUCCEEDED(status), "interface not found---were you expecting that?"); + NS_ASSERTION(NS_SUCCEEDED(status), "interface not found---were you expecting that?"); #endif } else diff --git a/mozilla/xpcom/build/nsXPComInit.cpp b/mozilla/xpcom/build/nsXPComInit.cpp index febf92180d6..6ff5789f499 100644 --- a/mozilla/xpcom/build/nsXPComInit.cpp +++ b/mozilla/xpcom/build/nsXPComInit.cpp @@ -800,7 +800,7 @@ NS_ShutdownXPCOM(nsIServiceManager* servMgr) if (nsComponentManagerImpl::gComponentManager) { nsrefcnt cnt; NS_RELEASE2(nsComponentManagerImpl::gComponentManager, cnt); - NS_WARN_IF_FALSE(cnt == 0, "Component Manager being held past XPCOM shutdown."); + NS_ASSERTION(cnt == 0, "Component Manager being held past XPCOM shutdown."); } nsComponentManagerImpl::gComponentManager = nsnull; diff --git a/mozilla/xpcom/ds/nsTimelineService.cpp b/mozilla/xpcom/ds/nsTimelineService.cpp index 31ccf95379e..beea191fac6 100644 --- a/mozilla/xpcom/ds/nsTimelineService.cpp +++ b/mozilla/xpcom/ds/nsTimelineService.cpp @@ -192,7 +192,7 @@ static TimelineThreadData *GetThisThreadData() if (new_data->timers==NULL) goto done; new_data->initTime = PR_Now(); - NS_WARN_IF_FALSE(!gTimelineDisabled, + NS_ASSERTION(!gTimelineDisabled, "Why are we creating new state when disabled?"); new_data->disabled = PR_FALSE; data = new_data; @@ -202,7 +202,7 @@ static TimelineThreadData *GetThisThreadData() done: if (new_data) // eeek - error during creation! delete new_data; - NS_WARN_IF_FALSE(data, "TimelineService could not get thread-local data"); + NS_ASSERTION(data, "TimelineService could not get thread-local data"); return data; } @@ -232,7 +232,7 @@ PRStatus TimelineInit(void) PRInt64 tmp1, tmp2; PRStatus status = PR_NewThreadPrivateIndex( &gTLSIndex, ThreadDestruct ); - NS_WARN_IF_FALSE(status==0, "TimelineService could not allocate TLS storage."); + NS_ASSERTION(status==0, "TimelineService could not allocate TLS storage."); timeStr = PR_GetEnv("NS_TIMELINE_INIT_TIME"); // NS_TIMELINE_INIT_TIME only makes sense for the main thread, so if it diff --git a/mozilla/xpcom/glue/nsBaseHashtable.h b/mozilla/xpcom/glue/nsBaseHashtable.h index 595b3669e65..d876d0ce0f8 100644 --- a/mozilla/xpcom/glue/nsBaseHashtable.h +++ b/mozilla/xpcom/glue/nsBaseHashtable.h @@ -366,7 +366,7 @@ nsBaseHashtableMT::Init(PRUint32 initSize) return PR_FALSE; this->mLock = PR_NewLock(); - NS_WARN_IF_FALSE(this->mLock, "Error creating lock during nsBaseHashtableL::Init()"); + NS_ASSERTION(this->mLock, "Error creating lock during nsBaseHashtableL::Init()"); return (this->mLock != nsnull); } diff --git a/mozilla/xpcom/glue/nsCOMPtr.cpp b/mozilla/xpcom/glue/nsCOMPtr.cpp index 53c055eb805..d02afc717ba 100644 --- a/mozilla/xpcom/glue/nsCOMPtr.cpp +++ b/mozilla/xpcom/glue/nsCOMPtr.cpp @@ -46,7 +46,7 @@ nsQueryInterface::operator()( const nsIID& aIID, void** answer ) const { status = mRawPtr->QueryInterface(aIID, answer); #ifdef NSCAP_FEATURE_TEST_NONNULL_QUERY_SUCCEEDS - NS_WARN_IF_FALSE(NS_SUCCEEDED(status), "interface not found---were you expecting that?"); + NS_ASSERTION(NS_SUCCEEDED(status), "interface not found---were you expecting that?"); #endif } else @@ -63,7 +63,7 @@ nsQueryInterfaceWithError::operator()( const nsIID& aIID, void** answer ) const { status = mRawPtr->QueryInterface(aIID, answer); #ifdef NSCAP_FEATURE_TEST_NONNULL_QUERY_SUCCEEDS - NS_WARN_IF_FALSE(NS_SUCCEEDED(status), "interface not found---were you expecting that?"); + NS_ASSERTION(NS_SUCCEEDED(status), "interface not found---were you expecting that?"); #endif } else diff --git a/mozilla/xpcom/obsolete/nsFileSpec.cpp b/mozilla/xpcom/obsolete/nsFileSpec.cpp index d1aec072df3..37ac0cbeddc 100644 --- a/mozilla/xpcom/obsolete/nsFileSpec.cpp +++ b/mozilla/xpcom/obsolete/nsFileSpec.cpp @@ -929,7 +929,7 @@ void nsFileSpec::MakeUnique(PRBool inCreateFile) localFile->GetNativePath(path); } - NS_WARN_IF_FALSE(!path.IsEmpty(), "MakeUnique() failed!"); + NS_ASSERTION(!path.IsEmpty(), "MakeUnique() failed!"); *this = path.get(); // reset the filepath to point to the unique location } // nsFileSpec::MakeUnique diff --git a/mozilla/xpcom/stub/nsOS2VACLegacy.cpp b/mozilla/xpcom/stub/nsOS2VACLegacy.cpp index 164ea3acc10..e899a0f47f1 100644 --- a/mozilla/xpcom/stub/nsOS2VACLegacy.cpp +++ b/mozilla/xpcom/stub/nsOS2VACLegacy.cpp @@ -539,7 +539,7 @@ __cl__16nsQueryInterfaceCFRC4nsIDPPv proc mov [ebp-04h],eax; status ; 48 #ifdef NSCAP_FEATURE_TEST_NONNULL_QUERY_SUCCEEDS -; 49 NS_WARN_IF_FALSE(NS_SUCCEEDED(status), "interface not found---were you expecting that?"); +; 49 NS_ASSERTION(NS_SUCCEEDED(status), "interface not found---were you expecting that?"); ; 50 #endif ; 51 } jmp @BLBL2 @@ -583,7 +583,7 @@ nsQueryInterface::operator()( const nsIID& aIID, void** answer ) const { status = mRawPtr->QueryInterface(aIID, answer); #ifdef NSCAP_FEATURE_TEST_NONNULL_QUERY_SUCCEEDS - NS_WARN_IF_FALSE(NS_SUCCEEDED(status), "interface not found---were you expecting that?"); + NS_ASSERTION(NS_SUCCEEDED(status), "interface not found---were you expecting that?"); #endif } else diff --git a/mozilla/xpfe/appshell/src/nsXULWindow.cpp b/mozilla/xpfe/appshell/src/nsXULWindow.cpp index c7a9fefdb76..dc5cd525b27 100644 --- a/mozilla/xpfe/appshell/src/nsXULWindow.cpp +++ b/mozilla/xpfe/appshell/src/nsXULWindow.cpp @@ -778,7 +778,7 @@ NS_IMETHODIMP nsXULWindow::SetVisibility(PRBool aVisibility) // notify observers so that we can hide the splash screen if possible nsCOMPtr obssvc (do_GetService("@mozilla.org/observer-service;1")); - NS_WARN_IF_FALSE(obssvc, "Couldn't get observer service."); + NS_ASSERTION(obssvc, "Couldn't get observer service."); if (obssvc) { obssvc->NotifyObservers(nsnull, "xul-window-visible", nsnull); } diff --git a/mozilla/xpfe/bootstrap/appleevents/nsAEApplicationClass.cpp b/mozilla/xpfe/bootstrap/appleevents/nsAEApplicationClass.cpp index 55b49c9d66b..8649642573d 100644 --- a/mozilla/xpfe/bootstrap/appleevents/nsAEApplicationClass.cpp +++ b/mozilla/xpfe/bootstrap/appleevents/nsAEApplicationClass.cpp @@ -338,11 +338,11 @@ void AEApplicationClass::HandleReOpen(AEDesc *token, const AppleEvent *appleEven if (!nas) ThrowIfOSErr(errAEEventNotHandled); #else nsCOMPtr appStartup(do_GetService(NS_APPSTARTUP_CONTRACTID)); - NS_WARN_IF_FALSE(appStartup, "Failed to get appstartup service"); + NS_ASSERTION(appStartup, "Failed to get appstartup service"); if(!appStartup) ThrowIfOSErr(errAEEventNotHandled); rv = appStartup->GetNativeAppSupport(getter_AddRefs(nas)); - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Failed to get NativeAppSupport"); + NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to get NativeAppSupport"); if(NS_FAILED(rv)) ThrowIfOSErr(errAEEventNotHandled); #endif diff --git a/mozilla/xpfe/components/winhooks/nsWindowsHooks.cpp b/mozilla/xpfe/components/winhooks/nsWindowsHooks.cpp index eb0881d6291..d5237762807 100644 --- a/mozilla/xpfe/components/winhooks/nsWindowsHooks.cpp +++ b/mozilla/xpfe/components/winhooks/nsWindowsHooks.cpp @@ -223,7 +223,7 @@ nsWindowsHooks::GetSettings( nsWindowsHooksSettings **result ) { prefs->mHaveBeenSet = BoolRegistryEntry( "haveBeenSet" ); #ifdef DEBUG_law -NS_WARN_IF_FALSE( NS_SUCCEEDED( rv ), "GetPreferences failed" ); +NS_ASSERTION( NS_SUCCEEDED( rv ), "GetPreferences failed" ); #endif return rv; diff --git a/mozilla/xpfe/components/winhooks/nsWindowsHooksUtil.cpp b/mozilla/xpfe/components/winhooks/nsWindowsHooksUtil.cpp index 473bd87d80b..1cbf2d7acee 100644 --- a/mozilla/xpfe/components/winhooks/nsWindowsHooksUtil.cpp +++ b/mozilla/xpfe/components/winhooks/nsWindowsHooksUtil.cpp @@ -365,7 +365,7 @@ else printf( "Setting %s=%s\n", fullName().get(), setting.get() ); rc = ::RegSetValueExA( key, valueNameArg(), 0, REG_SZ, (LPBYTE)cSetting.get(), cSetting.Length() ); #ifdef DEBUG_law - NS_WARN_IF_FALSE( rc == ERROR_SUCCESS, fullName().get() ); + NS_ASSERTION( rc == ERROR_SUCCESS, fullName().get() ); #endif if ( rc == ERROR_SUCCESS ) { result = NS_OK; @@ -397,7 +397,7 @@ else printf( "Setting %s=%s\n", fullName().get(), setting.get() ); ::RegCloseKey( key ); } else { #ifdef DEBUG_law -NS_WARN_IF_FALSE( rc == ERROR_SUCCESS, fullName().get() ); +NS_ASSERTION( rc == ERROR_SUCCESS, fullName().get() ); #endif } return result;