Remove unreachable code uncovered by MSVC /W4
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Jul 2007 04:51:57 +0000 (04:51 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Jul 2007 04:51:57 +0000 (04:51 +0000)
Reviewed by Oliver.

No regression test possible.

* html/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::createPattern):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::isLiveLink):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::contentEditable):
* platform/DeprecatedString.cpp:
(WebCore::allocateHandle):
(WebCore::freeHandle):
* plugins/win/npapi.cpp:
(pluginViewForInstance):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::isWidthSpecified):
(WebCore::RenderImage::isHeightSpecified):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::isControlStyled):

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

WebCore/ChangeLog
WebCore/html/CanvasRenderingContext2D.cpp
WebCore/html/HTMLAnchorElement.cpp
WebCore/html/HTMLElement.cpp
WebCore/platform/DeprecatedString.cpp
WebCore/plugins/win/npapi.cpp
WebCore/rendering/RenderImage.cpp
WebCore/rendering/RenderTheme.cpp

index 2914e6810620d15b1ad79efc23ce014b876e2764..028b3ce6e1e185402afa1b9c3857c318a4065c2b 100644 (file)
@@ -1,3 +1,28 @@
+2007-06-30  Adam Roben  <aroben@apple.com>
+
+        Remove unreachable code uncovered by MSVC /W4
+
+        Reviewed by Oliver.
+
+        No regression test possible.
+
+        * html/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::createPattern):
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::isLiveLink):
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::contentEditable):
+        * platform/DeprecatedString.cpp:
+        (WebCore::allocateHandle):
+        (WebCore::freeHandle):
+        * plugins/win/npapi.cpp:
+        (pluginViewForInstance):
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::isWidthSpecified):
+        (WebCore::RenderImage::isHeightSpecified):
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::isControlStyled):
+
 2007-06-29  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Oliver Hunt.
index 24a7044c653ffac4377b79f670f23dac70263c7a..373444e9653c10d7b0becbb58b73045e77a02c30 100644 (file)
@@ -39,6 +39,7 @@
 #include "HTMLCanvasElement.h"
 #include "HTMLImageElement.h"
 #include "HTMLNames.h"
+#include "NotImplemented.h"
 #include "RenderHTMLCanvas.h"
 #include "Settings.h"
 #include "cssparser.h"
@@ -974,10 +975,10 @@ PassRefPtr<CanvasPattern> CanvasRenderingContext2D::createPattern(HTMLCanvasElem
     PassRefPtr<CanvasPattern> pattern = new CanvasPattern(image, repeatX, repeatY);
     CGImageRelease(image);
     return pattern;
-#elif PLATFORM(QT)
-    fprintf(stderr, "FIXME: CanvasRenderingContext2D::createPattern patterns not implemented\n");
-#endif
+#else
+    notImplemented();
     return 0;
+#endif
 }
 
 void CanvasRenderingContext2D::willDraw(const FloatRect& r)
index c00c5c8e59702ce2bf5a7c3a489ccf1bfbfac50c..6a916ba3123bf29c78452858ca92ae39d9a9e270 100644 (file)
@@ -489,9 +489,6 @@ bool HTMLAnchorElement::isLiveLink() const
         case EditableLinkOnlyLiveWithShiftKey:
             return m_wasShiftKeyDownOnMouseDown;
     }
-    // not reached
-    ASSERT(0);
-    return false;
 }
 
 }
index 137a78b516aa05fb13ea232c8d02772216f4b389..281d5c3792333fbed462fe819116ba9cf9778b95 100644 (file)
@@ -578,7 +578,6 @@ String HTMLElement::contentEditable() const
         default:
             return "inherit";
     }
-    return "inherit";
 }
 
 void HTMLElement::setContentEditable(MappedAttribute* attr) 
index 19261a2279a6beb2120233f534bc378470132cce..b5f16508fa8b9de6e03f5934b3aa7bb9fe37e36f 100644 (file)
@@ -72,6 +72,7 @@ COMPILE_ASSERT(sizeof(DeprecatedChar) == 2, deprecated_char_is_2_bytes)
 #define WEBCORE_REALLOCATE_CHARACTERS(P, N) (DeprecatedChar *)fastRealloc(P, sizeof(DeprecatedChar)*(N))
 #define DELETE_QCHAR(P) fastFree(P)
 
+#ifndef CHECK_FOR_HANDLE_LEAKS
 struct HandleNode;
 struct HandlePageNode;
 
@@ -86,16 +87,18 @@ static inline void initializeHandleNodes()
     if (freeNodeAllocationPages == 0)
         freeNodeAllocationPages = allocatePageNode();
 }
+#endif
 
 static inline DeprecatedStringData **allocateHandle()
 {
 #ifdef CHECK_FOR_HANDLE_LEAKS
     return static_cast<DeprecatedStringData **>(fastMalloc(sizeof(DeprecatedStringData *)));
-#endif
+#else
 
     initializeHandleNodes();
     
     return reinterpret_cast<DeprecatedStringData **>(allocateNode(freeNodeAllocationPages));
+#endif
 }
 
 static void freeHandle(DeprecatedStringData **);
@@ -2456,6 +2459,8 @@ struct HandleNode {
     } type;
 };
 
+#ifndef CHECK_FOR_HANDLE_LEAKS
+
 static const size_t pageSize = 4096;
 static const uintptr_t pageMask = ~(pageSize - 1);
 static const size_t nodeBlockSize = pageSize / sizeof(HandleNode);
@@ -2536,12 +2541,14 @@ static HandleNode *allocateNode(HandlePageNode *pageNode)
     return allocated;
 }
 
+#endif
+
 void freeHandle(DeprecatedStringData **_free)
 {
 #ifdef CHECK_FOR_HANDLE_LEAKS
     fastFree(_free);
     return;
-#endif
+#else
 
     HandleNode *free = (HandleNode *)_free;
     HandleNode *base = (HandleNode *)((uintptr_t)free & pageMask);
@@ -2574,6 +2581,7 @@ void freeHandle(DeprecatedStringData **_free)
             freeNodeAllocationPages->next = pageNode;
         freeNodeAllocationPages = pageNode;
     }
+#endif
 }
 
 DeprecatedString DeprecatedString::fromUtf8(const char *chs)
index 8b775a9ea02e207c00d024d98514dd22222de4ec..0033e06c741e35833cea20dff36f291441e1e763 100644 (file)
@@ -39,9 +39,7 @@ static PluginViewWin* pluginViewForInstance(NPP instance)
 {
     if (instance && instance->ndata)
         return static_cast<PluginViewWin*>(instance->ndata);
-    else
-        return PluginViewWin::currentPluginView();
-    return 0;
+    return PluginViewWin::currentPluginView();
 }
 
 void* NPN_MemAlloc(uint32 size)
index a1611738648007fcbe2eeeff45dde5378e2b057d..8f34ea9cdeb54d9c488ef38bc46cfe034e0f006c 100644 (file)
@@ -359,8 +359,6 @@ bool RenderImage::isWidthSpecified() const
         default:
             return false;
     }
-    ASSERT(false);
-    return false;
 }
 
 bool RenderImage::isHeightSpecified() const
@@ -372,8 +370,6 @@ bool RenderImage::isHeightSpecified() const
         default:
             return false;
     }
-    ASSERT(false);
-    return false;
 }
 
 int RenderImage::calcReplacedWidth() const
index 23d269eae61ccde6ef081593dc6d92c735efd355..dab1d1c651efd729272cd3f10ffc94d2cdbfc91d 100644 (file)
@@ -309,8 +309,6 @@ bool RenderTheme::isControlStyled(const RenderStyle* style, const BorderData& bo
         default:
             return false;
     }
-
-    return false;
 }
 
 bool RenderTheme::supportsFocusRing(const RenderStyle* style) const