From 98dd456fc180ac5128de6fbb8821e82907267c74 Mon Sep 17 00:00:00 2001 From: Jeff Walden Date: Sun, 18 Dec 2011 01:00:47 -0500 Subject: [PATCH] Bug 711799 - Fix a bunch of initializing-pointer-from-boolean warnings. r=dholbert --HG-- extra : rebase_source : 4a5d03b10ad8ac4eaff222037ba3400a26e7cf55 --- dom/workers/XMLHttpRequestPrivate.cpp | 14 +++++++------- editor/libeditor/html/nsHTMLEditor.cpp | 4 ++-- intl/strres/src/nsStringBundleTextOverride.cpp | 2 +- js/xpconnect/src/XPCQuickStubs.cpp | 6 +++--- toolkit/components/places/nsNavHistoryResult.h | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dom/workers/XMLHttpRequestPrivate.cpp b/dom/workers/XMLHttpRequestPrivate.cpp index e3ac892c1bb..d2bd3cdc168 100644 --- a/dom/workers/XMLHttpRequestPrivate.cpp +++ b/dom/workers/XMLHttpRequestPrivate.cpp @@ -1566,19 +1566,19 @@ XMLHttpRequestPrivate::GetAllResponseHeaders(JSContext* aCx) mWorkerPrivate->AssertIsOnWorkerThread(); if (mCanceled) { - return false; + return nsnull; } if (!mProxy) { ThrowDOMExceptionForCode(aCx, INVALID_STATE_ERR); - return false; + return nsnull; } nsCString responseHeaders; nsRefPtr runnable = new GetAllResponseHeadersRunnable(mWorkerPrivate, mProxy, responseHeaders); if (!runnable->Dispatch(aCx)) { - return false; + return nsnull; } return JS_NewStringCopyN(aCx, responseHeaders.get(), @@ -1591,17 +1591,17 @@ XMLHttpRequestPrivate::GetResponseHeader(JSContext* aCx, JSString* aHeader) mWorkerPrivate->AssertIsOnWorkerThread(); if (mCanceled) { - return false; + return nsnull; } if (!mProxy) { ThrowDOMExceptionForCode(aCx, INVALID_STATE_ERR); - return false; + return nsnull; } nsDependentJSString header; if (!header.init(aCx, aHeader)) { - return false; + return nsnull; } nsCString value; @@ -1609,7 +1609,7 @@ XMLHttpRequestPrivate::GetResponseHeader(JSContext* aCx, JSString* aHeader) new GetResponseHeaderRunnable(mWorkerPrivate, mProxy, NS_ConvertUTF16toUTF8(header), value); if (!runnable->Dispatch(aCx)) { - return false; + return nsnull; } return JS_NewStringCopyN(aCx, value.get(), value.Length()); diff --git a/editor/libeditor/html/nsHTMLEditor.cpp b/editor/libeditor/html/nsHTMLEditor.cpp index da0e0439ffd..21b732a27c6 100644 --- a/editor/libeditor/html/nsHTMLEditor.cpp +++ b/editor/libeditor/html/nsHTMLEditor.cpp @@ -948,7 +948,7 @@ nsHTMLEditor::GetBlockNodeParent(nsIDOMNode *aNode) if (!aNode) { NS_NOTREACHED("null node passed to GetBlockNodeParent()"); - return false; + return nsnull; } nsCOMPtr p; @@ -5680,7 +5680,7 @@ nsHTMLEditor::IsActiveInDOMWindow() nsIContent* nsHTMLEditor::GetActiveEditingHost() { - NS_ENSURE_TRUE(mDocWeak, false); + NS_ENSURE_TRUE(mDocWeak, nsnull); nsCOMPtr doc = do_QueryReferent(mDocWeak); NS_ENSURE_TRUE(doc, nsnull); diff --git a/intl/strres/src/nsStringBundleTextOverride.cpp b/intl/strres/src/nsStringBundleTextOverride.cpp index 065c09359b5..16d24c8b789 100644 --- a/intl/strres/src/nsStringBundleTextOverride.cpp +++ b/intl/strres/src/nsStringBundleTextOverride.cpp @@ -302,7 +302,7 @@ nsPropertyEnumeratorByURL::HasMoreElements(bool * aResult) } if (!hasMore) - mCurrent = false; + mCurrent = nsnull; *aResult = mCurrent ? true : false; diff --git a/js/xpconnect/src/XPCQuickStubs.cpp b/js/xpconnect/src/XPCQuickStubs.cpp index 2521f62fbae..aa9a657bad7 100644 --- a/js/xpconnect/src/XPCQuickStubs.cpp +++ b/js/xpconnect/src/XPCQuickStubs.cpp @@ -187,7 +187,7 @@ GeneratePropertyOp(JSContext *cx, JSObject *obj, jsid id, uintN argc, Op pop) JSFunction *fun = js::NewFunctionByIdWithReserved(cx, PropertyOpForwarder, argc, 0, obj, id); if (!fun) - return false; + return nsnull; JSObject *funobj = JS_GetFunctionObject(fun); @@ -197,10 +197,10 @@ GeneratePropertyOp(JSContext *cx, JSObject *obj, jsid id, uintN argc, Op pop) // second object to work around this. JSObject *ptrobj = JS_NewObject(cx, &PointerHolderClass, nsnull, funobj); if (!ptrobj) - return false; + return nsnull; Op *popp = new Op; if (!popp) - return false; + return nsnull; *popp = pop; JS_SetPrivate(cx, ptrobj, popp); diff --git a/toolkit/components/places/nsNavHistoryResult.h b/toolkit/components/places/nsNavHistoryResult.h index 9f1701d313c..0fc3d2e4787 100644 --- a/toolkit/components/places/nsNavHistoryResult.h +++ b/toolkit/components/places/nsNavHistoryResult.h @@ -639,7 +639,7 @@ public: { nsCAutoString spec; if (NS_FAILED(aURI->GetSpec(spec))) - return false; + return nsnull; return FindChildURI(spec, aNodeIndex); } nsNavHistoryResultNode* FindChildURI(const nsACString& aSpec,