WebCore fails to build with newer versions of clang.

Reviewed by Sam Weinig.

* Modules/indexeddb/IDBIndex.cpp: Remove an unused constant.
* Modules/indexeddb/IDBObjectStore.cpp: Ditto.
* Modules/webaudio/AudioContext.cpp: Ditto.
* Modules/webaudio/ScriptProcessorNode.cpp: Ditto.
* Modules/webdatabase/SQLResultSet.cpp: Ditto.
* Modules/webdatabase/SQLTransactionBackend.cpp: Ditto.
* Modules/websockets/WebSocketHandshake.cpp: Ditto.
* bindings/objc/DOM.mm: Disable a warning about overriding a protocol method in a cateogry around the one
place we do it. I don't understand why this generates a warning, nor can I see a different approach that
would not result in the warning being emitted.
* css/CSSGrammar.y.in: #if a function that's only used inside an #if.
* html/track/TextTrackCue.cpp: Remove an unused constant.
* loader/TextResourceDecoder.cpp: Remove two unused functions.
* page/ContentSecurityPolicy.cpp: Add #if's around constants and functions that are only used when CSP_NEXT is enabled.
(WebCore::CSPDirectiveList::checkSourceAndReportViolation): Reorder the ifs slightly to make the #if'ing easier.
* page/ContentSecurityPolicy.h: Add #if's around functions that are only used when CSP_NEXT is enabled.
* page/DOMSecurityPolicy.cpp: Ditto.
* page/DOMSecurityPolicy.h: Ditto.
* page/animation/CSSPropertyAnimation.cpp: Remove an unused function.
* platform/mac/DisplaySleepDisabler.cpp: Add an #if around a constant that's only used on iOS.
* platform/mac/WebCoreFullScreenWarningView.mm: Remove three unused constants.
* rendering/RenderLayer.cpp: Remove two unused constants.
* rendering/RenderLayerCompositor.cpp:
(WebCore::compositingLogEnabled): Move the #if around the function definition.
* svg/SVGAnimatedAngle.cpp: Remove an unused function.
* svg/SVGUseElement.cpp: #if a function that's only used inside an ASSERT.
* xml/XPathStep.cpp: Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156600 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index e6430d4..618ad13 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,37 @@
+2013-09-28  Mark Rowe  <mrowe@apple.com>
+
+        WebCore fails to build with newer versions of clang.
+
+        Reviewed by Sam Weinig.
+
+        * Modules/indexeddb/IDBIndex.cpp: Remove an unused constant.
+        * Modules/indexeddb/IDBObjectStore.cpp: Ditto.
+        * Modules/webaudio/AudioContext.cpp: Ditto.
+        * Modules/webaudio/ScriptProcessorNode.cpp: Ditto.
+        * Modules/webdatabase/SQLResultSet.cpp: Ditto.
+        * Modules/webdatabase/SQLTransactionBackend.cpp: Ditto.
+        * Modules/websockets/WebSocketHandshake.cpp: Ditto.
+        * bindings/objc/DOM.mm: Disable a warning about overriding a protocol method in a cateogry around the one
+        place we do it. I don't understand why this generates a warning, nor can I see a different approach that
+        would not result in the warning being emitted.
+        * css/CSSGrammar.y.in: #if a function that's only used inside an #if.
+        * html/track/TextTrackCue.cpp: Remove an unused constant.
+        * loader/TextResourceDecoder.cpp: Remove two unused functions.
+        * page/ContentSecurityPolicy.cpp: Add #if's around constants and functions that are only used when CSP_NEXT is enabled.
+        (WebCore::CSPDirectiveList::checkSourceAndReportViolation): Reorder the ifs slightly to make the #if'ing easier.
+        * page/ContentSecurityPolicy.h: Add #if's around functions that are only used when CSP_NEXT is enabled.
+        * page/DOMSecurityPolicy.cpp: Ditto.
+        * page/DOMSecurityPolicy.h: Ditto.
+        * page/animation/CSSPropertyAnimation.cpp: Remove an unused function.
+        * platform/mac/DisplaySleepDisabler.cpp: Add an #if around a constant that's only used on iOS.
+        * platform/mac/WebCoreFullScreenWarningView.mm: Remove three unused constants.
+        * rendering/RenderLayer.cpp: Remove two unused constants.
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::compositingLogEnabled): Move the #if around the function definition.
+        * svg/SVGAnimatedAngle.cpp: Remove an unused function.
+        * svg/SVGUseElement.cpp: #if a function that's only used inside an ASSERT.
+        * xml/XPathStep.cpp: Ditto.
+
 2013-09-27  Brady Eidson  <beidson@apple.com>
 
         IndexedDB IDL Refactoring.
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
index 637b56b..26b55e44 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
@@ -39,8 +39,6 @@
 
 namespace WebCore {
 
-static const unsigned short defaultDirection = IndexedDB::CursorNext;
-
 IDBIndex::IDBIndex(const IDBIndexMetadata& metadata, IDBObjectStore* objectStore, IDBTransaction* transaction)
     : m_metadata(metadata)
     , m_objectStore(objectStore)
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
index a88473292..dbf54f5 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
@@ -46,8 +46,6 @@
 
 namespace WebCore {
 
-static const unsigned short defaultDirection = IndexedDB::CursorNext;
-
 IDBObjectStore::IDBObjectStore(const IDBObjectStoreMetadata& metadata, IDBTransaction* transaction)
     : m_metadata(metadata)
     , m_transaction(transaction)
diff --git a/Source/WebCore/Modules/webaudio/AudioContext.cpp b/Source/WebCore/Modules/webaudio/AudioContext.cpp
index aab309b7..df06860 100644
--- a/Source/WebCore/Modules/webaudio/AudioContext.cpp
+++ b/Source/WebCore/Modules/webaudio/AudioContext.cpp
@@ -91,7 +91,6 @@
 // FIXME: check the proper way to reference an undefined thread ID
 const int UndefinedThreadIdentifier = 0xffffffff;
 
-const unsigned MaxNodesToDeletePerQuantum = 10;
 const unsigned MaxPeriodicWaveLength = 4096;
 
 namespace WebCore {
diff --git a/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp b/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp
index ab1d2ee..5c12963 100644
--- a/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp
+++ b/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp
@@ -40,8 +40,6 @@
 
 namespace WebCore {
 
-const size_t DefaultBufferSize = 4096;
-
 PassRefPtr<ScriptProcessorNode> ScriptProcessorNode::create(AudioContext* context, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels)
 {
     // Check for valid buffer size.
diff --git a/Source/WebCore/Modules/webdatabase/SQLResultSet.cpp b/Source/WebCore/Modules/webdatabase/SQLResultSet.cpp
index 73cb430..91a2d91 100644
--- a/Source/WebCore/Modules/webdatabase/SQLResultSet.cpp
+++ b/Source/WebCore/Modules/webdatabase/SQLResultSet.cpp
@@ -35,8 +35,6 @@
 
 namespace WebCore {
 
-static unsigned const MaxErrorCode = 2;
-
 SQLResultSet::SQLResultSet()
     : m_rows(SQLResultSetRowList::create())
     , m_insertId(0)
diff --git a/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp b/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp
index 0490982..aa2b645 100644
--- a/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp
+++ b/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp
@@ -342,12 +342,6 @@
 //     - This is how a transaction ends normally.
 //     - state CleanupAndTerminate calls doCleanup().
 
-
-// There's no way of knowing exactly how much more space will be required when a statement hits the quota limit.
-// For now, we'll arbitrarily choose currentQuota + 1mb.
-// In the future we decide to track if a size increase wasn't enough, and ask for larger-and-larger increases until its enough.
-static const int DefaultQuotaSizeIncrease = 1048576;
-
 namespace WebCore {
 
 PassRefPtr<SQLTransactionBackend> SQLTransactionBackend::create(DatabaseBackend* db,
diff --git a/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp b/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp
index 1ec1277..a3b7667 100644
--- a/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp
+++ b/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp
@@ -61,8 +61,6 @@
 
 namespace WebCore {
 
-static const char randomCharacterInSecWebSocketKey[] = "!\"#$%&'()*+,-./:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
-
 static String resourceName(const URL& url)
 {
     StringBuilder name;
diff --git a/Source/WebCore/bindings/objc/DOM.mm b/Source/WebCore/bindings/objc/DOM.mm
index 9453527..4ffe861 100644
--- a/Source/WebCore/bindings/objc/DOM.mm
+++ b/Source/WebCore/bindings/objc/DOM.mm
@@ -180,6 +180,9 @@
 
 @implementation DOMNode (WebCoreInternal)
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
+
 - (NSString *)description
 {
     if (!_internal)
@@ -193,6 +196,8 @@
     return [NSString stringWithFormat:@"<%@ [%@]: %p>", [[self class] description], [self nodeName], _internal];
 }
 
+#pragma clang diagnostic pop
+
 - (JSC::Bindings::RootObject*)_rootObject
 {
     WebCore::Frame* frame = core(self)->document().frame();
diff --git a/Source/WebCore/css/CSSGrammar.y.in b/Source/WebCore/css/CSSGrammar.y.in
index 7575220..9dc91e4 100644
--- a/Source/WebCore/css/CSSGrammar.y.in
+++ b/Source/WebCore/css/CSSGrammar.y.in
@@ -40,6 +40,8 @@
     return 1;
 }
 
+#if YYDEBUG > 0
+
 static inline bool isCSSTokenAString(int yytype)
 {
     switch (yytype) {
@@ -65,6 +67,8 @@
     }
 }
 
+#endif
+
 %}
 
 #if ENABLE_SHADOW_DOM
diff --git a/Source/WebCore/html/track/TextTrackCue.cpp b/Source/WebCore/html/track/TextTrackCue.cpp
index cf00fed..c539268 100644
--- a/Source/WebCore/html/track/TextTrackCue.cpp
+++ b/Source/WebCore/html/track/TextTrackCue.cpp
@@ -56,7 +56,6 @@
 
 static const int invalidCueIndex = -1;
 static const int undefinedPosition = -1;
-static const int autoSize = 0;
 
 static const String& startKeyword()
 {
diff --git a/Source/WebCore/loader/TextResourceDecoder.cpp b/Source/WebCore/loader/TextResourceDecoder.cpp
index 79b028f..401239f 100644
--- a/Source/WebCore/loader/TextResourceDecoder.cpp
+++ b/Source/WebCore/loader/TextResourceDecoder.cpp
@@ -44,11 +44,6 @@
     return p[0] == b0 && p[1] == b1;
 }
 
-static inline bool bytesEqual(const char* p, char b0, char b1, char b2)
-{
-    return p[0] == b0 && p[1] == b1 && p[2] == b2;
-}
-
 static inline bool bytesEqual(const char* p, char b0, char b1, char b2, char b3, char b4)
 {
     return p[0] == b0 && p[1] == b1 && p[2] == b2 && p[3] == b3 && p[4] == b4;
@@ -404,14 +399,6 @@
     return pos;
 }
 
-// true if there is more to parse
-static inline bool skipWhitespace(const char*& pos, const char* dataEnd)
-{
-    while (pos < dataEnd && (*pos == '\t' || *pos == ' '))
-        ++pos;
-    return pos != dataEnd;
-}
-
 size_t TextResourceDecoder::checkForBOM(const char* data, size_t len)
 {
     // Check for UTF-16/32 or UTF-8 BOM mark at the beginning, which is a sure sign of a Unicode encoding.
diff --git a/Source/WebCore/page/ContentSecurityPolicy.cpp b/Source/WebCore/page/ContentSecurityPolicy.cpp
index 8c55530..0be9f98 100644
--- a/Source/WebCore/page/ContentSecurityPolicy.cpp
+++ b/Source/WebCore/page/ContentSecurityPolicy.cpp
@@ -125,7 +125,9 @@
 static const char formAction[] = "form-action";
 static const char pluginTypes[] = "plugin-types";
 static const char scriptNonce[] = "script-nonce";
+#if ENABLE(CSP_NEXT)
 static const char reflectedXSS[] = "reflected-xss";
+#endif
 
 bool isDirectiveName(const String& name)
 {
diff --git a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp b/Source/WebCore/page/animation/CSSPropertyAnimation.cpp
index 92e7ff2..57504e6 100644
--- a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp
+++ b/Source/WebCore/page/animation/CSSPropertyAnimation.cpp
@@ -93,12 +93,6 @@
                       blendFunc(anim, from.height(), to.height(), progress));
 }
 
-static inline IntSize blendFunc(const AnimationBase* anim, const IntSize& from, const IntSize& to, double progress)
-{
-    return IntSize(blendFunc(anim, from.width(), to.width(), progress),
-                   blendFunc(anim, from.height(), to.height(), progress));
-}
-
 static inline ShadowStyle blendFunc(const AnimationBase* anim, ShadowStyle from, ShadowStyle to, double progress)
 {
     if (from == to)
diff --git a/Source/WebCore/platform/mac/DisplaySleepDisabler.cpp b/Source/WebCore/platform/mac/DisplaySleepDisabler.cpp
index e3738c2..5b997ca 100644
--- a/Source/WebCore/platform/mac/DisplaySleepDisabler.cpp
+++ b/Source/WebCore/platform/mac/DisplaySleepDisabler.cpp
@@ -31,7 +31,9 @@
 
 namespace WebCore {
 
+#if PLATFORM(IOS)
 static const double systemActivityInterval = 1;
+#endif
 
 DisplaySleepDisabler::DisplaySleepDisabler(const char* reason)
     : m_disableDisplaySleepAssertion(0)
diff --git a/Source/WebCore/platform/mac/WebCoreFullScreenWarningView.mm b/Source/WebCore/platform/mac/WebCoreFullScreenWarningView.mm
index 1ba3882..c4e1fa3 100644
--- a/Source/WebCore/platform/mac/WebCoreFullScreenWarningView.mm
+++ b/Source/WebCore/platform/mac/WebCoreFullScreenWarningView.mm
@@ -40,11 +40,8 @@
 static const CGFloat WarningViewBackgroundAlpha = 0.9;
 static const CGFloat WarningViewShadowWhite = 0.1;
 static const CGFloat WarningViewShadowAlpha = 1;
-static const float WarningViewShadowOpacity = 0.25;
 static const NSSize WarningViewShadowOffset = {0, -2};
 static const CGFloat WarningViewShadowRadius = 5;
-static const NSTimeInterval WarningViewHideDelay = 3;
-static const NSTimeInterval WarningViewFadeDuration = 0.5;
 
 @implementation WebCoreFullScreenWarningView
 
diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp
index 37e8878..dd4fc7c 100644
--- a/Source/WebCore/rendering/RenderLayer.cpp
+++ b/Source/WebCore/rendering/RenderLayer.cpp
@@ -137,9 +137,6 @@
 
 using namespace HTMLNames;
 
-const int MinimumWidthWhileResizing = 100;
-const int MinimumHeightWhileResizing = 40;
-
 bool ClipRect::intersects(const HitTestLocation& hitTestLocation) const
 {
     return hitTestLocation.intersects(m_rect);
diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp
index caf1c01..f08a54b 100644
--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp
@@ -205,14 +205,12 @@
 };
 
 
+#if !LOG_DISABLED
 static inline bool compositingLogEnabled()
 {
-#if !LOG_DISABLED
     return LogCompositing.state == WTFLogChannelOn;
-#else
-    return false;
-#endif
 }
+#endif
 
 RenderLayerCompositor::RenderLayerCompositor(RenderView& renderView)
     : m_renderView(renderView)
@@ -636,7 +634,7 @@
 {
     if (!compositingLogEnabled())
         return;
-        
+
     RenderLayerBacking* backing = layer->backing();
     if (requiresCompositingLayer(layer) || layer->isRootLayer()) {
         ++m_obligateCompositedLayerCount;
diff --git a/Source/WebCore/svg/SVGAnimatedAngle.cpp b/Source/WebCore/svg/SVGAnimatedAngle.cpp
index ccdc999..d1ee99b 100644
--- a/Source/WebCore/svg/SVGAnimatedAngle.cpp
+++ b/Source/WebCore/svg/SVGAnimatedAngle.cpp
@@ -32,13 +32,6 @@
 {
 }
 
-static inline SVGAngle& sharedSVGAngle(const String& valueAsString)
-{
-    DEFINE_STATIC_LOCAL(SVGAngle, sharedAngle, ());
-    sharedAngle.setValueAsString(valueAsString, ASSERT_NO_EXCEPTION);
-    return sharedAngle;
-}
-
 PassOwnPtr<SVGAnimatedType> SVGAnimatedAngleAnimator::constructFromString(const String& string)
 {
     OwnPtr<SVGAnimatedType> animatedType = SVGAnimatedType::createAngleAndEnumeration(new pair<SVGAngle, unsigned>);
diff --git a/Source/WebCore/svg/SVGUseElement.cpp b/Source/WebCore/svg/SVGUseElement.cpp
index 4cea68c..e21808f 100644
--- a/Source/WebCore/svg/SVGUseElement.cpp
+++ b/Source/WebCore/svg/SVGUseElement.cpp
@@ -168,12 +168,14 @@
     reportAttributeParsingError(parseError, name, value);
 }
 
+#if !ASSERT_DISABLED
 static inline bool isWellFormedDocument(Document& document)
 {
     if (document.isSVGDocument() || document.isXHTMLDocument())
         return static_cast<XMLDocumentParser*>(document.parser())->wellFormed();
     return true;
 }
+#endif
 
 Node::InsertionNotificationRequest SVGUseElement::insertedInto(ContainerNode* rootParent)
 {
diff --git a/Source/WebCore/xml/XPathStep.cpp b/Source/WebCore/xml/XPathStep.cpp
index 32076f7..441dfe4 100644
--- a/Source/WebCore/xml/XPathStep.cpp
+++ b/Source/WebCore/xml/XPathStep.cpp
@@ -138,6 +138,7 @@
     }
 }
 
+#if !ASSERT_DISABLED
 static inline Node::NodeType primaryNodeType(Step::Axis axis)
 {
     switch (axis) {
@@ -149,6 +150,7 @@
             return Node::ELEMENT_NODE;
     }
 }
+#endif
 
 // Evaluate NodeTest without considering merged predicates.
 static inline bool nodeMatchesBasicTest(Node* node, Step::Axis axis, const Step::NodeTest& nodeTest)