[PATCH 5/6] comctl32/listview: Get rid of useless float cast

Gabriel Iv─âncescu gabrielopcode at gmail.com
Mon Feb 4 07:19:42 CST 2019


Signed-off-by: Gabriel Iv─âncescu <gabrielopcode at gmail.com>
---
 dlls/comctl32/listview.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 1230c55..8c04106 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -9913,7 +9913,8 @@ static LRESULT LISTVIEW_HScroll(LISTVIEW_INFO *infoPtr, INT nScrollCode,
 
 static LRESULT LISTVIEW_MouseWheel(LISTVIEW_INFO *infoPtr, INT wheelDelta)
 {
-    UINT pulScrollLines = 3;
+    INT pulScrollLines;
+    UINT tmp = 3;
 
     TRACE("(wheelDelta=%d)\n", wheelDelta);
 
@@ -9930,7 +9931,8 @@ static LRESULT LISTVIEW_MouseWheel(LISTVIEW_INFO *infoPtr, INT wheelDelta)
         break;
 
     case LV_VIEW_DETAILS:
-        SystemParametersInfoW(SPI_GETWHEELSCROLLLINES,0, &pulScrollLines, 0);
+        SystemParametersInfoW(SPI_GETWHEELSCROLLLINES,0, &tmp, 0);
+        pulScrollLines = tmp;
 
         /* if scrolling changes direction, ignore left overs */
         if ((wheelDelta < 0 && infoPtr->cWheelRemainder < 0) ||
@@ -9940,10 +9942,10 @@ static LRESULT LISTVIEW_MouseWheel(LISTVIEW_INFO *infoPtr, INT wheelDelta)
             infoPtr->cWheelRemainder = wheelDelta;
         if (infoPtr->cWheelRemainder && pulScrollLines)
         {
-            int cLineScroll;
+            INT cLineScroll;
             pulScrollLines = min((UINT)LISTVIEW_GetCountPerColumn(infoPtr), pulScrollLines);
-            cLineScroll = pulScrollLines * (float)infoPtr->cWheelRemainder / WHEEL_DELTA;
-            infoPtr->cWheelRemainder -= WHEEL_DELTA * cLineScroll / (int)pulScrollLines;
+            cLineScroll = (pulScrollLines * infoPtr->cWheelRemainder) / WHEEL_DELTA;
+            infoPtr->cWheelRemainder -= (cLineScroll * WHEEL_DELTA) / pulScrollLines;
             LISTVIEW_VScroll(infoPtr, SB_INTERNAL, -cLineScroll);
         }
         break;
-- 
2.19.1




More information about the wine-devel mailing list