Commit ceafe86b authored by Karl Heuer's avatar Karl Heuer

(minmax): New macro.

(update_frame): Use it.
parent 09522567
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment