Fix some compiler warnings (miscellaneous)
authorzhajiang@rim.com <zhajiang@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 May 2013 16:09:31 +0000 (16:09 +0000)
committerzhajiang@rim.com <zhajiang@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 May 2013 16:09:31 +0000 (16:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=80790

Patch by Jacky Jiang <zhajiang@blackberry.com> on 2013-05-09.
Reviewed by Rob Buis.

Fix the following warnings for BlackBerry:
InRegionScroller.cpp:286:39: warning: suggest parentheses around
assignment used as truth value [-Wparentheses].
InRegionScroller.cpp:349:39: warning: suggest parentheses around
assignment used as truth value [-Wparentheses].
InRegionScroller.cpp:456:82: warning: suggest parentheses around '&&'
within '||' [-Wparentheses].
InRegionScrollableArea.cpp:134:16: warning: suggest explicit braces to
avoid ambiguous 'else' [-Wparentheses].
SelectionHandler.cpp:390:109: warning: suggest parentheses around '&&'
within '||' [-Wparentheses].
SelectionOverlay.cpp:56:47: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare].

* Api/InRegionScroller.cpp:
(BlackBerry::WebKit::InRegionScrollerPrivate::calculateInRegionScrollableAreasForPoint):
(BlackBerry::WebKit::InRegionScrollerPrivate::firstScrollableInRegionForNode):
(BlackBerry::WebKit::InRegionScrollerPrivate::canScrollRenderBox):
* WebKitSupport/InRegionScrollableArea.cpp:
(BlackBerry::WebKit::InRegionScrollableArea::InRegionScrollableArea):
* WebKitSupport/SelectionHandler.cpp:
(BlackBerry::WebKit::SelectionHandler::extendSelectionToFieldBoundary):
* WebKitSupport/SelectionOverlay.cpp:
(BlackBerry::WebKit::SelectionOverlay::draw):

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

Source/WebKit/blackberry/Api/InRegionScroller.cpp
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.cpp
Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
Source/WebKit/blackberry/WebKitSupport/SelectionOverlay.cpp

index ef1554d..d48f6ed 100644 (file)
@@ -283,7 +283,7 @@ void InRegionScrollerPrivate::calculateInRegionScrollableAreasForPoint(const Web
             end->setCanPropagateScrollingToEnclosingScrollable(false);
         }
 
-    } while (layer = parentLayer(layer));
+    } while ((layer = parentLayer(layer)));
 
     if (m_activeInRegionScrollableAreas.empty())
         return;
@@ -346,7 +346,7 @@ Platform::ScrollViewBase* InRegionScrollerPrivate::firstScrollableInRegionForNod
             end->setCanPropagateScrollingToEnclosingScrollable(false);
         }
 
-    } while (layer = parentLayer(layer));
+    } while ((layer = parentLayer(layer)));
     return 0;
 }
 
@@ -452,8 +452,8 @@ bool InRegionScrollerPrivate::canScrollRenderBox(RenderBox* box)
     if (box->scrollHeight() == box->clientHeight() && box->scrollWidth() == box->clientWidth())
         return false;
 
-    if (box->scrollsOverflowX() && (box->scrollWidth() != box->clientWidth())
-        || box->scrollsOverflowY() && (box->scrollHeight() != box->clientHeight()))
+    if ((box->scrollsOverflowX() && (box->scrollWidth() != box->clientWidth()))
+        || (box->scrollsOverflowY() && (box->scrollHeight() != box->clientHeight())))
         return true;
 
     Node* node = box->node();
index 3772d76..52b4e66 100644 (file)
@@ -1,3 +1,36 @@
+2013-05-09  Jacky Jiang  <zhajiang@blackberry.com>
+
+        Fix some compiler warnings (miscellaneous)
+        https://bugs.webkit.org/show_bug.cgi?id=80790
+
+        Reviewed by Rob Buis.
+
+        Fix the following warnings for BlackBerry:
+        InRegionScroller.cpp:286:39: warning: suggest parentheses around
+        assignment used as truth value [-Wparentheses].
+        InRegionScroller.cpp:349:39: warning: suggest parentheses around
+        assignment used as truth value [-Wparentheses].
+        InRegionScroller.cpp:456:82: warning: suggest parentheses around '&&'
+        within '||' [-Wparentheses].
+        InRegionScrollableArea.cpp:134:16: warning: suggest explicit braces to
+        avoid ambiguous 'else' [-Wparentheses].
+        SelectionHandler.cpp:390:109: warning: suggest parentheses around '&&'
+        within '||' [-Wparentheses].
+        SelectionOverlay.cpp:56:47: warning: comparison between signed and
+        unsigned integer expressions [-Wsign-compare].
+
+
+        * Api/InRegionScroller.cpp:
+        (BlackBerry::WebKit::InRegionScrollerPrivate::calculateInRegionScrollableAreasForPoint):
+        (BlackBerry::WebKit::InRegionScrollerPrivate::firstScrollableInRegionForNode):
+        (BlackBerry::WebKit::InRegionScrollerPrivate::canScrollRenderBox):
+        * WebKitSupport/InRegionScrollableArea.cpp:
+        (BlackBerry::WebKit::InRegionScrollableArea::InRegionScrollableArea):
+        * WebKitSupport/SelectionHandler.cpp:
+        (BlackBerry::WebKit::SelectionHandler::extendSelectionToFieldBoundary):
+        * WebKitSupport/SelectionOverlay.cpp:
+        (BlackBerry::WebKit::SelectionOverlay::draw):
+
 2013-05-09  Mike Fenton  <mifenton@rim.com>
 
         [BlackBerry] Style updates required based on new check-webkit-style
index 67435eb..61ab335 100644 (file)
@@ -131,11 +131,12 @@ InRegionScrollableArea::InRegionScrollableArea(WebPagePrivate* webPage, RenderLa
             m_forceContentToBeHorizontallyScrollable = m_scrollsHorizontally;
             m_forceContentToBeVerticallyScrollable = m_scrollsVertically;
             // Force content to be scrollable even if it doesn't need to scroll in either direction.
-            if (!m_scrollsHorizontally && !m_scrollsVertically)
+            if (!m_scrollsHorizontally && !m_scrollsVertically) {
                 if (box->scrollsOverflowY())
                     m_forceContentToBeVerticallyScrollable = true;
                 else if (box->scrollsOverflowX()) // If it's already forced scrollable vertically, don't force it to scroll horizontally
                     m_forceContentToBeHorizontallyScrollable = true;
+            }
             m_supportsCompositedScrolling = true;
             ASSERT(m_layer->backing()->hasScrollingLayer());
             m_camouflagedCompositedScrollableLayer = reinterpret_cast<unsigned>(m_layer->backing()->scrollingContentsLayer()->platformLayer());
index d76426a..cb83b80 100644 (file)
@@ -386,8 +386,8 @@ unsigned SelectionHandler::extendSelectionToFieldBoundary(bool isStartHandle, co
 
     // Prevent incorrect movement, handles can only extend the selection this way
     // to prevent inversion of the handles.
-    if (isStartHandle && (character == KEYCODE_RIGHT || character == KEYCODE_DOWN)
-        || !isStartHandle && (character == KEYCODE_LEFT || character == KEYCODE_UP))
+    if ((isStartHandle && (character == KEYCODE_RIGHT || character == KEYCODE_DOWN))
+        || (!isStartHandle && (character == KEYCODE_LEFT || character == KEYCODE_UP)))
         character = 0;
 
     VisiblePosition newVisiblePosition = isStartHandle ? controller->selection().extent() : controller->selection().base();
index 5f4a10b..5eab6ea 100644 (file)
@@ -53,7 +53,7 @@ void SelectionOverlay::draw(const Selection& selection)
 
     m_selection = selection;
 
-    while (m_layers.size() < m_selection.size())
+    while (m_layers.size() < static_cast<size_t>(m_selection.size()))
         m_layers.append(GraphicsLayer::create(this));
 
     m_layers.resize(m_selection.size());