Mercurial > emacs
comparison src/dispnew.c @ 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 | 50929073a0ba |
children | fa9ff387d260 |
comparison
equal
deleted
inserted
replaced
21452:bd9b548fd162 | 21453:f23a3354d0ad |
---|---|
62 | 62 |
63 #include <errno.h> | 63 #include <errno.h> |
64 | 64 |
65 #define max(a, b) ((a) > (b) ? (a) : (b)) | 65 #define max(a, b) ((a) > (b) ? (a) : (b)) |
66 #define min(a, b) ((a) < (b) ? (a) : (b)) | 66 #define min(a, b) ((a) < (b) ? (a) : (b)) |
67 #define minmax(floor, val, ceil) \ | |
68 ((val) < (floor) ? (floor) : (val) > (ceil) ? (ceil) : (val)) | |
67 | 69 |
68 /* Get number of chars of output now in the buffer of a stdio stream. | 70 /* Get number of chars of output now in the buffer of a stdio stream. |
69 This ought to be built in in stdio, but it isn't. | 71 This ought to be built in in stdio, but it isn't. |
70 Some s- files override this because their stdio internals differ. */ | 72 Some s- files override this because their stdio internals differ. */ |
71 #ifdef __GNU_LIBRARY__ | 73 #ifdef __GNU_LIBRARY__ |
1355 | 1357 |
1356 cursor_to (row, col); | 1358 cursor_to (row, col); |
1357 } | 1359 } |
1358 else | 1360 else |
1359 cursor_to (FRAME_CURSOR_Y (f), | 1361 cursor_to (FRAME_CURSOR_Y (f), |
1360 max (min (FRAME_CURSOR_X (f), | 1362 minmax (0, FRAME_CURSOR_X (f), FRAME_WINDOW_WIDTH (f) - 1)); |
1361 FRAME_WINDOW_WIDTH (f) - 1), 0)); | |
1362 } | 1363 } |
1363 | 1364 |
1364 update_end (f); | 1365 update_end (f); |
1365 | 1366 |
1366 if (termscript) | 1367 if (termscript) |