From: Thomas E. Dickey Date: Sun, 10 May 2020 21:22:09 +0000 (+0000) Subject: ncurses 6.2 - patch 20200509 X-Git-Tag: v6.3~82 X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=460005b642d978c6d4b48810803514bd36a6245b ncurses 6.2 - patch 20200509 + add "-r" option to the dots test-programs, to help with scripting a performance comparison. + build-fix test/move_field.c for NetBSD curses, whose form headers use different names than SVr4 or ncurses. --- diff --git a/NEWS b/NEWS index e1487689..f73b102f 100644 --- a/NEWS +++ b/NEWS @@ -26,7 +26,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.3482 2020/05/02 23:42:21 tom Exp $ +-- $Id: NEWS,v 1.3484 2020/05/09 14:53:16 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -46,6 +46,12 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20200509 + + add "-r" option to the dots test-programs, to help with scripting + a performance comparison. + + build-fix test/move_field.c for NetBSD curses, whose form headers + use different names than SVr4 or ncurses. + 20200502 + add details on the change to Linux SGR 21 in 2018 -TD + add xterm-direct16 and xterm-direct256 -TD diff --git a/VERSION b/VERSION index 45f3b190..626abde0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:10 6.2 20200502 +5:0:10 6.2 20200509 diff --git a/dist.mk b/dist.mk index 6619b40c..6451c69b 100644 --- a/dist.mk +++ b/dist.mk @@ -26,7 +26,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.1348 2020/05/02 09:32:34 tom Exp $ +# $Id: dist.mk,v 1.1349 2020/05/09 09:21:38 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -38,7 +38,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 6 NCURSES_MINOR = 2 -NCURSES_PATCH = 20200502 +NCURSES_PATCH = 20200509 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/ncurses/base/lib_mouse.c b/ncurses/base/lib_mouse.c index 8705a39a..71acf474 100644 --- a/ncurses/base/lib_mouse.c +++ b/ncurses/base/lib_mouse.c @@ -85,7 +85,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_mouse.c,v 1.186 2020/05/02 21:13:04 tom Exp $") +MODULE_ID("$Id: lib_mouse.c,v 1.187 2020/05/09 23:24:03 tom Exp $") #include @@ -970,9 +970,9 @@ decode_X10_bstate(SCREEN *sp, MEVENT * eventp, unsigned intro) if (intro >= 96) { if (intro >= 160) { - button = (intro - 152); /* buttons 8-11 */ + button = (int) (intro - 152); /* buttons 8-11 */ } else if (intro >= 96) { - button = (intro - 92); /* buttons 4-7 */ + button = (int) (intro - 92); /* buttons 4-7 */ } } else { button = (intro & 3); diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index bdda0d6c..2c230e8d 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.2+20200502) unstable; urgency=low +ncurses6 (6.2+20200509) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 02 May 2020 05:32:34 -0400 + -- Thomas E. Dickey Sat, 09 May 2020 05:21:38 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index bdda0d6c..2c230e8d 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.2+20200502) unstable; urgency=low +ncurses6 (6.2+20200509) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 02 May 2020 05:32:34 -0400 + -- Thomas E. Dickey Sat, 09 May 2020 05:21:38 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index d11aa131..97967886 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.2+20200502) unstable; urgency=low +ncurses6 (6.2+20200509) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 02 May 2020 05:32:34 -0400 + -- Thomas E. Dickey Sat, 09 May 2020 05:21:38 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index 79c16b45..367d70d0 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.392 2020/05/02 09:32:34 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.393 2020/05/09 09:21:38 tom Exp $ ; TODO add examples ; TODO bump ABI to 6 @@ -10,7 +10,7 @@ !define VERSION_MAJOR "6" !define VERSION_MINOR "2" !define VERSION_YYYY "2020" -!define VERSION_MMDD "0502" +!define VERSION_MMDD "0509" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index 776a3c33..eaeece62 100644 --- a/package/mingw-ncurses.spec +++ b/package/mingw-ncurses.spec @@ -3,7 +3,7 @@ Summary: shared libraries for terminal handling Name: mingw32-ncurses6 Version: 6.2 -Release: 20200502 +Release: 20200509 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index 55e764cc..b2f483be 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Version: 6.2 -Release: 20200502 +Release: 20200509 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncursest.spec b/package/ncursest.spec index 15788ba9..bf4c989a 100644 --- a/package/ncursest.spec +++ b/package/ncursest.spec @@ -1,7 +1,7 @@ Summary: Curses library with POSIX thread support. Name: ncursest6 Version: 6.2 -Release: 20200502 +Release: 20200509 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/test/clip_printw.c b/test/clip_printw.c index f0684576..a4242e84 100644 --- a/test/clip_printw.c +++ b/test/clip_printw.c @@ -27,7 +27,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: clip_printw.c,v 1.17 2020/02/02 23:34:34 tom Exp $ + * $Id: clip_printw.c,v 1.19 2020/05/10 00:40:23 tom Exp $ * * demonstrate how to use printw without wrapping. */ @@ -331,7 +331,10 @@ test_clipping(WINDOW *win) need = (unsigned) st.count + 1; _nc_SPRINTF(fmt, _nc_SLIMIT(sizeof(fmt)) "%%c%%%ds%%c", st.count); } else { - need = (unsigned) getmaxx(win) - 1; + int want = getmaxx(win); + if (want < 10) + want = 10; + need = (unsigned) want - 1; _nc_STRCPY(fmt, "%c%s%c", sizeof(fmt)); } if ((buffer = typeMalloc(char, need + 1)) != 0) { diff --git a/test/demo_terminfo.c b/test/demo_terminfo.c index 8ea0edf9..61c4076b 100644 --- a/test/demo_terminfo.c +++ b/test/demo_terminfo.c @@ -30,7 +30,7 @@ /* * Author: Thomas E. Dickey * - * $Id: demo_terminfo.c,v 1.50 2020/02/02 23:34:34 tom Exp $ + * $Id: demo_terminfo.c,v 1.51 2020/05/09 13:56:40 tom Exp $ * * A simple demo of the terminfo interface. */ @@ -842,10 +842,12 @@ main(int argc, char *argv[]) case 's': s_opt = TRUE; break; -#ifdef NCURSES_VERSION case 'x': +#ifdef NCURSES_VERSION x_opt = TRUE; +#endif break; +#ifdef NCURSES_VERSION case 'y': y_opt = TRUE; x_opt = TRUE; diff --git a/test/dots.c b/test/dots.c index d34473c1..11fc1cfe 100644 --- a/test/dots.c +++ b/test/dots.c @@ -30,7 +30,7 @@ /* * Author: Thomas E. Dickey 1999 * - * $Id: dots.c,v 1.36 2020/02/02 23:34:34 tom Exp $ + * $Id: dots.c,v 1.39 2020/05/10 00:31:03 tom Exp $ * * A simple demo of the terminfo interface. */ @@ -79,9 +79,10 @@ cleanup(void) outs(clear_screen); outs(cursor_normal); - printf("\n\n%ld total cells, rate %.2f/sec\n", - total_chars, - ((double) (total_chars) / (double) (time((time_t *) 0) - started))); + fflush(stdout); + fprintf(stderr, "\n\n%ld total cells, rate %.2f/sec\n", + total_chars, + ((double) (total_chars) / (double) (time((time_t *) 0) - started))); } static void @@ -123,6 +124,7 @@ usage(void) #endif ," -f use tigetnum rather than mapping" ," -m SIZE set margin (default: 2)" + ," -r SECS self-interrupt/exit after specified number of seconds" ," -s MSECS delay 1% of the time (default: 1 msecs)" }; size_t n; @@ -143,11 +145,12 @@ main(int argc, int my_colors; int f_option = 0; int m_option = 2; + int r_option = 0; int s_option = 1; size_t need; char *my_env; - while ((ch = getopt(argc, argv, "T:efm:s:")) != -1) { + while ((ch = getopt(argc, argv, "T:efm:r:s:")) != -1) { switch (ch) { case 'T': need = 6 + strlen(optarg); @@ -166,6 +169,9 @@ main(int argc, case 'm': m_option = atoi(optarg); break; + case 'r': + r_option = atoi(optarg); + break; case 's': s_option = atoi(optarg); break; @@ -175,6 +181,7 @@ main(int argc, } } + SetupAlarm(r_option); InitAndCatch(setupterm((char *) 0, 1, (int *) 0), onsig); srand((unsigned) time(0)); diff --git a/test/dots_curses.c b/test/dots_curses.c index 930f522d..4754e98a 100644 --- a/test/dots_curses.c +++ b/test/dots_curses.c @@ -30,7 +30,7 @@ /* * Author: Thomas E. Dickey * - * $Id: dots_curses.c,v 1.16 2020/02/02 23:34:34 tom Exp $ + * $Id: dots_curses.c,v 1.19 2020/05/10 00:31:59 tom Exp $ * * A simple demo of the curses interface used for comparison with termcap. */ @@ -51,9 +51,10 @@ cleanup(void) { endwin(); - printf("\n\n%ld total cells, rate %.2f/sec\n", - total_chars, - ((double) (total_chars) / (double) (time((time_t *) 0) - started))); + fflush(stdout); + fprintf(stderr, "\n\n%ld total cells, rate %.2f/sec\n", + total_chars, + ((double) (total_chars) / (double) (time((time_t *) 0) - started))); } static void @@ -101,6 +102,7 @@ usage(void) ," -e allow environment $LINES / $COLUMNS" #endif ," -m SIZE set margin (default: 2)" + ," -r SECS self-interrupt/exit after specified number of seconds" ," -s MSECS delay 1% of the time (default: 1 msecs)" }; size_t n; @@ -122,11 +124,12 @@ main(int argc, char *argv[]) bool d_option = FALSE; #endif int m_option = 2; + int r_option = 0; int s_option = 1; size_t need; char *my_env; - while ((ch = getopt(argc, argv, "T:dem:s:")) != -1) { + while ((ch = getopt(argc, argv, "T:dem:r:s:")) != -1) { switch (ch) { case 'T': need = 6 + strlen(optarg); @@ -147,6 +150,9 @@ main(int argc, char *argv[]) case 'm': m_option = atoi(optarg); break; + case 'r': + r_option = atoi(optarg); + break; case 's': s_option = atoi(optarg); break; @@ -158,7 +164,9 @@ main(int argc, char *argv[]) srand((unsigned) time(0)); + SetupAlarm(r_option); InitAndCatch(initscr(), onsig); + if (has_colors()) { start_color(); #if HAVE_USE_DEFAULT_COLORS diff --git a/test/dots_mvcur.c b/test/dots_mvcur.c index d214ffc3..76176642 100644 --- a/test/dots_mvcur.c +++ b/test/dots_mvcur.c @@ -30,7 +30,7 @@ /* * Author: Thomas E. Dickey - 2007 * - * $Id: dots_mvcur.c,v 1.22 2020/02/02 23:34:34 tom Exp $ + * $Id: dots_mvcur.c,v 1.25 2020/05/10 00:32:11 tom Exp $ * * A simple demo of the terminfo interface, and mvcur. */ @@ -80,9 +80,10 @@ cleanup(void) outs(clear_screen); outs(cursor_normal); - printf("\n\n%ld total cells, rate %.2f/sec\n", - total_chars, - ((double) (total_chars) / (double) (time((time_t *) 0) - started))); + fflush(stdout); + fprintf(stderr, "\n\n%ld total cells, rate %.2f/sec\n", + total_chars, + ((double) (total_chars) / (double) (time((time_t *) 0) - started))); } static void @@ -124,6 +125,7 @@ usage(void) #endif ," -f use tigetnum rather than mapping" ," -m SIZE set margin (default: 2)" + ," -r SECS self-interrupt/exit after specified number of seconds" ," -s MSECS delay 1% of the time (default: 1 msecs)" }; size_t n; @@ -146,11 +148,12 @@ main(int argc GCC_UNUSED, int my_colors; int f_option = 0; int m_option = 2; + int r_option = 0; int s_option = 1; size_t need; char *my_env; - while ((ch = getopt(argc, argv, "T:efm:s:")) != -1) { + while ((ch = getopt(argc, argv, "T:efm:r:s:")) != -1) { switch (ch) { case 'T': need = 6 + strlen(optarg); @@ -169,6 +172,9 @@ main(int argc GCC_UNUSED, case 'm': m_option = atoi(optarg); break; + case 'r': + r_option = atoi(optarg); + break; case 's': s_option = atoi(optarg); break; @@ -178,6 +184,7 @@ main(int argc GCC_UNUSED, } } + SetupAlarm(r_option); InitAndCatch((sp = newterm((char *) 0, stdout, stdin)), onsig); refresh(); /* needed with Solaris curses to cancel endwin */ diff --git a/test/dots_termcap.c b/test/dots_termcap.c index 0e442b13..0fc1a89e 100644 --- a/test/dots_termcap.c +++ b/test/dots_termcap.c @@ -30,7 +30,7 @@ /* * Author: Thomas E. Dickey * - * $Id: dots_termcap.c,v 1.20 2020/02/02 23:34:34 tom Exp $ + * $Id: dots_termcap.c,v 1.23 2020/05/10 00:32:22 tom Exp $ * * A simple demo of the termcap interface. */ @@ -131,9 +131,10 @@ cleanup(void) outs(t_cl); outs(t_ve); - printf("\n\n%ld total cells, rate %.2f/sec\n", - total_chars, - ((double) (total_chars) / (double) (time((time_t *) 0) - started))); + fflush(stdout); + fprintf(stderr, "\n\n%ld total cells, rate %.2f/sec\n", + total_chars, + ((double) (total_chars) / (double) (time((time_t *) 0) - started))); } static void @@ -189,6 +190,7 @@ usage(void) ," -T TERM override $TERM" ," -e allow environment $LINES / $COLUMNS" ," -m SIZE set margin (default: 2)" + ," -r SECS self-interrupt/exit after specified number of seconds" ," -s MSECS delay 1% of the time (default: 1 msecs)" }; size_t n; @@ -208,6 +210,7 @@ main(int argc, char *argv[]) int num_columns; int e_option = 0; int m_option = 2; + int r_option = 0; int s_option = 1; double r; double c; @@ -217,7 +220,7 @@ main(int argc, char *argv[]) size_t need; char *my_env; - while ((ch = getopt(argc, argv, "T:em:s:")) != -1) { + while ((ch = getopt(argc, argv, "T:em:r:s:")) != -1) { switch (ch) { case 'T': need = 6 + strlen(optarg); @@ -231,6 +234,9 @@ main(int argc, char *argv[]) case 'm': m_option = atoi(optarg); break; + case 'r': + r_option = atoi(optarg); + break; case 's': s_option = atoi(optarg); break; @@ -247,6 +253,7 @@ main(int argc, char *argv[]) srand((unsigned) time(0)); + SetupAlarm((unsigned) r_option); InitAndCatch(ch = tgetent(buffer, name), onsig); if (ch < 0) { fprintf(stderr, "terminal description not found\n"); diff --git a/test/dots_xcurses.c b/test/dots_xcurses.c index ba65dab2..a2aa8b92 100644 --- a/test/dots_xcurses.c +++ b/test/dots_xcurses.c @@ -30,7 +30,7 @@ /* * Author: Thomas E. Dickey * - * $Id: dots_xcurses.c,v 1.19 2020/02/02 23:34:34 tom Exp $ + * $Id: dots_xcurses.c,v 1.22 2020/05/10 00:32:33 tom Exp $ * * A simple demo of the wide-curses interface used for comparison with termcap. */ @@ -65,9 +65,10 @@ cleanup(void) { endwin(); - printf("\n\n%ld total cells, rate %.2f/sec\n", - total_chars, - ((double) (total_chars) / (double) (time((time_t *) 0) - started))); + fflush(stdout); + fprintf(stderr, "\n\n%ld total cells, rate %.2f/sec\n", + total_chars, + ((double) (total_chars) / (double) (time((time_t *) 0) - started))); } static void @@ -124,6 +125,7 @@ usage(void) ," -e allow environment $LINES / $COLUMNS" #endif ," -m SIZE set margin (default: 2)" + ," -r SECS self-interrupt/exit after specified number of seconds" ," -s MSECS delay 1% of the time (default: 1 msecs)" #if HAVE_ALLOC_PAIR ," -x use alloc_pair() rather than init_pair()" @@ -148,11 +150,12 @@ main(int argc, char *argv[]) bool d_option = FALSE; #endif int m_option = 2; + int r_option = 0; int s_option = 1; size_t need; char *my_env; - while ((ch = getopt(argc, argv, "T:dem:s:x")) != -1) { + while ((ch = getopt(argc, argv, "T:dem:r:s:x")) != -1) { switch (ch) { case 'T': need = 6 + strlen(optarg); @@ -173,6 +176,9 @@ main(int argc, char *argv[]) case 'm': m_option = atoi(optarg); break; + case 'r': + r_option = atoi(optarg); + break; case 's': s_option = atoi(optarg); break; @@ -189,6 +195,7 @@ main(int argc, char *argv[]) srand((unsigned) time(0)); + SetupAlarm(r_option); InitAndCatch(initscr(), onsig); if (has_colors()) { start_color(); diff --git a/test/move_field.c b/test/move_field.c index 79b0b4df..8344c56f 100644 --- a/test/move_field.c +++ b/test/move_field.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: move_field.c,v 1.6 2020/03/28 17:43:03 tom Exp $ + * $Id: move_field.c,v 1.7 2020/05/09 12:52:00 tom Exp $ * * Demonstrate move_field(). */ @@ -38,6 +38,14 @@ #include #include +#ifdef HAVE_NETBSD_FORM_H +#define form_field_row(field) (field)->form_row +#define form_field_col(field) (field)->form_col +#else /* e.g., SVr4, ncurses */ +#define form_field_row(field) (field)->frow +#define form_field_col(field) (field)->fcol +#endif + #define DO_DEMO CTRL('F') /* actual key for toggling demo-mode */ #define MY_DEMO EDIT_FIELD('f') /* internal request-code */ @@ -286,8 +294,8 @@ show_status(FORM *form, FIELD *field) getyx(stdscr, currow, curcol); mvprintw(LINES - 1, 0, "Field at [%d,%d]. Press %s to quit moving.", - getbegy(sub) + field->frow, - getbegx(sub) + field->fcol, + getbegy(sub) + form_field_row(field), + getbegx(sub) + form_field_col(field), keyname(DO_DEMO)); clrtobot(); move(currow, curcol); @@ -332,8 +340,8 @@ do_demo(FORM *form) show_status(form, my_field); ch = '?'; while ((ch = wgetch(form_win(form))) != DO_DEMO) { - int field_y = my_field->frow; - int field_x = my_field->fcol; + int field_y = form_field_row(my_field); + int field_x = form_field_col(my_field); switch (ch) { case 'h': diff --git a/test/test.priv.h b/test/test.priv.h index f0b660f4..18cfc907 100644 --- a/test/test.priv.h +++ b/test/test.priv.h @@ -30,7 +30,7 @@ /**************************************************************************** * Author: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: test.priv.h,v 1.185 2020/02/02 23:34:34 tom Exp $ */ +/* $Id: test.priv.h,v 1.186 2020/05/10 00:36:06 tom Exp $ */ #ifndef __TEST_PRIV_H #define __TEST_PRIV_H 1 @@ -1022,6 +1022,12 @@ extern char *_nc_strstr(const char *, const char *); #define InitAndCatch(init,handler) do { init; CATCHALL(handler); } while (0) #endif +#if defined(_WIN32) || defined(USE_WIN32CON_DRIVER) +#define SetupAlarm(opt) (void)opt +#else +#define SetupAlarm(opt) if (opt) alarm((unsigned)opt) +#endif + /* * Workaround for clean(er) compile with Solaris's legacy curses. * The same would be needed for HPUX 10.20