X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_clrbot.c;fp=ncurses%2Flib_clrbot.c;h=cec34161acef4802cbf41c4833d3e247faf1232e;hp=9dac8c275cba27ee0e20b6242e18169d4fd148d4;hb=refs%2Ftags%2Fv5.0;hpb=661078ddbde3ce0f3b06e95642fbb9b5fef7dca1 diff --git a/ncurses/lib_clrbot.c b/ncurses/base/lib_clrbot.c similarity index 78% rename from ncurses/lib_clrbot.c rename to ncurses/base/lib_clrbot.c index 9dac8c27..cec34161 100644 --- a/ncurses/lib_clrbot.c +++ b/ncurses/base/lib_clrbot.c @@ -40,39 +40,35 @@ #include -MODULE_ID("$Id: lib_clrbot.c,v 1.13 1998/02/11 12:13:54 tom Exp $") +MODULE_ID("$Id: lib_clrbot.c,v 1.14 1998/06/28 00:36:26 tom Exp $") int wclrtobot(WINDOW *win) { int code = ERR; -chtype blank; -chtype *ptr, *end; -short y, startx; T((T_CALLED("wclrtobot(%p)"), win)); if (win) { - startx = win->_curx; - - T(("clearing from y = %d to y = %d with maxx = %d", win->_cury, win->_maxy, win->_maxx)); - - for (y = win->_cury; y <= win->_maxy; y++) { - end = &win->_line[y].text[win->_maxx]; - - blank = _nc_background(win); - for (ptr = &win->_line[y].text[startx]; ptr <= end; ptr++) - *ptr = blank; - - if (win->_line[y].firstchar > startx - || win->_line[y].firstchar == _NOCHANGE) - win->_line[y].firstchar = startx; - - win->_line[y].lastchar = win->_maxx; - - startx = 0; - } - _nc_synchook(win); - code = OK; + short y; + short startx = win->_curx; + chtype blank = _nc_background(win); + + T(("clearing from y = %d to y = %d with maxx = %d", win->_cury, win->_maxy, win->_maxx)); + + for (y = win->_cury; y <= win->_maxy; y++) { + struct ldat *line = &(win->_line[y]); + chtype *ptr = &(line->text[startx]); + chtype *end = &(line->text[win->_maxx]); + + CHANGED_TO_EOL(line, startx, win->_maxx); + + while (ptr <= end) + *ptr++ = blank; + + startx = 0; + } + _nc_synchook(win); + code = OK; } returnCode(code); }