Title: [92588] trunk/Source/WebCore
Revision
92588
Author
[email protected]
Date
2011-08-08 01:42:14 -0700 (Mon, 08 Aug 2011)

Log Message

Should not use C-style cast in CSSParser.cpp
https://bugs.webkit.org/show_bug.cgi?id=65807

Remove C-style cast.

Reviewed by Kent Tamura.

No new tests because no behavior change.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseAnimationTimingFunction): Replaced a cast with clampToInteger().
(WebCore::CSSParser::parseFontFeatureTag): Ditto.
(WebCore::CSSParser::createKeyframeRule): Replaced a cast with C++-style cast.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (92587 => 92588)


--- trunk/Source/WebCore/ChangeLog	2011-08-08 08:12:36 UTC (rev 92587)
+++ trunk/Source/WebCore/ChangeLog	2011-08-08 08:42:14 UTC (rev 92588)
@@ -1,3 +1,19 @@
+2011-08-08  Kenichi Ishibashi  <[email protected]>
+
+        Should not use C-style cast in CSSParser.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=65807
+
+        Remove C-style cast.
+
+        Reviewed by Kent Tamura.
+
+        No new tests because no behavior change.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseAnimationTimingFunction): Replaced a cast with clampToInteger().
+        (WebCore::CSSParser::parseFontFeatureTag): Ditto.
+        (WebCore::CSSParser::createKeyframeRule): Replaced a cast with C++-style cast.
+
 2011-08-05  Pavel Feldman  <[email protected]>
 
         Web Inspector: implement dock/undock in WebKit2 without getting into WebCore.

Modified: trunk/Source/WebCore/css/CSSParser.cpp (92587 => 92588)


--- trunk/Source/WebCore/css/CSSParser.cpp	2011-08-08 08:12:36 UTC (rev 92587)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2011-08-08 08:42:14 UTC (rev 92588)
@@ -3284,7 +3284,7 @@
         CSSParserValue* v = args->current();
         if (!validUnit(v, FInteger, m_strict))
             return 0;
-        numSteps = static_cast<int>(min(v->fValue, (double)INT_MAX));
+        numSteps = clampToInteger(v->fValue);
         if (numSteps < 1)
             return 0;
         v = args->next();
@@ -6333,7 +6333,7 @@
     value = m_valueList->next();
     if (value) {
         if (value->unit == CSSPrimitiveValue::CSS_NUMBER && value->isInt && value->fValue >= 0) {
-            tagValue = static_cast<int>(value->fValue);
+            tagValue = clampToInteger(value->fValue);
             if (tagValue < 0)
                 return false;
             m_valueList->next();
@@ -6952,7 +6952,7 @@
     // Create a key string from the passed keys
     String keyString;
     for (unsigned i = 0; i < keys->size(); ++i) {
-        float key = (float) keys->valueAt(i)->fValue;
+        float key = static_cast<float>(keys->valueAt(i)->fValue);
         if (i != 0)
             keyString += ",";
         keyString += String::number(key);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to