Bug 472348 - Some unused variables found by combing the warning database, rs=bz
authorBenjamin Smedberg <benjamin@smedbergs.us>
Tue, 06 Jan 2009 14:25:58 -0500
changeset 23383 ebb008ff4264723151fa42e9af7b1b98a95d2873
parent 23382 965b2068588d7aaa36b1df61de75694ac7c74480
child 23384 7658f9a1f67169e16431c68e8610c82dcfd10b66
push id4509
push userbsmedberg@mozilla.com
push dateTue, 06 Jan 2009 19:26:40 +0000
treeherdermozilla-central@ebb008ff4264 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs472348
milestone1.9.2a1pre
Bug 472348 - Some unused variables found by combing the warning database, rs=bz
content/xml/document/src/nsXMLFragmentContentSink.cpp
editor/libeditor/base/DeleteElementTxn.cpp
editor/libeditor/base/nsEditor.cpp
editor/libeditor/html/nsHTMLAnonymousUtils.cpp
editor/libeditor/html/nsWSRunObject.cpp
intl/uconv/tests/TestUConv.cpp
layout/generic/nsFrame.cpp
rdf/base/src/nsRDFXMLDataSource.cpp
xpcom/tests/TestCRT.cpp
--- a/content/xml/document/src/nsXMLFragmentContentSink.cpp
+++ b/content/xml/document/src/nsXMLFragmentContentSink.cpp
@@ -658,17 +658,16 @@ nsXHTMLParanoidFragmentSink::AddAttribut
 
 NS_IMETHODIMP
 nsXHTMLParanoidFragmentSink::HandleStartElement(const PRUnichar *aName,
                                                 const PRUnichar **aAtts,
                                                 PRUint32 aAttsCount,
                                                 PRInt32 aIndex,
                                                 PRUint32 aLineNumber)
 {
-  nsresult rv;
   PRInt32 nameSpaceID;
   nsCOMPtr<nsIAtom> prefix, localName;
   nsContentUtils::SplitExpatName(aName, getter_AddRefs(prefix),
                                  getter_AddRefs(localName), &nameSpaceID);
   
   // If the element is not in the XHTML namespace, bounce it
   if (nameSpaceID != kNameSpaceID_XHTML)
     return NS_OK;
--- a/editor/libeditor/base/DeleteElementTxn.cpp
+++ b/editor/libeditor/base/DeleteElementTxn.cpp
@@ -108,17 +108,17 @@ NS_IMETHODIMP DeleteElementTxn::DoTransa
 
     NS_Free(c);
     NS_Free(p);
   }
   // end debug output
 #endif
 
   // remember which child mElement was (by remembering which child was next)
-  nsresult result = mElement->GetNextSibling(getter_AddRefs(mRefNode));  // can return null mRefNode
+  mElement->GetNextSibling(getter_AddRefs(mRefNode));  // can return null mRefNode
 
   // give range updater a chance.  SelAdjDeleteNode() needs to be called *before*
   // we do the action, unlike some of the other nsRangeStore update methods.
   if (mRangeUpdater) 
     mRangeUpdater->SelAdjDeleteNode(mElement);
 
   nsCOMPtr<nsIDOMNode> resultNode;
   return mParent->RemoveChild(mElement, getter_AddRefs(resultNode));
--- a/editor/libeditor/base/nsEditor.cpp
+++ b/editor/libeditor/base/nsEditor.cpp
@@ -933,17 +933,17 @@ nsEditor::BeginPlaceHolderTransaction(ns
 
 NS_IMETHODIMP 
 nsEditor::EndPlaceHolderTransaction()
 {
   NS_PRECONDITION(mPlaceHolderBatch > 0, "zero or negative placeholder batch count when ending batch!");
   if (mPlaceHolderBatch == 1)
   {
     nsCOMPtr<nsISelection>selection;
-    nsresult rv = GetSelection(getter_AddRefs(selection));
+    GetSelection(getter_AddRefs(selection));
 
     nsCOMPtr<nsISelectionPrivate>selPrivate(do_QueryInterface(selection));
 
    // By making the assumption that no reflow happens during the calls
    // to EndUpdateViewBatch and ScrollSelectionIntoView, we are able to
    // allow the selection to cache a frame offset which is used by the
    // caret drawing code. We only enable this cache here; at other times,
    // we have no way to know whether reflow invalidates it
--- a/editor/libeditor/html/nsHTMLAnonymousUtils.cpp
+++ b/editor/libeditor/html/nsHTMLAnonymousUtils.cpp
@@ -248,17 +248,17 @@ nsHTMLEditor::DeleteRefToAnonymousNode(n
       // See bug 338129.
       if (aShell && aShell->GetPresContext() &&
           aShell->GetPresContext()->GetPresShell() == aShell) {
         nsCOMPtr<nsIDocumentObserver> docObserver = do_QueryInterface(aShell);
         if (docObserver) {
           // Call BeginUpdate() so that the nsCSSFrameConstructor/PresShell
           // knows we're messing with the frame tree.
           nsCOMPtr<nsIDOMDocument> domDocument;
-          nsresult res = GetDocument(getter_AddRefs(domDocument));
+          GetDocument(getter_AddRefs(domDocument));
           nsCOMPtr<nsIDocument> document = do_QueryInterface(domDocument);
           if (document)
             docObserver->BeginUpdate(document, UPDATE_CONTENT_MODEL);
 
           docObserver->ContentRemoved(content->GetCurrentDoc(),
                                       aParentContent, content, -1);
           if (document)
             docObserver->EndUpdate(document, UPDATE_CONTENT_MODEL);
--- a/editor/libeditor/html/nsWSRunObject.cpp
+++ b/editor/libeditor/html/nsWSRunObject.cpp
@@ -1705,17 +1705,16 @@ nsWSRunObject::GetCharBefore(WSPoint &aP
 {
   if (!aPoint.mTextNode || !outPoint)
     return NS_ERROR_NULL_POINTER;
   
   outPoint->mTextNode = nsnull;
   outPoint->mOffset = 0;
   outPoint->mChar = 0;
   
-  nsresult res = NS_OK;
   nsCOMPtr<nsIDOMNode> pointTextNode(do_QueryInterface(aPoint.mTextNode));
   PRInt32 idx = mNodeArray.IndexOf(pointTextNode);
   if (idx == -1) return NS_OK;  // can't find point, but it's not an error
   
   if (aPoint.mOffset != 0)
   {
     *outPoint = aPoint;
     outPoint->mOffset--;
--- a/intl/uconv/tests/TestUConv.cpp
+++ b/intl/uconv/tests/TestUConv.cpp
@@ -213,18 +213,16 @@ nsresult nsTestUConv::TestEncoders()
   nsCOMPtr<nsICharsetConverterManager> ccMan = 
            do_GetService(kCharsetConverterManagerCID, &res);
   if (NS_FAILED(res)) return res;
   
   nsCOMPtr<nsIUTF8StringEnumerator> encoders;
   res = ccMan->GetEncoderList(getter_AddRefs(encoders));
   if (NS_FAILED(res)) return res;
 
-  PRUint32 encoderCount=0;
-
   PRBool hasMore;
   encoders->HasMore(&hasMore);
   
   nsCAutoString charset;
   while (hasMore) {
     encoders->GetNext(charset);
 
     encoders->HasMore(&hasMore);
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -5341,17 +5341,16 @@ nsFrame::CheckVisibility(nsPresContext* 
 
 PRInt32
 nsFrame::GetLineNumber(nsIFrame *aFrame, PRBool aLockScroll, nsIFrame** aContainingBlock)
 {
   NS_ASSERTION(aFrame, "null aFrame");
   nsFrameManager* frameManager = aFrame->PresContext()->FrameManager();
   nsIFrame *blockFrame = aFrame;
   nsIFrame *thisBlock;
-  PRInt32   thisLine;
   nsAutoLineIterator it;
   nsresult result = NS_ERROR_FAILURE;
   while (NS_FAILED(result) && blockFrame)
   {
     thisBlock = blockFrame;
     if (thisBlock->GetStateBits() & NS_FRAME_OUT_OF_FLOW) {
       //if we are searching for a frame that is not in flow we will not find it. 
       //we must instead look for its placeholder
--- a/rdf/base/src/nsRDFXMLDataSource.cpp
+++ b/rdf/base/src/nsRDFXMLDataSource.cpp
@@ -496,17 +496,16 @@ RDFXMLDataSourceImpl::BlockingParse(nsIU
     
     nsCOMPtr<nsIChannel> channel;
     nsCOMPtr<nsIRequest> request;
 
     // Null LoadGroup ?
     rv = NS_NewChannel(getter_AddRefs(channel), aURL, nsnull);
     if (NS_FAILED(rv)) return rv;
     nsCOMPtr<nsIInputStream> in;
-    PRUint32 sourceOffset = 0;
     rv = channel->Open(getter_AddRefs(in));
 
     // Report success if the file doesn't exist, but propagate other errors.
     if (rv == NS_ERROR_FILE_NOT_FOUND) return NS_OK;
     if (NS_FAILED(rv)) return rv;
 
     if (! in) {
         NS_ERROR("no input stream");
--- a/xpcom/tests/TestCRT.cpp
+++ b/xpcom/tests/TestCRT.cpp
@@ -58,18 +58,16 @@ PRIntn sign(PRIntn val) {
 
 // Verify that nsCRT versions of string comparison routines get the
 // same answers as the native non-unicode versions. We only pass in
 // iso-latin-1 strings, so the comparison must be valid.
 static void Check(const char* s1, const char* s2, PRIntn n)
 {
   PRIntn clib = PL_strcmp(s1, s2);
   PRIntn clib_n = PL_strncmp(s1, s2, n);
-  PRIntn clib_case = PL_strcasecmp(s1, s2);
-  PRIntn clib_case_n = PL_strncasecmp(s1, s2, n);
 
   nsAutoString t1,t2; 
   t1.AssignWithConversion(s1);
   t2.AssignWithConversion(s2);
   const PRUnichar* us1 = t1.get();
   const PRUnichar* us2 = t2.get();
 
   PRIntn u2 = nsCRT::strcmp(us1, us2);