Blame SOURCES/0002-x11-randr-use-glib-s-MAX-and-MIN.patch

5de96c
From 70c5908f8c46a0cd53cca109ecc0c56ff5b33d77 Mon Sep 17 00:00:00 2001
5de96c
From: Victor Toso <me@victortoso.com>
5de96c
Date: Fri, 12 Jul 2019 11:12:39 +0200
5de96c
Subject: [PATCH 2/9] x11-randr: use glib's MAX and MIN
5de96c
5de96c
Since 2861868 "randr: remove monitors.xml on auto-configuration" in
5de96c
2015-04-10 by Marc-Andre Lureau <marcandre.lureau@redhat.com> this
5de96c
file includes glib.h and can remove those helpers.
5de96c
5de96c
Signed-off-by: Victor Toso <victortoso@redhat.com>
5de96c
Acked-by: Frediano Ziglio <fziglio@redhat.com>
5de96c
---
5de96c
 src/vdagent/x11-randr.c | 18 ++++--------------
5de96c
 1 file changed, 4 insertions(+), 14 deletions(-)
5de96c
5de96c
diff --git a/src/vdagent/x11-randr.c b/src/vdagent/x11-randr.c
5de96c
index 88857c8..d000e28 100644
5de96c
--- a/src/vdagent/x11-randr.c
5de96c
+++ b/src/vdagent/x11-randr.c
5de96c
@@ -555,16 +555,6 @@ int vdagent_x11_randr_handle_event(struct vdagent_x11 *x11,
5de96c
     return handled;
5de96c
 }
5de96c
 
5de96c
-static int min_int(int x, int y)
5de96c
-{
5de96c
-    return x > y ? y : x;
5de96c
-}
5de96c
-
5de96c
-static int max_int(int x, int y)
5de96c
-{
5de96c
-    return x > y ? x : y;
5de96c
-}
5de96c
-
5de96c
 static int constrain_to_range(int low, int *val, int high)
5de96c
 {
5de96c
     if (low <= *val && *val <= high) {
5de96c
@@ -631,10 +621,10 @@ static void zero_base_monitors(struct vdagent_x11 *x11,
5de96c
         mon_width = (int *)&mon_config->monitors[i].width;
5de96c
         mon_height = (int *)&mon_config->monitors[i].height;
5de96c
         constrain_to_screen(x11, mon_width, mon_height);
5de96c
-        min_x = min_int(mon_config->monitors[i].x, min_x);
5de96c
-        min_y = min_int(mon_config->monitors[i].y, min_y);
5de96c
-        max_x = max_int(mon_config->monitors[i].x + *mon_width, max_x);
5de96c
-        max_y = max_int(mon_config->monitors[i].y + *mon_height, max_y);
5de96c
+        min_x = MIN(mon_config->monitors[i].x, min_x);
5de96c
+        min_y = MIN(mon_config->monitors[i].y, min_y);
5de96c
+        max_x = MAX(mon_config->monitors[i].x + *mon_width, max_x);
5de96c
+        max_y = MAX(mon_config->monitors[i].y + *mon_height, max_y);
5de96c
     }
5de96c
     if (min_x != 0 || min_y != 0) {
5de96c
         syslog(LOG_ERR, "%s: agent config %d,%d rooted, adjusting to 0,0.",
5de96c
-- 
5de96c
2.21.0
5de96c