+
+/*
+ * set_ch:
+ * Set the first and last change flags for this window.
+ */
+static
+set_ch(win, y, x, ch)
+reg WINDOW *win;
+int y, x;
+{
+# ifdef FULLDEBUG
+ fprintf(outf, "SET_CH(%0.2o, %d, %d)\n", win, y, x);
+# endif
+ if (win->_y[y][x] != ch) {
+ x += win->_ch_off;
+ if (win->_firstch[y] == _NOCHANGE)
+ win->_firstch[y] = win->_lastch[y] = x;
+ else if (x < win->_firstch[y])
+ win->_firstch[y] = x;
+ else if (x > win->_lastch[y])
+ win->_lastch[y] = x;
+# ifdef FULLDEBUG
+ fprintf(outf, "SET_CH: change gives f/l: %d/%d [%d/%d]\n",
+ win->_firstch[y], win->_lastch[y],
+ win->_firstch[y] - win->_ch_off,
+ win->_lastch[y] - win->_ch_off);
+# endif
+ }
+}