diff options
Diffstat (limited to 'ncurses/tty')
-rwxr-xr-x | ncurses/tty/MKexpanded.sh | 6 | ||||
-rw-r--r-- | ncurses/tty/hashmap.c | 4 | ||||
-rw-r--r-- | ncurses/tty/lib_mvcur.c | 115 | ||||
-rw-r--r-- | ncurses/tty/lib_tstp.c | 6 | ||||
-rw-r--r-- | ncurses/tty/lib_twait.c | 4 | ||||
-rw-r--r-- | ncurses/tty/lib_vidattr.c | 22 | ||||
-rw-r--r-- | ncurses/tty/tty_update.c | 72 |
7 files changed, 112 insertions, 117 deletions
diff --git a/ncurses/tty/MKexpanded.sh b/ncurses/tty/MKexpanded.sh index 65c6b93..77f06f2 100755 --- a/ncurses/tty/MKexpanded.sh +++ b/ncurses/tty/MKexpanded.sh @@ -1,6 +1,6 @@ #! /bin/sh ############################################################################## -# Copyright 2019,2020 Thomas E. Dickey # +# Copyright 2019-2020,2021 Thomas E. Dickey # # Copyright 1998-2015,2017 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -30,7 +30,7 @@ # # Author: Thomas E. Dickey, 1997-on # -# $Id: MKexpanded.sh,v 1.22 2020/02/02 23:34:34 tom Exp $ +# $Id: MKexpanded.sh,v 1.23 2021/06/17 21:26:02 tom Exp $ # # Script to generate 'expanded.c', a dummy source that contains functions # corresponding to complex macros used in this library. By making functions, @@ -81,7 +81,7 @@ _nc_toggle_attr_on (attr_t *S, attr_t at) } NCURSES_EXPORT(void) -_nc_toggle_attr_off (attr_t *S, attr_t at) +_nc_toggle_attr_off (attr_t *S, attr_t at) { toggle_attr_off(*S,at); } diff --git a/ncurses/tty/hashmap.c b/ncurses/tty/hashmap.c index 9d1e482..3f124c9 100644 --- a/ncurses/tty/hashmap.c +++ b/ncurses/tty/hashmap.c @@ -74,7 +74,7 @@ AUTHOR #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: hashmap.c,v 1.68 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: hashmap.c,v 1.69 2020/05/31 17:50:48 tom Exp $") #ifdef HASHDEBUG @@ -88,7 +88,7 @@ MODULE_ID("$Id: hashmap.c,v 1.68 2020/02/02 23:34:34 tom Exp $") # undef screen_lines # define screen_lines(sp) MAXLINES # define TEXTWIDTH(sp) 1 -int oldnums[MAXLINES], reallines[MAXLINES]; +static int oldnums[MAXLINES], reallines[MAXLINES]; static NCURSES_CH_T oldtext[MAXLINES][TEXTWIDTH(sp)]; static NCURSES_CH_T newtext[MAXLINES][TEXTWIDTH(sp)]; # define OLDNUM(sp,n) oldnums[n] diff --git a/ncurses/tty/lib_mvcur.c b/ncurses/tty/lib_mvcur.c index 5382b3b..7959227 100644 --- a/ncurses/tty/lib_mvcur.c +++ b/ncurses/tty/lib_mvcur.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 2018-2020,2021 Thomas E. Dickey * * Copyright 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -83,8 +83,8 @@ /* * The average overhead of a full optimization computation in character - * transmission times. If it's too high, the algorithm will be a bit - * over-biased toward using cup rather than local motions; if it's too + * transmission times. If it is too high, the algorithm will be a bit + * over-biased toward using cup rather than local motions; if it is too * low, the algorithm may spend more time than is strictly optimal * looking for non-cup motions. Profile the optimizer using the `t' * command of the exerciser (see below), and round to the nearest integer. @@ -98,7 +98,7 @@ /* * LONG_DIST is the distance we consider to be just as costly to move over as a - * cup sequence is to emit. In other words, it's the length of a cup sequence + * cup sequence is to emit. In other words, it is the length of a cup sequence * adjusted for average computation overhead. The magic number is the length * of "\033[yy;xxH", the typical cup sequence these days. */ @@ -148,7 +148,7 @@ * int _rep_cost; // cost of (repeat_char) * * The USE_HARD_TABS switch controls whether it is reliable to use tab/backtabs - * for local motions. On many systems, it's not, due to uncertainties about + * for local motions. On many systems, it is not, due to uncertainties about * tab delays and whether or not tabs will be expanded in raw mode. If you * have parm_right_cursor, tab motions don't win you a lot anyhow. */ @@ -160,7 +160,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_mvcur.c,v 1.151 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_mvcur.c,v 1.156 2021/09/04 10:29:15 tom Exp $") #define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x] /* desired state */ @@ -279,8 +279,8 @@ reset_scroll_region(NCURSES_SP_DCL0) { if (change_scroll_region) { NCURSES_PUTP2("change_scroll_region", - TPARM_2(change_scroll_region, - 0, screen_lines(SP_PARM) - 1)); + TIPARM_2(change_scroll_region, + 0, screen_lines(SP_PARM) - 1)); } } @@ -399,13 +399,13 @@ NCURSES_SP_NAME(_nc_mvcur_init) (NCURSES_SP_DCL0) * All these averages depend on the assumption that all parameter values * are equally probable. */ - SP_PARM->_cup_cost = CostOf(TPARM_2(SP_PARM->_address_cursor, 23, 23), 1); - SP_PARM->_cub_cost = CostOf(TPARM_1(parm_left_cursor, 23), 1); - SP_PARM->_cuf_cost = CostOf(TPARM_1(parm_right_cursor, 23), 1); - SP_PARM->_cud_cost = CostOf(TPARM_1(parm_down_cursor, 23), 1); - SP_PARM->_cuu_cost = CostOf(TPARM_1(parm_up_cursor, 23), 1); - SP_PARM->_hpa_cost = CostOf(TPARM_1(column_address, 23), 1); - SP_PARM->_vpa_cost = CostOf(TPARM_1(row_address, 23), 1); + SP_PARM->_cup_cost = CostOf(TIPARM_2(SP_PARM->_address_cursor, 23, 23), 1); + SP_PARM->_cub_cost = CostOf(TIPARM_1(parm_left_cursor, 23), 1); + SP_PARM->_cuf_cost = CostOf(TIPARM_1(parm_right_cursor, 23), 1); + SP_PARM->_cud_cost = CostOf(TIPARM_1(parm_down_cursor, 23), 1); + SP_PARM->_cuu_cost = CostOf(TIPARM_1(parm_up_cursor, 23), 1); + SP_PARM->_hpa_cost = CostOf(TIPARM_1(column_address, 23), 1); + SP_PARM->_vpa_cost = CostOf(TIPARM_1(row_address, 23), 1); /* non-parameterized screen-update strings */ SP_PARM->_ed_cost = NormalizedCost(clr_eos, 1); @@ -422,17 +422,16 @@ NCURSES_SP_NAME(_nc_mvcur_init) (NCURSES_SP_DCL0) SP_PARM->_el_cost = 0; /* parameterized screen-update strings */ - SP_PARM->_dch_cost = NormalizedCost(TPARM_1(parm_dch, 23), 1); - SP_PARM->_ich_cost = NormalizedCost(TPARM_1(parm_ich, 23), 1); - SP_PARM->_ech_cost = NormalizedCost(TPARM_1(erase_chars, 23), 1); - SP_PARM->_rep_cost = NormalizedCost(TPARM_2(repeat_char, ' ', 23), 1); - - SP_PARM->_cup_ch_cost = NormalizedCost( - TPARM_2(SP_PARM->_address_cursor, - 23, 23), - 1); - SP_PARM->_hpa_ch_cost = NormalizedCost(TPARM_1(column_address, 23), 1); - SP_PARM->_cuf_ch_cost = NormalizedCost(TPARM_1(parm_right_cursor, 23), 1); + SP_PARM->_dch_cost = NormalizedCost(TIPARM_1(parm_dch, 23), 1); + SP_PARM->_ich_cost = NormalizedCost(TIPARM_1(parm_ich, 23), 1); + SP_PARM->_ech_cost = NormalizedCost(TIPARM_1(erase_chars, 23), 1); + SP_PARM->_rep_cost = NormalizedCost(TIPARM_2(repeat_char, ' ', 23), 1); + + SP_PARM->_cup_ch_cost = NormalizedCost(TIPARM_2(SP_PARM->_address_cursor, + 23, 23), + 1); + SP_PARM->_hpa_ch_cost = NormalizedCost(TIPARM_1(column_address, 23), 1); + SP_PARM->_cuf_ch_cost = NormalizedCost(TIPARM_1(parm_right_cursor, 23), 1); SP_PARM->_inline_cost = min(SP_PARM->_cup_ch_cost, min(SP_PARM->_hpa_ch_cost, SP_PARM->_cuf_ch_cost)); @@ -563,7 +562,7 @@ relative_move(NCURSES_SP_DCLx vcost = INFINITY; if (row_address != 0 - && _nc_safe_strcat(target, TPARM_1(row_address, to_y))) { + && _nc_safe_strcat(target, TIPARM_1(row_address, to_y))) { vcost = SP_PARM->_vpa_cost; } @@ -573,12 +572,12 @@ relative_move(NCURSES_SP_DCLx if (parm_down_cursor && SP_PARM->_cud_cost < vcost && _nc_safe_strcat(_nc_str_copy(target, &save), - TPARM_1(parm_down_cursor, n))) { + TIPARM_1(parm_down_cursor, n))) { vcost = SP_PARM->_cud_cost; } if (cursor_down - && (*cursor_down != '\n' || SP_PARM->_nl) + && (*cursor_down != '\n') && (n * SP_PARM->_cud1_cost < vcost)) { vcost = repeated_append(_nc_str_copy(target, &save), 0, SP_PARM->_cud1_cost, n, cursor_down); @@ -589,7 +588,7 @@ relative_move(NCURSES_SP_DCLx if (parm_up_cursor && SP_PARM->_cuu_cost < vcost && _nc_safe_strcat(_nc_str_copy(target, &save), - TPARM_1(parm_up_cursor, n))) { + TIPARM_1(parm_up_cursor, n))) { vcost = SP_PARM->_cuu_cost; } @@ -613,7 +612,7 @@ relative_move(NCURSES_SP_DCLx if (column_address && _nc_safe_strcat(_nc_str_copy(target, &save), - TPARM_1(column_address, to_x))) { + TIPARM_1(column_address, to_x))) { hcost = SP_PARM->_hpa_cost; } @@ -623,7 +622,7 @@ relative_move(NCURSES_SP_DCLx if (parm_right_cursor && SP_PARM->_cuf_cost < hcost && _nc_safe_strcat(_nc_str_copy(target, &save), - TPARM_1(parm_right_cursor, n))) { + TIPARM_1(parm_right_cursor, n))) { hcost = SP_PARM->_cuf_cost; } @@ -716,7 +715,7 @@ relative_move(NCURSES_SP_DCLx if (parm_left_cursor && SP_PARM->_cub_cost < hcost && _nc_safe_strcat(_nc_str_copy(target, &save), - TPARM_1(parm_left_cursor, n))) { + TIPARM_1(parm_left_cursor, n))) { hcost = SP_PARM->_cub_cost; } @@ -761,7 +760,7 @@ relative_move(NCURSES_SP_DCLx #endif /* !NO_OPTIMIZE */ /* - * With the machinery set up above, it's conceivable that + * With the machinery set up above, it is conceivable that * onscreen_mvcur could be modified into a recursive function that does * an alpha-beta search of motion space, as though it were a chess * move tree, with the weight function being boolean and the search @@ -793,7 +792,8 @@ onscreen_mvcur(NCURSES_SP_DCLx #define InitResult _nc_str_init(&result, buffer, sizeof(buffer)) /* tactic #0: use direct cursor addressing */ - if (_nc_safe_strcpy(InitResult, TPARM_2(SP_PARM->_address_cursor, ynew, xnew))) { + if (_nc_safe_strcpy(InitResult, TIPARM_2(SP_PARM->_address_cursor, + ynew, xnew))) { tactic = 0; usecost = SP_PARM->_cup_cost; @@ -962,7 +962,7 @@ _nc_real_mvcur(NCURSES_SP_DCLx NCURSES_CH_T oldattr; int code; - TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("_nc_tinfo_mvcur(%p,%d,%d,%d,%d)"), + TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("_nc_real_mvcur(%p,%d,%d,%d,%d)"), (void *) SP_PARM, yold, xold, ynew, xnew)); if (SP_PARM == 0) { @@ -997,37 +997,28 @@ _nc_real_mvcur(NCURSES_SP_DCLx if (xold >= screen_columns(SP_PARM)) { - if (SP_PARM->_nl) { - int l = (xold + 1) / screen_columns(SP_PARM); + int l = (xold + 1) / screen_columns(SP_PARM); - yold += l; - if (yold >= screen_lines(SP_PARM)) - l -= (yold - screen_lines(SP_PARM) - 1); + yold += l; + if (yold >= screen_lines(SP_PARM)) + l -= (yold - screen_lines(SP_PARM) - 1); - if (l > 0) { - if (carriage_return) { - NCURSES_PUTP2("carriage_return", carriage_return); - } else { - myOutCh(NCURSES_SP_ARGx '\r'); - } - xold = 0; + if (l > 0) { + if (carriage_return) { + NCURSES_PUTP2("carriage_return", carriage_return); + } else { + myOutCh(NCURSES_SP_ARGx '\r'); + } + xold = 0; - while (l > 0) { - if (newline) { - NCURSES_PUTP2("newline", newline); - } else { - myOutCh(NCURSES_SP_ARGx '\n'); - } - l--; + while (l > 0) { + if (newline) { + NCURSES_PUTP2("newline", newline); + } else { + myOutCh(NCURSES_SP_ARGx '\n'); } + l--; } - } else { - /* - * If caller set nonl(), we cannot really use newlines to - * position to the next row. - */ - xold = -1; - yold = -1; } } diff --git a/ncurses/tty/lib_tstp.c b/ncurses/tty/lib_tstp.c index 43a58e6..a20e72a 100644 --- a/ncurses/tty/lib_tstp.c +++ b/ncurses/tty/lib_tstp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 1998-2014,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -43,7 +43,7 @@ #include <SigAction.h> -MODULE_ID("$Id: lib_tstp.c,v 1.50 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_tstp.c,v 1.51 2021/09/04 10:54:35 tom Exp $") #if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC) #define USE_SIGTSTP 1 @@ -130,7 +130,7 @@ signal_name(int sig) * (this may include XENIX). * * This implementation will probably be changed to use signal(3) in - * the future. If nothing else, it's simpler... + * the future. If nothing else, it is simpler... */ #if USE_SIGTSTP diff --git a/ncurses/tty/lib_twait.c b/ncurses/tty/lib_twait.c index 3ab168d..a7604b3 100644 --- a/ncurses/tty/lib_twait.c +++ b/ncurses/tty/lib_twait.c @@ -71,12 +71,12 @@ # include <sys/select.h> # endif #endif -#ifdef _WIN32 +#if HAVE_SYS_TIME_H # include <sys/time.h> #endif #undef CUR -MODULE_ID("$Id: lib_twait.c,v 1.74 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_twait.c,v 1.75 2020/02/29 15:46:00 anonymous.maarten Exp $") static long _nc_gettime(TimeType * t0, int first) diff --git a/ncurses/tty/lib_vidattr.c b/ncurses/tty/lib_vidattr.c index c752919..15e7397 100644 --- a/ncurses/tty/lib_vidattr.c +++ b/ncurses/tty/lib_vidattr.c @@ -70,7 +70,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_vidattr.c,v 1.76 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_vidattr.c,v 1.78 2020/05/27 23:56:32 tom Exp $") #define doPut(mode) \ TPUTS_TRACE(#mode); \ @@ -258,16 +258,16 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx if (turn_on || turn_off) { TPUTS_TRACE("set_attributes"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - tparm(set_attributes, - (newmode & A_STANDOUT) != 0, - (newmode & A_UNDERLINE) != 0, - (newmode & A_REVERSE) != 0, - (newmode & A_BLINK) != 0, - (newmode & A_DIM) != 0, - (newmode & A_BOLD) != 0, - (newmode & A_INVIS) != 0, - (newmode & A_PROTECT) != 0, - (newmode & A_ALTCHARSET) != 0), + TIPARM_9(set_attributes, + (newmode & A_STANDOUT) != 0, + (newmode & A_UNDERLINE) != 0, + (newmode & A_REVERSE) != 0, + (newmode & A_BLINK) != 0, + (newmode & A_DIM) != 0, + (newmode & A_BOLD) != 0, + (newmode & A_INVIS) != 0, + (newmode & A_PROTECT) != 0, + (newmode & A_ALTCHARSET) != 0), 1, outc); PreviousAttr &= ALL_BUT_COLOR; } diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c index 8626c79..bdd673b 100644 --- a/ncurses/tty/tty_update.c +++ b/ncurses/tty/tty_update.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 2018-2020,2021 Thomas E. Dickey * * Copyright 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -85,7 +85,7 @@ #include <ctype.h> -MODULE_ID("$Id: tty_update.c,v 1.305 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.312 2021/09/04 10:29:59 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -117,14 +117,14 @@ static int ClrBottom(SCREEN *, int total); static void ClearScreen(SCREEN *, NCURSES_CH_T blank); static void ClrUpdate(SCREEN *); static void DelChar(SCREEN *, int count); -static void InsStr(SCREEN *, NCURSES_CH_T * line, int count); +static void InsStr(SCREEN *, NCURSES_CH_T *line, int count); static void TransformLine(SCREEN *, int const lineno); #else static int ClrBottom(int total); static void ClearScreen(NCURSES_CH_T blank); static void ClrUpdate(void); static void DelChar(int count); -static void InsStr(NCURSES_CH_T * line, int count); +static void InsStr(NCURSES_CH_T *line, int count); static void TransformLine(int const lineno); #endif @@ -136,7 +136,7 @@ static void TransformLine(int const lineno); ****************************************************************************/ static void -position_check(NCURSES_SP_DCLx int expected_y, int expected_x, char *legend) +position_check(NCURSES_SP_DCLx int expected_y, int expected_x, const char *legend) /* check to see if the real cursor position matches the virtual */ { char buf[20]; @@ -170,9 +170,9 @@ position_check(NCURSES_SP_DCLx int expected_y, int expected_x, char *legend) if (y - 1 != expected_y || x - 1 != expected_x) { NCURSES_SP_NAME(beep) (NCURSES_SP_ARG); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - tparm("\033[%d;%dH", - expected_y + 1, - expected_x + 1), + TIPARM_2("\033[%d;%dH", + expected_y + 1, + expected_x + 1), 1, NCURSES_SP_NAME(_nc_outch)); _tracef("position seen (%d, %d) doesn't match expected one (%d, %d) in %s", y - 1, x - 1, expected_y, expected_x, legend); @@ -429,11 +429,12 @@ PutCharLR(NCURSES_SP_DCLx const ARG_CH_T ch) /* we can put the char directly */ PutAttrChar(NCURSES_SP_ARGx ch); } else if (enter_am_mode && exit_am_mode) { + int oldcol = SP_PARM->_curscol; /* we can suppress automargin */ NCURSES_PUTP2("exit_am_mode", exit_am_mode); PutAttrChar(NCURSES_SP_ARGx ch); - SP_PARM->_curscol--; + SP_PARM->_curscol = oldcol; position_check(NCURSES_SP_ARGx SP_PARM->_cursrow, SP_PARM->_curscol, @@ -472,7 +473,7 @@ wrap_cursor(NCURSES_SP_DCL0) * An aggressive way to handle this would be to emit CR/LF after the * char and then assume the wrap is done, you're on the first position * of the next line, and the terminal out of its weird state. Here - * it's safe to just tell the code that the cursor is in hyperspace and + * it is safe to just tell the code that the cursor is in hyperspace and * let the next mvcur() call straighten things out. */ SP_PARM->_curscol = -1; @@ -567,7 +568,7 @@ can_clear_with(NCURSES_SP_DCLx ARG_CH_T ch) * This code is optimized using ech and rep. */ static int -EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) +EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T *ntext, int num) { int i; @@ -605,7 +606,7 @@ EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) && runcount > SP_PARM->_ech_cost + SP_PARM->_cup_ch_cost && can_clear_with(NCURSES_SP_ARGx CHREF(ntext0))) { UpdateAttrs(SP_PARM, ntext0); - NCURSES_PUTP2("erase_chars", TPARM_1(erase_chars, runcount)); + NCURSES_PUTP2("erase_chars", TIPARM_1(erase_chars, runcount)); /* * If this is the last part of the given interval, @@ -620,6 +621,9 @@ EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) return 1; /* cursor stays in the middle */ } } else if (repeat_char != 0 && +#if BSD_TPUTS + !isdigit(UChar(CharOf(ntext0))) && +#endif #if USE_WIDEC_SUPPORT (!SP_PARM->_screen_unicode && (CharOf(ntext0) < ((AttrOf(ntext0) & A_ALTCHARSET) @@ -645,9 +649,9 @@ EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) AttrOf(ntext0) | A_ALTCHARSET); } NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(repeat_char, - CharOf(temp), - rep_count), + TIPARM_2(repeat_char, + CharOf(temp), + rep_count), 1, NCURSES_SP_NAME(_nc_outch)); SP_PARM->_curscol += rep_count; @@ -679,8 +683,8 @@ EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) */ static int PutRange(NCURSES_SP_DCLx - const NCURSES_CH_T * otext, - const NCURSES_CH_T * ntext, + const NCURSES_CH_T *otext, + const NCURSES_CH_T *ntext, int row, int first, int last) { @@ -819,7 +823,7 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) /* * This is the support for magic-cookie terminals. The theory: we scan * the virtual screen looking for attribute turnons. Where we find one, - * check to make sure it's realizable by seeing if the required number of + * check to make sure it is realizable by seeing if the required number of * un-attributed blanks are present before and after the attributed range; * try to shift the range boundaries over blanks (not changing the screen * display) so this becomes true. If it is, shift the beginning attribute @@ -881,7 +885,7 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) bool end_onscreen = FALSE; int m, n = j; - /* find end of span, if it's onscreen */ + /* find end of span, if it is onscreen */ for (m = i; m < screen_lines(SP_PARM); m++) { for (; n < screen_columns(SP_PARM); n++) { attr_t testattr = @@ -1321,8 +1325,8 @@ TransformLine(NCURSES_SP_DCLx int const lineno) newPair = GetPair(newLine[n]); if (oldPair != newPair && unColor(oldLine[n]) == unColor(newLine[n])) { - if (oldPair < SP_PARM->_pair_limit - && newPair < SP_PARM->_pair_limit + if (oldPair < SP_PARM->_pair_alloc + && newPair < SP_PARM->_pair_alloc && (isSamePair(SP_PARM->_color_pairs[oldPair], SP_PARM->_color_pairs[newPair]))) { SetPair(oldLine[n], GetPair(newLine[n])); @@ -1701,7 +1705,7 @@ ClearScreen(NCURSES_SP_DCLx NCURSES_CH_T blank) */ static void -InsStr(NCURSES_SP_DCLx NCURSES_CH_T * line, int count) +InsStr(NCURSES_SP_DCLx NCURSES_CH_T *line, int count) { TR(TRACE_UPDATE, ("InsStr(%p, %p,%d) called", (void *) SP_PARM, @@ -1713,7 +1717,7 @@ InsStr(NCURSES_SP_DCLx NCURSES_CH_T * line, int count) if (parm_ich) { TPUTS_TRACE("parm_ich"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(parm_ich, count), + TIPARM_1(parm_ich, count), 1, NCURSES_SP_NAME(_nc_outch)); while (count > 0) { @@ -1766,7 +1770,7 @@ DelChar(NCURSES_SP_DCLx int count) if (parm_dch) { TPUTS_TRACE("parm_dch"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(parm_dch, count), + TIPARM_1(parm_dch, count), 1, NCURSES_SP_NAME(_nc_outch)); } else { @@ -1835,7 +1839,7 @@ scroll_csr_forward(NCURSES_SP_DCLx UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_index"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(parm_index, n, 0), + TIPARM_1(parm_index, n), n, NCURSES_SP_NAME(_nc_outch)); } else if (parm_delete_line && bot == maxy) { @@ -1843,7 +1847,7 @@ scroll_csr_forward(NCURSES_SP_DCLx UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_delete_line"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(parm_delete_line, n, 0), + TIPARM_1(parm_delete_line, n), n, NCURSES_SP_NAME(_nc_outch)); } else if (scroll_forward && top == miny && bot == maxy) { @@ -1900,7 +1904,7 @@ scroll_csr_backward(NCURSES_SP_DCLx UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_rindex"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(parm_rindex, n, 0), + TIPARM_1(parm_rindex, n), n, NCURSES_SP_NAME(_nc_outch)); } else if (parm_insert_line && bot == maxy) { @@ -1908,7 +1912,7 @@ scroll_csr_backward(NCURSES_SP_DCLx UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_insert_line"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(parm_insert_line, n, 0), + TIPARM_1(parm_insert_line, n), n, NCURSES_SP_NAME(_nc_outch)); } else if (scroll_reverse && top == miny && bot == maxy) { @@ -1956,7 +1960,7 @@ scroll_idl(NCURSES_SP_DCLx int n, int del, int ins, NCURSES_CH_T blank) } else if (parm_delete_line) { TPUTS_TRACE("parm_delete_line"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(parm_delete_line, n, 0), + TIPARM_1(parm_delete_line, n), n, NCURSES_SP_NAME(_nc_outch)); } else { /* if (delete_line) */ @@ -1972,7 +1976,7 @@ scroll_idl(NCURSES_SP_DCLx int n, int del, int ins, NCURSES_CH_T blank) } else if (parm_insert_line) { TPUTS_TRACE("parm_insert_line"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(parm_insert_line, n, 0), + TIPARM_1(parm_insert_line, n), n, NCURSES_SP_NAME(_nc_outch)); } else { /* if (insert_line) */ @@ -2037,7 +2041,7 @@ NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx NCURSES_PUTP2("save_cursor", save_cursor); } NCURSES_PUTP2("change_scroll_region", - TPARM_2(change_scroll_region, top, bot)); + TIPARM_2(change_scroll_region, top, bot)); if (cursor_saved) { NCURSES_PUTP2("restore_cursor", restore_cursor); } else { @@ -2047,7 +2051,7 @@ NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx res = scroll_csr_forward(NCURSES_SP_ARGx n, top, bot, top, bot, blank); NCURSES_PUTP2("change_scroll_region", - TPARM_2(change_scroll_region, 0, maxy)); + TIPARM_2(change_scroll_region, 0, maxy)); SP_PARM->_cursrow = SP_PARM->_curscol = -1; } @@ -2083,7 +2087,7 @@ NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx NCURSES_PUTP2("save_cursor", save_cursor); } NCURSES_PUTP2("change_scroll_region", - TPARM_2(change_scroll_region, top, bot)); + TIPARM_2(change_scroll_region, top, bot)); if (cursor_saved) { NCURSES_PUTP2("restore_cursor", restore_cursor); } else { @@ -2094,7 +2098,7 @@ NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx -n, top, bot, top, bot, blank); NCURSES_PUTP2("change_scroll_region", - TPARM_2(change_scroll_region, 0, maxy)); + TIPARM_2(change_scroll_region, 0, maxy)); SP_PARM->_cursrow = SP_PARM->_curscol = -1; } |