changeset 21453:f23a3354d0ad

(minmax): New macro. (update_frame): Use it.
author Karl Heuer <kwzh@gnu.org>
date Thu, 09 Apr 1998 17:21:02 +0000
parents bd9b548fd162
children 1361a790bca8
files src/dispnew.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/dispnew.c	Thu Apr 09 17:07:32 1998 +0000
+++ b/src/dispnew.c	Thu Apr 09 17:21:02 1998 +0000
@@ -64,6 +64,8 @@
 
 #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 @@
 	}
       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);