On Aug 22, 2018, at 12:48 PM, Nikolay Sivov nsivov@codeweavers.com wrote:
On 08/22/2018 06:49 PM, Ken Thomases wrote:
To be honest, I don't clearly remember why I put the float cast in there. I think perhaps to avoid potential (if unlikely) integer overflow. We want something like MulDiv() but always rounding toward zero. Perhaps just casting to INT64 would be better.
I like MulDiv better. Gabriel, do you think it's possible to get rid of some casts by changing variable types?
But MulDiv() rounds to the nearest integer (sometimes rounding up), which isn't acceptable. It can lead to scrolling too far and/or end up reversing the sign of wheel_remain.
-Ken