From e36b183d7148b0d0d1ea5739c1247747189058c0 Mon Sep 17 00:00:00 2001 From: "scc%netscape.com" Date: Wed, 20 Oct 1999 18:59:00 +0000 Subject: [PATCH] eliminate warnings, r=shaver --- layout/forms/nsGfxCheckboxControlFrame.cpp | 4 ++++ .../html/forms/src/nsCheckboxControlFrame.cpp | 4 ++-- .../forms/src/nsGfxCheckboxControlFrame.cpp | 4 ++++ layout/xul/base/src/nsFontPickerFrame.cpp | 1 - layout/xul/base/src/nsSpinnerFrame.cpp | 1 - layout/xul/base/src/nsToolbarDragListener.cpp | 6 ++++-- layout/xul/base/src/nsToolbarFrame.cpp | 2 +- layout/xul/base/src/nsToolboxFrame.cpp | 19 +++++++++++-------- widget/src/xpwidgets/nsPrimitiveHelpers.cpp | 4 ++-- widget/src/xpwidgets/nsXIFFormatConverter.cpp | 6 +++--- 10 files changed, 31 insertions(+), 20 deletions(-) diff --git a/layout/forms/nsGfxCheckboxControlFrame.cpp b/layout/forms/nsGfxCheckboxControlFrame.cpp index 949d951a7ee2..33dc6c6ff0be 100644 --- a/layout/forms/nsGfxCheckboxControlFrame.cpp +++ b/layout/forms/nsGfxCheckboxControlFrame.cpp @@ -85,6 +85,10 @@ nsGfxCheckboxControlFrame::PaintCheckBox(nsIPresContext& aPresContext, case eMixed: PaintMixedMark(aRenderingContext, p2t, checkRect); break; + + // no special drawing otherwise + default: + break; } // case of value of checkbox } else { // Get current checked state through content model. diff --git a/layout/html/forms/src/nsCheckboxControlFrame.cpp b/layout/html/forms/src/nsCheckboxControlFrame.cpp index 8696f422b6d0..c0c441a2ff9d 100644 --- a/layout/html/forms/src/nsCheckboxControlFrame.cpp +++ b/layout/html/forms/src/nsCheckboxControlFrame.cpp @@ -213,7 +213,7 @@ nsCheckboxControlFrame::MouseUp(nsIPresContext* aPresContext) // attribute changed event since we just set the state of the checkbox ourselves. nsAutoString value; CheckStateToString ( newState, value ); - nsresult res = mContent->SetAttribute ( kNameSpaceID_None, GetTristateValueAtom(), value, PR_FALSE ); + mContent->SetAttribute ( kNameSpaceID_None, GetTristateValueAtom(), value, PR_FALSE ); } else { CheckState newState = GetCheckboxState() == eOn ? eOff : eOn; @@ -384,7 +384,7 @@ nsCheckboxControlFrame :: SwitchModesWithEmergencyBrake ( PRBool inIsNowTristate // our parallel attribute. nsAutoString value; CheckStateToString ( GetCheckboxState(), value ); - nsresult res = mContent->SetAttribute ( kNameSpaceID_None, GetTristateValueAtom(), value, PR_FALSE ); + mContent->SetAttribute ( kNameSpaceID_None, GetTristateValueAtom(), value, PR_FALSE ); } else { // we were a tri-state checkbox, and now we're a normal checkbox. The current diff --git a/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp b/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp index 949d951a7ee2..33dc6c6ff0be 100644 --- a/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp +++ b/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp @@ -85,6 +85,10 @@ nsGfxCheckboxControlFrame::PaintCheckBox(nsIPresContext& aPresContext, case eMixed: PaintMixedMark(aRenderingContext, p2t, checkRect); break; + + // no special drawing otherwise + default: + break; } // case of value of checkbox } else { // Get current checked state through content model. diff --git a/layout/xul/base/src/nsFontPickerFrame.cpp b/layout/xul/base/src/nsFontPickerFrame.cpp index 26ad88ad5e3a..edec983d677a 100644 --- a/layout/xul/base/src/nsFontPickerFrame.cpp +++ b/layout/xul/base/src/nsFontPickerFrame.cpp @@ -83,7 +83,6 @@ nsFontPickerFrame :: GetDesiredSize(nsIPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredLayoutSize) { const int CSS_NOTSET = -1; - const int ATTR_NOTSET = -1; nsSize styleSize; if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) { diff --git a/layout/xul/base/src/nsSpinnerFrame.cpp b/layout/xul/base/src/nsSpinnerFrame.cpp index 95b1f9341911..b98b7cff8ecf 100644 --- a/layout/xul/base/src/nsSpinnerFrame.cpp +++ b/layout/xul/base/src/nsSpinnerFrame.cpp @@ -83,7 +83,6 @@ nsSpinnerFrame :: GetDesiredSize(nsIPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredLayoutSize) { const int CSS_NOTSET = -1; - const int ATTR_NOTSET = -1; nsSize styleSize; if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) { diff --git a/layout/xul/base/src/nsToolbarDragListener.cpp b/layout/xul/base/src/nsToolbarDragListener.cpp index c2193d8bfc68..645beb44908c 100644 --- a/layout/xul/base/src/nsToolbarDragListener.cpp +++ b/layout/xul/base/src/nsToolbarDragListener.cpp @@ -290,9 +290,11 @@ printf ( "DRAGOVER:: toolbar content is %ld, as DOMNode %ld, target is %ld\n", c mToolbar->GetContent ( getter_AddRefs(content) ); if ( content ) { char buffer[10]; - sprintf(buffer, "%ld", xLoc); + + // need the cast, because on some platforms, PR[U]int32 != long, but we're using "%ld" + sprintf(buffer, "%ld", NS_STATIC_CAST(long, xLoc)); content->SetAttribute ( kNameSpaceID_None, nsXULAtoms::tbDropLocationCoord, buffer, PR_TRUE ); - sprintf(buffer, "%ld", beforeIndex); + sprintf(buffer, "%ld", NS_STATIC_CAST(long, beforeIndex)); content->SetAttribute ( kNameSpaceID_None, nsXULAtoms::tbDropLocation, "1", PR_FALSE ); content->SetAttribute ( kNameSpaceID_None, nsXULAtoms::tbDropOn, onChild ? "true" : "false", PR_FALSE ); } diff --git a/layout/xul/base/src/nsToolbarFrame.cpp b/layout/xul/base/src/nsToolbarFrame.cpp index 704b82a32fdf..0c08aa64b9e2 100644 --- a/layout/xul/base/src/nsToolbarFrame.cpp +++ b/layout/xul/base/src/nsToolbarFrame.cpp @@ -245,7 +245,7 @@ nsToolbarFrame::Init ( nsIPresContext& aPresContext, nsIContent* aContent, for ( PRUint32 i = 0; i < length; ++i ) { nsCOMPtr node; inputList->Item(i, getter_AddRefs(node)); - nsCOMPtr receiver(do_QueryInterface(node)); + receiver = do_QueryInterface(node); if ( receiver ) receiver->AddEventListenerByIID(new nsTEMPDragGestureEater, nsIDOMDragListener::GetIID()); // yes, i know this will leak. That's ok, i don't care because this code will go away diff --git a/layout/xul/base/src/nsToolboxFrame.cpp b/layout/xul/base/src/nsToolboxFrame.cpp index 0ff01b3fc4e1..14a18c1ad704 100644 --- a/layout/xul/base/src/nsToolboxFrame.cpp +++ b/layout/xul/base/src/nsToolboxFrame.cpp @@ -424,19 +424,22 @@ nsToolboxFrame::CalculateGrippies(nsIPresContext& aPresContext) float p2t; aPresContext.GetScaledPixelsToTwips(&p2t); nscoord onePixel = NSIntPixelsToTwips(1, p2t); - nscoord grippyWidth = kGrippyWidthInPixels * onePixel; // remember to leave room for the grippy on the right nscoord collapsedGrippyHeight = kCollapsedGrippyHeightInPixels * onePixel; nscoord collapsedGrippyWidth = kCollapsedGrippyWidthInPixels * onePixel; const PRBool isHorz = IsHorizontal(); - // Leave room at the side for the grippies of visible toolbars. Make a margin - // of the appropriate dimensions. - mInset = nsMargin(0,0,0,0); - if ( isHorz ) // Set margins so we have a place for uncollapsed grippies - mInset.top = grippyWidth; - else - mInset.left = grippyWidth; + { + nscoord grippyWidth = kGrippyWidthInPixels * onePixel; // remember to leave room for the grippy on the right + + // Leave room at the side for the grippies of visible toolbars. Make a margin + // of the appropriate dimensions. + mInset = nsMargin(0,0,0,0); + if ( isHorz ) // Set margins so we have a place for uncollapsed grippies + mInset.top = grippyWidth; + else + mInset.left = grippyWidth; + } // Save old tabs so we can make newly collapsed bars as wide as they WERE tall. We will // release the grippies in mGrippies at the very end when we dispose of |oldGrippies| diff --git a/widget/src/xpwidgets/nsPrimitiveHelpers.cpp b/widget/src/xpwidgets/nsPrimitiveHelpers.cpp index 9ea61482a541..ab919203d320 100644 --- a/widget/src/xpwidgets/nsPrimitiveHelpers.cpp +++ b/widget/src/xpwidgets/nsPrimitiveHelpers.cpp @@ -44,8 +44,8 @@ nsPrimitiveHelpers :: CreatePrimitiveForData ( const char* aFlavor, void* aDataB if ( strcmp(aFlavor,kTextMime) == 0 ) { nsCOMPtr primitive; - nsresult rv = nsComponentManager::CreateInstance(NS_SUPPORTS_STRING_PROGID, nsnull, - NS_GET_IID(nsISupportsString), getter_AddRefs(primitive)); + nsComponentManager::CreateInstance(NS_SUPPORTS_STRING_PROGID, nsnull, + NS_GET_IID(nsISupportsString), getter_AddRefs(primitive)); if ( primitive ) { primitive->SetData ( (char*)aDataBuff ); nsCOMPtr genericPrimitive ( do_QueryInterface(primitive) ); diff --git a/widget/src/xpwidgets/nsXIFFormatConverter.cpp b/widget/src/xpwidgets/nsXIFFormatConverter.cpp index 8f74afc858ff..382b2648d48c 100644 --- a/widget/src/xpwidgets/nsXIFFormatConverter.cpp +++ b/widget/src/xpwidgets/nsXIFFormatConverter.cpp @@ -219,10 +219,10 @@ nsXIFFormatConverter::Convert(const char *aFromDataFlavor, nsISupports *aFromDat // XIF on clipboard is going to always be double byte so it will be in a primitive // class of nsISupportsWString. Also, since the data is in two byte chunks the // length represents the length in 1-byte chars, so we need to divide by two. - nsCOMPtr dataWrapper ( do_QueryInterface(aFromData) ); - if ( dataWrapper ) { + nsCOMPtr dataWrapper0 ( do_QueryInterface(aFromData) ); + if ( dataWrapper0 ) { nsXPIDLString data; - dataWrapper->ToString ( getter_Copies(data) ); //еее COPY #1 + dataWrapper0->ToString ( getter_Copies(data) ); //еее COPY #1 if ( data ) { PRUnichar* castedData = NS_CONST_CAST(PRUnichar*, NS_STATIC_CAST(const PRUnichar*, data)); nsAutoString dataStr ( CBufDescriptor(castedData, PR_TRUE, aDataLen) ); //еее try not to copy the data