X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftty%2Ftty_update.c;h=80815244bb9b1162dd54fb4a9cb7d8215236fb4b;hp=bdd673bec0c8e601182c5825f120b15dfeb2ee18;hb=HEAD;hpb=643ec2bf782cd02efafe3ccdeaea8920a404645e diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c index bdd673be..0427024c 100644 --- a/ncurses/tty/tty_update.c +++ b/ncurses/tty/tty_update.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2020,2021 Thomas E. Dickey * + * Copyright 2018-2023,2024 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 -MODULE_ID("$Id: tty_update.c,v 1.312 2021/09/04 10:29:59 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.316 2024/02/04 00:09:34 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -256,6 +256,7 @@ PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch) * not checked. */ if (is8bits(CharOf(CHDEREF(ch))) + && (!is7bits(CharOf(CHDEREF(ch))) && _nc_unicode_locale()) && (isprint(CharOf(CHDEREF(ch))) || (SP_PARM->_legacy_coding > 0 && CharOf(CHDEREF(ch)) >= 160) || (SP_PARM->_legacy_coding > 1 && CharOf(CHDEREF(ch)) >= 128) @@ -757,14 +758,20 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) * We do not allow applications to assign new values in the reentrant * model. */ +#if NCURSES_SP_FUNCS + if (SP_PARM == CURRENT_SCREEN) { +#endif #define SyncScreens(internal,exported) \ if (internal == 0) internal = exported; \ if (internal != exported) exported = internal - SyncScreens(CurScreen(SP_PARM), curscr); - SyncScreens(NewScreen(SP_PARM), newscr); - SyncScreens(StdScreen(SP_PARM), stdscr); + SyncScreens(CurScreen(SP_PARM), curscr); + SyncScreens(NewScreen(SP_PARM), newscr); + SyncScreens(StdScreen(SP_PARM), stdscr); +#if NCURSES_SP_FUNCS + } #endif +#endif /* !USE_REENTRANT */ if (CurScreen(SP_PARM) == 0 || NewScreen(SP_PARM) == 0 @@ -998,7 +1005,7 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) if (check_pending(NCURSES_SP_ARG)) goto cleanup; - nonempty = min(screen_lines(SP_PARM), NewScreen(SP_PARM)->_maxy + 1); + nonempty = Min(screen_lines(SP_PARM), NewScreen(SP_PARM)->_maxy + 1); if (SP_PARM->_scrolling) { NCURSES_SP_NAME(_nc_scroll_optimize) (NCURSES_SP_ARG); @@ -1128,7 +1135,7 @@ ClrUpdate(NCURSES_SP_DCL0) if (0 != SP_PARM) { int i; NCURSES_CH_T blank = ClrBlank(NCURSES_SP_ARGx StdScreen(SP_PARM)); - int nonempty = min(screen_lines(SP_PARM), + int nonempty = Min(screen_lines(SP_PARM), NewScreen(SP_PARM)->_maxy + 1); ClearScreen(NCURSES_SP_ARGx blank); @@ -1227,7 +1234,7 @@ static int ClrBottom(NCURSES_SP_DCLx int total) { int top = total; - int last = min(screen_columns(SP_PARM), NewScreen(SP_PARM)->_maxx + 1); + int last = Min(screen_columns(SP_PARM), NewScreen(SP_PARM)->_maxx + 1); NCURSES_CH_T blank = NewScreen(SP_PARM)->_line[total - 1].text[last - 1]; if (clr_eos && can_clear_with(NCURSES_SP_ARGx CHREF(blank))) { @@ -1287,7 +1294,7 @@ ClrBottom(NCURSES_SP_DCLx int total) ** nLastChar = position of last different character in new line ** ** move to firstChar -** overwrite chars up to min(oLastChar, nLastChar) +** overwrite chars up to Min(oLastChar, nLastChar) ** if oLastChar < nLastChar ** insert newLine[oLastChar+1..nLastChar] ** else @@ -1525,7 +1532,7 @@ TransformLine(NCURSES_SP_DCLx int const lineno) } ClrToEOL(NCURSES_SP_ARGx blank, FALSE); } else { - n = max(nLastChar, oLastChar); + n = Max(nLastChar, oLastChar); PutRange(NCURSES_SP_ARGx oldLine, newLine, @@ -1550,7 +1557,7 @@ TransformLine(NCURSES_SP_DCLx int const lineno) break; } - n = min(oLastChar, nLastChar); + n = Min(oLastChar, nLastChar); if (n >= firstChar) { GoTo(NCURSES_SP_ARGx lineno, firstChar); PutRange(NCURSES_SP_ARGx @@ -1562,7 +1569,7 @@ TransformLine(NCURSES_SP_DCLx int const lineno) } if (oLastChar < nLastChar) { - int m = max(nLastNonblank, oLastNonblank); + int m = Max(nLastNonblank, oLastNonblank); #if USE_WIDEC_SUPPORT if (n) { while (isWidecExt(newLine[n + 1]) && n) {