[linux/vd-agent v1 4/7] x11-randr: use glib's MAX and MIN

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Victor Toso <me@xxxxxxxxxxxxxx>

Since 2861868 "randr: remove monitors.xml on auto-configuration" in
2015-04-10 by Marc-Andre Lureau <marcandre.lureau@xxxxxxxxxx> this
file includes glib.h and can remove those helpers.

Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx>
---
 src/vdagent/x11-randr.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/src/vdagent/x11-randr.c b/src/vdagent/x11-randr.c
index 88857c8..d000e28 100644
--- a/src/vdagent/x11-randr.c
+++ b/src/vdagent/x11-randr.c
@@ -555,16 +555,6 @@ int vdagent_x11_randr_handle_event(struct vdagent_x11 *x11,
     return handled;
 }
 
-static int min_int(int x, int y)
-{
-    return x > y ? y : x;
-}
-
-static int max_int(int x, int y)
-{
-    return x > y ? x : y;
-}
-
 static int constrain_to_range(int low, int *val, int high)
 {
     if (low <= *val && *val <= high) {
@@ -631,10 +621,10 @@ static void zero_base_monitors(struct vdagent_x11 *x11,
         mon_width = (int *)&mon_config->monitors[i].width;
         mon_height = (int *)&mon_config->monitors[i].height;
         constrain_to_screen(x11, mon_width, mon_height);
-        min_x = min_int(mon_config->monitors[i].x, min_x);
-        min_y = min_int(mon_config->monitors[i].y, min_y);
-        max_x = max_int(mon_config->monitors[i].x + *mon_width, max_x);
-        max_y = max_int(mon_config->monitors[i].y + *mon_height, max_y);
+        min_x = MIN(mon_config->monitors[i].x, min_x);
+        min_y = MIN(mon_config->monitors[i].y, min_y);
+        max_x = MAX(mon_config->monitors[i].x + *mon_width, max_x);
+        max_y = MAX(mon_config->monitors[i].y + *mon_height, max_y);
     }
     if (min_x != 0 || min_y != 0) {
         syslog(LOG_ERR, "%s: agent config %d,%d rooted, adjusting to 0,0.",
-- 
2.21.0

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]