Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libcurses Style fixes most for __CTRACE().



details:   https://anonhg.NetBSD.org/src/rev/d45820c7a240
branches:  trunk
changeset: 1023409:d45820c7a240
user:      rin <rin%NetBSD.org@localhost>
date:      Mon Sep 06 07:45:48 2021 +0000

description:
Style fixes most for __CTRACE().

diffstat:

 lib/libcurses/add_wchstr.c |  10 +++---
 lib/libcurses/addbytes.c   |  72 ++++++++++++++++++++++++---------------------
 lib/libcurses/addch.c      |   8 ++--
 lib/libcurses/addnstr.c    |   7 +--
 lib/libcurses/addwstr.c    |   8 ++--
 lib/libcurses/background.c |   8 ++--
 lib/libcurses/border.c     |   6 +-
 lib/libcurses/chgat.c      |   8 ++--
 lib/libcurses/color.c      |  12 ++++---
 lib/libcurses/cr_put.c     |  15 +++++---
 lib/libcurses/curs_set.c   |   7 +--
 lib/libcurses/get_wch.c    |  37 ++++++++++++-----------
 lib/libcurses/getch.c      |  49 +++++++++++++++++--------------
 lib/libcurses/ins_wstr.c   |  10 +++---
 lib/libcurses/mvwin.c      |   8 +++-
 lib/libcurses/refresh.c    |  35 ++++++++++++---------
 lib/libcurses/setterm.c    |   7 ++-
 lib/libcurses/slk.c        |  14 +++++---
 18 files changed, 172 insertions(+), 149 deletions(-)

diffs (truncated from 973 to 300 lines):

diff -r 790b315e0140 -r d45820c7a240 lib/libcurses/add_wchstr.c
--- a/lib/libcurses/add_wchstr.c        Mon Sep 06 07:08:25 2021 +0000
+++ b/lib/libcurses/add_wchstr.c        Mon Sep 06 07:45:48 2021 +0000
@@ -1,4 +1,4 @@
-/*   $NetBSD: add_wchstr.c,v 1.9 2021/09/06 07:03:49 rin Exp $ */
+/*   $NetBSD: add_wchstr.c,v 1.10 2021/09/06 07:45:48 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.9 2021/09/06 07:03:49 rin Exp $");
+__RCSID("$NetBSD: add_wchstr.c,v 1.10 2021/09/06 07:45:48 rin Exp $");
 #endif                         /* not lint */
 
 #include <stdlib.h>
@@ -244,8 +244,8 @@
                        }
                        lp++, ex++;
                        __CTRACE(__CTRACE_INPUT,
-                               "wadd_wchnstr: ex = %d, x = %d, cw = %d\n",
-                                ex, x, cw);
+                           "wadd_wchnstr: ex = %d, x = %d, cw = %d\n",
+                           ex, x, cw);
                        while (ex - x <= cw - 1) {
                                np = lp->nsp;
                                if (np) {
@@ -264,7 +264,7 @@
                } else {
                        /* non-spacing character */
                        __CTRACE(__CTRACE_INPUT,
-                               "wadd_wchnstr: as non-spacing char");
+                           "wadd_wchnstr: as non-spacing char");
                        for (i = 0; i < chp->elements; i++) {
                                np = malloc(sizeof(nschar_t));
                                if (!np)
diff -r 790b315e0140 -r d45820c7a240 lib/libcurses/addbytes.c
--- a/lib/libcurses/addbytes.c  Mon Sep 06 07:08:25 2021 +0000
+++ b/lib/libcurses/addbytes.c  Mon Sep 06 07:45:48 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: addbytes.c,v 1.58 2021/09/06 07:08:25 rin Exp $        */
+/*     $NetBSD: addbytes.c,v 1.59 2021/09/06 07:45:48 rin Exp $        */
 
 /*
  * Copyright (c) 1987, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)addbytes.c 8.4 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: addbytes.c,v 1.58 2021/09/06 07:08:25 rin Exp $");
+__RCSID("$NetBSD: addbytes.c,v 1.59 2021/09/06 07:45:48 rin Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -253,8 +253,7 @@
                (*lp)->flags &= ~__ISPASTEOL;
                if (*y == win->scr_b) {
                        __CTRACE(__CTRACE_INPUT,
-                                "ADDBYTES - on bottom "
-                                "of scrolling region\n");
+                           "ADDBYTES - on bottom of scrolling region\n");
                        if (!(win->flags & __SCROLLOK))
                                return ERR;
                        scroll(win);
@@ -267,9 +266,8 @@
        }
 
        __CTRACE(__CTRACE_INPUT,
-                "ADDBYTES: 1: y = %d, x = %d, firstch = %d, lastch = %d\n",
-                *y, *x, *win->alines[*y]->firstchp,
-                *win->alines[*y]->lastchp);
+           "ADDBYTES: 1: y = %d, x = %d, firstch = %d, lastch = %d\n",
+           *y, *x, *win->alines[*y]->firstchp, *win->alines[*y]->lastchp);
 
        attributes = (win->wattr | attr) & (__ATTRIBUTES & ~__COLOR);
        if (attr & __COLOR)
@@ -293,9 +291,9 @@
        if (newx > *(*lp)->lastchp)
                *(*lp)->lastchp = newx;
        __CTRACE(__CTRACE_INPUT, "ADDBYTES: change gives f/l: %d/%d [%d/%d]\n",
-                *(*lp)->firstchp, *(*lp)->lastchp,
-                *(*lp)->firstchp - win->ch_off,
-                *(*lp)->lastchp - win->ch_off);
+           *(*lp)->firstchp, *(*lp)->lastchp,
+           *(*lp)->firstchp - win->ch_off,
+           *(*lp)->lastchp - win->ch_off);
        if (win->bch != ' ' && c == ' ')
                (*lp)->line[*x].ch = win->bch;
        else
@@ -313,9 +311,8 @@
                (*x)++;
 
        __CTRACE(__CTRACE_INPUT,
-                "ADDBYTES: 2: y = %d, x = %d, firstch = %d, lastch = %d\n",
-                *y, *x, *win->alines[*y]->firstchp,
-                *win->alines[*y]->lastchp);
+           "ADDBYTES: 2: y = %d, x = %d, firstch = %d, lastch = %d\n",
+           *y, *x, *win->alines[*y]->firstchp, *win->alines[*y]->lastchp);
        __sync(win);
        return OK;
 }
@@ -392,8 +389,8 @@
        /* check for non-spacing character */
        if (!wcwidth(wch->vals[0])) {
                __CTRACE(__CTRACE_INPUT,
-                        "_cursesi_addwchar: char '%c' is non-spacing\n",
-                        wch->vals[0]);
+                   "_cursesi_addwchar: char '%c' is non-spacing\n",
+                   wch->vals[0]);
                cw = WCOL(*lp);
                if (cw < 0) {
                        lp += cw;
@@ -436,8 +433,8 @@
        } else {
                for (sx = *x - 1; sx >= max(*x + cw, 0); sx--) {
                        __CTRACE(__CTRACE_INPUT,
-                                "_cursesi_addwchar: clear current char (%d,%d)\n",
-                                *y, sx);
+                           "_cursesi_addwchar: clear current char (%d,%d)\n",
+                           *y, sx);
                        tp = &win->alines[*y]->line[sx];
                        tp->ch = (wchar_t) btowc((int) win->bch);
                        if (_cursesi_copy_nsp(win->bnsp, tp) == ERR)
@@ -460,8 +457,7 @@
 
        if (cw > win->maxx - *x) {
                __CTRACE(__CTRACE_INPUT,
-                        "_cursesi_addwchar: clear EOL (%d,%d)\n",
-                        *y, *x);
+                   "_cursesi_addwchar: clear EOL (%d,%d)\n", *y, *x);
                if (*y == win->scr_b) {
                        if (!(win->flags & __SCROLLOK))
                                return ERR;
@@ -493,8 +489,8 @@
 
        /* add spacing character */
        __CTRACE(__CTRACE_INPUT,
-                "_cursesi_addwchar: add character (%d,%d) 0x%x\n",
-                *y, *x, wch->vals[0]);
+           "_cursesi_addwchar: add character (%d,%d) 0x%x\n",
+           *y, *x, wch->vals[0]);
        (*lnp)->flags |= __ISDIRTY;
        newx = *x + win->ch_off;
        if (newx < *(*lnp)->firstchp)
@@ -520,8 +516,8 @@
        SET_WCOL(*lp, cw);
 
        __CTRACE(__CTRACE_INPUT,
-                "_cursesi_addwchar: add spacing char 0x%x, attr 0x%x\n",
-                lp->ch, lp->attr);
+           "_cursesi_addwchar: add spacing char 0x%x, attr 0x%x\n",
+           lp->ch, lp->attr);
 
        if (wch->elements > 1) {
                for (i = 1; i < wch->elements; i++) {
@@ -531,15 +527,18 @@
                        np->ch = wch->vals[i];
                        np->next = lp->nsp;
                        __CTRACE(__CTRACE_INPUT,
-                           "_cursesi_addwchar: add non-spacing char 0x%x\n", np->ch);
+                           "_cursesi_addwchar: add non-spacing char 0x%x\n",
+                           np->ch);
                        lp->nsp = np;
                }
        }
-       __CTRACE(__CTRACE_INPUT, "_cursesi_addwchar: non-spacing list header: %p\n",
-           lp->nsp);
-       __CTRACE(__CTRACE_INPUT, "_cursesi_addwchar: add rest columns (%d:%d)\n",
-               sx + 1, sx + cw - 1);
-       __CTRACE(__CTRACE_INPUT, "_cursesi_addwchar: *x = %d, win->maxx = %d\n", *x, win->maxx);
+       __CTRACE(__CTRACE_INPUT,
+           "_cursesi_addwchar: non-spacing list header: %p\n", lp->nsp);
+       __CTRACE(__CTRACE_INPUT,
+           "_cursesi_addwchar: add rest columns (%d:%d)\n",
+           sx + 1, sx + cw - 1);
+       __CTRACE(__CTRACE_INPUT, "_cursesi_addwchar: *x = %d, win->maxx = %d\n",
+           *x, win->maxx);
        for (tp = lp + 1, *x = sx + 1; *x - sx <= cw - 1; tp++, (*x)++) {
                if (tp->nsp) {
                        __cursesi_free_nsp(tp->nsp);
@@ -552,12 +551,14 @@
        }
 
        if (*x == win->maxx) {
-       __CTRACE(__CTRACE_INPUT, "_cursesi_addwchar: do line wrap\n");
+               __CTRACE(__CTRACE_INPUT, "_cursesi_addwchar: do line wrap\n");
                if (*y == win->scr_b) {
-       __CTRACE(__CTRACE_INPUT, "_cursesi_addwchar: at bottom of screen\n");
+                       __CTRACE(__CTRACE_INPUT,
+                           "_cursesi_addwchar: at bottom of screen\n");
                        if (!(win->flags & __SCROLLOK))
                                return ERR;
-       __CTRACE(__CTRACE_INPUT, "_cursesi_addwchar: do a scroll\n");
+                       __CTRACE(__CTRACE_INPUT,
+                           "_cursesi_addwchar: do a scroll\n");
                        scroll(win);
                }
                newx = win->maxx - 1 + win->ch_off;
@@ -595,8 +596,11 @@
                }
        }
 
-       __CTRACE(__CTRACE_INPUT, "_cursesi_addwchar: %d : 0x%x\n", lp->ch, lp->attr);
-       __CTRACE(__CTRACE_INPUT, "_cursesi_addwchar: *x = %d, *y = %d, win->maxx = %d\n", *x, *y, win->maxx);
+       __CTRACE(__CTRACE_INPUT, "_cursesi_addwchar: %d : 0x%x\n",
+           lp->ch, lp->attr);
+       __CTRACE(__CTRACE_INPUT,
+           "_cursesi_addwchar: *x = %d, *y = %d, win->maxx = %d\n",
+           *x, *y, win->maxx);
        __sync(win);
        return OK;
 #endif
diff -r 790b315e0140 -r d45820c7a240 lib/libcurses/addch.c
--- a/lib/libcurses/addch.c     Mon Sep 06 07:08:25 2021 +0000
+++ b/lib/libcurses/addch.c     Mon Sep 06 07:45:48 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: addch.c,v 1.22 2021/09/06 07:03:49 rin Exp $   */
+/*     $NetBSD: addch.c,v 1.23 2021/09/06 07:45:48 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.22 2021/09/06 07:03:49 rin Exp $");
+__RCSID("$NetBSD: addch.c,v 1.23 2021/09/06 07:45:48 rin Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -94,8 +94,8 @@
 
        __cursesi_chtype_to_cchar(ch, &cc);
        __CTRACE(__CTRACE_INPUT,
-                "addch: %d : 0x%x (adding char as wide char)\n",
-                cc.vals[0], cc.attributes);
+           "addch: %d : 0x%x (adding char as wide char)\n",
+           cc.vals[0], cc.attributes);
 
        return wadd_wch(win, &cc);
 }
diff -r 790b315e0140 -r d45820c7a240 lib/libcurses/addnstr.c
--- a/lib/libcurses/addnstr.c   Mon Sep 06 07:08:25 2021 +0000
+++ b/lib/libcurses/addnstr.c   Mon Sep 06 07:45:48 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: addnstr.c,v 1.18 2021/09/06 07:03:49 rin Exp $ */
+/*     $NetBSD: addnstr.c,v 1.19 2021/09/06 07:45:48 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.18 2021/09/06 07:03:49 rin Exp $");
+__RCSID("$NetBSD: addnstr.c,v 1.19 2021/09/06 07:45:48 rin Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -135,8 +135,7 @@
        size_t  len;
        const char *p;
 
-               __CTRACE(__CTRACE_INPUT, "ADDNSTR: win %p, length %d\n",
-                        win, n);
+       __CTRACE(__CTRACE_INPUT, "ADDNSTR: win %p, length %d\n", win, n);
        /*
         * behavior changed from traditional BSD curses, for better XCURSES
         * conformance.
diff -r 790b315e0140 -r d45820c7a240 lib/libcurses/addwstr.c
--- a/lib/libcurses/addwstr.c   Mon Sep 06 07:08:25 2021 +0000
+++ b/lib/libcurses/addwstr.c   Mon Sep 06 07:45:48 2021 +0000
@@ -1,4 +1,4 @@
-/*   $NetBSD: addwstr.c,v 1.7 2021/09/06 07:03:49 rin Exp $ */
+/*   $NetBSD: addwstr.c,v 1.8 2021/09/06 07:45:48 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.7 2021/09/06 07:03:49 rin Exp $");
+__RCSID("$NetBSD: addwstr.c,v 1.8 2021/09/06 07:45:48 rin Exp $");
 #endif                                           /* not lint */
 
 #include <string.h>
@@ -146,7 +146,7 @@
                for (p = s, len = 0; n-- && *p++; ++len);
        else
                len = wcslen(s);
-       __CTRACE(__CTRACE_INPUT, "waddnwstr: string len=%ld\n", (long) len);
+       __CTRACE(__CTRACE_INPUT, "waddnwstr: string len=%zu\n", len);
 
        p = s;
        while (len) {
@@ -157,7 +157,7 @@
                if (wadd_wch( win, &cc ) == ERR)



Home | Main Index | Thread Index | Old Index