diff options
| author | rin <rin@NetBSD.org> | 2021-09-06 07:03:49 +0000 |
|---|---|---|
| committer | rin <rin@NetBSD.org> | 2021-09-06 07:03:49 +0000 |
| commit | dd26fe31fefbc337bbdcb04f82870fe2484ed4f6 (patch) | |
| tree | cf9a84cf31ee5f168a51bb4c924de7a7c522dbc3 /lib/libcurses | |
| parent | 5ec7355757a731e60692c2b2e376633b173c7f4d (diff) | |
Expand __CTRACE() to __nothing #ifndef DEBUG.
Remove most of #ifdef DEBUG around __CTRACE() calls.
No binary changes, except for line numbers for assert().
Diffstat (limited to 'lib/libcurses')
52 files changed, 106 insertions, 630 deletions
diff --git a/lib/libcurses/acs.c b/lib/libcurses/acs.c index 0561b5a1fb1..bc720e9f675 100644 --- a/lib/libcurses/acs.c +++ b/lib/libcurses/acs.c @@ -1,4 +1,4 @@ -/* $NetBSD: acs.c,v 1.21 2017/01/06 13:53:18 roy Exp $ */ +/* $NetBSD: acs.c,v 1.22 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: acs.c,v 1.21 2017/01/06 13:53:18 roy Exp $"); +__RCSID("$NetBSD: acs.c,v 1.22 2021/09/06 07:03:49 rin Exp $"); #endif /* not lint */ #include "curses.h" @@ -112,9 +112,7 @@ __init_acs(SCREEN *screen) if (acs < NUM_ACS) _acs_char[acs] = term | __ALTCHARSET; aofac++; -#ifdef DEBUG __CTRACE(__CTRACE_INIT, "__init_acs: %c = %c\n", acs, term); -#endif } if (t_ena_acs(screen->term) != NULL) @@ -162,9 +160,7 @@ __init_wacs(SCREEN *screen) lstr = nl_langinfo(CODESET); _DIAGASSERT(lstr); if (strcasecmp(lstr, "UTF-8")) { -#ifdef DEBUG __CTRACE(__CTRACE_INIT, "__init_wacs: setting defaults\n" ); -#endif /* DEBUG */ WACS_RARROW->vals[0] = ( wchar_t )btowc( '>' ); WACS_LARROW->vals[0] = ( wchar_t )btowc( '<' ); WACS_UARROW->vals[0] = ( wchar_t )btowc( '^' ); @@ -189,10 +185,8 @@ __init_wacs(SCREEN *screen) WACS_STERLING->vals[0]= ( wchar_t )btowc( '}' ); } else { /* Unicode defaults */ -#ifdef DEBUG __CTRACE(__CTRACE_INIT, "__init_wacs: setting Unicode defaults\n" ); -#endif /* DEBUG */ WACS_RARROW->vals[0] = 0x2192; ACS_RARROW = '+' | __ACS_IS_WACS; WACS_LARROW->vals[0] = 0x2190; @@ -260,10 +254,8 @@ __init_wacs(SCREEN *screen) } if (t_acs_chars(screen->term) == NULL) { -#ifdef DEBUG __CTRACE(__CTRACE_INIT, "__init_wacs: no alternative characters\n" ); -#endif /* DEBUG */ goto out; } @@ -280,9 +272,7 @@ __init_wacs(SCREEN *screen) _wacs_char[acs].attributes |= WA_ALTCHARSET; } aofac++; -#ifdef DEBUG __CTRACE(__CTRACE_INIT, "__init_wacs: %c = %c\n", acs, term); -#endif } if (t_ena_acs(screen->term) != NULL) diff --git a/lib/libcurses/add_wchstr.c b/lib/libcurses/add_wchstr.c index d1ebe9be4b7..2afdccc0d62 100644 --- a/lib/libcurses/add_wchstr.c +++ b/lib/libcurses/add_wchstr.c @@ -1,4 +1,4 @@ -/* $NetBSD: add_wchstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $ */ +/* $NetBSD: add_wchstr.c,v 1.9 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 2005 The NetBSD Foundation Inc. @@ -36,7 +36,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: add_wchstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $"); +__RCSID("$NetBSD: add_wchstr.c,v 1.9 2021/09/06 07:03:49 rin Exp $"); #endif /* not lint */ #include <stdlib.h> @@ -142,10 +142,8 @@ wadd_wchnstr(WINDOW *win, const cchar_t *wchstr, int n) nschar_t *np, *tnp; __LINE *lnp; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wadd_wchnstr: win = %p, wchstr = %p, n = %d\n", win, wchstr, n); -#endif if (!wchstr) return OK; @@ -158,9 +156,7 @@ wadd_wchnstr(WINDOW *win, const cchar_t *wchstr, int n) n--, chp++, ++cnt); else for (chp = wchstr, cnt = 0; chp->vals[0]; chp++, ++cnt); -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wadd_wchnstr: len=%d\n", cnt); -#endif /* DEBUG */ chp = wchstr; x = win->curx; y = win->cury; @@ -198,18 +194,14 @@ wadd_wchnstr(WINDOW *win, const cchar_t *wchstr, int n) while (cnt) { x = ex; wc = chp->vals[0]; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wadd_wchnstr: adding %x", wc); -#endif /* DEBUG */ cw = wcwidth(wc); if (cw < 0) cw = 1; if (cw) { /* spacing character */ -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, " as a spacing char(width=%d)\n", cw); -#endif /* DEBUG */ if (cw > win->maxx - ex) { /* clear to EOL */ while (ex < win->maxx) { @@ -251,11 +243,9 @@ wadd_wchnstr(WINDOW *win, const cchar_t *wchstr, int n) } } lp++, ex++; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wadd_wchnstr: ex = %d, x = %d, cw = %d\n", ex, x, cw); -#endif /* DEBUG */ while (ex - x <= cw - 1) { np = lp->nsp; if (np) { @@ -273,10 +263,8 @@ wadd_wchnstr(WINDOW *win, const cchar_t *wchstr, int n) } } else { /* non-spacing character */ -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wadd_wchnstr: as non-spacing char"); -#endif /* DEBUG */ for (i = 0; i < chp->elements; i++) { np = malloc(sizeof(nschar_t)); if (!np) diff --git a/lib/libcurses/addch.c b/lib/libcurses/addch.c index e087e777bd1..6b96756e5a2 100644 --- a/lib/libcurses/addch.c +++ b/lib/libcurses/addch.c @@ -1,4 +1,4 @@ -/* $NetBSD: addch.c,v 1.21 2019/06/09 07:40:14 blymn Exp $ */ +/* $NetBSD: addch.c,v 1.22 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)addch.c 8.2 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: addch.c,v 1.21 2019/06/09 07:40:14 blymn Exp $"); +__RCSID("$NetBSD: addch.c,v 1.22 2021/09/06 07:03:49 rin Exp $"); #endif #endif /* not lint */ @@ -93,11 +93,9 @@ waddch(WINDOW *win, chtype ch) cchar_t cc; __cursesi_chtype_to_cchar(ch, &cc); -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "addch: %d : 0x%x (adding char as wide char)\n", cc.vals[0], cc.attributes); -#endif return wadd_wch(win, &cc); } @@ -115,9 +113,7 @@ waddch(WINDOW *win, chtype ch) buf.ch = (wchar_t)ch & __CHARTEXT; buf.attr = (attr_t)ch & __ATTRIBUTES; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "addch: %d : 0x%x\n", buf.ch, buf.attr); -#endif return __waddch(win, &buf); } #endif /* !HAVE_WCHAR */ diff --git a/lib/libcurses/addchnstr.c b/lib/libcurses/addchnstr.c index 3b32217e68f..147dc26cbe8 100644 --- a/lib/libcurses/addchnstr.c +++ b/lib/libcurses/addchnstr.c @@ -1,4 +1,4 @@ -/* $NetBSD: addchnstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $ */ +/* $NetBSD: addchnstr.c,v 1.9 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: addchnstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $"); +__RCSID("$NetBSD: addchnstr.c,v 1.9 2021/09/06 07:03:49 rin Exp $"); #endif /* not lint */ #include <stdlib.h> @@ -137,10 +137,8 @@ waddchnstr(WINDOW *win, const chtype *chstr, int n) char *ocp, *cp, *start; int i, ret, ox, oy; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "waddchnstr: win = %p, chstr = %p, n = %d\n", win, chstr, n); -#endif if (n >= 0) for (chp = chstr, len = 0; n-- && *chp++; ++len); diff --git a/lib/libcurses/addnstr.c b/lib/libcurses/addnstr.c index 6c60828c4a6..ccb71391541 100644 --- a/lib/libcurses/addnstr.c +++ b/lib/libcurses/addnstr.c @@ -1,4 +1,4 @@ -/* $NetBSD: addnstr.c,v 1.17 2019/06/09 07:40:14 blymn Exp $ */ +/* $NetBSD: addnstr.c,v 1.18 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)addnstr.c 8.2 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: addnstr.c,v 1.17 2019/06/09 07:40:14 blymn Exp $"); +__RCSID("$NetBSD: addnstr.c,v 1.18 2021/09/06 07:03:49 rin Exp $"); #endif #endif /* not lint */ @@ -135,10 +135,8 @@ waddnstr(WINDOW *win, const char *s, int n) size_t len; const char *p; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "ADDNSTR: win %p, length %d\n", win, n); -#endif /* * behavior changed from traditional BSD curses, for better XCURSES * conformance. diff --git a/lib/libcurses/addwstr.c b/lib/libcurses/addwstr.c index f6118bcf798..40cfff7cdea 100644 --- a/lib/libcurses/addwstr.c +++ b/lib/libcurses/addwstr.c @@ -1,4 +1,4 @@ -/* $NetBSD: addwstr.c,v 1.6 2019/06/09 07:40:14 blymn Exp $ */ +/* $NetBSD: addwstr.c,v 1.7 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 2005 The NetBSD Foundation Inc. @@ -36,7 +36,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: addwstr.c,v 1.6 2019/06/09 07:40:14 blymn Exp $"); +__RCSID("$NetBSD: addwstr.c,v 1.7 2021/09/06 07:03:49 rin Exp $"); #endif /* not lint */ #include <string.h> @@ -146,9 +146,7 @@ waddnwstr(WINDOW *win, const wchar_t *s, int n) for (p = s, len = 0; n-- && *p++; ++len); else len = wcslen(s); -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "waddnwstr: string len=%ld\n", (long) len); -#endif /* DEBUG */ p = s; while (len) { @@ -158,10 +156,8 @@ waddnwstr(WINDOW *win, const wchar_t *s, int n) return ERR; if (wadd_wch( win, &cc ) == ERR) return ERR; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "waddnwstr: (%x,%x,%d) added\n", cc.vals[ 0 ], cc.attributes, cc.elements ); -#endif /* DEBUG */ p++, len--; } diff --git a/lib/libcurses/attributes.c b/lib/libcurses/attributes.c index c9876902ff5..0c22c6b9d6c 100644 --- a/lib/libcurses/attributes.c +++ b/lib/libcurses/attributes.c @@ -1,4 +1,4 @@ -/* $NetBSD: attributes.c,v 1.31 2019/07/25 20:18:50 uwe Exp $ */ +/* $NetBSD: attributes.c,v 1.32 2021/09/06 07:03:49 rin Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: attributes.c,v 1.31 2019/07/25 20:18:50 uwe Exp $"); +__RCSID("$NetBSD: attributes.c,v 1.32 2021/09/06 07:03:49 rin Exp $"); #endif /* not lint */ #include "curses.h" @@ -143,9 +143,7 @@ attrset(int attr) int wattr_get(WINDOW *win, attr_t *attr, short *pair, void *opts) { -#ifdef DEBUG __CTRACE(__CTRACE_ATTR, "wattr_get: win %p\n", win); -#endif if (attr != NULL) { *attr = win->wattr; #ifdef HAVE_WCHAR @@ -195,10 +193,8 @@ wattr_off(WINDOW *win, attr_t attr, void *opts) int wattr_set(WINDOW *win, attr_t attr, short pair, void *opts) { -#ifdef DEBUG __CTRACE(__CTRACE_ATTR, "wattr_set: win %p, attr %08x, pair %d\n", win, attr, pair); -#endif if (__predict_false(opts != NULL)) return ERR; @@ -221,9 +217,7 @@ wattr_set(WINDOW *win, attr_t attr, short pair, void *opts) int wcolor_set(WINDOW *win, short pair, void *opts) { -#ifdef DEBUG __CTRACE(__CTRACE_COLOR, "wolor_set: win %p, pair %d\n", win, pair); -#endif __wcolor_set(win, (attr_t) COLOR_PAIR(pair)); return OK; } @@ -237,9 +231,7 @@ wcolor_set(WINDOW *win, short pair, void *opts) chtype getattrs(WINDOW *win) { -#ifdef DEBUG __CTRACE(__CTRACE_ATTR, "getattrs: win %p\n", win); -#endif return((chtype) win->wattr); } @@ -250,9 +242,7 @@ getattrs(WINDOW *win) int wattron(WINDOW *win, int attr) { -#ifdef DEBUG __CTRACE(__CTRACE_ATTR, "wattron: win %p, attr %08x\n", win, attr); -#endif return __wattr_on(win, (attr_t) attr); } @@ -263,9 +253,7 @@ wattron(WINDOW *win, int attr) int wattroff(WINDOW *win, int attr) { -#ifdef DEBUG __CTRACE(__CTRACE_ATTR, "wattroff: win %p, attr %08x\n", win, attr); -#endif return __wattr_off(win, (attr_t) attr); } @@ -277,9 +265,7 @@ wattroff(WINDOW *win, int attr) int wattrset(WINDOW *win, int attr) { -#ifdef DEBUG __CTRACE(__CTRACE_ATTR, "wattrset: win %p, attr %08x\n", win, attr); -#endif __wattr_off(win, __ATTRIBUTES); __wattr_on(win, (attr_t) attr); return OK; @@ -294,13 +280,9 @@ termattrs(void) { chtype ch = 0; -#ifdef DEBUG __CTRACE(__CTRACE_ATTR, "termattrs\n"); -#endif if (exit_attribute_mode != NULL) { -#ifdef DEBUG __CTRACE(__CTRACE_ATTR, "termattrs: have exit attribute mode\n"); -#endif if (enter_blink_mode != NULL) ch |= __BLINK; if (enter_bold_mode != NULL) @@ -335,9 +317,7 @@ term_attrs(void) { attr_t attr = 0; -#ifdef DEBUG __CTRACE(__CTRACE_ATTR, "term_attrs\n"); -#endif if (exit_attribute_mode != NULL) { if (enter_blink_mode != NULL) attr |= __BLINK; @@ -383,9 +363,7 @@ __wattr_on(WINDOW *win, attr_t attr) { const TERMINAL *t = win->screen->term; -#ifdef DEBUG __CTRACE(__CTRACE_ATTR, "wattr_on: win %p, attr %08x\n", win, attr); -#endif /* If can enter modes, set the relevent attribute bits. */ if (t_exit_attribute_mode(t) != NULL) { if (attr & __BLINK && t_enter_blink_mode(t) != NULL) @@ -432,9 +410,7 @@ __wattr_off(WINDOW *win, attr_t attr) { const TERMINAL *t = win->screen->term; -#ifdef DEBUG __CTRACE(__CTRACE_ATTR, "wattr_off: win %p, attr %08x\n", win, attr); -#endif /* If can do exit modes, unset the relevent attribute bits. */ if (t_exit_attribute_mode(t) != NULL) { if (attr & __BLINK) diff --git a/lib/libcurses/background.c b/lib/libcurses/background.c index 9f4b5146cba..51c7229f7e5 100644 --- a/lib/libcurses/background.c +++ b/lib/libcurses/background.c @@ -1,4 +1,4 @@ -/* $NetBSD: background.c,v 1.25 2018/11/19 20:37:04 uwe Exp $ */ +/* $NetBSD: background.c,v 1.26 2021/09/06 07:03:49 rin Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: background.c,v 1.25 2018/11/19 20:37:04 uwe Exp $"); +__RCSID("$NetBSD: background.c,v 1.26 2021/09/06 07:03:49 rin Exp $"); #endif /* not lint */ #include <stdlib.h> @@ -66,10 +66,8 @@ bkgd(chtype ch) void wbkgdset(WINDOW *win, chtype ch) { -#ifdef DEBUG __CTRACE(__CTRACE_ATTR, "wbkgdset: (%p), '%s', %08x\n", win, unctrl(ch & __CHARTEXT), ch & __ATTRIBUTES); -#endif /* Background character. */ if (ch & __CHARTEXT) @@ -92,10 +90,8 @@ wbkgd(WINDOW *win, chtype ch) chtype obch; int y, x; -#ifdef DEBUG __CTRACE(__CTRACE_ATTR, "wbkgd: (%p), '%s', %08x\n", win, unctrl(ch & __CHARTEXT), ch & __ATTRIBUTES); -#endif obch = win->bch; wbkgdset(win, ch); @@ -166,10 +162,8 @@ wbkgrndset(WINDOW *win, const cchar_t *wch) nschar_t *np, *tnp; int i; -#ifdef DEBUG __CTRACE(__CTRACE_ATTR, "wbkgrndset: (%p), '%s', %x\n", win, (const char *) wunctrl(wch), wch->attributes); -#endif /* ignore multi-column characters */ if (!wch->elements || wcwidth(wch->vals[0]) > 1) @@ -228,10 +222,8 @@ wbkgrndset(WINDOW *win, const cchar_t *wch) int wbkgrnd(WINDOW *win, const cchar_t *wch) { -#ifdef DEBUG __CTRACE(__CTRACE_ATTR, "wbkgrnd: (%p), '%s', %x\n", win, (const char *) wunctrl(wch), wch->attributes); -#endif /* ignore multi-column characters */ if (!wch->elements || wcwidth( wch->vals[ 0 ]) > 1) diff --git a/lib/libcurses/bell.c b/lib/libcurses/bell.c index 355d565672d..114aae7e847 100644 --- a/lib/libcurses/bell.c +++ b/lib/libcurses/bell.c @@ -1,4 +1,4 @@ -/* $NetBSD: bell.c,v 1.9 2017/01/06 13:53:18 roy Exp $ */ +/* $NetBSD: bell.c,v 1.10 2021/09/06 07:03:49 rin Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: bell.c,v 1.9 2017/01/06 13:53:18 roy Exp $"); +__RCSID("$NetBSD: bell.c,v 1.10 2021/09/06 07:03:49 rin Exp $"); #endif /* not lint */ #include "curses.h" @@ -45,14 +45,10 @@ int beep(void) { if (bell != NULL) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "beep: bl\n"); -#endif tputs(bell, 0, __cputchar); } else if (flash_screen != NULL) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "beep: vb\n"); -#endif tputs(flash_screen, 0, __cputchar); } return OK; @@ -66,14 +62,10 @@ int flash(void) { if (flash_screen != NULL) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "flash: vb\n"); -#endif tputs(flash_screen, 0, __cputchar); } else if (bell != NULL) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "flash: bl\n"); -#endif tputs(bell, 0, __cputchar); } return OK; diff --git a/lib/libcurses/border.c b/lib/libcurses/border.c index 8b8816c73cd..ec708c6d33f 100644 --- a/lib/libcurses/border.c +++ b/lib/libcurses/border.c @@ -1,4 +1,4 @@ -/* $NetBSD: border.c,v 1.18 2017/01/09 21:17:29 blymn Exp $ */ +/* $NetBSD: border.c,v 1.19 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: border.c,v 1.18 2017/01/09 21:17:29 blymn Exp $"); +__RCSID("$NetBSD: border.c,v 1.19 2021/09/06 07:03:49 rin Exp $"); #endif /* not lint */ #include <stdlib.h> @@ -87,7 +87,6 @@ wborder(WINDOW *win, chtype left, chtype right, chtype top, chtype bottom, if (!(botright & __CHARTEXT)) botright |= ACS_LRCORNER; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wborder: left = %c, 0x%x\n", left & __CHARTEXT, left & __ATTRIBUTES); __CTRACE(__CTRACE_INPUT, "wborder: right = %c, 0x%x\n", @@ -104,7 +103,6 @@ wborder(WINDOW *win, chtype left, chtype right, chtype top, chtype bottom, botleft & __CHARTEXT, botleft & __ATTRIBUTES); __CTRACE(__CTRACE_INPUT, "wborder: botright = %c, 0x%x\n", botright & __CHARTEXT, botright & __ATTRIBUTES); -#endif /* Merge window and background attributes */ left |= (left & __COLOR) ? (win->wattr & ~__COLOR) : win->wattr; @@ -239,7 +237,6 @@ int wborder_set(WINDOW *win, const cchar_t *ls, const cchar_t *rs, else memcpy(&botright, WACS_LRCORNER, sizeof(cchar_t)); -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wborder_set: left = %c, 0x%x\n", left.vals[0], left.attributes ); __CTRACE(__CTRACE_INPUT, "wborder_set: right = %c, 0x%x\n", @@ -256,7 +253,6 @@ int wborder_set(WINDOW *win, const cchar_t *ls, const cchar_t *rs, botleft.vals[0], botleft.attributes ); __CTRACE(__CTRACE_INPUT, "wborder_set: botright = %c, 0x%x\n", botright.vals[0], botright.attributes ); -#endif /* Merge window attributes */ left.attributes |= (left.attributes & __COLOR) ? @@ -331,10 +327,8 @@ int wborder_set(WINDOW *win, const cchar_t *ls, const cchar_t *rs, } } for (j = cw; WCOL(win->alines[i]->line[j]) < 0; j++) { -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wborder_set: clean out partial char[%d]", j); -#endif /* DEBUG */ win->alines[i]->line[j].ch = ( wchar_t )btowc(win->bch); if (_cursesi_copy_nsp(win->bnsp, &win->alines[i]->line[j]) == ERR) @@ -376,11 +370,9 @@ int wborder_set(WINDOW *win, const cchar_t *ls, const cchar_t *rs, endx - cw + 1 - j); } if (pcw != 1) { -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wborder_set: clean out partial chars[%d:%d]", endx - cw + pcw, endx - cw ); -#endif /* DEBUG */ k = pcw < 0 ? endx -cw + pcw : endx - cw; for (j = endx - cw; j >= k; j--) { win->alines[i]->line[j].ch diff --git a/lib/libcurses/chgat.c b/lib/libcurses/chgat.c index ce81033e2fb..01793b0447a 100644 --- a/lib/libcurses/chgat.c +++ b/lib/libcurses/chgat.c @@ -1,4 +1,4 @@ -/* $NetBSD: chgat.c,v 1.5 2012/09/28 06:05:19 blymn Exp $ */ +/* $NetBSD: chgat.c,v 1.6 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: chgat.c,v 1.5 2012/09/28 06:05:19 blymn Exp $"); +__RCSID("$NetBSD: chgat.c,v 1.6 2021/09/06 07:03:49 rin Exp $"); #include "curses.h" #include "curses_private.h" @@ -71,11 +71,9 @@ mvwchgat(WINDOW *win , int y, int x, int count, attr_t attr, short color, if (count < 0 || count > win->maxx - x) count = win->maxx - x; -#ifdef DEBUG __CTRACE(__CTRACE_ATTR, "mvwchgat: x: %d y: %d count: %d attr: 0x%x " "color pair %d\n", x, y, count, (attr & ~__COLOR), PAIR_NUMBER(color)); -#endif lp = win->alines[y]; lc = &lp->line[x]; diff --git a/lib/libcurses/clrtoeol.c b/lib/libcurses/clrtoeol.c index d053b61d5f7..8d1d5494649 100644 --- a/lib/libcurses/clrtoeol.c +++ b/lib/libcurses/clrtoeol.c @@ -1,4 +1,4 @@ -/* $NetBSD: clrtoeol.c,v 1.31 2020/03/15 01:18:43 uwe Exp $ */ +/* $NetBSD: clrtoeol.c,v 1.32 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)clrtoeol.c 8.2 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: clrtoeol.c,v 1.31 2020/03/15 01:18:43 uwe Exp $"); +__RCSID("$NetBSD: clrtoeol.c,v 1.32 2021/09/06 07:03:49 rin Exp $"); #endif #endif /* not lint */ @@ -111,12 +111,10 @@ wclrtoeol(WINDOW *win) #endif } -#ifdef DEBUG __CTRACE(__CTRACE_ERASE, "CLRTOEOL: y = %d, minx = %d, maxx = %d, " "firstch = %d, lastch = %d\n", y, minx, (int)(maxx - win->alines[y]->line), *win->alines[y]->firstchp, *win->alines[y]->lastchp); -#endif /* Update firstch and lastch for the line. */ __touchline(win, y, x, (int)win->maxx - 1); __sync(win); diff --git a/lib/libcurses/color.c b/lib/libcurses/color.c index 77e06766c3c..339ec058ac5 100644 --- a/lib/libcurses/color.c +++ b/lib/libcurses/color.c @@ -1,4 +1,4 @@ -/* $NetBSD: color.c,v 1.42 2021/09/06 02:48:54 rin Exp $ */ +/* $NetBSD: color.c,v 1.43 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: color.c,v 1.42 2021/09/06 02:48:54 rin Exp $"); +__RCSID("$NetBSD: color.c,v 1.43 2021/09/06 07:03:49 rin Exp $"); #endif /* not lint */ #include "curses.h" @@ -184,10 +184,8 @@ start_color(void) if (temp_nc & 0x0100) _cursesi_screen->nca |= __ALTCHARSET; } -#ifdef DEBUG __CTRACE(__CTRACE_COLOR, "start_color: _cursesi_screen->nca = %08x\n", _cursesi_screen->nca); -#endif /* Set up initial 8 colours */ #define RGB_ON 680 /* Allow for bright colours */ @@ -269,9 +267,7 @@ init_pair(short pair, short fore, short back) { int changed; -#ifdef DEBUG __CTRACE(__CTRACE_COLOR, "init_pair: %d, %d, %d\n", pair, fore, back); -#endif if (pair < 0 || pair >= COLOR_PAIRS) return ERR; @@ -405,10 +401,8 @@ init_color_value(short color, short red, short green, short blue) int init_color(short color, short red, short green, short blue) { -#ifdef DEBUG __CTRACE(__CTRACE_COLOR, "init_color: %d, %d, %d, %d\n", color, red, green, blue); -#endif if (init_color_value(color, red, green, blue) == ERR) return ERR; if (!can_change || t_initialize_color(_cursesi_screen->term) == NULL) @@ -441,9 +435,7 @@ color_content(short color, short *redp, short *greenp, short *bluep) int use_default_colors(void) { -#ifdef DEBUG __CTRACE(__CTRACE_COLOR, "use_default_colors\n"); -#endif return (assume_default_colors(-1, -1)); } @@ -455,11 +447,9 @@ use_default_colors(void) int assume_default_colors(short fore, short back) { -#ifdef DEBUG __CTRACE(__CTRACE_COLOR, "assume_default_colors: %d, %d\n", fore, back); __CTRACE(__CTRACE_COLOR, "assume_default_colors: default_colour = %d, pair_number = %d\n", __default_color, PAIR_NUMBER(__default_color)); -#endif /* Swap red/blue and yellow/cyan */ if (_cursesi_screen->color_type == COLOR_OTHER) { @@ -540,11 +530,9 @@ __set_color( /*ARGSUSED*/ WINDOW *win, attr_t attr) return; pair = PAIR_NUMBER((uint32_t)attr); -#ifdef DEBUG __CTRACE(__CTRACE_COLOR, "__set_color: %d, %d, %d\n", pair, _cursesi_screen->colour_pairs[pair].fore, _cursesi_screen->colour_pairs[pair].back); -#endif switch (_cursesi_screen->color_type) { /* Set ANSI forground and background colours */ case COLOR_ANSI: @@ -591,9 +579,7 @@ __set_color( /*ARGSUSED*/ WINDOW *win, attr_t attr) void __unset_color(WINDOW *win) { -#ifdef DEBUG __CTRACE(__CTRACE_COLOR, "__unset_color\n"); -#endif switch (_cursesi_screen->color_type) { /* Clear ANSI forground and background colours */ case COLOR_ANSI: @@ -650,19 +636,15 @@ __change_pair(short pair) for (wlp = _cursesi_screen->winlistp; wlp != NULL; wlp = wlp->nextp) { -#ifdef DEBUG __CTRACE(__CTRACE_COLOR, "__change_pair: win = %p\n", wlp->winp); -#endif win = wlp->winp; if (win == __virtscr) continue; else if (win == curscr) { /* Reset colour attribute on curscr */ -#ifdef DEBUG __CTRACE(__CTRACE_COLOR, "__change_pair: win == curscr\n"); -#endif for (y = 0; y < curscr->maxy; y++) { lp = curscr->alines[y]; for (x = 0; x < curscr->maxx; x++) { diff --git a/lib/libcurses/copywin.c b/lib/libcurses/copywin.c index 0c204fe3e9c..b0c47b7488f 100644 --- a/lib/libcurses/copywin.c +++ b/lib/libcurses/copywin.c @@ -1,4 +1,4 @@ -/* $NetBSD: copywin.c,v 1.19 2019/06/09 07:40:14 blymn Exp $ */ +/* $NetBSD: copywin.c,v 1.20 2021/09/06 07:03:49 rin Exp $ */ /*- * Copyright (c) 1998-1999 Brett Lymn @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: copywin.c,v 1.19 2019/06/09 07:40:14 blymn Exp $"); +__RCSID("$NetBSD: copywin.c,v 1.20 2021/09/06 07:03:49 rin Exp $"); #endif /* not lint */ #include <ctype.h> @@ -59,12 +59,10 @@ int copywin(const WINDOW *srcwin, WINDOW *dstwin, nschar_t *np; #endif /* HAVE_WCHAR */ -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "copywin %s mode: from (%d,%d) to (%d,%d-%d,%d)\n", dooverlay ? "overlay" : "overwrite", sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol); -#endif /* overwrite() and overlay() can come here with -ve srcwin coords */ if (sminrow < 0) { @@ -101,28 +99,22 @@ int copywin(const WINDOW *srcwin, WINDOW *dstwin, if (sminrow + (dmaxrow - dminrow) >= srcwin->maxy) dmaxrow = srcwin->maxy + dminrow - sminrow - 1; -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "copywin %s mode: from (%d,%d) to (%d,%d-%d,%d)\n", dooverlay ? "overlay" : "overwrite", sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol); -#endif for (; dminrow <= dmaxrow; sminrow++, dminrow++) { sp = &srcwin->alines[sminrow]->line[smincol]; end = sp + dmaxcol - dmincol; -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "copywin: row %d\n", sminrow); -#endif for (dcol = dmincol; sp <= end; dcol++, sp++) { /* XXX: Perhaps this should check for the * background character */ if ((dooverlay && !isspace(sp->ch)) || !dooverlay) { wmove(dstwin, dminrow, dcol); -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "copywin: dcol = %d\n", dcol); -#endif #ifndef HAVE_WCHAR __waddch(dstwin, sp); #else diff --git a/lib/libcurses/cr_put.c b/lib/libcurses/cr_put.c index e2ee6192a11..6d728d0661b 100644 --- a/lib/libcurses/cr_put.c +++ b/lib/libcurses/cr_put.c @@ -1,4 +1,4 @@ -/* $NetBSD: cr_put.c,v 1.35 2021/06/27 23:57:08 blymn Exp $ */ +/* $NetBSD: cr_put.c,v 1.36 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)cr_put.c 8.3 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: cr_put.c,v 1.35 2021/06/27 23:57:08 blymn Exp $"); +__RCSID("$NetBSD: cr_put.c,v 1.36 2021/09/06 07:03:49 rin Exp $"); #endif #endif /* not lint */ @@ -73,10 +73,8 @@ static int outcol, outline, destcol, destline; int __mvcur(int ly, int lx, int y, int x, int in_refresh) { -#ifdef DEBUG __CTRACE(__CTRACE_OUTPUT, "mvcur: moving cursor from (%d, %d) to (%d, %d) in refresh %d\n", ly, lx, y, x, in_refresh); -#endif destcol = x; destline = y; outcol = lx; @@ -91,11 +89,9 @@ fgoto(int in_refresh) int c, l; char *cgp; -#ifdef DEBUG __CTRACE(__CTRACE_OUTPUT, "fgoto: in_refresh=%d\n", in_refresh); __CTRACE(__CTRACE_OUTPUT, "fgoto: outcol=%d, outline=%d, destcol=%d, destline=%d\n", outcol, outline, destcol, destline); -#endif /* DEBUG */ if (destcol >= COLS) { destline += destcol / COLS; destcol %= COLS; @@ -172,9 +168,7 @@ fgoto(int in_refresh) * Need this condition due to inconsistent behavior * of backspace on the last column. */ -#ifdef DEBUG __CTRACE(__CTRACE_OUTPUT, "fgoto: cgp=%s\n", cgp); -#endif /* DEBUG */ if (outcol != COLS - 1 && plod((int) strlen(cgp), in_refresh) > 0) plod(0, in_refresh); @@ -213,12 +207,10 @@ plod(int cnt, int in_refresh) { int i, j, k, soutcol, soutline; -#ifdef DEBUG __CTRACE(__CTRACE_OUTPUT, "plod: cnt=%d, in_refresh=%d\n", cnt, in_refresh); __CTRACE(__CTRACE_OUTPUT, "plod: plodding from col %d, row %d to col %d, row %d\n", outcol, outline, destcol, destline); -#endif /* DEBUG */ plodcnt = plodflg = cnt; soutcol = outcol; soutline = outline; @@ -434,14 +426,12 @@ dontcr:while (outline < destline) { __cursesi_putnsp(curscr->alines[outline]->line[outcol].nsp, outline, outcol); -#ifdef DEBUG __CTRACE(__CTRACE_OUTPUT, "plod: (%d,%d)WCOL(%d), " "putwchar(%x)\n", outline, outcol, WCOL(curscr->alines[outline]->line[outcol]), curscr->alines[outline]->line[outcol].ch); -#endif /* DEBUG */ /*FALLTHROUGH*/ case 0: break; @@ -467,9 +457,7 @@ out: if (plodflg) { outcol = soutcol; outline = soutline; } -#ifdef DEBUG __CTRACE(__CTRACE_OUTPUT, "plod: returns %d\n", plodcnt); -#endif /* DEBUG */ return plodcnt; } diff --git a/lib/libcurses/curs_set.c b/lib/libcurses/curs_set.c index 90688824b20..f3e9f5a0a2a 100644 --- a/lib/libcurses/curs_set.c +++ b/lib/libcurses/curs_set.c @@ -1,4 +1,4 @@ -/* $NetBSD: curs_set.c,v 1.10 2011/03/30 09:47:02 blymn Exp $ */ +/* $NetBSD: curs_set.c,v 1.11 2021/09/06 07:03:49 rin Exp $ */ /*- * Copyright (c) 1998-2000 Brett Lymn @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: curs_set.c,v 1.10 2011/03/30 09:47:02 blymn Exp $"); +__RCSID("$NetBSD: curs_set.c,v 1.11 2021/09/06 07:03:49 rin Exp $"); #endif /* not lint */ #include "curses.h" @@ -53,10 +53,8 @@ curs_set(int visibility) switch (visibility) { case 0: /* invisible */ if (cursor_invisible != NULL) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "curs_set: invisible\n"); -#endif _cursesi_screen->old_mode = 0; tputs(cursor_invisible, 0, __cputchar); fflush(_cursesi_screen->outfd); @@ -66,9 +64,7 @@ curs_set(int visibility) case 1: /* normal */ if (cursor_normal != NULL) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "curs_set: normal\n"); -#endif _cursesi_screen->old_mode = 1; tputs(cursor_normal, 0, __cputchar); fflush(_cursesi_screen->outfd); @@ -78,10 +74,8 @@ curs_set(int visibility) case 2: /* high visibility */ if (cursor_visible != NULL) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "curs_set: high vis\n"); -#endif _cursesi_screen->old_mode = 2; tputs(cursor_visible, 0, __cputchar); fflush(_cursesi_screen->outfd); diff --git a/lib/libcurses/curses_private.h b/lib/libcurses/curses_private.h index 37bcbefdc5e..202a6c4573e 100644 --- a/lib/libcurses/curses_private.h +++ b/lib/libcurses/curses_private.h @@ -1,4 +1,4 @@ -/* $NetBSD: curses_private.h,v 1.74 2021/08/15 12:39:39 christos Exp $ */ +/* $NetBSD: curses_private.h,v 1.75 2021/09/06 07:03:49 rin Exp $ */ /*- * Copyright (c) 1998-2000 Brett Lymn @@ -341,6 +341,8 @@ extern SCREEN *_cursesi_screen; /* The current screen in use */ #define __CTRACE_FILEIO 0x00001000 #define __CTRACE_ALL 0x7fffffff void __CTRACE(int, const char *, ...) __attribute__((__format__(__printf__, 2, 3))); +#else +#define __CTRACE(area, fmt, ...) __nothing #endif /* Common erase logic */ diff --git a/lib/libcurses/delwin.c b/lib/libcurses/delwin.c index 3faa28e001e..c57da653c86 100644 --- a/lib/libcurses/delwin.c +++ b/lib/libcurses/delwin.c @@ -1,4 +1,4 @@ -/* $NetBSD: delwin.c,v 1.21 2019/04/01 11:39:15 roy Exp $ */ +/* $NetBSD: delwin.c,v 1.22 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)delwin.c 8.2 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: delwin.c,v 1.21 2019/04/01 11:39:15 roy Exp $"); +__RCSID("$NetBSD: delwin.c,v 1.22 2021/09/06 07:03:49 rin Exp $"); #endif #endif /* not lint */ @@ -54,9 +54,7 @@ delwin(WINDOW *win) struct __winlist *wl, *pwl; SCREEN *screen; -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "delwin(%p)\n", win); -#endif if (win == NULL) return OK; diff --git a/lib/libcurses/erase.c b/lib/libcurses/erase.c index e34a7fa1c29..8c2b782ca82 100644 --- a/lib/libcurses/erase.c +++ b/lib/libcurses/erase.c @@ -1,4 +1,4 @@ -/* $NetBSD: erase.c,v 1.32 2020/03/15 01:18:43 uwe Exp $ */ +/* $NetBSD: erase.c,v 1.33 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)erase.c 8.2 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: erase.c,v 1.32 2020/03/15 01:18:43 uwe Exp $"); +__RCSID("$NetBSD: erase.c,v 1.33 2021/09/06 07:03:49 rin Exp $"); #endif #endif /* not lint */ @@ -69,9 +69,7 @@ werase(WINDOW *win) wchar_t bch; attr_t battr; -#ifdef DEBUG __CTRACE(__CTRACE_ERASE, "werase: (%p)\n", win); -#endif #ifdef HAVE_WCHAR bch = (wchar_t)btowc((int)win->bch); #else diff --git a/lib/libcurses/fileio.c b/lib/libcurses/fileio.c index 2298eaa9818..251c5ee8965 100644 --- a/lib/libcurses/fileio.c +++ b/lib/libcurses/fileio.c @@ -1,4 +1,4 @@ -/* $NetBSD: fileio.c,v 1.7 2020/02/24 12:20:29 rin Exp $ */ +/* $NetBSD: fileio.c,v 1.8 2021/09/06 07:03:49 rin Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: fileio.c,v 1.7 2020/02/24 12:20:29 rin Exp $"); +__RCSID("$NetBSD: fileio.c,v 1.8 2021/09/06 07:03:49 rin Exp $"); #endif /* not lint */ #include "curses.h" @@ -83,9 +83,7 @@ putwin(WINDOW *win, FILE *fp) int y, x; __LDATA *sp; -#ifdef DEBUG __CTRACE(__CTRACE_FILEIO, "putwin: win %p\n", win); -#endif if (win == NULL) return ERR; @@ -176,9 +174,7 @@ getwin(FILE *fp) int y, x; __LDATA *sp; -#ifdef DEBUG __CTRACE(__CTRACE_FILEIO, "getwin\n"); -#endif /* Check library version */ if (fread(&major, sizeof(int), 1, fp) != 1) @@ -235,9 +231,7 @@ getwin(FILE *fp) } __touchline(win, y, 0, (int) win->maxx - 1); } -#ifdef DEBUG __CTRACE(__CTRACE_FILEIO, "getwin: win = %p\n", win); -#endif return win; error1: diff --git a/lib/libcurses/get_wch.c b/lib/libcurses/get_wch.c index 39f7fa032fc..f90a71a6de8 100644 --- a/lib/libcurses/get_wch.c +++ b/lib/libcurses/get_wch.c @@ -1,4 +1,4 @@ -/* $NetBSD: get_wch.c,v 1.24 2020/07/06 23:33:38 uwe Exp $ */ +/* $NetBSD: get_wch.c,v 1.25 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 2005 The NetBSD Foundation Inc. @@ -36,7 +36,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: get_wch.c,v 1.24 2020/07/06 23:33:38 uwe Exp $"); +__RCSID("$NetBSD: get_wch.c,v 1.25 2021/09/06 07:03:49 rin Exp $"); #endif /* not lint */ #include <errno.h> @@ -87,9 +87,7 @@ inkey(wchar_t *wc, int to, int delay) *end = &_cursesi_screen->cbuf_tail; char *inbuf = &_cursesi_screen->cbuf[ 0 ]; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey (%p, %d, %d)\n", wc, to, delay); -#endif for (;;) { /* loop until we get a complete key sequence */ if (wstate == INKEY_NORM) { if (delay && __timeout(delay) == ERR) @@ -104,32 +102,26 @@ inkey(wchar_t *wc, int to, int delay) return ERR; k = (wchar_t)c; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey (wstate normal) got '%s'\n", unctrl(k)); -#endif inbuf[*end] = k; *end = (*end + 1) % MAX_CBUF_SIZE; *working = *start; wstate = INKEY_ASSEMBLING; /* go to assembling state */ -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: NORM=>ASSEMBLING: start(%d), " "current(%d), end(%d)\n", *start, *working, *end); -#endif /* DEBUG */ } else if (wstate == INKEY_BACKOUT) { k = inbuf[*working]; *working = (*working + 1) % MAX_CBUF_SIZE; if (*working == *end) { /* see if run out of keys */ /* if so, switch to assembling */ wstate = INKEY_ASSEMBLING; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: BACKOUT=>ASSEMBLING, start(%d), " "current(%d), end(%d)\n", *start, *working, *end); -#endif /* DEBUG */ } } else if (wstate == INKEY_ASSEMBLING) { /* assembling a key sequence */ @@ -152,10 +144,8 @@ inkey(wchar_t *wc, int to, int delay) return ERR; k = (wchar_t)c; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey (wstate assembling) got '%s'\n", unctrl(k)); -#endif /* DEBUG */ if (feof(infd)) { /* inter-char T/O, start backout */ clearerr(infd); if (*start == *end) @@ -164,22 +154,18 @@ inkey(wchar_t *wc, int to, int delay) k = inbuf[*start]; wstate = INKEY_TIMEOUT; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: ASSEMBLING=>TIMEOUT, start(%d), " "current(%d), end(%d)\n", *start, *working, *end); -#endif /* DEBUG */ } else { inbuf[*end] = k; *working = *end; *end = (*end + 1) % MAX_CBUF_SIZE; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: ASSEMBLING: start(%d), " "current(%d), end(%d)", *start, *working, *end); -#endif /* DEBUG */ } } else if (wstate == INKEY_WCASSEMBLING) { /* assembling a wide-char sequence */ @@ -202,11 +188,9 @@ inkey(wchar_t *wc, int to, int delay) return ERR; k = (wchar_t)c; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey (wstate wcassembling) got '%s'\n", unctrl(k)); -#endif if (feof(infd)) { /* inter-char T/O, start backout */ clearerr(infd); if (*start == *end) @@ -217,20 +201,16 @@ inkey(wchar_t *wc, int to, int delay) *working = *start = (*start +1) % MAX_CBUF_SIZE; if (*start == *end) { _cursesi_state = wstate = INKEY_NORM; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: WCASSEMBLING=>NORM, " "start(%d), current(%d), end(%d)", *start, *working, *end); -#endif /* DEBUG */ } else { _cursesi_state = wstate = INKEY_BACKOUT; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: WCASSEMBLING=>BACKOUT, " "start(%d), current(%d), end(%d)", *start, *working, *end); -#endif /* DEBUG */ } return OK; } else { @@ -238,19 +218,15 @@ inkey(wchar_t *wc, int to, int delay) inbuf[*end] = k; *working = *end; *end = (*end + 1) % MAX_CBUF_SIZE; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: WCASSEMBLING[head(%d), " "urrent(%d), tail(%d)]\n", *start, *working, *end); -#endif /* DEBUG */ ret = (int)mbrtowc(wc, inbuf + (*working), 1, &_cursesi_screen->sp); -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: mbrtowc returns %d, wc(%x)\n", ret, *wc); -#endif /* DEBUG */ if (ret == -2) { *working = (*working+1) % MAX_CBUF_SIZE; continue; @@ -261,45 +237,37 @@ inkey(wchar_t *wc, int to, int delay) /* return the 1st character we know */ *wc = inbuf[*start]; *working = *start = (*start + 1) % MAX_CBUF_SIZE; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: Invalid wide char(%x) " "[head(%d), current(%d), " "tail(%d)]\n", *wc, *start, *working, *end); -#endif /* DEBUG */ } else { /* > 0 */ /* return the wide character */ *start = *working = (*working + ret)%MAX_CBUF_SIZE; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: Wide char found(%x) " "[head(%d), current(%d), " "tail(%d)]\n", *wc, *start, *working, *end); -#endif /* DEBUG */ } if (*start == *end) { /* only one char processed */ _cursesi_state = wstate = INKEY_NORM; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: WCASSEMBLING=>NORM, " "start(%d), current(%d), end(%d)", *start, *working, *end); -#endif /* DEBUG */ } else { /* otherwise we must have more than * one char to backout */ _cursesi_state = wstate = INKEY_BACKOUT; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: WCASSEMBLING=>BACKOUT, " "start(%d), current(%d), end(%d)", *start, *working, *end); -#endif /* DEBUG */ } return OK; } @@ -319,28 +287,22 @@ inkey(wchar_t *wc, int to, int delay) && (current->key[mapping]->enable == FALSE))) { /* wide-character specific code */ -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: Checking for wide char\n"); -#endif /* DEBUG */ mbrtowc( NULL, NULL, 1, &_cursesi_screen->sp ); *working = *start; mlen = *end > *working ? *end - *working : MAX_CBUF_SIZE - *working; if (!mlen) return ERR; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: Check wide char[head(%d), " "current(%d), tail(%d), mlen(%ld)]\n", *start, *working, *end, (long) mlen); -#endif /* DEBUG */ ret = (int)mbrtowc(wc, inbuf + (*working), mlen, &_cursesi_screen->sp); -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: mbrtowc returns %d, wc(%x)\n", ret, *wc); -#endif /* DEBUG */ if (ret == -2 && *end < *working) { /* second half of a wide character */ *working = 0; @@ -362,42 +324,34 @@ inkey(wchar_t *wc, int to, int delay) *wc = inbuf[*start]; *working = *start = (*start + 1) % MAX_CBUF_SIZE; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: Invalid wide char(%x)[head(%d), " "current(%d), tail(%d)]\n", *wc, *start, *working, *end); -#endif /* DEBUG */ } else { /* > 0 */ /* return the wide character */ *start = *working = (*working + ret) % MAX_CBUF_SIZE; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: Wide char found(%x)[head(%d), " "current(%d), tail(%d)]\n", *wc, *start, *working, *end); -#endif /* DEBUG */ } if (*start == *end) { /* only one char processed */ _cursesi_state = wstate = INKEY_NORM; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: Empty cbuf=>NORM, " "start(%d), current(%d), end(%d)\n", *start, *working, *end); -#endif /* DEBUG */ } else { /* otherwise we must have more than one * char to backout */ _cursesi_state = wstate = INKEY_BACKOUT; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: Non-empty cbuf=>BACKOUT, " "start(%d), current(%d), end(%d)\n", *start, *working, *end); -#endif /* DEBUG */ } return OK; } else { /* must be part of a multikey sequence */ @@ -409,29 +363,23 @@ inkey(wchar_t *wc, int to, int delay) % MAX_CBUF_SIZE; /* check if inbuf empty now */ -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: Key found(%s)\n", key_name(current->key[mapping]->value.symbol)); -#endif /* DEBUG */ if (*start == *end) { /* if it is go back to normal */ _cursesi_state = wstate = INKEY_NORM; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "[inkey]=>NORM, start(%d), " "current(%d), end(%d)", *start, *working, *end); -#endif /* DEBUG */ } else { /* otherwise go to backout state */ _cursesi_state = wstate = INKEY_BACKOUT; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "[inkey]=>BACKOUT, start(%d), " "current(%d), end(%d)", *start, *working, *end ); -#endif /* DEBUG */ } /* return the symbol */ @@ -501,11 +449,9 @@ wget_wch(WINDOW *win, wint_t *ch) if (!(win->flags & __ISPAD) && is_wintouched(win)) wrefresh(win); -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wget_wch: __echoit = %d, " "__rawmode = %d, __nl = %d, flags = %#.4x\n", __echoit, __rawmode, _cursesi_screen->nl, win->flags); -#endif if (_cursesi_screen->resized) { resizeterm(LINES, COLS); _cursesi_screen->resized = 0; @@ -513,10 +459,8 @@ wget_wch(WINDOW *win, wint_t *ch) return KEY_CODE_YES; } if (_cursesi_screen->unget_pos) { -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wget_wch returning char at %d\n", _cursesi_screen->unget_pos); -#endif _cursesi_screen->unget_pos--; *ch = _cursesi_screen->unget_list[_cursesi_screen->unget_pos]; if (__echoit) { @@ -656,9 +600,7 @@ __fgetwc_resize(FILE *infd, bool *resized) if (!ferror(infd) || errno != EINTR || !_cursesi_screen->resized) return ERR; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "__fgetwc_resize returning KEY_RESIZE\n"); -#endif resizeterm(LINES, COLS); _cursesi_screen->resized = 0; *resized = true; diff --git a/lib/libcurses/get_wstr.c b/lib/libcurses/get_wstr.c index 39cbbb2864b..86ac941c110 100644 --- a/lib/libcurses/get_wstr.c +++ b/lib/libcurses/get_wstr.c @@ -1,4 +1,4 @@ -/* $NetBSD: get_wstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $ */ +/* $NetBSD: get_wstr.c,v 1.10 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 2005 The NetBSD Foundation Inc. @@ -36,7 +36,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: get_wstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $"); +__RCSID("$NetBSD: get_wstr.c,v 1.10 2021/09/06 07:03:49 rin Exp $"); #endif /* not lint */ #include "curses.h" @@ -175,11 +175,9 @@ __wgetn_wstr(WINDOW *win, wchar_t *wstr, int n) while (wget_wch(win, &wc) != ERR && wc != L'\n' && wc != L'\r') { -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "__wgetn_wstr: win %p, char 0x%x, remain %d\n", win, wc, remain); -#endif *wstr = wc; touchline(win, win->cury, 1); if (wc == ec || wc == KEY_BACKSPACE || wc == KEY_LEFT) { diff --git a/lib/libcurses/getch.c b/lib/libcurses/getch.c index 999d4eefdce..47cda68e10f 100644 --- a/lib/libcurses/getch.c +++ b/lib/libcurses/getch.c @@ -1,4 +1,4 @@ -/* $NetBSD: getch.c,v 1.75 2020/07/06 23:33:38 uwe Exp $ */ +/* $NetBSD: getch.c,v 1.76 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)getch.c 8.2 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: getch.c,v 1.75 2020/07/06 23:33:38 uwe Exp $"); +__RCSID("$NetBSD: getch.c,v 1.76 2021/09/06 07:03:49 rin Exp $"); #endif #endif /* not lint */ @@ -261,11 +261,9 @@ add_new_key(keymap_t *current, char chr, int key_type, int symbol) key_entry_t *the_key; int i, ki; -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "Adding character %s of type %d, symbol 0x%x\n", unctrl(chr), key_type, symbol); -#endif if (current->mapping[(unsigned char)chr] < 0) { if (current->mapping[(unsigned char)chr] == MAPPING_UNUSED) { /* first time for this char */ @@ -306,18 +304,14 @@ add_new_key(keymap_t *current, char chr, int key_type, int symbol) switch (key_type) { case KEYMAP_MULTI: /* need for next key */ -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "Creating new keymap\n"); -#endif the_key->value.next = new_keymap(); the_key->enable = TRUE; break; case KEYMAP_LEAF: /* the associated symbol for the key */ -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "Adding leaf key\n"); -#endif the_key->value.symbol = symbol; the_key->enable = TRUE; break; @@ -328,9 +322,7 @@ add_new_key(keymap_t *current, char chr, int key_type, int symbol) } } else { /* the key is already known - just return the address. */ -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "Keymap already known\n"); -#endif the_key = current->key[current->mapping[(unsigned char)chr]]; } @@ -365,10 +357,8 @@ delete_key_sequence(keymap_t *current, int key_type) _cursesi_free_keymap(key->value.next); } else if ((key->type == KEYMAP_LEAF) && (key->value.symbol == key_type)) { -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "delete_key_sequence: found keysym %d, deleting\n", key_type); -#endif key->enable = FALSE; } } @@ -385,10 +375,8 @@ add_key_sequence(SCREEN *screen, char *sequence, int key_type) keymap_t *current; int length, j, key_ent; -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "add_key_sequence: add key sequence: %s(%s)\n", sequence, keyname(key_type)); -#endif /* DEBUG */ current = screen->base_keymap; /* always start with * base keymap. */ length = (int)strlen(sequence); @@ -552,9 +540,7 @@ inkey(int to, int delay) k = 0; /* XXX gcc -Wuninitialized */ -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey (%d, %d)\n", to, delay); -#endif for (;;) { /* loop until we get a complete key sequence */ reread: if (_cursesi_state == INKEY_NORM) { @@ -570,10 +556,8 @@ reread: return ERR; k = (wchar_t)c; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey (state normal) got '%s'\n", unctrl(k)); -#endif working = start; inbuf[working] = k; @@ -613,10 +597,8 @@ reread: if ((to || delay) && (__notimeout() == ERR)) return ERR; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey (state assembling) got '%s'\n", unctrl(k)); -#endif if (feof(infd) || c == -1) { /* inter-char timeout, * start backing out */ clearerr(infd); @@ -786,10 +768,8 @@ define_key(char *sequence, int symbol) return ERR; if (sequence == NULL) { -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "define_key: deleting keysym %d\n", symbol); -#endif delete_key_sequence(_cursesi_screen->base_keymap, symbol); } else add_key_sequence(_cursesi_screen, sequence, symbol); @@ -808,9 +788,7 @@ wgetch(WINDOW *win) int c; FILE *infd = _cursesi_screen->infd; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wgetch: win(%p)\n", win); -#endif if (win == NULL) return ERR; if (!(win->flags & __SCROLLOK) && (win->flags & __FULLWIN) @@ -823,11 +801,9 @@ wgetch(WINDOW *win) wrefresh(win); else if ((_cursesi_screen->curscr->cury != (win->begy + win->cury)) || (_cursesi_screen->curscr->curx != (win->begx + win->curx))) { -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wgetch: curscr cury %d cury %d curscr curx %d curx %d\n", _cursesi_screen->curscr->cury, win->begy + win->cury, _cursesi_screen->curscr->curx, win->begx + win->curx); -#endif /* * Just in case the window is not dirty but the * cursor was moved, check and update the @@ -843,24 +819,18 @@ wgetch(WINDOW *win) } } -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wgetch: __echoit = %d, " "__rawmode = %d, __nl = %d, flags = %#.4x, delay = %d\n", __echoit, __rawmode, _cursesi_screen->nl, win->flags, win->delay); -#endif if (_cursesi_screen->resized) { resizeterm(LINES, COLS); _cursesi_screen->resized = 0; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wgetch returning KEY_RESIZE\n"); -#endif return KEY_RESIZE; } if (_cursesi_screen->unget_pos) { -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wgetch returning char at %d\n", _cursesi_screen->unget_pos); -#endif _cursesi_screen->unget_pos--; c = _cursesi_screen->unget_list[_cursesi_screen->unget_pos]; if (__echoit) @@ -961,9 +931,7 @@ __unget(wint_t c) wchar_t *p; int len; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "__unget(%x)\n", c); -#endif if (_cursesi_screen == NULL) return ERR; if (_cursesi_screen->unget_pos >= _cursesi_screen->unget_len) { @@ -1033,9 +1001,7 @@ __fgetc_resize(FILE *infd) if (!ferror(infd) || errno != EINTR || !_cursesi_screen->resized) return ERR; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "__fgetc_resize returning KEY_RESIZE\n"); -#endif resizeterm(LINES, COLS); _cursesi_screen->resized = 0; return KEY_RESIZE; diff --git a/lib/libcurses/getstr.c b/lib/libcurses/getstr.c index 71dae1122aa..96327f6c891 100644 --- a/lib/libcurses/getstr.c +++ b/lib/libcurses/getstr.c @@ -1,4 +1,4 @@ -/* $NetBSD: getstr.c,v 1.28 2021/08/15 15:12:36 rillig Exp $ */ +/* $NetBSD: getstr.c,v 1.29 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -35,7 +35,7 @@ #if 0 static char sccsid[] = "@(#)getstr.c 8.2 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: getstr.c,v 1.28 2021/08/15 15:12:36 rillig Exp $"); +__RCSID("$NetBSD: getstr.c,v 1.29 2021/09/06 07:03:49 rin Exp $"); #endif #endif /* not lint */ @@ -172,11 +172,9 @@ __wgetnstr(WINDOW *win, char *str, int n) remain = n - 1; while ((c = wgetch(win)) != ERR && c != '\n' && c != '\r') { -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "__wgetnstr: win %p, char 0x%x, remain %d\n", win, c, remain); -#endif *str = c; __touchline(win, win->cury, 0, (int) win->maxx - 1); if (c == ec || c == KEY_BACKSPACE || c == KEY_LEFT) { diff --git a/lib/libcurses/initscr.c b/lib/libcurses/initscr.c index cae7754dc18..c60f930bb16 100644 --- a/lib/libcurses/initscr.c +++ b/lib/libcurses/initscr.c @@ -1,4 +1,4 @@ -/* $NetBSD: initscr.c,v 1.35 2020/03/12 15:50:11 roy Exp $ */ +/* $NetBSD: initscr.c,v 1.36 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)initscr.c 8.2 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: initscr.c,v 1.35 2020/03/12 15:50:11 roy Exp $"); +__RCSID("$NetBSD: initscr.c,v 1.36 2021/09/06 07:03:49 rin Exp $"); #endif #endif /* not lint */ @@ -53,9 +53,7 @@ initscr(void) { const char *sp; -#ifdef DEBUG __CTRACE(__CTRACE_INIT, "initscr\n"); -#endif /* * If My_term is set, or can't find a terminal in the environment, diff --git a/lib/libcurses/ins_wch.c b/lib/libcurses/ins_wch.c index ac9e17cfac6..aa729e258b4 100644 --- a/lib/libcurses/ins_wch.c +++ b/lib/libcurses/ins_wch.c @@ -1,4 +1,4 @@ -/* $NetBSD: ins_wch.c,v 1.16 2021/06/22 07:22:44 blymn Exp $ */ +/* $NetBSD: ins_wch.c,v 1.17 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 2005 The NetBSD Foundation Inc. @@ -36,7 +36,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: ins_wch.c,v 1.16 2021/06/22 07:22:44 blymn Exp $"); +__RCSID("$NetBSD: ins_wch.c,v 1.17 2021/09/06 07:03:49 rin Exp $"); #endif /* not lint */ #include <string.h> @@ -95,9 +95,7 @@ wins_wch(WINDOW *win, const cchar_t *wch) if (!wch) return OK; cw = wcwidth(wch->vals[0]); -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wins_wch: wcwidth %d\n", cw); -#endif if (cw < 0) cw = 1; if (!cw) @@ -105,9 +103,7 @@ wins_wch(WINDOW *win, const cchar_t *wch) x = win->curx; y = win->cury; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wins_wch: (%d,%d)\n", y, x); -#endif /* DEBUG */ switch (wch->vals[0]) { case L'\b': if (--x < 0) @@ -151,16 +147,12 @@ wins_wch(WINDOW *win, const cchar_t *wch) *lnp->firstchp = newx; /* shift all complete characters */ -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wins_wch: shift all characters\n"); -#endif /* DEBUG */ temp1 = &win->alines[y]->line[win->maxx - 1]; temp2 = temp1 - cw; pcw = WCOL(*(temp2 + 1)); if (pcw < 0) { -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wins_wch: clear EOL\n"); -#endif /* DEBUG */ temp2 += pcw; while (temp1 > temp2 + cw) { np = temp1->nsp; @@ -200,10 +192,8 @@ wins_wch(WINDOW *win, const cchar_t *wch) start->nsp = np; } } -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wins_wch: insert (%x,%x,%p)\n", start->ch, start->attr, start->nsp); -#endif /* DEBUG */ temp1 = start + 1; ex = x + 1; while (ex - x < cw) { diff --git a/lib/libcurses/ins_wstr.c b/lib/libcurses/ins_wstr.c index e4b6144d633..a6a749e59da 100644 --- a/lib/libcurses/ins_wstr.c +++ b/lib/libcurses/ins_wstr.c @@ -1,4 +1,4 @@ -/* $NetBSD: ins_wstr.c,v 1.15 2020/07/06 22:46:50 uwe Exp $ */ +/* $NetBSD: ins_wstr.c,v 1.16 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 2005 The NetBSD Foundation Inc. @@ -36,7 +36,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: ins_wstr.c,v 1.15 2020/07/06 22:46:50 uwe Exp $"); +__RCSID("$NetBSD: ins_wstr.c,v 1.16 2021/09/06 07:03:49 rin Exp $"); #endif /* not lint */ #include <string.h> @@ -160,9 +160,7 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) n--, len++, width += w; scp++; } -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wins_nwstr: width=%d,len=%d\n", width, len); -#endif /* DEBUG */ if (cw > win->maxx - win->curx + 1) return ERR; @@ -174,9 +172,7 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) sx += pcw; start += pcw; } -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wins_nwstr: start@(%d)\n", sx); -#endif /* DEBUG */ pcw = WCOL(*start); lnp->flags |= __ISDIRTY; newx = sx + win->ch_off; @@ -197,18 +193,14 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) /* shift all complete characters */ if (sx + width + pcw <= win->maxx) { -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wins_nwstr: shift all characters\n"); -#endif /* DEBUG */ temp1 = &win->alines[win->cury]->line[win->maxx - 1]; temp2 = temp1 - width; pcw = WCOL(*(temp2 + 1)); if (pcw < 0) { -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wins_nwstr: clear from %d to EOL(%d)\n", win->maxx + pcw, win->maxx - 1); -#endif /* DEBUG */ temp2 += pcw; while (temp1 > temp2 + width) { temp1->ch = (wchar_t)btowc((int) win->bch); @@ -216,10 +208,8 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) return ERR; temp1->attr = win->battr; SET_WCOL(*temp1, 1); -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wins_nwstr: empty cell(%p)\n", temp1); -#endif /* DEBUG */ temp1--; } } @@ -278,10 +268,8 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) temp1->attr = win->wattr; SET_WCOL(*temp1, cw); temp1->nsp = NULL; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wins_nwstr: add spacing char(%x)\n", temp1->ch); -#endif /* DEBUG */ temp2 = temp1++; if (cw > 1) { x = -1; @@ -303,10 +291,8 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) np->ch = *scp; np->next = temp1->nsp; temp1->nsp = np; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "wins_nstr: add non-spacing char(%x)\n", np->ch); -#endif /* DEBUG */ } } #ifdef DEBUG diff --git a/lib/libcurses/insdelln.c b/lib/libcurses/insdelln.c index 21f49211aba..1a0e413a313 100644 --- a/lib/libcurses/insdelln.c +++ b/lib/libcurses/insdelln.c @@ -1,4 +1,4 @@ -/* $NetBSD: insdelln.c,v 1.18 2017/01/06 13:53:18 roy Exp $ */ +/* $NetBSD: insdelln.c,v 1.19 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: insdelln.c,v 1.18 2017/01/06 13:53:18 roy Exp $"); +__RCSID("$NetBSD: insdelln.c,v 1.19 2021/09/06 07:03:49 rin Exp $"); #endif /* not lint */ /* @@ -75,10 +75,8 @@ winsdelln(WINDOW *win, int nlines) #endif /* HAVE_WCHAR */ attr_t attr; -#ifdef DEBUG __CTRACE(__CTRACE_LINE, "winsdelln: (%p) cury=%d lines=%d\n", win, win->cury, nlines); -#endif if (!nlines) return OK; diff --git a/lib/libcurses/insstr.c b/lib/libcurses/insstr.c index 3aca7488e22..dc561ea8cc7 100644 --- a/lib/libcurses/insstr.c +++ b/lib/libcurses/insstr.c @@ -1,4 +1,4 @@ -/* $NetBSD: insstr.c,v 1.8 2020/07/06 22:46:50 uwe Exp $ */ +/* $NetBSD: insstr.c,v 1.9 2021/09/06 07:03:49 rin Exp $ */ /* * Copyright (c) 2005 The NetBSD Foundation Inc. @@ -36,7 +36,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: insstr.c,v 1.8 2020/07/06 22:46:50 uwe Exp $"); +__RCSID("$NetBSD: insstr.c,v 1.9 2021/09/06 07:03:49 rin Exp $"); #endif /* not lint */ #include <string.h> @@ -155,16 +155,12 @@ winsnstr(WINDOW *win, const char *str, int n) for (scp = str, len = 0; n-- && *scp++; ++len); else for (scp = str, len = 0; *scp++; ++len); -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "winsnstr: len = %d\n", len); -#endif /* DEBUG */ /* move string */ end = &win->alines[win->cury]->line[win->curx]; if (len < win->maxx - win->curx) { -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "winsnstr: shift %d cells\n", len); -#endif /* DEBUG */ temp1 = &win->alines[win->cury]->line[win->maxx - 1]; temp2 = temp1 - len; while (temp2 >= end) { diff --git a/lib/libcurses/keypad.c b/lib/libcurses/keypad.c index d44cd8f090a..3b3409816ee 100644 --- a/lib/libcurses/keypad.c +++ b/lib/libcurses/keypad.c @@ -1,4 +1,4 @@ -/* $NetBSD: keypad.c,v 1.14 2017/01/06 13:53:18 roy Exp $ */ +/* $NetBSD: keypad.c,v 1.15 2021/09/06 07:03:49 rin Exp $ */ /*- * Copyright (c) 1998-1999 Brett Lymn (blymn@baea.com.au, brett_lymn@yahoo.com) @@ -28,7 +28,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: keypad.c,v 1.14 2017/01/06 13:53:18 roy Exp $"); +__RCSID("$NetBSD: keypad.c,v 1.15 2021/09/06 07:03:49 rin Exp $"); #endif /* not lint */ #include "curses.h" @@ -42,10 +42,8 @@ __RCSID("$NetBSD: keypad.c,v 1.14 2017/01/06 13:53:18 roy Exp $"); int keypad(WINDOW *win, bool bf) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "keypad: win %p, %s\n", win, bf ? "TRUE" : "FALSE"); -#endif if (bf) { win->flags |= __KEYPAD; if (!(curscr->flags & __KEYPAD)) { diff --git a/lib/libcurses/line.c b/lib/libcurses/line.c index 90d34e87f3e..272307240b3 100644 --- a/lib/libcurses/line.c +++ b/lib/libcurses/line.c @@ -1,4 +1,4 @@ -/* $NetBSD: line.c,v 1.16 2020/07/01 02:57:01 uwe Exp $ */ +/* $NetBSD: line.c,v 1.17 2021/09/06 07:03:50 rin Exp $ */ /*- * Copyright (c) 1998-1999 Brett Lymn @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: line.c,v 1.16 2020/07/01 02:57:01 uwe Exp $"); +__RCSID("$NetBSD: line.c,v 1.17 2021/09/06 07:03:50 rin Exp $"); #endif /* not lint */ #include <string.h> @@ -226,17 +226,13 @@ int whline_set(WINDOW *win, const cchar_t *wch, int n) if ( ( win->maxx - win->curx ) < cw ) return ERR; wcn = min( n, ( win->maxx - win->curx ) / cw ); -#ifdef DEBUG __CTRACE(__CTRACE_LINE, "whline_set: line of %d\n", wcn); -#endif /* DEBUG */ ocury = win->cury; ocurx = win->curx; for (i = 0; i < wcn; i++ ) { -#ifdef DEBUG __CTRACE(__CTRACE_LINE, "whline_set: (%d,%d)\n", ocury, ocurx + i * cw); -#endif /* DEBUG */ mvwadd_wch(win, ocury, ocurx + i * cw, &cc); } @@ -285,9 +281,7 @@ int wvline_set(WINDOW *win, const cchar_t *wch, int n) cchar_t cc; wcn = min(n, win->maxy - win->cury); -#ifdef DEBUG __CTRACE(__CTRACE_LINE, "wvline_set: line of %d\n", wcn); -#endif /* DEBUG */ ocury = win->cury; ocurx = win->curx; @@ -298,10 +292,8 @@ int wvline_set(WINDOW *win, const cchar_t *wch, int n) } for (i = 0; i < wcn; i++) { mvwadd_wch(win, ocury + i, ocurx, &cc); -#ifdef DEBUG __CTRACE(__CTRACE_LINE, "wvline_set: (%d,%d)\n", ocury + i, ocurx); -#endif /* DEBUG */ } wmove(win, ocury, ocurx); diff --git a/lib/libcurses/meta.c b/lib/libcurses/meta.c index d4853a9dc68..50456e3de2c 100644 --- a/lib/libcurses/meta.c +++ b/lib/libcurses/meta.c @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.9 2017/01/06 13:53:18 roy Exp $ */ +/* $NetBSD: meta.c,v 1.10 2021/09/06 07:03:50 rin Exp $ */ /*- * Copyright (c) 1998-2000 Brett Lymn @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: meta.c,v 1.9 2017/01/06 13:53:18 roy Exp $"); +__RCSID("$NetBSD: meta.c,v 1.10 2021/09/06 07:03:50 rin Exp $"); #endif /* not lint */ #include "curses.h" @@ -47,18 +47,14 @@ meta(/*ARGSUSED*/ WINDOW *win, bool bf) if (bf == TRUE) { if (meta_on != NULL) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "meta: TRUE\n"); -#endif tputs(meta_on, 0, __cputchar); _cursesi_screen->meta_state = TRUE; fflush(_cursesi_screen->outfd); } } else { if (meta_off != NULL) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "meta: FALSE\n"); -#endif tputs(meta_off, 0, __cputchar); _cursesi_screen->meta_state = FALSE; fflush(_cursesi_screen->outfd); diff --git a/lib/libcurses/move.c b/lib/libcurses/move.c index f96ac57d3a1..4d76325acc1 100644 --- a/lib/libcurses/move.c +++ b/lib/libcurses/move.c @@ -1,4 +1,4 @@ -/* $NetBSD: move.c,v 1.21 2019/06/09 07:40:14 blymn Exp $ */ +/* $NetBSD: move.c,v 1.22 2021/09/06 07:03:50 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)move.c 8.2 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: move.c,v 1.21 2019/06/09 07:40:14 blymn Exp $"); +__RCSID("$NetBSD: move.c,v 1.22 2021/09/06 07:03:50 rin Exp $"); #endif #endif /* not lint */ @@ -62,9 +62,7 @@ move(int y, int x) int wmove(WINDOW *win, int y, int x) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "wmove: (%d, %d)\n", y, x); -#endif if (x < 0 || y < 0) return ERR; if (x >= win->maxx || y >= win->maxy) diff --git a/lib/libcurses/mvwin.c b/lib/libcurses/mvwin.c index 6c60afad36d..cadf1c33d04 100644 --- a/lib/libcurses/mvwin.c +++ b/lib/libcurses/mvwin.c @@ -1,4 +1,4 @@ -/* $NetBSD: mvwin.c,v 1.21 2017/01/11 20:43:03 roy Exp $ */ +/* $NetBSD: mvwin.c,v 1.22 2021/09/06 07:03:50 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)mvwin.c 8.2 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: mvwin.c,v 1.21 2017/01/11 20:43:03 roy Exp $"); +__RCSID("$NetBSD: mvwin.c,v 1.22 2021/09/06 07:03:50 rin Exp $"); #endif #endif /* not lint */ @@ -84,9 +84,7 @@ mvderwin(WINDOW *win, int dy, int dx) *plp->firstchp = x; if (*plp->lastchp < x + win->maxx) *plp->lastchp = x + win->maxx; -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "mvderwin: firstchp = %d, lastchp = %d\n", *plp->firstchp, *plp->lastchp); -#endif } return OK; diff --git a/lib/libcurses/newwin.c b/lib/libcurses/newwin.c index e36f7aba83b..f0651adcfd9 100644 --- a/lib/libcurses/newwin.c +++ b/lib/libcurses/newwin.c @@ -1,4 +1,4 @@ -/* $NetBSD: newwin.c,v 1.60 2021/06/01 00:59:01 mcf Exp $ */ +/* $NetBSD: newwin.c,v 1.61 2021/09/06 07:03:50 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)newwin.c 8.3 (Berkeley) 7/27/94"; #else -__RCSID("$NetBSD: newwin.c,v 1.60 2021/06/01 00:59:01 mcf Exp $"); +__RCSID("$NetBSD: newwin.c,v 1.61 2021/09/06 07:03:50 rin Exp $"); #endif #endif /* not lint */ @@ -151,9 +151,7 @@ __newwin(SCREEN *screen, int nlines, int ncols, int by, int bx, int ispad, win->reqy = nlines; win->reqx = ncols; -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "newwin: win->ch_off = %d\n", win->ch_off); -#endif for (i = 0; i < maxy; i++) { lp = win->alines[i]; @@ -192,10 +190,8 @@ __subwin(WINDOW *orig, int nlines, int ncols, int by, int bx, int ispad) WINDOW *win; int maxy, maxx; -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "subwin: (%p, %d, %d, %d, %d, %d)\n", orig, nlines, ncols, by, bx, ispad); -#endif if (orig == NULL) return NULL; @@ -270,10 +266,8 @@ __set_subwin(WINDOW *orig, WINDOW *win) #endif /* HAVE_WCHAR */ } -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "__set_subwin: win->ch_off = %d\n", win->ch_off); -#endif } /* * __makenew -- @@ -289,18 +283,14 @@ __makenew(SCREEN *screen, int nlines, int ncols, int by, int bx, int sub, int i; -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "makenew: (%d, %d, %d, %d)\n", nlines, ncols, by, bx); -#endif if (nlines <= 0 || ncols <= 0) return NULL; if ((win = malloc(sizeof(WINDOW))) == NULL) return NULL; -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "makenew: win = %p\n", win); -#endif win->fp = NULL; win->buf = NULL; win->buflen = 0; @@ -370,9 +360,7 @@ __makenew(SCREEN *screen, int nlines, int ncols, int by, int bx, int sub, } } } -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "makenew: ncols = %d\n", ncols); -#endif win->screen = screen; win->cury = win->curx = 0; win->maxy = nlines; @@ -402,7 +390,6 @@ __makenew(SCREEN *screen, int nlines, int ncols, int by, int bx, int sub, win->smaxx = 0; } else __swflags(win); -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "makenew: win->wattr = %08x\n", win->wattr); __CTRACE(__CTRACE_WINDOW, "makenew: win->flags = %#.4x\n", win->flags); __CTRACE(__CTRACE_WINDOW, "makenew: win->maxy = %d\n", win->maxy); @@ -411,7 +398,6 @@ __makenew(SCREEN *screen, int nlines, int ncols, int by, int bx, int sub, __CTRACE(__CTRACE_WINDOW, "makenew: win->begx = %d\n", win->begx); __CTRACE(__CTRACE_WINDOW, "makenew: win->scr_t = %d\n", win->scr_t); __CTRACE(__CTRACE_WINDOW, "makenew: win->scr_b = %d\n", win->scr_b); -#endif return win; } diff --git a/lib/libcurses/overlay.c b/lib/libcurses/overlay.c index 75f5cb39b74..2b25f2275aa 100644 --- a/lib/libcurses/overlay.c +++ b/lib/libcurses/overlay.c @@ -1,4 +1,4 @@ -/* $NetBSD: overlay.c,v 1.17 2007/01/21 13:25:36 jdc Exp $ */ +/* $NetBSD: overlay.c,v 1.18 2021/09/06 07:03:50 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)overlay.c 8.2 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: overlay.c,v 1.17 2007/01/21 13:25:36 jdc Exp $"); +__RCSID("$NetBSD: overlay.c,v 1.18 2021/09/06 07:03:50 rin Exp $"); #endif #endif /* not lint */ @@ -51,9 +51,7 @@ int overlay(const WINDOW *win1, WINDOW *win2) { -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "overlay: (%p, %p);\n", win1, win2); -#endif return copywin(win1, win2, win2->begy - win1->begy, win2->begx - win1->begx, 0, 0, win2->maxy - 1, win2->maxx - 1, TRUE); diff --git a/lib/libcurses/overwrite.c b/lib/libcurses/overwrite.c index 5900b808b9b..ee38ad6df6f 100644 --- a/lib/libcurses/overwrite.c +++ b/lib/libcurses/overwrite.c @@ -1,4 +1,4 @@ -/* $NetBSD: overwrite.c,v 1.18 2007/01/21 13:25:36 jdc Exp $ */ +/* $NetBSD: overwrite.c,v 1.19 2021/09/06 07:03:50 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)overwrite.c 8.2 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: overwrite.c,v 1.18 2007/01/21 13:25:36 jdc Exp $"); +__RCSID("$NetBSD: overwrite.c,v 1.19 2021/09/06 07:03:50 rin Exp $"); #endif #endif /* not lint */ @@ -51,9 +51,7 @@ __RCSID("$NetBSD: overwrite.c,v 1.18 2007/01/21 13:25:36 jdc Exp $"); int overwrite(const WINDOW *win1, WINDOW *win2) { -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "overwrite: (%p, %p);\n", win1, win2); -#endif return copywin(win1, win2, win2->begy - win1->begy, win2->begx - win1->begx, 0, 0, win2->maxy - 1, win2->maxx - 1, FALSE); diff --git a/lib/libcurses/pause.c b/lib/libcurses/pause.c index 36df8a13e56..decaab73686 100644 --- a/lib/libcurses/pause.c +++ b/lib/libcurses/pause.c @@ -1,4 +1,4 @@ -/* $NetBSD: pause.c,v 1.10 2017/01/06 13:53:18 roy Exp $ */ +/* $NetBSD: pause.c,v 1.11 2021/09/06 07:03:50 rin Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: pause.c,v 1.10 2017/01/06 13:53:18 roy Exp $"); +__RCSID("$NetBSD: pause.c,v 1.11 2021/09/06 07:03:50 rin Exp $"); #endif /* not lint */ #include <stdarg.h> @@ -50,9 +50,7 @@ napms(int ms) { struct timespec ts; -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "napms: %d\n", ms); -#endif ts.tv_sec = ms / 1000; ts.tv_nsec = (ms % 1000) * 1000000; (void)nanosleep(&ts, NULL); @@ -68,9 +66,7 @@ delay_output(int ms) { char *delstr; -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "delay_output: %d\n", ms); -#endif if (!_cursesi_screen->padchar) return napms(ms); diff --git a/lib/libcurses/putchar.c b/lib/libcurses/putchar.c index 14943a5f168..19cae8d39ae 100644 --- a/lib/libcurses/putchar.c +++ b/lib/libcurses/putchar.c @@ -1,4 +1,4 @@ -/* $NetBSD: putchar.c,v 1.23 2019/05/20 22:17:41 blymn Exp $ */ +/* $NetBSD: putchar.c,v 1.24 2021/09/06 07:03:50 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)putchar.c 8.2 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: putchar.c,v 1.23 2019/05/20 22:17:41 blymn Exp $"); +__RCSID("$NetBSD: putchar.c,v 1.24 2021/09/06 07:03:50 rin Exp $"); #endif #endif /* not lint */ @@ -45,9 +45,7 @@ int __cputchar(int ch) { -#ifdef DEBUG __CTRACE(__CTRACE_OUTPUT, "__cputchar: %s\n", unctrl(ch)); -#endif return __cputchar_args(ch, _cursesi_screen->outfd); } @@ -62,10 +60,8 @@ __cputchar_args(int ch, void *args) FILE *outfd = (FILE *)args; int status; -#ifdef DEBUG __CTRACE(__CTRACE_OUTPUT, "__cputchar_args: %s on fd %d\n", unctrl(ch), outfd->_file); -#endif status = putc(ch, outfd); fflush(outfd); return status; @@ -75,9 +71,7 @@ __cputchar_args(int ch, void *args) int __cputwchar(wchar_t wch) { -#ifdef DEBUG __CTRACE(__CTRACE_OUTPUT, "__cputwchar: 0x%x\n", wch); -#endif return __cputwchar_args(wch, _cursesi_screen->outfd); } @@ -92,10 +86,8 @@ __cputwchar_args(wchar_t wch, void *args) FILE *outfd = (FILE *)args; int status; -#ifdef DEBUG __CTRACE(__CTRACE_OUTPUT, "__cputwchar_args: 0x%x on fd %d\n", wch, outfd->_file); -#endif status = putwc(wch, outfd); fflush(outfd); return status; diff --git a/lib/libcurses/refresh.c b/lib/libcurses/refresh.c index 5bb68e64479..62ea86e508e 100644 --- a/lib/libcurses/refresh.c +++ b/lib/libcurses/refresh.c @@ -1,4 +1,4 @@ -/* $NetBSD: refresh.c,v 1.113 2021/05/08 04:29:07 mrg Exp $ */ +/* $NetBSD: refresh.c,v 1.114 2021/09/06 07:03:50 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)refresh.c 8.7 (Berkeley) 8/13/94"; #else -__RCSID("$NetBSD: refresh.c,v 1.113 2021/05/08 04:29:07 mrg Exp $"); +__RCSID("$NetBSD: refresh.c,v 1.114 2021/09/06 07:03:50 rin Exp $"); #endif #endif /* not lint */ @@ -100,9 +100,7 @@ int wnoutrefresh(WINDOW *win) { -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "wnoutrefresh: win %p, begy %d, begx %d, maxy %d, maxx %d\n", win, win->begy, win->begx, win->maxy, win->maxx); -#endif return _wnoutrefresh(win, 0, 0, win->begy, win->begx, win->maxy, win->maxx); @@ -118,13 +116,11 @@ pnoutrefresh(WINDOW *pad, int pbegy, int pbegx, int sbegy, int sbegx, { int pmaxy, pmaxx; -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "pnoutrefresh: pad %p, flags 0x%08x\n", pad, pad->flags); __CTRACE(__CTRACE_REFRESH, "pnoutrefresh: (%d, %d), (%d, %d), (%d, %d)\n", pbegy, pbegx, sbegy, sbegx, smaxy, smaxx); -#endif /* SUS says if these are negative, they should be treated as zero */ if (pbegy < 0) @@ -170,13 +166,11 @@ _wnoutrefresh(WINDOW *win, int begy, int begx, int wbegy, int wbegx, __LINE *wlp, *vlp, *dwlp; WINDOW *sub_win, *orig, *swin, *dwin; -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "_wnoutrefresh: win %p, flags 0x%08x\n", win, win->flags); __CTRACE(__CTRACE_REFRESH, "_wnoutrefresh: (%d, %d), (%d, %d), (%d, %d)\n", begy, begx, wbegy, wbegx, maxy, maxx); -#endif if (screen->curwin) return OK; @@ -196,11 +190,9 @@ _wnoutrefresh(WINDOW *win, int begy, int begx, int wbegy, int wbegx, sub_win = sub_win->nextp) { if (sub_win->flags & __ISDERWIN) continue; -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "wnout_refresh: win %p, sub_win %p\n", orig, sub_win); -#endif for (sy = 0; sy < sub_win->maxy; sy++) { if (sub_win->alines[sy]->flags & __ISDIRTY) { orig->alines[sy + sub_win->begy - orig->begy]->flags @@ -269,11 +261,9 @@ _wnoutrefresh(WINDOW *win, int begy, int begx, int wbegy, int wbegx, if (((wlp->flags & (__ISDIRTY | __ISFORCED)) == 0) && ((dwlp->flags & (__ISDIRTY | __ISFORCED)) == 0)) continue; -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "_wnoutrefresh: line y_off %d (dy_off %d) is dirty\n", y_off, dy_off); -#endif wlp = swin->alines[wy]; vlp = screen->__virtscr->alines[y_off]; @@ -309,7 +299,6 @@ _wnoutrefresh(WINDOW *win, int begy, int begx, int wbegy, int wbegx, /* Copy line from "win" to "__virtscr". */ while (wx < mx) { -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "_wnoutrefresh: copy from %d, " "%d to %d, %d: %s, 0x%x", @@ -319,7 +308,6 @@ _wnoutrefresh(WINDOW *win, int begy, int begx, int wbegy, int wbegx, __CTRACE(__CTRACE_REFRESH, " (curdest %s, 0x%x)", unctrl(vlp->line[x_off].ch), vlp->line[x_off].attr); -#endif /* Copy character */ vlp->line[x_off].ch = wlp->line[wx].ch; /* Copy attributes */ @@ -355,11 +343,9 @@ _wnoutrefresh(WINDOW *win, int begy, int begx, int wbegy, int wbegx, } } #endif /* HAVE_WCHAR */ -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, " = %s, 0x%x\n", unctrl(vlp->line[x_off].ch), vlp->line[x_off].attr); -#endif wx++; x_off++; dx_off++; @@ -414,11 +400,9 @@ _wnoutrefresh(WINDOW *win, int begy, int begx, int wbegy, int wbegx, } } -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "__virtscr: firstch = %d, lastch = %d\n", *vlp->firstchp, *vlp->lastchp); -#endif /* * Unset change pointers only if a window and we * are not forcing a redraw. A pad can be displayed @@ -435,11 +419,9 @@ _wnoutrefresh(WINDOW *win, int begy, int begx, int wbegy, int wbegx, if ((*wlp->lastchp < *wlp->firstchp) || (*wlp->firstchp >= maxx + win->ch_off) || (*wlp->lastchp <= win->ch_off)) { -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "_wnoutrefresh: " "line %d notdirty\n", wy); -#endif wlp->flags &= ~(__ISDIRTY | __ISFORCED); } } @@ -459,9 +441,7 @@ wrefresh(WINDOW *win) int retval; int pbegx, pbegy; -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "wrefresh: win %p\n", win); -#endif _cursesi_screen->curwin = (win == _cursesi_screen->curscr); if (!_cursesi_screen->curwin) { @@ -469,10 +449,8 @@ wrefresh(WINDOW *win) if ((win->flags & __ISDERWIN) == __ISDERWIN) { pbegx = win->derx; pbegy = win->dery; -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "wrefresh: derwin, begy = %d, begx = %x\n", pbegy, pbegx); -#endif } retval = _wnoutrefresh(win, pbegy, pbegx, win->begy, win->begx, win->maxy, win->maxx); @@ -500,10 +478,8 @@ prefresh(WINDOW *pad, int pbegy, int pbegx, int sbegy, int sbegx, { int retval; -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "prefresh: pad %p, flags 0x%08x\n", pad, pad->flags); -#endif /* Retain values in case pechochar() is called. */ pad->pbegy = pbegy; pad->pbegx = pbegx; @@ -613,11 +589,9 @@ doupdate(void) if (!_cursesi_screen->curwin) werase(curscr); } -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "doupdate: (%p): curwin = %d\n", win, _cursesi_screen->curwin); __CTRACE(__CTRACE_REFRESH, "doupdate: \tfirstch\tlastch\n"); -#endif if (!_cursesi_screen->curwin) { /* @@ -687,20 +661,16 @@ doupdate(void) for (wy = 0; wy < win->maxy; wy++) { wlp = win->alines[wy]; vlp = _cursesi_screen->__virtscr->alines[win->begy + wy]; -/* XXX: remove this debug */ -#ifdef DEBUG +/* XXX: remove this */ __CTRACE(__CTRACE_REFRESH, "doupdate: wy %d\tf: %d\tl:%d\tflags %x\n", wy, *wlp->firstchp, *wlp->lastchp, wlp->flags); -#endif /* DEBUG */ if (!_cursesi_screen->curwin) curscr->alines[wy]->hash = wlp->hash; if (wlp->flags & __ISDIRTY || wlp->flags & __ISFORCED) { -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "doupdate: [ISDIRTY]wy:%d\tf:%d\tl:%d\n", wy, *wlp->firstchp, *wlp->lastchp); -#endif /* DEBUG */ /* * We have just cleared so don't force an update * otherwise we spray neeedless blanks to a cleared @@ -717,10 +687,8 @@ doupdate(void) if (*wlp->lastchp < win->maxx) *wlp->lastchp = win->ch_off; if (*wlp->lastchp < *wlp->firstchp) { -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "doupdate: line %d notdirty\n", wy); -#endif /* DEBUG */ wlp->flags &= ~(__ISDIRTY | __ISFORCED); } @@ -750,16 +718,12 @@ doupdate(void) if (*vlp->lastchp <= _cursesi_screen->__virtscr->maxx) *vlp->lastchp = 0; -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "\t%d\t%d\n", *wlp->firstchp, *wlp->lastchp); -#endif /* DEBUG */ } -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "doupdate: ly=%d, lx=%d\n", _cursesi_screen->ly, _cursesi_screen->lx); -#endif /* DEBUG */ if (_cursesi_screen->curwin) domvcur(win, _cursesi_screen->ly, _cursesi_screen->lx, @@ -812,7 +776,6 @@ putattr(__LDATA *nsp) { attr_t off, on; -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "makech: have attr %08x, need attr %08x\n", curscr->wattr @@ -828,7 +791,6 @@ putattr(__LDATA *nsp) & WA_ATTRIBUTES #endif ); -#endif off = (~nsp->attr & curscr->wattr) #ifndef HAVE_WCHAR @@ -1026,10 +988,8 @@ putch(__LDATA *nsp, __LDATA *csp, int wy, int wx) if (WCOL(*nsp) <= 0) goto out; __cputwchar((int)nsp->ch); -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "makech: (%d,%d)putwchar(0x%x)\n", wy, wx - 1, nsp->ch); -#endif /* DEBUG */ /* Output non-spacing characters for the cell. */ __cursesi_putnsp(nsp->nsp, wy, wx); @@ -1185,15 +1145,11 @@ makech(int wy) if (_cursesi_screen->curwin) { csp = ␣ -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "makech: csp is blank\n"); -#endif /* DEBUG */ } else { csp = &curscr->alines[wy]->line[wx]; -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "makech: csp is on curscr:(%d,%d)\n", wy, wx); -#endif /* DEBUG */ } nsp = fsp = &win->alines[wy]->line[wx]; @@ -1229,7 +1185,6 @@ makech(int wy) ce = NULL; while (wx <= lch) { -#ifdef DEBUG #ifndef HAVE_WCHAR __CTRACE(__CTRACE_REFRESH, "makech: wx=%d,lch=%d\n", wx, lch); #else @@ -1238,7 +1193,6 @@ makech(int wy) __CTRACE(__CTRACE_REFRESH, "makech: csp=(%x,%x,%x,%x,%p)\n", csp->ch, csp->attr, win->bch, win->battr, csp->nsp); #endif -#endif /* DEBUG */ if (!(wlp->flags & __ISFORCED) && #ifdef HAVE_WCHAR ((nsp->attr & __WCWIDTH) != __WCWIDTH) && @@ -1259,11 +1213,9 @@ makech(int wy) domvcur(win, _cursesi_screen->ly, _cursesi_screen->lx, wy, wx); -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "makech: 1: wx = %d, ly= %d, " "lx = %d, newy = %d, newx = %d\n", wx, _cursesi_screen->ly, _cursesi_screen->lx, wy, wx); -#endif _cursesi_screen->ly = wy; _cursesi_screen->lx = wx; while (wx <= lch && @@ -1293,14 +1245,12 @@ makech(int wy) win->begx * __LDATASIZE; else clsp = 0; -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "makech: clsp = %zu, nlsp = %zu\n", clsp, nlsp); __CTRACE(__CTRACE_REFRESH, "makech: line = %p, cep = %p, begx = %u\n", curscr->alines[wy]->line, cep, win->begx); -#endif if (((clsp - nlsp >= strlen(ce) && clsp < win->maxx * __LDATASIZE) || wy == win->maxy - 1) && @@ -1380,11 +1330,9 @@ makech(int wy) } wx += chw; nsp++; -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "makech: 2: wx = %d, lx = %d\n", wx, _cursesi_screen->lx); -#endif } if (_cursesi_screen->lx == wx) /* If no change. */ break; @@ -1400,10 +1348,8 @@ makech(int wy) (int)(win->maxx - 1)); _cursesi_screen->lx = win->maxx - 1; } -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "makech: 3: wx = %d, lx = %d\n", wx, _cursesi_screen->lx); -#endif } #ifdef DEBUG #if HAVE_WCHAR @@ -1440,10 +1386,8 @@ static void domvcur(WINDOW *win, int oy, int ox, int ny, int nx) { -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "domvcur: (%d,%d)=>(%d,%d) win %p\n", oy, ox, ny, nx, win ); -#endif /* DEBUG */ __unsetattr(1); @@ -1582,11 +1526,9 @@ done: if (bsize < THRESH) return; -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "quickch:bsize=%d, starts=%d, startw=%d, " "curw=%d, curs=%d, top=%d, bot=%d\n", bsize, starts, startw, curw, curs, top, bot); -#endif /* * Make sure that there is no overlap between the bottom and top @@ -1704,17 +1646,13 @@ done: curscr->alines[target] = tmp1; /* Mark block as clean and blank out scrolled lines. */ clp = curscr->alines[target]; -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "quickch: n=%d startw=%d curw=%d i = %d target=%d ", n, startw, curw, i, target); -#endif if ((target >= startw && target < curw) || target < top || target > bot) { -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, " notdirty\n"); -#endif __virtscr->alines[target]->flags &= ~__ISDIRTY; } else if ((n > 0 && target >= top && target < top + n) || @@ -1733,23 +1671,17 @@ done: } (void) memcpy(clp->line , buf, i * sizeof(buf[0])); -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, " blanked out: dirty\n"); -#endif clp->hash = blank_hash; __touchline(__virtscr, target, 0, (int) __virtscr->maxx - 1); } else { -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, " -- blank line already: dirty\n"); -#endif __touchline(__virtscr, target, 0, (int) __virtscr->maxx - 1); } } else { -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, " -- dirty\n"); -#endif __touchline(__virtscr, target, 0, (int) __virtscr->maxx - 1); } if (target == cur_period) { @@ -1968,11 +1900,9 @@ __unsetattr(int checkms) isms = 0; } else isms = 1; -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "__unsetattr: checkms = %d, ms = %s, wattr = %08x\n", checkms, move_standout_mode ? "TRUE" : "FALSE", curscr->wattr); -#endif /* * Don't leave the screen in standout mode (check against ms). Check @@ -2065,11 +1995,9 @@ __cursesi_putnsp(nschar_t *nsp, const int wy, const int wx) p = nsp; while (p != NULL) { __cputwchar((int)p->ch); -#ifdef DEBUG __CTRACE(__CTRACE_REFRESH, "_cursesi_putnsp: (%d,%d) non-spacing putwchar(0x%x)\n", wy, wx - 1, p->ch); -#endif p = p->next; } } diff --git a/lib/libcurses/resize.c b/lib/libcurses/resize.c index 49b08278820..278806e5f0c 100644 --- a/lib/libcurses/resize.c +++ b/lib/libcurses/resize.c @@ -1,4 +1,4 @@ -/* $NetBSD: resize.c,v 1.31 2021/05/29 09:11:14 nia Exp $ */ +/* $NetBSD: resize.c,v 1.32 2021/09/06 07:03:50 rin Exp $ */ /* * Copyright (c) 2001 @@ -33,7 +33,7 @@ #if 0 static char sccsid[] = "@(#)resize.c blymn 2001/08/26"; #else -__RCSID("$NetBSD: resize.c,v 1.31 2021/05/29 09:11:14 nia Exp $"); +__RCSID("$NetBSD: resize.c,v 1.32 2021/09/06 07:03:50 rin Exp $"); #endif #endif /* not lint */ @@ -58,10 +58,8 @@ wresize(WINDOW *win, int req_nlines, int req_ncols) if (win == NULL) return ERR; -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "wresize: (%p, %d, %d)\n", win, nlines, ncols); -#endif if (win->orig != NULL) { /* subwins must fit inside the parent - check this */ if (win->begy > win->orig->begy + win->orig->maxy) @@ -152,9 +150,7 @@ resizeterm(int nlines, int ncols) { int result; -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "resizeterm: (%d, %d)\n", nlines, ncols); -#endif /* Unconditionally inform application screen has been resized. */ _cursesi_screen->resized = 1; @@ -188,9 +184,7 @@ resize_term(int nlines, int ncols) struct __winlist *list; int rlines; -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "resize_term: (%d, %d)\n", nlines, ncols); -#endif if (!is_term_resized(nlines, ncols)) return OK; @@ -261,7 +255,6 @@ __resizewin(WINDOW *win, int nlines, int ncols) int y, x; WINDOW *swin; -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "resize: (%p, %d, %d)\n", win, nlines, ncols); __CTRACE(__CTRACE_WINDOW, "resize: win->wattr = %08x\n", win->wattr); __CTRACE(__CTRACE_WINDOW, "resize: win->flags = %#.4x\n", win->flags); @@ -271,7 +264,6 @@ __resizewin(WINDOW *win, int nlines, int ncols) __CTRACE(__CTRACE_WINDOW, "resize: win->begx = %d\n", win->begx); __CTRACE(__CTRACE_WINDOW, "resize: win->scr_t = %d\n", win->scr_t); __CTRACE(__CTRACE_WINDOW, "resize: win->scr_b = %d\n", win->scr_b); -#endif /* * free up any non-spacing storage before we lose the @@ -372,7 +364,6 @@ __resizewin(WINDOW *win, int nlines, int ncols) (size_t)(ncols * __LDATASIZE)); } -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "resize: win->wattr = %08x\n", win->wattr); __CTRACE(__CTRACE_WINDOW, "resize: win->flags = %#.4x\n", win->flags); __CTRACE(__CTRACE_WINDOW, "resize: win->maxy = %d\n", win->maxy); @@ -381,7 +372,6 @@ __resizewin(WINDOW *win, int nlines, int ncols) __CTRACE(__CTRACE_WINDOW, "resize: win->begx = %d\n", win->begx); __CTRACE(__CTRACE_WINDOW, "resize: win->scr_t = %d\n", win->scr_t); __CTRACE(__CTRACE_WINDOW, "resize: win->scr_b = %d\n", win->scr_b); -#endif if (win->orig == NULL) { /* bound subwindows to new size and fixup their pointers */ diff --git a/lib/libcurses/ripoffline.c b/lib/libcurses/ripoffline.c index f1e43a3065d..463fa42b481 100644 --- a/lib/libcurses/ripoffline.c +++ b/lib/libcurses/ripoffline.c @@ -1,4 +1,4 @@ -/* $NetBSD: ripoffline.c,v 1.5 2018/10/03 13:22:29 roy Exp $ */ +/* $NetBSD: ripoffline.c,v 1.6 2021/09/06 07:03:50 rin Exp $ */ /*- * Copyright (c) 2017 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: ripoffline.c,v 1.5 2018/10/03 13:22:29 roy Exp $"); +__RCSID("$NetBSD: ripoffline.c,v 1.6 2021/09/06 07:03:50 rin Exp $"); #endif /* not lint */ #include "curses.h" @@ -53,9 +53,7 @@ int ripoffline(int line, int (*init)(WINDOW *, int)) { -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "ripoffline: %d\n", line); -#endif if (nrips >= MAX_RIPS || init == NULL) return ERR; /* This makes sense, but not standards compliant. */ diff --git a/lib/libcurses/screen.c b/lib/libcurses/screen.c index b299fef1528..9572d8eaa49 100644 --- a/lib/libcurses/screen.c +++ b/lib/libcurses/screen.c @@ -1,4 +1,4 @@ -/* $NetBSD: screen.c,v 1.35 2018/11/16 10:12:00 blymn Exp $ */ +/* $NetBSD: screen.c,v 1.36 2021/09/06 07:03:50 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)screen.c 8.2 (blymn) 11/27/2001"; #else -__RCSID("$NetBSD: screen.c,v 1.35 2018/11/16 10:12:00 blymn Exp $"); +__RCSID("$NetBSD: screen.c,v 1.36 2021/09/06 07:03:50 rin Exp $"); #endif #endif /* not lint */ @@ -112,10 +112,8 @@ set_term(SCREEN *new) _cursesi_reset_wacs(new); #endif /* HAVE_WCHAR */ -#ifdef DEBUG __CTRACE(__CTRACE_SCREEN, "set_term: LINES = %d, COLS = %d\n", LINES, COLS); -#endif return old_screen; } @@ -138,9 +136,7 @@ newterm(char *type, FILE *outfd, FILE *infd) if ((new_screen = calloc(1, sizeof(SCREEN))) == NULL) return NULL; -#ifdef DEBUG __CTRACE(__CTRACE_INIT, "newterm\n"); -#endif new_screen->infd = infd; /* @@ -229,10 +225,8 @@ newterm(char *type, FILE *outfd, FILE *infd) set_term(new_screen); } -#ifdef DEBUG __CTRACE(__CTRACE_SCREEN, "newterm: LINES = %d, COLS = %d\n", LINES, COLS); -#endif __startwin(new_screen); return new_screen; @@ -254,9 +248,7 @@ void delscreen(SCREEN *screen) { -#ifdef DEBUG __CTRACE(__CTRACE_SCREEN, "delscreen(%p)\n", screen); -#endif __delscreen(screen); diff --git a/lib/libcurses/scroll.c b/lib/libcurses/scroll.c index f3a1febcbcf..ef1c2b3969c 100644 --- a/lib/libcurses/scroll.c +++ b/lib/libcurses/scroll.c @@ -1,4 +1,4 @@ -/* $NetBSD: scroll.c,v 1.26 2019/06/09 07:40:14 blymn Exp $ */ +/* $NetBSD: scroll.c,v 1.27 2021/09/06 07:03:50 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)scroll.c 8.3 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: scroll.c,v 1.26 2019/06/09 07:40:14 blymn Exp $"); +__RCSID("$NetBSD: scroll.c,v 1.27 2021/09/06 07:03:50 rin Exp $"); #endif #endif /* not lint */ @@ -87,9 +87,7 @@ wscrl(WINDOW *win, int nlines) { int oy, ox; -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "wscrl: (%p) lines=%d\n", win, nlines); -#endif if (!(win->flags & __SCROLLOK)) return ERR; @@ -97,9 +95,7 @@ wscrl(WINDOW *win, int nlines) return OK; getyx(win, oy, ox); -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "wscrl: y=%d\n", oy); -#endif wmove(win, win->scr_t, 1); winsdelln(win, 0 - nlines); wmove(win, oy, ox); @@ -108,9 +104,7 @@ wscrl(WINDOW *win, int nlines) __cputchar('\n'); if (!__NONL) win->curx = 0; -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "scroll: win == curscr\n"); -#endif } return OK; } diff --git a/lib/libcurses/setterm.c b/lib/libcurses/setterm.c index 1292d24899b..4427428a411 100644 --- a/lib/libcurses/setterm.c +++ b/lib/libcurses/setterm.c @@ -1,4 +1,4 @@ -/* $NetBSD: setterm.c,v 1.69 2021/06/10 07:15:40 mcf Exp $ */ +/* $NetBSD: setterm.c,v 1.70 2021/09/06 07:03:50 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)setterm.c 8.8 (Berkeley) 10/25/94"; #else -__RCSID("$NetBSD: setterm.c,v 1.69 2021/06/10 07:15:40 mcf Exp $"); +__RCSID("$NetBSD: setterm.c,v 1.70 2021/09/06 07:03:50 rin Exp $"); #endif #endif /* not lint */ @@ -78,9 +78,7 @@ _cursesi_setterm(char *type, SCREEN *screen) if (screen->term == NULL) return ERR; } -#ifdef DEBUG __CTRACE(__CTRACE_INIT, "setterm: tty = %s\n", type); -#endif /* lines and cols will have been setup correctly by ti_setupterm(3). */ screen->LINES = t_lines(screen->term); @@ -102,9 +100,7 @@ _cursesi_setterm(char *type, SCREEN *screen) screen->LINES = 1; t_lines(screen->term) = 1; } -#ifdef DEBUG __CTRACE(__CTRACE_INIT, "setterm: filtered %d\n", screen->filtered); -#endif if ((p = getenv("ESCDELAY")) != NULL) screen->ESCDELAY = (int)strtol(p, NULL, 0); @@ -127,11 +123,9 @@ _cursesi_setterm(char *type, SCREEN *screen) ESCDELAY = screen->ESCDELAY; TABSIZE = screen->TABSIZE; -#ifdef DEBUG __CTRACE(__CTRACE_INIT, "setterm: LINES = %d, COLS = %d, TABSIZE = %d\n", LINES, COLS, TABSIZE); -#endif /* * set the pad char, only take the first char of the pc capability @@ -280,9 +274,7 @@ does_esc_m(const char *cap) const char *capptr; int seq; -#ifdef DEBUG __CTRACE(__CTRACE_INIT, "does_esc_m: Checking %s\n", cap); -#endif /* Is it just "\E[m" or "\E[0m"? */ if (!strcmp(cap, "\x1b[m") || !strcmp(cap, "\x1b[0m")) return 1; @@ -378,9 +370,7 @@ does_ctrl_o(const char *exit_cap, const char *acs_cap) char *eptr, *aptr; int res; -#ifdef DEBUG __CTRACE(__CTRACE_INIT, "does_ctrl_o: Testing %s for %s\n", exit_cap, acs_cap); -#endif eptr = capdup_nodelay(exit_cap); if (__predict_false(eptr == NULL)) diff --git a/lib/libcurses/slk.c b/lib/libcurses/slk.c index 2bb56bdfcbc..50840951481 100644 --- a/lib/libcurses/slk.c +++ b/lib/libcurses/slk.c @@ -1,4 +1,4 @@ -/* $NetBSD: slk.c,v 1.14 2021/08/15 12:39:39 christos Exp $ */ +/* $NetBSD: slk.c,v 1.15 2021/09/06 07:03:50 rin Exp $ */ /*- * Copyright (c) 2017 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: slk.c,v 1.14 2021/08/15 12:39:39 christos Exp $"); +__RCSID("$NetBSD: slk.c,v 1.15 2021/09/06 07:03:50 rin Exp $"); #endif /* not lint */ #include <ctype.h> @@ -555,21 +555,15 @@ __slk_wset(SCREEN *screen, int labnum, const wchar_t *label, int justify) if (screen == NULL) return ERR; -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "__slk_wset: entry\n"); -#endif olabel = label; if ((len = wcsrtombs(NULL, &olabel, 0, &screen->sp)) == -1) { -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "__slk_wset: conversion failed on char 0x%x\n", (uint16_t) *olabel); -#endif return ERR; } -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "__slk_wset: wcsrtombs %zu\n", len); -#endif len++; /* We need to store the NULL character. */ if ((str = malloc(len)) == NULL) return ERR; @@ -579,10 +573,8 @@ __slk_wset(SCREEN *screen, int labnum, const wchar_t *label, int justify) result = __slk_set(screen, labnum, str, justify); out: free(str); -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "__slk_wset: return %s\n", (result == OK)?"OK":"ERR"); -#endif return result; } #endif /* HAVE_WCHAR */ @@ -851,12 +843,10 @@ __slk_draw(SCREEN *screen, int labnum) continue; } -#ifdef DEBUG __CTRACE(__CTRACE_INPUT, "__slk_draw: last label, (%d,%d) char[%d] 0x%x\n", l->x + tx, 0, lcnt, l->label[lcnt]); __CTRACE(__CTRACE_INPUT, "__slk_draw: label len %d, wcwidth %d\n", screen->slk_label_len, wcwidth(l->label[lcnt])); -#endif #ifdef HAVE_WCHAR wc[0] = l->label[lcnt]; wc[1] = L'\0'; diff --git a/lib/libcurses/toucholap.c b/lib/libcurses/toucholap.c index 0bea740afa1..ae02338a2fc 100644 --- a/lib/libcurses/toucholap.c +++ b/lib/libcurses/toucholap.c @@ -1,4 +1,4 @@ -/* $NetBSD: toucholap.c,v 1.17 2017/01/06 13:53:18 roy Exp $ */ +/* $NetBSD: toucholap.c,v 1.18 2021/09/06 07:03:50 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)toucholap.c 8.2 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: toucholap.c,v 1.17 2017/01/06 13:53:18 roy Exp $"); +__RCSID("$NetBSD: toucholap.c,v 1.18 2021/09/06 07:03:50 rin Exp $"); #endif #endif /* not lint */ @@ -50,14 +50,11 @@ touchoverlap(WINDOW *win1, WINDOW *win2) { int y, endy, endx, starty, startx; -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "touchoverlap: (%p, %p);\n", win1, win2); -#endif starty = max(win1->begy, win2->begy); startx = max(win1->begx, win2->begx); endy = min(win1->maxy + win1->begy, win2->maxy + win2->begy); endx = min(win1->maxx + win1->begx, win2->maxx + win2->begx); -#ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "touchoverlap: from (%d,%d) to (%d,%d)\n", starty, startx, endy, endx); __CTRACE(__CTRACE_WINDOW, "touchoverlap: win1 (%d,%d) to (%d,%d)\n", @@ -66,7 +63,6 @@ touchoverlap(WINDOW *win1, WINDOW *win2) __CTRACE(__CTRACE_WINDOW, "touchoverlap: win2 (%d,%d) to (%d,%d)\n", win2->begy, win2->begx, win2->begy + win2->maxy, win2->begx + win2->maxx); -#endif if (starty >= endy || startx >= endx) return OK; starty -= win2->begy; diff --git a/lib/libcurses/touchwin.c b/lib/libcurses/touchwin.c index 69f80caef9b..5465f048251 100644 --- a/lib/libcurses/touchwin.c +++ b/lib/libcurses/touchwin.c @@ -1,4 +1,4 @@ -/* $NetBSD: touchwin.c,v 1.32 2020/07/03 23:28:51 uwe Exp $ */ +/* $NetBSD: touchwin.c,v 1.33 2021/09/06 07:03:50 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)touchwin.c 8.2 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: touchwin.c,v 1.32 2020/07/03 23:28:51 uwe Exp $"); +__RCSID("$NetBSD: touchwin.c,v 1.33 2021/09/06 07:03:50 rin Exp $"); #endif #endif /* not lint */ @@ -67,10 +67,8 @@ is_linetouched(WINDOW *win, int line) if (line > win->maxy) return FALSE; -#ifdef DEBUG __CTRACE(__CTRACE_LINE, "is_linetouched: (%p, line %d, dirty %d)\n", win, line, (win->alines[line]->flags & __ISDIRTY)); -#endif return (win->alines[line]->flags & __ISDIRTY) != 0; } @@ -82,9 +80,7 @@ is_linetouched(WINDOW *win, int line) int touchline(WINDOW *win, int start, int count) { -#ifdef DEBUG __CTRACE(__CTRACE_LINE, "touchline: (%p, %d, %d)\n", win, start, count); -#endif return wtouchln(win, start, count, 1); } @@ -95,9 +91,7 @@ touchline(WINDOW *win, int start, int count) */ int wredrawln(WINDOW *win, int start, int count) { -#ifdef DEBUG __CTRACE(__CTRACE_LINE, "wredrawln: (%p, %d, %d)\n", win, start, count); -#endif return wtouchln(win, start, count, 1); } @@ -110,10 +104,8 @@ is_wintouched(WINDOW *win) { int y, maxy; -#ifdef DEBUG __CTRACE(__CTRACE_LINE, "is_wintouched: (%p, maxy %d)\n", win, win->maxy); -#endif maxy = win->maxy; for (y = 0; y < maxy; y++) { if (is_linetouched(win, y) == TRUE) @@ -130,9 +122,7 @@ is_wintouched(WINDOW *win) int touchwin(WINDOW *win) { -#ifdef DEBUG __CTRACE(__CTRACE_LINE, "touchwin: (%p)\n", win); -#endif return wtouchln(win, 0, win->maxy, 1); } @@ -143,9 +133,7 @@ touchwin(WINDOW *win) int redrawwin(WINDOW *win) { -#ifdef DEBUG __CTRACE(__CTRACE_LINE, "redrawwin: (%p)\n", win); -#endif return wtouchln(win, 0, win->maxy, 1); } @@ -156,9 +144,7 @@ redrawwin(WINDOW *win) int untouchwin(WINDOW *win) { -#ifdef DEBUG __CTRACE(__CTRACE_LINE, "untouchwin: (%p)\n", win); -#endif return wtouchln(win, 0, win->maxy, 0); } @@ -173,10 +159,8 @@ wtouchln(WINDOW *win, int line, int n, int changed) int y; __LINE *wlp; -#ifdef DEBUG __CTRACE(__CTRACE_LINE, "wtouchln: (%p) %d, %d, %d\n", win, line, n, changed); -#endif if (line < 0 || win->maxy <= line) return ERR; if (n < 0) @@ -208,9 +192,7 @@ __touchwin(WINDOW *win) { int y, maxy; -#ifdef DEBUG __CTRACE(__CTRACE_LINE, "__touchwin: (%p)\n", win); -#endif maxy = win->maxy; for (y = 0; y < maxy; y++) __touchline(win, y, 0, (int) win->maxx - 1); @@ -235,12 +217,10 @@ static int _cursesi_touchline_force(WINDOW *win, int y, int sx, int ex, int force) { -#ifdef DEBUG __CTRACE(__CTRACE_LINE, "__touchline: (%p, %d, %d, %d, %d)\n", win, y, sx, ex, force); __CTRACE(__CTRACE_LINE, "__touchline: first = %d, last = %d\n", *win->alines[y]->firstchp, *win->alines[y]->lastchp); -#endif sx += win->ch_off; ex += win->ch_off; win->alines[y]->flags |= __ISDIRTY; @@ -251,10 +231,8 @@ _cursesi_touchline_force(WINDOW *win, int y, int sx, int ex, int force) *win->alines[y]->firstchp = sx; if (*win->alines[y]->lastchp < ex) *win->alines[y]->lastchp = ex; -#ifdef DEBUG __CTRACE(__CTRACE_LINE, "__touchline: first = %d, last = %d\n", *win->alines[y]->firstchp, *win->alines[y]->lastchp); -#endif return OK; } diff --git a/lib/libcurses/tscroll.c b/lib/libcurses/tscroll.c index eb883ea0ffd..cc2d7958625 100644 --- a/lib/libcurses/tscroll.c +++ b/lib/libcurses/tscroll.c @@ -1,4 +1,4 @@ -/* $NetBSD: tscroll.c,v 1.14 2017/01/06 13:53:18 roy Exp $ */ +/* $NetBSD: tscroll.c,v 1.15 2021/09/06 07:03:50 rin Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -35,7 +35,7 @@ #if 0 static char sccsid[] = "@(#)tscroll.c 8.4 (Berkeley) 7/27/94"; #else -__RCSID("$NetBSD: tscroll.c,v 1.14 2017/01/06 13:53:18 roy Exp $"); +__RCSID("$NetBSD: tscroll.c,v 1.15 2021/09/06 07:03:50 rin Exp $"); #endif #endif /* not lint */ @@ -113,10 +113,8 @@ __parse_cap (char const *cap, ...) if (!have_input) { n = va_arg(ap, int); have_input = 1; -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__parse_cap: %%n, val = %d\n", n); -#endif } n ^= 0140; continue; @@ -124,10 +122,8 @@ __parse_cap (char const *cap, ...) if (!have_input) { n = va_arg(ap, int); have_input = 1; -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__parse_cap: %%d, val = %d\n", n); -#endif } if (n < 10) goto one; @@ -138,10 +134,8 @@ __parse_cap (char const *cap, ...) if (!have_input) { n = va_arg(ap, int); have_input = 1; -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__parse_cap: %%3, val = %d\n", n); -#endif } *dp++ = (n / 100) | '0'; n %= 100; @@ -150,10 +144,8 @@ __parse_cap (char const *cap, ...) if (!have_input) { n = va_arg(ap, int); have_input = 1; -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__parse_cap: %%2, val = %d\n", n); -#endif } two: *dp++ = n / 10 | '0'; one: *dp++ = n % 10 | '0'; @@ -163,10 +155,8 @@ __parse_cap (char const *cap, ...) if (!have_input) { n = va_arg(ap, int); have_input = 1; -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__parse_cap: %%>, val = %d\n", n); -#endif } if (n > *cap++) n += *cap++; @@ -177,10 +167,8 @@ __parse_cap (char const *cap, ...) if (!have_input) { n = va_arg(ap, int); have_input = 1; -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__parse_cap: %%+, val = %d\n", n); -#endif } n += *cap++; /* FALLTHROUGH */ @@ -188,10 +176,8 @@ __parse_cap (char const *cap, ...) if (!have_input) { n = va_arg(ap, int); have_input = 1; -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__parse_cap: %%., val = %d\n", n); -#endif } *dp++ = n; have_input = 0; @@ -200,10 +186,8 @@ __parse_cap (char const *cap, ...) if (!have_input) { n = va_arg(ap, int); have_input = 1; -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__parse_cap: %%i, val = %d\n", n); -#endif } n++; continue; @@ -214,10 +198,8 @@ __parse_cap (char const *cap, ...) if (!have_input) { n = va_arg(ap, int); have_input = 1; -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__parse_cap: %%B, val = %d\n", n); -#endif } n = (n / 10 << 4) + n % 10; continue; @@ -225,10 +207,8 @@ __parse_cap (char const *cap, ...) if (!have_input) { n = va_arg(ap, int); have_input = 1; -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__parse_cap: %%D, val = %d\n", n); -#endif } n = n - 2 * (n % 16); continue; diff --git a/lib/libcurses/tstp.c b/lib/libcurses/tstp.c index f0baa999120..27199f80e47 100644 --- a/lib/libcurses/tstp.c +++ b/lib/libcurses/tstp.c @@ -1,4 +1,4 @@ -/* $NetBSD: tstp.c,v 1.44 2018/10/18 07:53:13 roy Exp $ */ +/* $NetBSD: tstp.c,v 1.45 2021/09/06 07:03:50 rin Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)tstp.c 8.3 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: tstp.c,v 1.44 2018/10/18 07:53:13 roy Exp $"); +__RCSID("$NetBSD: tstp.c,v 1.45 2021/09/06 07:03:50 rin Exp $"); #endif #endif /* not lint */ @@ -107,9 +107,7 @@ void __set_stophandler(void) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__set_stophandler: %d\n", tstp_set); -#endif if (!tstp_set) { otstpfn = signal(SIGTSTP, __stop_signal_handler); tstp_set = 1; @@ -123,9 +121,7 @@ void __restore_stophandler(void) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__restore_stophandler: %d\n", tstp_set); -#endif if (tstp_set) { (void)signal(SIGTSTP, otstpfn); tstp_set = 0; @@ -167,9 +163,7 @@ void __set_winchhandler(void) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__set_winchhandler: %d\n", winch_set); -#endif if (!winch_set) { struct sigaction sa; @@ -178,11 +172,9 @@ __set_winchhandler(void) sigemptyset(&sa.sa_mask); sigaction(SIGWINCH, &sa, &owsa); winch_set = 1; -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__set_winchhandler: owsa.sa_handler=%p\n", owsa.sa_handler); -#endif } } @@ -193,9 +185,7 @@ void __restore_winchhandler(void) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__restore_winchhandler: %d\n", winch_set); -#endif if (winch_set > 0) { struct sigaction cwsa; @@ -209,10 +199,8 @@ __restore_winchhandler(void) * so don't restore the previous one. */ winch_set = -1; -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "cwsa.sa_handler = %p\n", cwsa.sa_handler); -#endif } } } @@ -224,9 +212,7 @@ int __stopwin(void) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__stopwin\n"); -#endif if (_cursesi_screen == NULL) return ERR; if (_cursesi_screen->endwin) @@ -269,9 +255,7 @@ __restartwin(void) struct winsize win; int nlines, ncols; -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__restartwin\n"); -#endif if (!_cursesi_screen->endwin) return; diff --git a/lib/libcurses/tty.c b/lib/libcurses/tty.c index 9818fa8f3d8..b9dd543bb6d 100644 --- a/lib/libcurses/tty.c +++ b/lib/libcurses/tty.c @@ -1,4 +1,4 @@ -/* $NetBSD: tty.c,v 1.48 2018/11/16 10:12:00 blymn Exp $ */ +/* $NetBSD: tty.c,v 1.49 2021/09/06 07:03:50 rin Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)tty.c 8.6 (Berkeley) 1/10/95"; #else -__RCSID("$NetBSD: tty.c,v 1.48 2018/11/16 10:12:00 blymn Exp $"); +__RCSID("$NetBSD: tty.c,v 1.49 2021/09/06 07:03:50 rin Exp $"); #endif #endif /* not lint */ @@ -172,9 +172,7 @@ _cursesi_gettmode(SCREEN *screen) int raw(void) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "raw()\n"); -#endif /* Check if we need to restart ... */ if (_cursesi_screen->endwin) __restartwin(); @@ -194,9 +192,7 @@ raw(void) int noraw(void) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "noraw()\n"); -#endif /* Check if we need to restart ... */ if (_cursesi_screen->endwin) __restartwin(); @@ -216,9 +212,7 @@ noraw(void) int cbreak(void) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "cbreak()\n"); -#endif /* Check if we need to restart ... */ if (_cursesi_screen->endwin) __restartwin(); @@ -239,9 +233,7 @@ cbreak(void) int nocbreak(void) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "nocbreak()\n"); -#endif /* Check if we need to restart ... */ if (_cursesi_screen->endwin) __restartwin(); @@ -287,9 +279,7 @@ halfdelay(int duration) int __delay(void) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__delay()\n"); -#endif /* Check if we need to restart ... */ if (_cursesi_screen->endwin) __restartwin(); @@ -315,9 +305,7 @@ __delay(void) int __nodelay(void) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__nodelay()\n"); -#endif /* Check if we need to restart ... */ if (_cursesi_screen->endwin) __restartwin(); @@ -373,9 +361,7 @@ __restore_termios(void) int __timeout(int delay) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__timeout()\n"); -#endif /* Check if we need to restart ... */ if (_cursesi_screen->endwin) __restartwin(); @@ -403,9 +389,7 @@ __timeout(int delay) int __notimeout(void) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "__notimeout()\n"); -#endif /* Check if we need to restart ... */ if (_cursesi_screen->endwin) __restartwin(); @@ -426,9 +410,7 @@ __notimeout(void) int echo(void) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "echo()\n"); -#endif /* Check if we need to restart ... */ if (_cursesi_screen->endwin) __restartwin(); @@ -440,9 +422,7 @@ echo(void) int noecho(void) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "noecho()\n"); -#endif /* Check if we need to restart ... */ if (_cursesi_screen->endwin) __restartwin(); @@ -454,9 +434,7 @@ noecho(void) int nl(void) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "nl()\n"); -#endif /* Check if we need to restart ... */ if (_cursesi_screen->endwin) __restartwin(); @@ -479,9 +457,7 @@ nl(void) int nonl(void) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "nonl()\n"); -#endif /* Check if we need to restart ... */ if (_cursesi_screen->endwin) __restartwin(); @@ -587,9 +563,7 @@ __startwin(SCREEN *screen) int endwin(void) { -#ifdef DEBUG __CTRACE(__CTRACE_MISC, "endwin\n"); -#endif return __stopwin(); } diff --git a/lib/libcurses/underscore.c b/lib/libcurses/underscore.c index 080a03dd932..d64f9446f70 100644 --- a/lib/libcurses/underscore.c +++ b/lib/libcurses/underscore.c @@ -1,4 +1,4 @@ -/* $NetBSD: underscore.c,v 1.12 2017/01/06 13:53:18 roy Exp $ */ +/* $NetBSD: underscore.c,v 1.13 2021/09/06 07:03:50 rin Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: underscore.c,v 1.12 2017/01/06 13:53:18 roy Exp $"); +__RCSID("$NetBSD: underscore.c,v 1.13 2021/09/06 07:03:50 rin Exp $"); #endif /* not lint */ #include "curses.h" @@ -76,9 +76,7 @@ wunderscore(WINDOW *win) if ((enter_underline_mode != NULL && exit_underline_mode != NULL) || underline_char != NULL) { -#ifdef DEBUG __CTRACE(__CTRACE_ATTR, "wunderscore\n"); -#endif win->wattr |= __UNDERSCORE; } return 1; @@ -93,9 +91,7 @@ wunderend(WINDOW *win) { if (exit_underline_mode != NULL) { -#ifdef DEBUG __CTRACE(__CTRACE_ATTR, "wunderend\n"); -#endif win->wattr &= ~__UNDERSCORE; } return 1; |
