On 12/28/18 3:22 PM, Gabriel Ivăncescu wrote:
Signed-off-by: Gabriel Ivăncescu
<gabrielopcode(a)gmail.com>
---
These notes apply to the entire patch series (but each patch is independent).
Since patch 156187 was rejected and the reason for lack of including CopyRect
in that patch was "it makes no sense. A straight assignment should be used
instead", this patch series will do just that, and replace the remaining
CopyRect calls with straight assignments (and some NULL checks where needed).
To avoid redundant NULL checks, they have been added only to the rects that
can actually be NULL.
Even if CopyRect() doesn't necessarily make sense sometimes, it's not
wrong to use it. I personally don't think such cleanup is useful unless
you change surrounding code and going for straight assignment without
null check works better.
case TBM_GETTHUMBRECT:
- return CopyRect((LPRECT)lParam, &infoPtr->rcThumb);
+ if (!lParam) return FALSE;
+ *(RECT*)lParam = infoPtr->rcThumb;
+ return TRUE;
That's an example when it doesn't improve anything.