WebCore: Enable -Wimplicit-fallthrough and add FALLTHROUGH annotation where needed
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jan 2014 04:04:52 +0000 (04:04 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jan 2014 04:04:52 +0000 (04:04 +0000)
commit732e010aedcd8f2fe041dbf7c9407dbb6478a817
tree1f8fb07ddad05b8ab601e3e8954da16ba9f8da6f
parent1e13f5b2e8d3142ccddb5bfb87c468a083ef67fc
WebCore: Enable -Wimplicit-fallthrough and add FALLTHROUGH annotation where needed
https://bugs.webkit.org/show_bug.cgi?id=127671

Source/WebCore:

Reviewed by Ryosuke Niwa.

* Configurations/Base.xcconfig:
Enable the warning.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
Caught a bug. CSSPropertyWebkitAlt could fall through to CSSPropertyQuotes.

* css/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
Caught a bug. CSSPropertyWebkitSvgShadow could fall through to CSSPropertyMaskType.

* platform/Decimal.cpp:
(WebCore::Decimal::fromString):
Possible bug. Implementation doesn't seem to match its documentation.
Filed an issue to follow-up on this unclear function.

* css/makeprop.pl:
* css/makevalues.pl:
* platform/ColorData.gperf:
Ignore implicit fallthrough warnings in generated code. gperf outputs
a "/*FALLTHROUGH*/" comment, but is not easily customizable to change
this output. Easiest to just ignore the warning for now.

* rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::recalcColumn):
(WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
(WebCore::AutoTableLayout::layout):
There has been a "fall through" comment immediately followed by a break
since its introduction in 2003. Removing the inaccurate comment.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canHaveChildren):
(WebCore::AccessibilityNodeObject::visibleText):
(WebCore::AccessibilityNodeObject::title):
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase accessibilityDescription]):
(-[WebAccessibilityObjectWrapperBase accessibilityHelpText]):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):
(WebCore::CloneDeserializer::deserialize):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseContent):
(WebCore::CSSParser::realLex):
* css/CSSSelector.cpp:
(WebCore::CSSSelector::extractPseudoType):
(WebCore::CSSSelector::selectorText):
* css/StyleProperties.cpp:
(WebCore::StyleProperties::asText):
* css/StyleSheetContents.cpp:
(WebCore::childRulesHaveFailedOrCanceledSubresources):
* dom/Node.cpp:
(WebCore::appendTextContent):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processStartTag):
(WebCore::HTMLTreeBuilder::processEndTag):
(WebCore::HTMLTreeBuilder::processCharacterBuffer):
(WebCore::HTMLTreeBuilder::processEndOfFile):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
* page/EventSource.cpp:
(WebCore::EventSource::parseEventStream):
* platform/DateComponents.cpp:
(WebCore::DateComponents::toStringForTime):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::updateStates):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::platformInit):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::totalBytes):
* platform/graphics/win/FullScreenController.cpp:
(FullScreenController::Private::fullscreenClientWndProc):
* platform/text/BidiResolver.h:
(WebCore::Run>::updateStatusLastFromCurrentDirection):
(WebCore::Run>::createBidiRunsForLine):
* platform/text/win/LocaleWin.cpp:
(WebCore::LocaleWin::initializeLocaleData):
* rendering/PointerEventsHitRules.cpp:
(WebCore::PointerEventsHitRules::PointerEventsHitRules):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::newLine):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::updateLogicalWidthForAlignment):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeReplacedLogicalWidthUsing):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::calculateFillTileSize):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::drawLineForBoxSide):
* rendering/RenderQuote.cpp:
(WebCore::RenderQuote::originalText):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::replacedContentRect):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::addChild):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setWordSpacing):
* rendering/svg/RenderSVGResource.cpp:
(WebCore::requestPaintingResource):
* rendering/svg/SVGMarkerData.h:
(WebCore::SVGMarkerData::updateMarkerDataForPathElement):
* svg/SVGPathParser.cpp:
(WebCore::SVGPathParser::parsePathDataFromSource):
* svg/SVGTransformDistance.cpp:
(WebCore::SVGTransformDistance::SVGTransformDistance):
(WebCore::SVGTransformDistance::scaledDistance):
(WebCore::SVGTransformDistance::addSVGTransforms):
(WebCore::SVGTransformDistance::addToSVGTransform):
(WebCore::SVGTransformDistance::distance):
Add annotation or break before falling into a default:break;

Source/WTF:

Reviewed by Ryosuke Niwa.

* wtf/text/WTFString.h:
(WTF::appendNumber):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
45 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/text/WTFString.h
Source/WebCore/ChangeLog
Source/WebCore/Configurations/Base.xcconfig
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm
Source/WebCore/bindings/js/SerializedScriptValue.cpp
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSSelector.cpp
Source/WebCore/css/SVGCSSParser.cpp
Source/WebCore/css/StyleProperties.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/StyleSheetContents.cpp
Source/WebCore/css/makeprop.pl [changed mode: 0644->0755]
Source/WebCore/css/makevalues.pl [changed mode: 0644->0755]
Source/WebCore/dom/Node.cpp
Source/WebCore/html/parser/HTMLTreeBuilder.cpp
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/page/EventSource.cpp
Source/WebCore/platform/ColorData.gperf
Source/WebCore/platform/DateComponents.cpp
Source/WebCore/platform/Decimal.cpp
Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/win/FullScreenController.cpp
Source/WebCore/platform/text/BidiResolver.h
Source/WebCore/platform/text/win/LocaleWin.cpp
Source/WebCore/rendering/AutoTableLayout.cpp
Source/WebCore/rendering/PointerEventsHitRules.cpp
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderQuote.cpp
Source/WebCore/rendering/RenderReplaced.cpp
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/svg/RenderSVGResource.cpp
Source/WebCore/rendering/svg/SVGMarkerData.h
Source/WebCore/svg/SVGPathParser.cpp
Source/WebCore/svg/SVGTransformDistance.cpp