[Spice-commits] common/rect.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 25 15:18:24 UTC 2020


 common/rect.h |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit ba7af04f6508250982e56e0285f05864bd8a03a1
Author: Frediano Ziglio <freddy77 at gmail.com>
Date:   Thu Jun 18 20:08:13 2020 +0100

    rect: Avoid usage of "small"
    
    Some Windows headers define "small" causing issues.
    Use "small_rect" instead. For coherence use "big_rect" instead of
    "big".
    
    Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>
    Acked-by: Francesco Giudici <fgiudici at redhat.com>

diff --git a/common/rect.h b/common/rect.h
index c3920e2..950b23b 100644
--- a/common/rect.h
+++ b/common/rect.h
@@ -75,10 +75,10 @@ static inline int rect_is_same_size(const SpiceRect *r1, const SpiceRect *r2)
            r1->bottom - r1->top == r2->bottom - r2->top;
 }
 
-static inline int rect_contains(const SpiceRect *big, const SpiceRect *small)
+static inline int rect_contains(const SpiceRect *big_rect, const SpiceRect *small_rect)
 {
-    return big->left <= small->left && big->right >= small->right &&
-           big->top <= small->top && big->bottom >= small->bottom;
+    return big_rect->left <= small_rect->left && big_rect->right >= small_rect->right &&
+           big_rect->top <= small_rect->top && big_rect->bottom >= small_rect->bottom;
 }
 
 static inline int rect_get_area(const SpiceRect *r)
@@ -130,9 +130,9 @@ static inline int rect_is_same_size(const SpiceRect& r1, const SpiceRect& r2)
     return rect_is_same_size(&r1, &r2);
 }
 
-static inline int rect_contains(const SpiceRect& big, const SpiceRect& small)
+static inline int rect_contains(const SpiceRect& big_rect, const SpiceRect& small_rect)
 {
-    return rect_contains(&big, &small);
+    return rect_contains(&big_rect, &small_rect);
 }
 
 static inline int rect_get_area(const SpiceRect& r)


More information about the Spice-commits mailing list