From: Karl Heuer Date: Thu, 9 Apr 1998 17:21:02 +0000 (+0000) Subject: (minmax): New macro. X-Git-Tag: emacs-20.3~1621 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ceafe86b40fd5ad9a91a15b2f12fcaf7f03bd41d;p=emacs.git (minmax): New macro. (update_frame): Use it. --- 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);