Cleanup of switch statements with default cases
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Sep 2011 00:50:09 +0000 (00:50 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Sep 2011 00:50:09 +0000 (00:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=67808

Reviewed by Adam Barth.

No new tests, just a small refactoring.

* page/WebKitAnimation.cpp:
(WebCore::WebKitAnimation::fillMode):
* platform/audio/Distance.cpp:
(WebCore::DistanceEffect::gain):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94823 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/WebKitAnimation.cpp
Source/WebCore/platform/audio/Distance.cpp

index 4df9301..b67ae14 100644 (file)
@@ -1,3 +1,17 @@
+2011-09-08  Tony Chang  <tony@chromium.org>
+
+        Cleanup of switch statements with default cases
+        https://bugs.webkit.org/show_bug.cgi?id=67808
+
+        Reviewed by Adam Barth.
+
+        No new tests, just a small refactoring.
+
+        * page/WebKitAnimation.cpp:
+        (WebCore::WebKitAnimation::fillMode):
+        * platform/audio/Distance.cpp:
+        (WebCore::DistanceEffect::gain):
+
 2011-09-08  Eric Seidel  <eric@webkit.org>
 
         [BiDi] Add support for the BDI element
index ff7102f..b757d23 100644 (file)
@@ -94,17 +94,15 @@ WebKitAnimation::FillMode WebKitAnimation::fillMode() const
     switch (m_keyframeAnimation->animation()->fillMode()) {
     case AnimationFillModeNone:
         return FILL_NONE;
-        break;
     case AnimationFillModeForwards:
         return FILL_FORWARDS;
-        break;
     case AnimationFillModeBackwards:
         return FILL_BACKWARDS;
-        break;
-    default:
+    case AnimationFillModeBoth:
         return FILL_BOTH;
-        break;
     }
+    ASSERT_NOT_REACHED();
+    return FILL_BOTH;
 }
 
 void WebKitAnimation::pause()
index 0f1b005..04e28f9 100644 (file)
@@ -60,17 +60,13 @@ double DistanceEffect::gain(double distance)
     switch (m_model) {
     case ModelLinear:
         return linearGain(distance);
-        break;
     case ModelInverse:
         return inverseGain(distance);
-        break;
     case ModelExponential:
         return exponentialGain(distance);
-        break;
-
-    default:
-        return 0.0;
     }
+    ASSERT_NOT_REACHED();
+    return 0.0;
 }
 
 double DistanceEffect::linearGain(double distance)