diff --git a/mozilla/content/base/src/nsGenericDOMNodeList.cpp b/mozilla/content/base/src/nsGenericDOMNodeList.cpp index d8d8e6ac8a4..a5a487493d3 100644 --- a/mozilla/content/base/src/nsGenericDOMNodeList.cpp +++ b/mozilla/content/base/src/nsGenericDOMNodeList.cpp @@ -37,9 +37,7 @@ nsGenericDOMNodeList::QueryInterface(REFNSIID aIID, void** aInstancePtr) if (NULL == aInstancePtr) { return NS_ERROR_NULL_POINTER; } - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_IID(kIDOMNodeListIID, NS_IDOMNODELIST_IID); - static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID); if (aIID.Equals(kIDOMNodeListIID)) { *aInstancePtr = (void*)(nsIDOMNodeList*)this; AddRef(); diff --git a/mozilla/content/base/src/nsGenericElement.cpp b/mozilla/content/base/src/nsGenericElement.cpp index 7fe4eabe742..a2913b771ab 100644 --- a/mozilla/content/base/src/nsGenericElement.cpp +++ b/mozilla/content/base/src/nsGenericElement.cpp @@ -1642,15 +1642,15 @@ nsGenericContainerElement::ReplaceChild(nsIDOMNode* aNewChild, } nsIContent* content = nsnull; nsresult res = aOldChild->QueryInterface(kIContentIID, (void**)&content); - NS_ASSERTION(NS_OK == res, "Must be an nsIContent"); - if (NS_OK == res) { + NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent"); + if (NS_SUCCEEDED(res)) { PRInt32 pos; IndexOf(content, pos); if (pos >= 0) { nsIContent* newContent = nsnull; - nsresult res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent); - NS_ASSERTION(NS_OK == res, "Must be an nsIContent"); - if (NS_OK == res) { + res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent); + NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent"); + if (NS_SUCCEEDED(res)) { // Check if this is a document fragment. If it is, we need // to remove the children of the document fragment and add them // individually (i.e. we don't add the actual document fragment). @@ -1660,7 +1660,7 @@ nsGenericContainerElement::ReplaceChild(nsIDOMNode* aNewChild, nsIContent* docFragContent; res = aNewChild->QueryInterface(kIContentIID, (void **)&docFragContent); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { PRInt32 count; docFragContent->ChildCount(count); @@ -1670,9 +1670,9 @@ nsGenericContainerElement::ReplaceChild(nsIDOMNode* aNewChild, // Remove the last child of the document fragment // and do a replace with it res = docFragContent->ChildAt(count-1, childContent); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { res = docFragContent->RemoveChildAt(count-1, PR_FALSE); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { SetDocumentInChildrenOf(childContent, mDocument); res = ReplaceChildAt(childContent, pos, PR_TRUE); // If there are more children, then insert them before @@ -1682,11 +1682,11 @@ nsGenericContainerElement::ReplaceChild(nsIDOMNode* aNewChild, res = childContent->QueryInterface(kIDOMNodeIID, (void **)&childNode); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { nsIDOMNode* rv; res = InsertBefore(aNewChild, childNode, &rv); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { NS_IF_RELEASE(rv); } NS_RELEASE(childNode); diff --git a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp index 2c8a262b465..82b04779604 100644 --- a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp +++ b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp @@ -2529,25 +2529,25 @@ nsGenericHTMLContainerElement::ReplaceChild(nsIDOMNode* aNewChild, } nsIContent* content = nsnull; nsresult res = aOldChild->QueryInterface(kIContentIID, (void**)&content); - NS_ASSERTION(NS_OK == res, "Must be an nsIContent"); - if (NS_OK == res) { + NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent"); + if (NS_SUCCEEDED(res)) { PRInt32 pos; IndexOf(content, pos); if (pos >= 0) { nsIContent* newContent = nsnull; - nsresult res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent); - NS_ASSERTION(NS_OK == res, "Must be an nsIContent"); - if (NS_OK == res) { + res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent); + NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent"); + if (NS_SUCCEEDED(res)) { // Check if this is a document fragment. If it is, we need // to remove the children of the document fragment and add them // individually (i.e. we don't add the actual document fragment). nsIDOMDocumentFragment* docFrag = nsnull; - if (NS_OK == aNewChild->QueryInterface(kIDOMDocumentFragmentIID, - (void **)&docFrag)) { + if (NS_SUCCEEDED(aNewChild->QueryInterface(kIDOMDocumentFragmentIID, + (void **)&docFrag))) { nsIContent* docFragContent; res = aNewChild->QueryInterface(kIContentIID, (void **)&docFragContent); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { PRInt32 count; docFragContent->ChildCount(count); @@ -2557,23 +2557,23 @@ nsGenericHTMLContainerElement::ReplaceChild(nsIDOMNode* aNewChild, // Remove the last child of the document fragment // and do a replace with it res = docFragContent->ChildAt(count-1, childContent); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { res = docFragContent->RemoveChildAt(count-1, PR_FALSE); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { SetDocumentInChildrenOf(childContent, mDocument); res = ReplaceChildAt(childContent, pos, PR_TRUE); // If there are more children, then insert them before // the newly replaced child - if ((NS_OK == res) && (count > 1)) { + if ((NS_SUCCEEDED(res)) && (count > 1)) { nsIDOMNode* childNode = nsnull; res = childContent->QueryInterface(kIDOMNodeIID, (void **)&childNode); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { nsIDOMNode* rv; res = InsertBefore(aNewChild, childNode, &rv); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { NS_IF_RELEASE(rv); } NS_RELEASE(childNode); @@ -2593,7 +2593,7 @@ nsGenericHTMLContainerElement::ReplaceChild(nsIDOMNode* aNewChild, else { nsIContent* oldParent; res = newContent->GetParent(oldParent); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { // Remove the element from the old parent if one exists if (nsnull != oldParent) { PRInt32 index; @@ -2639,8 +2639,8 @@ nsGenericHTMLContainerElement::RemoveChild(nsIDOMNode* aOldChild, return NS_ERROR_NULL_POINTER; } nsresult res = aOldChild->QueryInterface(kIContentIID, (void**)&content); - NS_ASSERTION(NS_OK == res, "Must be an nsIContent"); - if (NS_OK == res) { + NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent"); + if (NS_SUCCEEDED(res)) { PRInt32 pos; IndexOf(content, pos); if (pos >= 0) { diff --git a/mozilla/content/html/content/src/nsHTMLTableElement.cpp b/mozilla/content/html/content/src/nsHTMLTableElement.cpp index af2cc6f3167..998e76d5374 100644 --- a/mozilla/content/html/content/src/nsHTMLTableElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTableElement.cpp @@ -1073,8 +1073,8 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes, if (nsnull!=aAttributes) { - float p2t; - aPresContext->GetScaledPixelsToTwips(&p2t); + float sp2t; + aPresContext->GetScaledPixelsToTwips(&sp2t); nsHTMLValue value; const nsStyleDisplay* readDisplay = (nsStyleDisplay*) @@ -1116,7 +1116,7 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes, break; case eHTMLUnit_Pixel: - position->mWidth.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t)); + position->mWidth.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t)); break; default: break; @@ -1134,14 +1134,15 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes, break; case eHTMLUnit_Pixel: - position->mHeight.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t)); + position->mHeight.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t)); break; default: break; } } - nsStyleSpacing* spacing = (nsStyleSpacing*)aContext->GetMutableStyleData(eStyleStruct_Spacing); + nsStyleSpacing* spacing = (nsStyleSpacing*) + aContext->GetMutableStyleData(eStyleStruct_Spacing); // default border style is the quirks outset PRUint8 borderStyle = NS_STYLE_BORDER_STYLE_BG_OUTSET; @@ -1165,8 +1166,6 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes, aAttributes->GetAttribute(nsHTMLAtoms::align, value); if (value.GetUnit() == eHTMLUnit_Enumerated) { if (NS_STYLE_TEXT_ALIGN_CENTER == value.GetIntValue()) { - nsStyleSpacing* spacing = (nsStyleSpacing*) - aContext->GetMutableStyleData(eStyleStruct_Spacing); nsStyleCoord otto(eStyleUnit_Auto); spacing->mMargin.SetLeft(otto); spacing->mMargin.SetRight(otto); @@ -1199,7 +1198,7 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes, if (value.GetUnit() == eHTMLUnit_Pixel) { if (nsnull==tableStyle) tableStyle = (nsStyleTable*)aContext->GetMutableStyleData(eStyleStruct_Table); - tableStyle->mCellPadding.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t)); + tableStyle->mCellPadding.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t)); } // cellspacing (reuses tableStyle if already resolved) @@ -1208,8 +1207,8 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes, if (value.GetUnit() == eHTMLUnit_Pixel) { if (nsnull==tableStyle) tableStyle = (nsStyleTable*)aContext->GetMutableStyleData(eStyleStruct_Table); - tableStyle->mBorderSpacingX.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t)); - tableStyle->mBorderSpacingY.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t)); + tableStyle->mBorderSpacingX.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t)); + tableStyle->mBorderSpacingY.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t)); } // cols diff --git a/mozilla/content/xml/document/src/nsXMLContentSink.cpp b/mozilla/content/xml/document/src/nsXMLContentSink.cpp index c5f842ed148..6d238e0d660 100644 --- a/mozilla/content/xml/document/src/nsXMLContentSink.cpp +++ b/mozilla/content/xml/document/src/nsXMLContentSink.cpp @@ -75,7 +75,6 @@ static char kNameSpaceSeparator = ':'; static char kNameSpaceDef[] = "xmlns"; static char kStyleSheetPI[] = "xml-stylesheet"; -static char kCSSType[] = "text/css"; #ifdef XSL static char kXSLType[] = "text/xsl"; @@ -457,14 +456,14 @@ GetAttributeValueAt(const nsIParserNode& aNode, PRBool ok = PR_FALSE; PRInt32 slen = aResult.Length(); while ((index < slen) && (cp < limit)) { - PRUnichar e = aResult.CharAt(index); - if (e == ';') { + PRUnichar ch = aResult.CharAt(index); + if (ch == ';') { index++; ok = PR_TRUE; break; } - if ((e >= '0') && (e <= '9')) { - *cp++ = char(e); + if ((ch >= '0') && (ch <= '9')) { + *cp++ = char(ch); index++; continue; } @@ -498,16 +497,16 @@ GetAttributeValueAt(const nsIParserNode& aNode, PRBool ok = PR_FALSE; PRInt32 slen = aResult.Length(); while ((index < slen) && (cp < limit)) { - PRUnichar e = aResult.CharAt(index); - if (e == ';') { + PRUnichar ch = aResult.CharAt(index); + if (ch == ';') { index++; ok = PR_TRUE; break; } - if (((e >= '0') && (e <= '9')) || - ((e >= 'A') && (e <= 'Z')) || - ((e >= 'a') && (e <= 'z'))) { - *cp++ = char(e); + if (((ch >= '0') && (ch <= '9')) || + ((ch >= 'A') && (ch <= 'Z')) || + ((ch >= 'a') && (ch <= 'z'))) { + *cp++ = char(ch); index++; continue; } @@ -1607,7 +1606,7 @@ nsXMLContentSink::StartLayout() // Get initial scroll preference and save it away; disable the // scroll bars. - PRInt32 i, ns = mDocument->GetNumberOfShells(); + ns = mDocument->GetNumberOfShells(); for (i = 0; i < ns; i++) { nsIPresShell* shell = mDocument->GetShellAt(i); if (nsnull != shell) { @@ -1679,8 +1678,8 @@ nsXMLContentSink::EvaluateScript(nsString& aScript, PRUint32 aLineNo) nsAutoString val; PRBool isUndefined; - nsresult result = context->EvaluateString(aScript, url, aLineNo, - val, &isUndefined); + (void) context->EvaluateString(aScript, url, aLineNo, + val, &isUndefined); NS_IF_RELEASE(docURL); diff --git a/mozilla/content/xml/document/src/nsXMLDocument.cpp b/mozilla/content/xml/document/src/nsXMLDocument.cpp index 1d0f9daced0..589ea84c1a2 100644 --- a/mozilla/content/xml/document/src/nsXMLDocument.cpp +++ b/mozilla/content/xml/document/src/nsXMLDocument.cpp @@ -448,15 +448,15 @@ nsXMLDocument::CreateElementWithNameSpace(const nsString& aTagName, const nsString& aNameSpace, nsIDOMElement** aReturn) { - PRInt32 nsID = kNameSpaceID_None; + PRInt32 namespaceID = kNameSpaceID_None; nsresult rv = NS_OK; if ((0 < aNameSpace.Length() && (nsnull != mNameSpaceManager))) { - mNameSpaceManager->GetNameSpaceID(aNameSpace, nsID); + mNameSpaceManager->GetNameSpaceID(aNameSpace, namespaceID); } nsIContent* content; - if (nsID == kNameSpaceID_HTML) { + if (namespaceID == kNameSpaceID_HTML) { nsIHTMLContent* htmlContent; rv = NS_CreateHTMLElement(&htmlContent, aTagName); @@ -470,7 +470,7 @@ nsXMLDocument::CreateElementWithNameSpace(const nsString& aTagName, rv = NS_NewXMLElement(&xmlContent, tag); NS_RELEASE(tag); if (NS_OK == rv) { - xmlContent->SetNameSpaceID(nsID); + xmlContent->SetNameSpaceID(namespaceID); } content = (nsIXMLContent*)xmlContent; } diff --git a/mozilla/layout/base/src/nsGenericDOMNodeList.cpp b/mozilla/layout/base/src/nsGenericDOMNodeList.cpp index d8d8e6ac8a4..a5a487493d3 100644 --- a/mozilla/layout/base/src/nsGenericDOMNodeList.cpp +++ b/mozilla/layout/base/src/nsGenericDOMNodeList.cpp @@ -37,9 +37,7 @@ nsGenericDOMNodeList::QueryInterface(REFNSIID aIID, void** aInstancePtr) if (NULL == aInstancePtr) { return NS_ERROR_NULL_POINTER; } - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_IID(kIDOMNodeListIID, NS_IDOMNODELIST_IID); - static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID); if (aIID.Equals(kIDOMNodeListIID)) { *aInstancePtr = (void*)(nsIDOMNodeList*)this; AddRef(); diff --git a/mozilla/layout/base/src/nsGenericElement.cpp b/mozilla/layout/base/src/nsGenericElement.cpp index 7fe4eabe742..a2913b771ab 100644 --- a/mozilla/layout/base/src/nsGenericElement.cpp +++ b/mozilla/layout/base/src/nsGenericElement.cpp @@ -1642,15 +1642,15 @@ nsGenericContainerElement::ReplaceChild(nsIDOMNode* aNewChild, } nsIContent* content = nsnull; nsresult res = aOldChild->QueryInterface(kIContentIID, (void**)&content); - NS_ASSERTION(NS_OK == res, "Must be an nsIContent"); - if (NS_OK == res) { + NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent"); + if (NS_SUCCEEDED(res)) { PRInt32 pos; IndexOf(content, pos); if (pos >= 0) { nsIContent* newContent = nsnull; - nsresult res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent); - NS_ASSERTION(NS_OK == res, "Must be an nsIContent"); - if (NS_OK == res) { + res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent); + NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent"); + if (NS_SUCCEEDED(res)) { // Check if this is a document fragment. If it is, we need // to remove the children of the document fragment and add them // individually (i.e. we don't add the actual document fragment). @@ -1660,7 +1660,7 @@ nsGenericContainerElement::ReplaceChild(nsIDOMNode* aNewChild, nsIContent* docFragContent; res = aNewChild->QueryInterface(kIContentIID, (void **)&docFragContent); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { PRInt32 count; docFragContent->ChildCount(count); @@ -1670,9 +1670,9 @@ nsGenericContainerElement::ReplaceChild(nsIDOMNode* aNewChild, // Remove the last child of the document fragment // and do a replace with it res = docFragContent->ChildAt(count-1, childContent); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { res = docFragContent->RemoveChildAt(count-1, PR_FALSE); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { SetDocumentInChildrenOf(childContent, mDocument); res = ReplaceChildAt(childContent, pos, PR_TRUE); // If there are more children, then insert them before @@ -1682,11 +1682,11 @@ nsGenericContainerElement::ReplaceChild(nsIDOMNode* aNewChild, res = childContent->QueryInterface(kIDOMNodeIID, (void **)&childNode); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { nsIDOMNode* rv; res = InsertBefore(aNewChild, childNode, &rv); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { NS_IF_RELEASE(rv); } NS_RELEASE(childNode); diff --git a/mozilla/layout/html/content/src/nsGenericHTMLElement.cpp b/mozilla/layout/html/content/src/nsGenericHTMLElement.cpp index 2c8a262b465..82b04779604 100644 --- a/mozilla/layout/html/content/src/nsGenericHTMLElement.cpp +++ b/mozilla/layout/html/content/src/nsGenericHTMLElement.cpp @@ -2529,25 +2529,25 @@ nsGenericHTMLContainerElement::ReplaceChild(nsIDOMNode* aNewChild, } nsIContent* content = nsnull; nsresult res = aOldChild->QueryInterface(kIContentIID, (void**)&content); - NS_ASSERTION(NS_OK == res, "Must be an nsIContent"); - if (NS_OK == res) { + NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent"); + if (NS_SUCCEEDED(res)) { PRInt32 pos; IndexOf(content, pos); if (pos >= 0) { nsIContent* newContent = nsnull; - nsresult res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent); - NS_ASSERTION(NS_OK == res, "Must be an nsIContent"); - if (NS_OK == res) { + res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent); + NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent"); + if (NS_SUCCEEDED(res)) { // Check if this is a document fragment. If it is, we need // to remove the children of the document fragment and add them // individually (i.e. we don't add the actual document fragment). nsIDOMDocumentFragment* docFrag = nsnull; - if (NS_OK == aNewChild->QueryInterface(kIDOMDocumentFragmentIID, - (void **)&docFrag)) { + if (NS_SUCCEEDED(aNewChild->QueryInterface(kIDOMDocumentFragmentIID, + (void **)&docFrag))) { nsIContent* docFragContent; res = aNewChild->QueryInterface(kIContentIID, (void **)&docFragContent); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { PRInt32 count; docFragContent->ChildCount(count); @@ -2557,23 +2557,23 @@ nsGenericHTMLContainerElement::ReplaceChild(nsIDOMNode* aNewChild, // Remove the last child of the document fragment // and do a replace with it res = docFragContent->ChildAt(count-1, childContent); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { res = docFragContent->RemoveChildAt(count-1, PR_FALSE); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { SetDocumentInChildrenOf(childContent, mDocument); res = ReplaceChildAt(childContent, pos, PR_TRUE); // If there are more children, then insert them before // the newly replaced child - if ((NS_OK == res) && (count > 1)) { + if ((NS_SUCCEEDED(res)) && (count > 1)) { nsIDOMNode* childNode = nsnull; res = childContent->QueryInterface(kIDOMNodeIID, (void **)&childNode); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { nsIDOMNode* rv; res = InsertBefore(aNewChild, childNode, &rv); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { NS_IF_RELEASE(rv); } NS_RELEASE(childNode); @@ -2593,7 +2593,7 @@ nsGenericHTMLContainerElement::ReplaceChild(nsIDOMNode* aNewChild, else { nsIContent* oldParent; res = newContent->GetParent(oldParent); - if (NS_OK == res) { + if (NS_SUCCEEDED(res)) { // Remove the element from the old parent if one exists if (nsnull != oldParent) { PRInt32 index; @@ -2639,8 +2639,8 @@ nsGenericHTMLContainerElement::RemoveChild(nsIDOMNode* aOldChild, return NS_ERROR_NULL_POINTER; } nsresult res = aOldChild->QueryInterface(kIContentIID, (void**)&content); - NS_ASSERTION(NS_OK == res, "Must be an nsIContent"); - if (NS_OK == res) { + NS_ASSERTION(NS_SUCCEEDED(res), "Must be an nsIContent"); + if (NS_SUCCEEDED(res)) { PRInt32 pos; IndexOf(content, pos); if (pos >= 0) { diff --git a/mozilla/layout/html/content/src/nsHTMLTableElement.cpp b/mozilla/layout/html/content/src/nsHTMLTableElement.cpp index af2cc6f3167..998e76d5374 100644 --- a/mozilla/layout/html/content/src/nsHTMLTableElement.cpp +++ b/mozilla/layout/html/content/src/nsHTMLTableElement.cpp @@ -1073,8 +1073,8 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes, if (nsnull!=aAttributes) { - float p2t; - aPresContext->GetScaledPixelsToTwips(&p2t); + float sp2t; + aPresContext->GetScaledPixelsToTwips(&sp2t); nsHTMLValue value; const nsStyleDisplay* readDisplay = (nsStyleDisplay*) @@ -1116,7 +1116,7 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes, break; case eHTMLUnit_Pixel: - position->mWidth.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t)); + position->mWidth.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t)); break; default: break; @@ -1134,14 +1134,15 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes, break; case eHTMLUnit_Pixel: - position->mHeight.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t)); + position->mHeight.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t)); break; default: break; } } - nsStyleSpacing* spacing = (nsStyleSpacing*)aContext->GetMutableStyleData(eStyleStruct_Spacing); + nsStyleSpacing* spacing = (nsStyleSpacing*) + aContext->GetMutableStyleData(eStyleStruct_Spacing); // default border style is the quirks outset PRUint8 borderStyle = NS_STYLE_BORDER_STYLE_BG_OUTSET; @@ -1165,8 +1166,6 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes, aAttributes->GetAttribute(nsHTMLAtoms::align, value); if (value.GetUnit() == eHTMLUnit_Enumerated) { if (NS_STYLE_TEXT_ALIGN_CENTER == value.GetIntValue()) { - nsStyleSpacing* spacing = (nsStyleSpacing*) - aContext->GetMutableStyleData(eStyleStruct_Spacing); nsStyleCoord otto(eStyleUnit_Auto); spacing->mMargin.SetLeft(otto); spacing->mMargin.SetRight(otto); @@ -1199,7 +1198,7 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes, if (value.GetUnit() == eHTMLUnit_Pixel) { if (nsnull==tableStyle) tableStyle = (nsStyleTable*)aContext->GetMutableStyleData(eStyleStruct_Table); - tableStyle->mCellPadding.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t)); + tableStyle->mCellPadding.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t)); } // cellspacing (reuses tableStyle if already resolved) @@ -1208,8 +1207,8 @@ MapAttributesInto(const nsIHTMLMappedAttributes* aAttributes, if (value.GetUnit() == eHTMLUnit_Pixel) { if (nsnull==tableStyle) tableStyle = (nsStyleTable*)aContext->GetMutableStyleData(eStyleStruct_Table); - tableStyle->mBorderSpacingX.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t)); - tableStyle->mBorderSpacingY.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t)); + tableStyle->mBorderSpacingX.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t)); + tableStyle->mBorderSpacingY.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), sp2t)); } // cols diff --git a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp index d2b63f21d82..418703954ca 100644 --- a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp +++ b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp @@ -1469,8 +1469,8 @@ void BasicTableLayoutStrategy::Dump(PRInt32 aIndent) } indent[aIndent] = 0; - printf("%s**START BASIC STRATEGY DUMP** table=%X cols=%X numCols=%d", - indent, mTableFrame, mCols, mNumCols); + printf("%s**START BASIC STRATEGY DUMP** table=%p cols=%X numCols=%d", + indent, mTableFrame, mCols, mNumCols); printf("\n%s minConWidth=%d maxConWidth=%d cellSpacing=%d propRatio=%.2f navQuirks=%d", indent, mMinTableContentWidth, mMaxTableContentWidth, mCellSpacingTotal, mMinToDesProportionRatio, mIsNavQuirksMode); printf(" **END BASIC STRATEGY DUMP** \n"); diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.cpp b/mozilla/layout/html/table/src/nsTableCellFrame.cpp index 49a8f2c0952..dabc73f12b3 100644 --- a/mozilla/layout/html/table/src/nsTableCellFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableCellFrame.cpp @@ -658,8 +658,6 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext, kidSize.width = kidReflowState.availableWidth; } if (0 == kidSize.height) { - const nsStylePosition* pos; - GetStyleData(eStyleStruct_Position, ((const nsStyleStruct *&)pos)); if ((pos->mHeight.GetUnit() != eStyleUnit_Coord) && (pos->mHeight.GetUnit() != eStyleUnit_Percent)) { // Standard mode should probably be 0 pixels high instead of 1 diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index e1e3cbbd3c8..8539b4edb25 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -625,7 +625,6 @@ PRBool nsTableFrame::HasGroupRules() const // this won't work until bug 12948 is resolved and col groups are considered void nsTableFrame::ProcessGroupRules(nsIPresContext& aPresContext) { - PRInt32 numRows = GetRowCount(); PRInt32 numCols = GetColCount(); // process row groups diff --git a/mozilla/layout/tables/BasicTableLayoutStrategy.cpp b/mozilla/layout/tables/BasicTableLayoutStrategy.cpp index d2b63f21d82..418703954ca 100644 --- a/mozilla/layout/tables/BasicTableLayoutStrategy.cpp +++ b/mozilla/layout/tables/BasicTableLayoutStrategy.cpp @@ -1469,8 +1469,8 @@ void BasicTableLayoutStrategy::Dump(PRInt32 aIndent) } indent[aIndent] = 0; - printf("%s**START BASIC STRATEGY DUMP** table=%X cols=%X numCols=%d", - indent, mTableFrame, mCols, mNumCols); + printf("%s**START BASIC STRATEGY DUMP** table=%p cols=%X numCols=%d", + indent, mTableFrame, mCols, mNumCols); printf("\n%s minConWidth=%d maxConWidth=%d cellSpacing=%d propRatio=%.2f navQuirks=%d", indent, mMinTableContentWidth, mMaxTableContentWidth, mCellSpacingTotal, mMinToDesProportionRatio, mIsNavQuirksMode); printf(" **END BASIC STRATEGY DUMP** \n"); diff --git a/mozilla/layout/tables/nsTableCellFrame.cpp b/mozilla/layout/tables/nsTableCellFrame.cpp index 49a8f2c0952..dabc73f12b3 100644 --- a/mozilla/layout/tables/nsTableCellFrame.cpp +++ b/mozilla/layout/tables/nsTableCellFrame.cpp @@ -658,8 +658,6 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext, kidSize.width = kidReflowState.availableWidth; } if (0 == kidSize.height) { - const nsStylePosition* pos; - GetStyleData(eStyleStruct_Position, ((const nsStyleStruct *&)pos)); if ((pos->mHeight.GetUnit() != eStyleUnit_Coord) && (pos->mHeight.GetUnit() != eStyleUnit_Percent)) { // Standard mode should probably be 0 pixels high instead of 1 diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index e1e3cbbd3c8..8539b4edb25 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -625,7 +625,6 @@ PRBool nsTableFrame::HasGroupRules() const // this won't work until bug 12948 is resolved and col groups are considered void nsTableFrame::ProcessGroupRules(nsIPresContext& aPresContext) { - PRInt32 numRows = GetRowCount(); PRInt32 numCols = GetColCount(); // process row groups diff --git a/mozilla/layout/xml/document/src/nsXMLContentSink.cpp b/mozilla/layout/xml/document/src/nsXMLContentSink.cpp index c5f842ed148..6d238e0d660 100644 --- a/mozilla/layout/xml/document/src/nsXMLContentSink.cpp +++ b/mozilla/layout/xml/document/src/nsXMLContentSink.cpp @@ -75,7 +75,6 @@ static char kNameSpaceSeparator = ':'; static char kNameSpaceDef[] = "xmlns"; static char kStyleSheetPI[] = "xml-stylesheet"; -static char kCSSType[] = "text/css"; #ifdef XSL static char kXSLType[] = "text/xsl"; @@ -457,14 +456,14 @@ GetAttributeValueAt(const nsIParserNode& aNode, PRBool ok = PR_FALSE; PRInt32 slen = aResult.Length(); while ((index < slen) && (cp < limit)) { - PRUnichar e = aResult.CharAt(index); - if (e == ';') { + PRUnichar ch = aResult.CharAt(index); + if (ch == ';') { index++; ok = PR_TRUE; break; } - if ((e >= '0') && (e <= '9')) { - *cp++ = char(e); + if ((ch >= '0') && (ch <= '9')) { + *cp++ = char(ch); index++; continue; } @@ -498,16 +497,16 @@ GetAttributeValueAt(const nsIParserNode& aNode, PRBool ok = PR_FALSE; PRInt32 slen = aResult.Length(); while ((index < slen) && (cp < limit)) { - PRUnichar e = aResult.CharAt(index); - if (e == ';') { + PRUnichar ch = aResult.CharAt(index); + if (ch == ';') { index++; ok = PR_TRUE; break; } - if (((e >= '0') && (e <= '9')) || - ((e >= 'A') && (e <= 'Z')) || - ((e >= 'a') && (e <= 'z'))) { - *cp++ = char(e); + if (((ch >= '0') && (ch <= '9')) || + ((ch >= 'A') && (ch <= 'Z')) || + ((ch >= 'a') && (ch <= 'z'))) { + *cp++ = char(ch); index++; continue; } @@ -1607,7 +1606,7 @@ nsXMLContentSink::StartLayout() // Get initial scroll preference and save it away; disable the // scroll bars. - PRInt32 i, ns = mDocument->GetNumberOfShells(); + ns = mDocument->GetNumberOfShells(); for (i = 0; i < ns; i++) { nsIPresShell* shell = mDocument->GetShellAt(i); if (nsnull != shell) { @@ -1679,8 +1678,8 @@ nsXMLContentSink::EvaluateScript(nsString& aScript, PRUint32 aLineNo) nsAutoString val; PRBool isUndefined; - nsresult result = context->EvaluateString(aScript, url, aLineNo, - val, &isUndefined); + (void) context->EvaluateString(aScript, url, aLineNo, + val, &isUndefined); NS_IF_RELEASE(docURL); diff --git a/mozilla/layout/xml/document/src/nsXMLDocument.cpp b/mozilla/layout/xml/document/src/nsXMLDocument.cpp index 1d0f9daced0..589ea84c1a2 100644 --- a/mozilla/layout/xml/document/src/nsXMLDocument.cpp +++ b/mozilla/layout/xml/document/src/nsXMLDocument.cpp @@ -448,15 +448,15 @@ nsXMLDocument::CreateElementWithNameSpace(const nsString& aTagName, const nsString& aNameSpace, nsIDOMElement** aReturn) { - PRInt32 nsID = kNameSpaceID_None; + PRInt32 namespaceID = kNameSpaceID_None; nsresult rv = NS_OK; if ((0 < aNameSpace.Length() && (nsnull != mNameSpaceManager))) { - mNameSpaceManager->GetNameSpaceID(aNameSpace, nsID); + mNameSpaceManager->GetNameSpaceID(aNameSpace, namespaceID); } nsIContent* content; - if (nsID == kNameSpaceID_HTML) { + if (namespaceID == kNameSpaceID_HTML) { nsIHTMLContent* htmlContent; rv = NS_CreateHTMLElement(&htmlContent, aTagName); @@ -470,7 +470,7 @@ nsXMLDocument::CreateElementWithNameSpace(const nsString& aTagName, rv = NS_NewXMLElement(&xmlContent, tag); NS_RELEASE(tag); if (NS_OK == rv) { - xmlContent->SetNameSpaceID(nsID); + xmlContent->SetNameSpaceID(namespaceID); } content = (nsIXMLContent*)xmlContent; }