X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;ds=sidebyside;f=ncurses%2Ftty%2Ftty_update.c;h=16fc17d27236ae04960e4fef13bcf5de7f69a549;hb=1078c0231b8a58fbd2dd56b6e0a81b19d6b07f77;hp=57222f15f5ff31bbe98af66e3968aed6b560a18a;hpb=7a27c7d49c2e8b4a1ecbe85b4423d647cbc75ea5;p=ncurses.git diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c index 57222f15..16fc17d2 100644 --- a/ncurses/tty/tty_update.c +++ b/ncurses/tty/tty_update.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -74,7 +74,7 @@ #include #include -MODULE_ID("$Id: tty_update.c,v 1.239 2007/04/19 20:57:49 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.245 2008/05/03 22:43:04 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -289,7 +289,7 @@ PutAttrChar(CARG_CH_T ch) #endif { PUTC(CHDEREF(ch), SP->_ofp); /* macro's fastest... */ - TRACE_OUTCHARS(1); + COUNT_OUTCHARS(1); } SP->_curscol += chlen; if (char_padding) { @@ -624,13 +624,18 @@ doupdate(void) T((T_CALLED("doupdate()"))); + if (curscr == 0 + || newscr == 0) + returnCode(ERR); + #ifdef TRACE - if (_nc_tracing & TRACE_UPDATE) { + if (USE_TRACEF(TRACE_UPDATE)) { if (curscr->_clear) _tracef("curscr is clear"); else _tracedump("curscr", curscr); _tracedump("newscr", newscr); + _nc_unlock_global(tracef); } #endif /* TRACE */ @@ -640,7 +645,7 @@ doupdate(void) SP->_fifohold--; #if USE_SIZECHANGE - if (SP->_endwin || _nc_handle_sigwinch(FALSE)) { + if (SP->_endwin || _nc_handle_sigwinch(SP)) { /* * This is a transparent extension: XSI does not address it, * and applications need not know that ncurses can do it. @@ -649,7 +654,7 @@ doupdate(void) * (this can happen in an xterm, for example), and resize the * ncurses data structures accordingly. */ - _nc_update_screensize(); + _nc_update_screensize(SP); } #endif @@ -666,7 +671,7 @@ doupdate(void) } #if USE_TRACE_TIMES /* zero the metering machinery */ - _nc_outchars = 0; + RESET_OUTCHARS(); (void) times(&before); #endif /* USE_TRACE_TIMES */ @@ -826,9 +831,10 @@ doupdate(void) #ifdef TRACE /* show altered highlights after magic-cookie check */ - if (_nc_tracing & TRACE_UPDATE) { + if (USE_TRACEF(TRACE_UPDATE)) { _tracef("After magic-cookie check..."); _tracedump("newscr", newscr); + _nc_unlock_global(tracef); } #endif /* TRACE */ } @@ -836,7 +842,6 @@ doupdate(void) nonempty = 0; if (curscr->_clear || newscr->_clear) { /* force refresh ? */ - TR(TRACE_UPDATE, ("clearing and updating from scratch")); ClrUpdate(); curscr->_clear = FALSE; /* reset flag */ newscr->_clear = FALSE; /* reset flag */ @@ -967,7 +972,7 @@ ClrUpdate(void) NCURSES_CH_T blank = ClrBlank(stdscr); int nonempty = min(screen_lines, newscr->_maxy + 1); - TR(TRACE_UPDATE, ("ClrUpdate() called")); + TR(TRACE_UPDATE, (T_CALLED("ClrUpdate"))); ClearScreen(blank); @@ -977,6 +982,8 @@ ClrUpdate(void) for (i = 0; i < nonempty; i++) TransformLine(i); + + TR(TRACE_UPDATE, (T_RETURN(""))); } /*