Remove min/max macros

...and replace with a local MAX macro, because:

- They contain a ({}) construct which is a GNU extension and that's
  against Drew's coding style
- min() is not used anyway
- MAX() clashes with cairo's macro, so best to not add this in labwc.h
This commit is contained in:
Johan Malm 2021-11-26 19:16:00 +00:00
parent b7c326ec6f
commit bca57213a0
3 changed files with 8 additions and 14 deletions

View file

@ -168,6 +168,7 @@ handle_set_app_id(struct wl_listener *listener, void *data)
view_update_app_id(view);
}
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
static void
xdg_toplevel_view_configure(struct view *view, struct wlr_box geo)
{
@ -178,8 +179,8 @@ xdg_toplevel_view_configure(struct view *view, struct wlr_box geo)
view->pending_move_resize.update_y = geo.y != view->y;
view->pending_move_resize.x = geo.x;
view->pending_move_resize.y = geo.y;
view->pending_move_resize.width = max(geo.width, min_width);
view->pending_move_resize.height = max(geo.height, min_height);
view->pending_move_resize.width = MAX(geo.width, min_width);
view->pending_move_resize.height = MAX(geo.height, min_height);
uint32_t serial = wlr_xdg_toplevel_set_size(view->xdg_surface,
(uint32_t)geo.width, (uint32_t)geo.height);
@ -192,6 +193,7 @@ xdg_toplevel_view_configure(struct view *view, struct wlr_box geo)
damage_all_outputs(view->server);
}
}
#undef MAX
static void
xdg_toplevel_view_move(struct view *view, double x, double y)