X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftty%2Ftty_update.c;h=dd6c3b670597c3cafd95860d7b32fd30de05636d;hp=87996232dc2df7705111989a34d6e42fd6613c7c;hb=d96f3e9b8a422f6daa2101d4d165801421312aa0;hpb=da1f84b7eb32f17e91f6de242132ab3b2d462148 diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c index 87996232..dd6c3b67 100644 --- a/ncurses/tty/tty_update.c +++ b/ncurses/tty/tty_update.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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 * @@ -43,7 +43,6 @@ * *-----------------------------------------------------------------*/ -#define NEED_NCURSES_CH_T 1 #include #ifndef CUR @@ -83,7 +82,7 @@ #include -MODULE_ID("$Id: tty_update.c,v 1.258 2009/06/27 19:16:17 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.263 2010/05/01 20:44:34 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -194,12 +193,14 @@ static NCURSES_INLINE void GoTo(NCURSES_SP_DCLx int const row, int const col) { TR(TRACE_MOVE, ("GoTo(%p, %d, %d) from (%d, %d)", - SP_PARM, row, col, SP_PARM->_cursrow, SP_PARM->_curscol)); + (void *) SP_PARM, row, col, SP_PARM->_cursrow, SP_PARM->_curscol)); position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "GoTo"); - NCURSES_SP_NAME(mvcur) (NCURSES_SP_ARGx SP_PARM->_cursrow, - SP_PARM->_curscol, row, col); + TINFO_MVCUR(NCURSES_SP_ARGx + SP_PARM->_cursrow, + SP_PARM->_curscol, + row, col); position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "GoTo2"); } @@ -627,7 +628,10 @@ PutRange(NCURSES_SP_DCLx int i, j, same; TR(TRACE_CHARPUT, ("PutRange(%p, %p, %p, %d, %d, %d)", - SP_PARM, otext, ntext, row, first, last)); + (void *) SP_PARM, + (const void *) otext, + (const void *) ntext, + row, first, last)); if (otext != ntext && (last - first + 1) > SP_PARM->_inline_cost) { @@ -661,7 +665,7 @@ PutRange(NCURSES_SP_DCLx if_USE_SCROLL_HINTS(win->_line[row].oldindex = row) NCURSES_EXPORT(int) -NCURSES_SP_NAME(doupdate) (NCURSES_SP_DCL0) +TINFO_DOUPDATE(NCURSES_SP_DCL0) { int i; int nonempty; @@ -669,7 +673,7 @@ NCURSES_SP_NAME(doupdate) (NCURSES_SP_DCL0) struct tms before, after; #endif /* USE_TRACE_TIMES */ - T((T_CALLED("_nc_tinfo:doupdate(%p)"), SP_PARM)); + T((T_CALLED("_nc_tinfo:doupdate(%p)"), (void *) SP_PARM)); #if !USE_REENTRANT /* @@ -1004,11 +1008,11 @@ NCURSES_SP_NAME(doupdate) (NCURSES_SP_DCL0) returnCode(OK); } -#if NCURSES_SP_FUNCS +#if NCURSES_SP_FUNCS && !defined(USE_TERM_DRIVER) NCURSES_EXPORT(int) doupdate(void) { - return NCURSES_SP_NAME(doupdate) (CURRENT_SCREEN); + return TINFO_DOUPDATE(CURRENT_SCREEN); } #endif @@ -1074,24 +1078,24 @@ ClrToEOL(NCURSES_SP_DCLx NCURSES_CH_T blank, bool needclear) { int j; - if (SP_PARM != 0 && CurScreen(SP_PARM) != 0 - && SP_PARM->_cursrow >= 0) { - for (j = SP_PARM->_curscol; j < screen_columns(SP_PARM); j++) { - if (j >= 0) { - NCURSES_CH_T *cp = - &(CurScreen(SP_PARM)->_line[SP_PARM->_cursrow].text[j]); - - if (!CharEq(*cp, blank)) { - *cp = blank; - needclear = TRUE; + if (SP_PARM != 0) { + if (CurScreen(SP_PARM) != 0 + && SP_PARM->_cursrow >= 0) { + for (j = SP_PARM->_curscol; j < screen_columns(SP_PARM); j++) { + if (j >= 0) { + NCURSES_CH_T *cp = + &(CurScreen(SP_PARM)->_line[SP_PARM->_cursrow].text[j]); + + if (!CharEq(*cp, blank)) { + *cp = blank; + needclear = TRUE; + } } } } - } else { - needclear = TRUE; } - if (needclear) { + if (needclear && (SP_PARM != 0)) { UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("clr_eol"); if (clr_eol && SP_PARM->_el_cost <= (screen_columns(SP_PARM) - SP_PARM->_curscol)) { @@ -1200,7 +1204,7 @@ ClrBottom(NCURSES_SP_DCLx int total) ** TransformLine(lineno) ** ** Transform the given line in curscr to the one in newscr, using -** Insert/Delete Character if _nc_idcok && has_ic(). +** Insert/Delete Character if idcok && has_ic(). ** ** firstChar = position of first different character in line ** oLastChar = position of last different character in old line @@ -1223,7 +1227,7 @@ TransformLine(NCURSES_SP_DCLx int const lineno) int n; bool attrchanged = FALSE; - TR(TRACE_UPDATE, (T_CALLED("TransformLine(%p, %d)"), SP_PARM, lineno)); + TR(TRACE_UPDATE, (T_CALLED("TransformLine(%p, %d)"), (void *) SP_PARM, lineno)); /* copy new hash value to old one */ if (SP_PARM->oldhash && SP_PARM->newhash) @@ -1622,7 +1626,9 @@ ClearScreen(NCURSES_SP_DCLx NCURSES_CH_T blank) static void InsStr(NCURSES_SP_DCLx NCURSES_CH_T * line, int count) { - TR(TRACE_UPDATE, ("InsStr(%p, %p,%d) called", SP_PARM, line, count)); + TR(TRACE_UPDATE, ("InsStr(%p, %p,%d) called", + (void *) SP_PARM, + (void *) line, count)); /* Prefer parm_ich as it has the smallest cost - no need to shift * the whole line on each character. */ @@ -1681,7 +1687,7 @@ DelChar(NCURSES_SP_DCLx int count) int n; TR(TRACE_UPDATE, ("DelChar(%p, %d) called, position = (%ld,%ld)", - SP_PARM, count, + (void *) SP_PARM, count, (long) NewScreen(SP_PARM)->_cury, (long) NewScreen(SP_PARM)->_curx)); @@ -1938,7 +1944,8 @@ NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx bool cursor_saved = FALSE; int res; - TR(TRACE_MOVE, ("_nc_scrolln(%p, %d, %d, %d, %d)", SP_PARM, n, top, bot, maxy)); + TR(TRACE_MOVE, ("_nc_scrolln(%p, %d, %d, %d, %d)", + (void *) SP_PARM, n, top, bot, maxy)); if (!IsValidScreen(SP_PARM)) return (ERR); @@ -2162,11 +2169,11 @@ NCURSES_SP_NAME(_nc_screen_wrap) (NCURSES_SP_DCL0) NCURSES_SP_NAME(_nc_outch)); SP_PARM->_default_color = FALSE; - NCURSES_SP_NAME(mvcur) (NCURSES_SP_ARGx - SP_PARM->_cursrow, - SP_PARM->_curscol, - screen_lines(SP_PARM) - 1, - 0); + TINFO_MVCUR(NCURSES_SP_ARGx + SP_PARM->_cursrow, + SP_PARM->_curscol, + screen_lines(SP_PARM) - 1, + 0); ClrToEOL(NCURSES_SP_ARGx blank, TRUE); }