Get WebCore compiling with /W2 on Windows
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2007 05:49:36 +0000 (05:49 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2007 05:49:36 +0000 (05:49 +0000)
Reviewed by Steve.

No regression tests affected.

* WebCore.vcproj/WebCore.vcproj: Turn the warning level up to 2, and
disable two warnings: implicit int <=> float conversion, and class vs.
struct inconsistency.
* dom/CharacterData.cpp:
(WebCore::CharacterData::deleteData): Cast to int before negating.
* loader/Cache.cpp:
(WebCore::Cache::remove): Ditto.
* platform/graphics/Path.cpp:
(WebCore::pathLengthApplierFunction): Consistently use floats.
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawEllipse): Ditto.
* platform/win/GraphicsContextWin.cpp:
(WebCore::GraphicsContext::drawLineForMisspellingOrBadGrammar): Ditto.

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

WebCore/ChangeLog
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/dom/CharacterData.cpp
WebCore/loader/Cache.cpp
WebCore/platform/graphics/Path.cpp
WebCore/platform/graphics/cg/GraphicsContextCG.cpp
WebCore/platform/win/GraphicsContextWin.cpp

index f007bb453514f643118672ebfd5bd07abff2a9e6..b6cb5eb59110e4920a1c1025296c61642289dab5 100644 (file)
@@ -1,3 +1,25 @@
+2007-06-28  Adam Roben  <aroben@apple.com>
+
+        Get WebCore compiling with /W2 on Windows
+
+        Reviewed by Steve.
+
+        No regression tests affected.
+
+        * WebCore.vcproj/WebCore.vcproj: Turn the warning level up to 2, and
+        disable two warnings: implicit int <=> float conversion, and class vs.
+        struct inconsistency.
+        * dom/CharacterData.cpp:
+        (WebCore::CharacterData::deleteData): Cast to int before negating.
+        * loader/Cache.cpp:
+        (WebCore::Cache::remove): Ditto.
+        * platform/graphics/Path.cpp:
+        (WebCore::pathLengthApplierFunction): Consistently use floats.
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::GraphicsContext::drawEllipse): Ditto.
+        * platform/win/GraphicsContextWin.cpp:
+        (WebCore::GraphicsContext::drawLineForMisspellingOrBadGrammar): Ditto.
+
 2007-06-28  Geoffrey Garen  <ggaren@apple.com>
 
         Reviewed by Maciej Stachowiak.
index e3797b9938e447a1d8661942eacfc8d9769f6ded..f0a9c79ec72acabdf22f7577ff2702fc38c66fd2 100644 (file)
                                RuntimeTypeInfo="false"
                                UsePrecompiledHeader="2"
                                PrecompiledHeaderThrough="WebCorePrefix.h"
-                               WarningLevel="1"
+                               WarningLevel="2"
                                Detect64BitPortabilityProblems="false"
                                DebugInformationFormat="4"
-                               DisableSpecificWarnings="4138;4996;4355;4291;4068;6011;6031;6211;6246;6255;6387"
+                               DisableSpecificWarnings="4099;4138;4244;4996;4355;4291;4068;6011;6031;6211;6246;6255;6387"
                                ForcedIncludeFiles="WebCorePrefix.h"
                                EnablePREfast="true"
                        />
                                RuntimeTypeInfo="false"
                                UsePrecompiledHeader="2"
                                PrecompiledHeaderThrough="WebCorePrefix.h"
-                               WarningLevel="1"
+                               WarningLevel="2"
                                Detect64BitPortabilityProblems="false"
                                DebugInformationFormat="3"
-                               DisableSpecificWarnings="4138;4996;4355;4291;4068;6011;6031;6211;6246;6255;6387"
+                               DisableSpecificWarnings="4099;4138;4244;4996;4355;4291;4068;6011;6031;6211;6246;6255;6387"
                                ForcedIncludeFiles="WebCorePrefix.h"
                                EnablePREfast="true"
                        />
                                RuntimeTypeInfo="false"
                                UsePrecompiledHeader="2"
                                PrecompiledHeaderThrough="WebCorePrefix.h"
-                               WarningLevel="1"
+                               WarningLevel="2"
                                Detect64BitPortabilityProblems="false"
                                DebugInformationFormat="4"
-                               DisableSpecificWarnings="4138;4996;4355;4291;4068;6011;6031;6211;6246;6255;6387"
+                               DisableSpecificWarnings="4099;4138;4244;4996;4355;4291;4068;6011;6031;6211;6246;6255;6387"
                                ForcedIncludeFiles="WebCorePrefix.h"
                                EnablePREfast="true"
                        />
                                        >
                                </File>
                                <File
-                                       RelativePath="..\bindings\js\JSEventTargetNode.cpp"
+                                       RelativePath="..\bindings\js\JSEventCustom.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\bindings\js\JSEventCustom.cpp"
+                                       RelativePath="..\bindings\js\JSEventTargetNode.cpp"
                                        >
                                </File>
                                <File
index 222c8893e4fd5e13a61f37bb6c8133f04fe0ef39..c272745ceb100cc907ca489acba96f5d6a5b5ca1 100644 (file)
@@ -164,7 +164,7 @@ void CharacterData::deleteData( const unsigned offset, const unsigned count, Exc
 
     // update the markers for spell checking and grammar checking
     document()->removeMarkers(this, offset, count);
-    document()->shiftMarkers(this, offset + count, -count);
+    document()->shiftMarkers(this, offset + count, -static_cast<int>(count));
 }
 
 void CharacterData::replaceData( const unsigned offset, const unsigned count, const String &arg, ExceptionCode& ec)
index 0240bab6d0194e14287a9666779fcac0deb4e4a4..f9732fcaa35265fd231ffc1ce8ff6f242818c19f 100644 (file)
@@ -264,9 +264,9 @@ void Cache::remove(CachedResource* resource)
             (*itr)->removeCachedResource(resource);
 
         // Subtract from our size totals.
-        int delta = -resource->size();
+        int delta = -static_cast<int>(resource->size());
         if (delta)
-            adjustSize(resource->referenced(), delta, -resource->decodedSize());
+            adjustSize(resource->referenced(), delta, -static_cast<int>(resource->decodedSize()));
     }
 
     if (resource->canDelete())
index 322963ddd5f1f979fb87fdd56754908fd94669ad..39bd6055af6c1f4addcdc13b9e17f7b456f645b5 100644 (file)
@@ -75,7 +75,7 @@ void pathLengthApplierFunction(void* info, const PathElement* element)
             float offset = traversalState.m_desiredLength - traversalState.m_totalLength;
             traversalState.m_current.move(offset * cosf(slope), offset * sinf(slope));
         } else {
-            static const float rad2deg = 180.0f / M_PI;
+            static const float rad2deg = 180.0f / static_cast<float>(M_PI);
             traversalState.m_normalAngle = slope * rad2deg;
         }
 
index 90086233cee8ad4baa909c5074b411a3f3b8673b..58981f6daf9ea758f240d1975fcc799fc25df428 100644 (file)
@@ -261,7 +261,7 @@ void GraphicsContext::drawEllipse(const IntRect& rect)
     CGContextRef context = platformContext();
     CGContextBeginPath(context);
     float r = (float)rect.width() / 2;
-    CGContextAddArc(context, rect.x() + r, rect.y() + r, r, 0, 2*M_PI, 0);
+    CGContextAddArc(context, rect.x() + r, rect.y() + r, r, 0, static_cast<float>(2*M_PI), 0);
     CGContextClosePath(context);
 
     if (fillColor().alpha()) {
index a8f04df41c8d6e8c7af61b9c77d32d57bfe32ab1..0452c7892be95ae17c844c0c4da82712dcf4e6ad 100644 (file)
@@ -389,7 +389,7 @@ void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint& point,
     // Dash lengths for the top and bottom of the error underline are the same.
     // These are magic.
     static const float edge_dash_lengths[] = {2, 2};
-    static const float middle_dash_lengths[] = {2.76, 1.24};
+    static const float middle_dash_lengths[] = {2.76f, 1.24f};
     static const float edge_offset = -(edge_dash_lengths[1] - 1.0f) / 2.0f;
     static const float middle_offset = -(middle_dash_lengths[1] - 1.0f) / 2.0f;