[PATCH v2 6/6] comctl32/treeview: Get rid of useless float cast

Gabriel Ivăncescu gabrielopcode at gmail.com
Wed Jun 5 06:39:02 CDT 2019


Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---
 dlls/comctl32/treeview.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c
index 6854b0c..cbb69bb 100644
--- a/dlls/comctl32/treeview.c
+++ b/dlls/comctl32/treeview.c
@@ -5027,7 +5027,7 @@ static LRESULT
 TREEVIEW_MouseWheel(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
 {
     short wheelDelta;
-    UINT pulScrollLines = 3;
+    INT pulScrollLines = 3;
 
     if (wParam & (MK_SHIFT | MK_CONTROL))
         return DefWindowProcW(infoPtr->hwnd, WM_MOUSEWHEEL, wParam, lParam);
@@ -5051,8 +5051,8 @@ TREEVIEW_MouseWheel(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
 	int maxDy;
 	int lineScroll;
 
-	lineScroll = pulScrollLines * (float)infoPtr->wheelRemainder / WHEEL_DELTA;
-	infoPtr->wheelRemainder -= WHEEL_DELTA * lineScroll / (int)pulScrollLines;
+	lineScroll = (pulScrollLines * infoPtr->wheelRemainder) / WHEEL_DELTA;
+	infoPtr->wheelRemainder -= (WHEEL_DELTA * lineScroll) / pulScrollLines;
 
 	newDy = infoPtr->firstVisible->visibleOrder - lineScroll;
 	maxDy = infoPtr->maxVisibleOrder;
-- 
2.21.0




More information about the wine-devel mailing list