user32: Use SetRect() in SERVER_START_REQ code too.
Michael Stefaniuc
mstefani at redhat.de
Tue Jul 19 03:01:10 CDT 2016
Signed-off-by: Michael Stefaniuc <mstefani at redhat.de>
---
Keeping this in a separate patch, just for the "not convinced" case ;)
dlls/user32/caret.c | 36 ++++++++++++------------------------
dlls/user32/cursoricon.c | 12 ++++--------
dlls/user32/painting.c | 12 ++++--------
dlls/user32/win.c | 16 ++++------------
4 files changed, 24 insertions(+), 52 deletions(-)
diff --git a/dlls/user32/caret.c b/dlls/user32/caret.c
index 686dade..4951599 100644
--- a/dlls/user32/caret.c
+++ b/dlls/user32/caret.c
@@ -90,10 +90,8 @@ static void CALLBACK CARET_Callback( HWND hwnd, UINT msg, UINT_PTR id, DWORD cti
if ((ret = !wine_server_call( req )))
{
hwnd = wine_server_ptr_handle( reply->full_handle );
- r.left = reply->old_rect.left;
- r.top = reply->old_rect.top;
- r.right = reply->old_rect.right;
- r.bottom = reply->old_rect.bottom;
+ SetRect(&r, reply->old_rect.left, reply->old_rect.top, reply->old_rect.right,
+ reply->old_rect.bottom);
hidden = reply->old_hide;
}
}
@@ -172,10 +170,8 @@ BOOL WINAPI CreateCaret( HWND hwnd, HBITMAP bitmap, INT width, INT height )
if ((ret = !wine_server_call_err( req )))
{
prev = wine_server_ptr_handle( reply->previous );
- r.left = reply->old_rect.left;
- r.top = reply->old_rect.top;
- r.right = reply->old_rect.right;
- r.bottom = reply->old_rect.bottom;
+ SetRect(&r, reply->old_rect.left, reply->old_rect.top, reply->old_rect.right,
+ reply->old_rect.bottom);
old_state = reply->old_state;
hidden = reply->old_hide;
}
@@ -216,10 +212,8 @@ BOOL WINAPI DestroyCaret(void)
if ((ret = !wine_server_call_err( req )))
{
prev = wine_server_ptr_handle( reply->previous );
- r.left = reply->old_rect.left;
- r.top = reply->old_rect.top;
- r.right = reply->old_rect.right;
- r.bottom = reply->old_rect.bottom;
+ SetRect(&r, reply->old_rect.left, reply->old_rect.top, reply->old_rect.right,
+ reply->old_rect.bottom);
old_state = reply->old_state;
hidden = reply->old_hide;
}
@@ -260,10 +254,8 @@ BOOL WINAPI SetCaretPos( INT x, INT y )
if ((ret = !wine_server_call_err( req )))
{
hwnd = wine_server_ptr_handle( reply->full_handle );
- r.left = reply->old_rect.left;
- r.top = reply->old_rect.top;
- r.right = reply->old_rect.right;
- r.bottom = reply->old_rect.bottom;
+ SetRect(&r, reply->old_rect.left, reply->old_rect.top, reply->old_rect.right,
+ reply->old_rect.bottom);
old_state = reply->old_state;
hidden = reply->old_hide;
}
@@ -304,10 +296,8 @@ BOOL WINAPI HideCaret( HWND hwnd )
if ((ret = !wine_server_call_err( req )))
{
hwnd = wine_server_ptr_handle( reply->full_handle );
- r.left = reply->old_rect.left;
- r.top = reply->old_rect.top;
- r.right = reply->old_rect.right;
- r.bottom = reply->old_rect.bottom;
+ SetRect(&r, reply->old_rect.left, reply->old_rect.top, reply->old_rect.right,
+ reply->old_rect.bottom);
old_state = reply->old_state;
hidden = reply->old_hide;
}
@@ -343,10 +333,8 @@ BOOL WINAPI ShowCaret( HWND hwnd )
if ((ret = !wine_server_call_err( req )))
{
hwnd = wine_server_ptr_handle( reply->full_handle );
- r.left = reply->old_rect.left;
- r.top = reply->old_rect.top;
- r.right = reply->old_rect.right;
- r.bottom = reply->old_rect.bottom;
+ SetRect(&r, reply->old_rect.left, reply->old_rect.top, reply->old_rect.right,
+ reply->old_rect.bottom);
hidden = reply->old_hide;
}
}
diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c
index 2b92307..8f4b4a6 100644
--- a/dlls/user32/cursoricon.c
+++ b/dlls/user32/cursoricon.c
@@ -1753,10 +1753,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH ClipCursor( const RECT *rect )
if ((ret = !wine_server_call( req )))
{
- new_rect.left = reply->new_clip.left;
- new_rect.top = reply->new_clip.top;
- new_rect.right = reply->new_clip.right;
- new_rect.bottom = reply->new_clip.bottom;
+ SetRect(&new_rect, reply->new_clip.left, reply->new_clip.top, reply->new_clip.right,
+ reply->new_clip.bottom);
}
}
SERVER_END_REQ;
@@ -1779,10 +1777,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetClipCursor( RECT *rect )
req->flags = 0;
if ((ret = !wine_server_call( req )))
{
- rect->left = reply->new_clip.left;
- rect->top = reply->new_clip.top;
- rect->right = reply->new_clip.right;
- rect->bottom = reply->new_clip.bottom;
+ SetRect(rect, reply->new_clip.left, reply->new_clip.top, reply->new_clip.right,
+ reply->new_clip.bottom);
}
}
SERVER_END_REQ;
diff --git a/dlls/user32/painting.c b/dlls/user32/painting.c
index 30dabfe..466854a 100644
--- a/dlls/user32/painting.c
+++ b/dlls/user32/painting.c
@@ -144,14 +144,10 @@ static void update_visible_region( struct dce *dce )
vis_rgn = ExtCreateRegion( NULL, data->rdh.dwSize + data->rdh.nRgnSize, data );
top_win = wine_server_ptr_handle( reply->top_win );
- win_rect.left = reply->win_rect.left;
- win_rect.top = reply->win_rect.top;
- win_rect.right = reply->win_rect.right;
- win_rect.bottom = reply->win_rect.bottom;
- top_rect.left = reply->top_rect.left;
- top_rect.top = reply->top_rect.top;
- top_rect.right = reply->top_rect.right;
- top_rect.bottom = reply->top_rect.bottom;
+ SetRect(&win_rect, reply->win_rect.left, reply->win_rect.top, reply->win_rect.right,
+ reply->win_rect.bottom);
+ SetRect(&top_rect, reply->top_rect.left, reply->top_rect.top, reply->top_rect.right,
+ reply->top_rect.bottom);
paint_flags = reply->paint_flags;
}
else size = reply->total_size;
diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index f69297c..dd80ed2 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -923,19 +923,11 @@ other_process:
if ((ret = !wine_server_call_err( req )))
{
if (rectWindow)
- {
- rectWindow->left = reply->window.left;
- rectWindow->top = reply->window.top;
- rectWindow->right = reply->window.right;
- rectWindow->bottom = reply->window.bottom;
- }
+ SetRect(rectWindow, reply->window.left, reply->window.top, reply->window.right,
+ reply->window.bottom);
if (rectClient)
- {
- rectClient->left = reply->client.left;
- rectClient->top = reply->client.top;
- rectClient->right = reply->client.right;
- rectClient->bottom = reply->client.bottom;
- }
+ SetRect(rectClient, reply->client.left, reply->client.top, reply->client.right,
+ reply->client.bottom);
}
}
SERVER_END_REQ;
--
2.4.11
More information about the wine-patches
mailing list