From ceafe86b40fd5ad9a91a15b2f12fcaf7f03bd41d Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Thu, 9 Apr 1998 17:21:02 +0000 Subject: [PATCH] (minmax): New macro. (update_frame): Use it. --- src/dispnew.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dispnew.c b/src/dispnew.c index 5bb97150b77..8eb3d95dd9b 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -64,6 +64,8 @@ Boston, MA 02111-1307, USA. */ #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b)) +#define minmax(floor, val, ceil) \ + ((val) < (floor) ? (floor) : (val) > (ceil) ? (ceil) : (val)) /* Get number of chars of output now in the buffer of a stdio stream. This ought to be built in in stdio, but it isn't. @@ -1357,8 +1359,7 @@ update_frame (f, force, inhibit_hairy_id) } else cursor_to (FRAME_CURSOR_Y (f), - max (min (FRAME_CURSOR_X (f), - FRAME_WINDOW_WIDTH (f) - 1), 0)); + minmax (0, FRAME_CURSOR_X (f), FRAME_WINDOW_WIDTH (f) - 1)); } update_end (f); -- 2.39.2