[PATCH resend 3/6] comctl32/edit: Get rid of useless float cast
Gabriel Ivăncescu
gabrielopcode at gmail.com
Wed Mar 6 07:42:55 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.20.1
More information about the wine-devel
mailing list