Bug 1224951 - Part 2: Fix -Wunreachable-code warnings in layout. r=dholbert

layout/base/nsCSSFrameConstructor.cpp:12067:12: warning: will never be executed [-Wunreachable-code]
layout/base/nsPresContext.cpp:2861:10: warning: will never be executed [-Wunreachable-code]
layout/generic/nsFrameSetFrame.cpp:730:11: warning: will never be executed [-Wunreachable-code]
layout/generic/nsFrameSetFrame.cpp:725:11: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:268:62: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:269:66: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:270:68: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:271:75: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:272:73: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:273:81: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:274:69: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:275:60: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:276:68: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:277:68: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:279:18: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:290:62: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:291:66: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:292:68: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:293:75: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:294:73: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:295:81: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:296:69: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:297:60: warning: will never be executed [-Wunreachable-code]
layout/generic/nsSelection.cpp:5657:7: warning: will never be executed [-Wunreachable-code]
layout/mathml/nsMathMLmrootFrame.cpp:405:5: warning: will never be executed [-Wunreachable-code]
This commit is contained in:
Chris Peterson 2015-11-14 00:06:58 -08:00
parent 50912a55b9
commit bfeb9f1127
4 changed files with 25 additions and 31 deletions

View File

@ -12062,8 +12062,8 @@ nsCSSFrameConstructor::WipeContainingBlock(nsFrameConstructorState& aState,
return false;
}
// We might have some inline kids for this block. Just reconstruct.
break;
// We might have some inline kids for this block. Just fall out of the
// loop and reconstruct.
} while (0);
// If we don't have a containing block, start with aFrame and look for one.

View File

@ -722,12 +722,10 @@ nsFrameborder GetFrameBorderHelper(nsGenericHTMLElement* aContent)
case NS_STYLE_FRAME_YES:
case NS_STYLE_FRAME_1:
return eFrameborder_Yes;
break;
case NS_STYLE_FRAME_NO:
case NS_STYLE_FRAME_0:
return eFrameborder_No;
break;
}
}
}

View File

@ -265,21 +265,20 @@ GetIndexFromSelectionType(SelectionType aType)
{
switch (aType)
{
case nsISelectionController::SELECTION_NORMAL: return 0; break;
case nsISelectionController::SELECTION_SPELLCHECK: return 1; break;
case nsISelectionController::SELECTION_IME_RAWINPUT: return 2; break;
case nsISelectionController::SELECTION_IME_SELECTEDRAWTEXT: return 3; break;
case nsISelectionController::SELECTION_IME_CONVERTEDTEXT: return 4; break;
case nsISelectionController::SELECTION_IME_SELECTEDCONVERTEDTEXT: return 5; break;
case nsISelectionController::SELECTION_ACCESSIBILITY: return 6; break;
case nsISelectionController::SELECTION_FIND: return 7; break;
case nsISelectionController::SELECTION_URLSECONDARY: return 8; break;
case nsISelectionController::SELECTION_URLSTRIKEOUT: return 9; break;
case nsISelectionController::SELECTION_NORMAL: return 0;
case nsISelectionController::SELECTION_SPELLCHECK: return 1;
case nsISelectionController::SELECTION_IME_RAWINPUT: return 2;
case nsISelectionController::SELECTION_IME_SELECTEDRAWTEXT: return 3;
case nsISelectionController::SELECTION_IME_CONVERTEDTEXT: return 4;
case nsISelectionController::SELECTION_IME_SELECTEDCONVERTEDTEXT: return 5;
case nsISelectionController::SELECTION_ACCESSIBILITY: return 6;
case nsISelectionController::SELECTION_FIND: return 7;
case nsISelectionController::SELECTION_URLSECONDARY: return 8;
case nsISelectionController::SELECTION_URLSTRIKEOUT: return 9;
default:
return -1; break;
return -1;
}
/* NOTREACHED */
return 0;
}
static SelectionType
@ -287,21 +286,20 @@ GetSelectionTypeFromIndex(int8_t aIndex)
{
switch (aIndex)
{
case 0: return nsISelectionController::SELECTION_NORMAL; break;
case 1: return nsISelectionController::SELECTION_SPELLCHECK; break;
case 2: return nsISelectionController::SELECTION_IME_RAWINPUT; break;
case 3: return nsISelectionController::SELECTION_IME_SELECTEDRAWTEXT; break;
case 4: return nsISelectionController::SELECTION_IME_CONVERTEDTEXT; break;
case 5: return nsISelectionController::SELECTION_IME_SELECTEDCONVERTEDTEXT; break;
case 6: return nsISelectionController::SELECTION_ACCESSIBILITY; break;
case 7: return nsISelectionController::SELECTION_FIND; break;
case 8: return nsISelectionController::SELECTION_URLSECONDARY; break;
case 9: return nsISelectionController::SELECTION_URLSTRIKEOUT; break;
case 0: return nsISelectionController::SELECTION_NORMAL;
case 1: return nsISelectionController::SELECTION_SPELLCHECK;
case 2: return nsISelectionController::SELECTION_IME_RAWINPUT;
case 3: return nsISelectionController::SELECTION_IME_SELECTEDRAWTEXT;
case 4: return nsISelectionController::SELECTION_IME_CONVERTEDTEXT;
case 5: return nsISelectionController::SELECTION_IME_SELECTEDCONVERTEDTEXT;
case 6: return nsISelectionController::SELECTION_ACCESSIBILITY;
case 7: return nsISelectionController::SELECTION_FIND;
case 8: return nsISelectionController::SELECTION_URLSECONDARY;
case 9: return nsISelectionController::SELECTION_URLSTRIKEOUT;
default:
return nsISelectionController::SELECTION_NORMAL; break;
return nsISelectionController::SELECTION_NORMAL;
}
/* NOTREACHED */
return 0;
}
/*
@ -5669,7 +5667,6 @@ Selection::GetSelectionAnchorGeometry(SelectionRegion aRegion, nsRect* aRect)
case nsISelectionController::SELECTION_ANCHOR_REGION:
case nsISelectionController::SELECTION_FOCUS_REGION:
return GetSelectionEndPointGeometry(aRegion, aRect);
break;
case nsISelectionController::SELECTION_WHOLE_SELECTION:
break;
default:

View File

@ -402,7 +402,6 @@ nsMathMLmrootFrame::GetAdditionalStyleContext(int32_t aIndex) const
switch (aIndex) {
case NS_SQR_CHAR_STYLE_CONTEXT_INDEX:
return mSqrChar.GetStyleContext();
break;
default:
return nullptr;
}