[PATCH 1/4] gdi32: Use the helper function to order the points of a rectangle.

Akihiro Sagawa sagawa.aki at gmail.com
Thu Oct 11 10:35:34 CDT 2018


Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
---
 dlls/gdi32/bitblt.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/dlls/gdi32/bitblt.c b/dlls/gdi32/bitblt.c
index 0f2128390c..c8d67cbada 100644
--- a/dlls/gdi32/bitblt.c
+++ b/dlls/gdi32/bitblt.c
@@ -40,13 +40,6 @@ static inline BOOL rop_uses_src( DWORD rop )
     return ((rop >> 2) & 0x330000) != (rop & 0x330000);
 }
 
-static inline void swap_ints( int *i, int *j )
-{
-    int tmp = *i;
-    *i = *j;
-    *j = tmp;
-}
-
 BOOL intersect_vis_rectangles( struct bitblt_coords *dst, struct bitblt_coords *src )
 {
     RECT rect;
@@ -70,8 +63,7 @@ BOOL intersect_vis_rectangles( struct bitblt_coords *dst, struct bitblt_coords *
         rect.top    = dst->y + rect.top * dst->height / abs(src->height);
         rect.right  = dst->x + rect.right * dst->width / abs(src->width);
         rect.bottom = dst->y + rect.bottom * dst->height / abs(src->height);
-        if (rect.left > rect.right) swap_ints( &rect.left, &rect.right );
-        if (rect.top > rect.bottom) swap_ints( &rect.top, &rect.bottom );
+        order_rect( &rect );
 
         /* avoid rounding errors */
         rect.left--;
@@ -88,8 +80,7 @@ BOOL intersect_vis_rectangles( struct bitblt_coords *dst, struct bitblt_coords *
         rect.top    = src->y + rect.top * src->height / abs(dst->height);
         rect.right  = src->x + rect.right * src->width / abs(dst->width);
         rect.bottom = src->y + rect.bottom * src->height / abs(dst->height);
-        if (rect.left > rect.right) swap_ints( &rect.left, &rect.right );
-        if (rect.top > rect.bottom) swap_ints( &rect.top, &rect.bottom );
+        order_rect( &rect );
 
         /* avoid rounding errors */
         rect.left--;
-- 
2.17.1





More information about the wine-devel mailing list