[PATCH 3/6] comctl32/edit: Get rid of useless float cast

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


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

diff --git a/dlls/comctl32/edit.c b/dlls/comctl32/edit.c
index 1f17276..c724bc6 100644
--- a/dlls/comctl32/edit.c
+++ b/dlls/comctl32/edit.c
@@ -4975,9 +4975,10 @@ static LRESULT CALLBACK EDIT_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
 
     case WM_MOUSEWHEEL:
     {
-        int wheelDelta;
-        UINT pulScrollLines = 3;
-        SystemParametersInfoW(SPI_GETWHEELSCROLLLINES,0, &pulScrollLines, 0);
+        INT wheelDelta, pulScrollLines;
+        UINT tmp = 3;
+        SystemParametersInfoW(SPI_GETWHEELSCROLLLINES,0, &tmp, 0);
+        pulScrollLines = tmp;
 
         if (wParam & (MK_SHIFT | MK_CONTROL))
         {
@@ -4995,10 +4996,10 @@ static LRESULT CALLBACK EDIT_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
 
         if (es->wheelDeltaRemainder && pulScrollLines)
         {
-            int cLineScroll;
-            pulScrollLines = (int) min((UINT) es->line_count, pulScrollLines);
-            cLineScroll = pulScrollLines * (float)es->wheelDeltaRemainder / WHEEL_DELTA;
-            es->wheelDeltaRemainder -= WHEEL_DELTA * cLineScroll / (int)pulScrollLines;
+            INT cLineScroll;
+            pulScrollLines = min((UINT)es->line_count, pulScrollLines);
+            cLineScroll = (pulScrollLines * es->wheelDeltaRemainder) / WHEEL_DELTA;
+            es->wheelDeltaRemainder -= (cLineScroll * WHEEL_DELTA) / pulScrollLines;
             result = EDIT_EM_LineScroll(es, 0, -cLineScroll);
         }
         break;
-- 
2.19.1




More information about the wine-devel mailing list