]> git.mdlowis.com Git - proto/labwc.git/commitdiff
include/labwc.h: Provide MIN/MAX macros
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Fri, 6 Jan 2023 14:06:57 +0000 (15:06 +0100)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Fri, 6 Jan 2023 17:33:25 +0000 (18:33 +0100)
include/labwc.h
src/ssd/ssd_part.c
src/view.c
src/xwayland.c

index 38edf3488628d2ffaba3f7e70b4aba02177f2aa4..68a69817e659102a4dc9b7173c6b7bd2c2662065 100644 (file)
 #define XCURSOR_DEFAULT "left_ptr"
 #define XCURSOR_SIZE 24
 
+#ifndef MIN
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
+#endif
+
+#ifndef MAX
+#define MAX(a, b) (((a) > (b)) ? (a) : (b))
+#endif
+
 enum input_mode {
        LAB_INPUT_STATE_PASSTHROUGH = 0,
        LAB_INPUT_STATE_MOVE,
index 5b5e6820fd4fa02f96793918caa0e0c028fd69af..07cd695988cc0e45d45efd1c1d6c8c0ac8a11958 100644 (file)
@@ -123,10 +123,8 @@ get_scale_box(struct wlr_buffer *buffer, double container_width,
 
        /* Scale down buffer if required */
        if (icon_geo.width && icon_geo.height) {
-               #define MIN(a, b) ((a) < (b) ? (a) : (b))
                double scale = MIN(container_width / icon_geo.width,
                        container_height / icon_geo.height);
-               #undef MIN
                if (scale < 1.0f) {
                        icon_geo.width = (double)icon_geo.width * scale;
                        icon_geo.height = (double)icon_geo.height * scale;
index 34446a45be05963fb6c386a0041dd78a094782a5..468c019ddea5b174ba964cdd332bb5ba47359407 100644 (file)
@@ -14,8 +14,6 @@
 #define LAB_FALLBACK_WIDTH  640
 #define LAB_FALLBACK_HEIGHT 480
 
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-
 /**
  * All view_apply_xxx_geometry() functions must *not* modify
  * any state besides repositioning or resizing the view.
index 353f49ffbc9d10810be500b2be560f996ff8d7e7..7c935dad378fcae9a22cade7f9b776e8e2bde0ae 100644 (file)
@@ -7,8 +7,6 @@
 #include "view.h"
 #include "workspaces.h"
 
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-
 static int
 round_to_increment(int val, int base, int inc)
 {