summaryrefslogtreecommitdiff
path: root/usr/src/lib/libcurses/screen
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2017-02-15 19:54:37 +0200
committerRobert Mustacchi <rm@joyent.com>2017-07-30 15:21:03 +0000
commite07d85f87c3920e032adb855fdc500e4616c7718 (patch)
treeed27edeebfebae128de2824f740a6e24939acda5 /usr/src/lib/libcurses/screen
parentf1cdbd3731f01314c1d46f05280ad63f1770fdc6 (diff)
downloadillumos-joyent-e07d85f87c3920e032adb855fdc500e4616c7718.tar.gz
7875 libcurses: multiple misleading-indentation errors
Reviewed by: Marcel Telka <marcel@telka.sk> Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/lib/libcurses/screen')
-rw-r--r--usr/src/lib/libcurses/screen/termcap.ed25
-rw-r--r--usr/src/lib/libcurses/screen/tparm.c84
-rw-r--r--usr/src/lib/libcurses/screen/waddch.c27
-rw-r--r--usr/src/lib/libcurses/screen/wnoutref.c22
-rw-r--r--usr/src/lib/libcurses/screen/wrefresh.c83
5 files changed, 123 insertions, 118 deletions
diff --git a/usr/src/lib/libcurses/screen/termcap.ed b/usr/src/lib/libcurses/screen/termcap.ed
index da57358091..6375be8dfb 100644
--- a/usr/src/lib/libcurses/screen/termcap.ed
+++ b/usr/src/lib/libcurses/screen/termcap.ed
@@ -16,8 +16,6 @@ H
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Simulation of termcap using terminfo.
* This file is created from termcap.ed. DO NOT EDIT ME!
@@ -60,17 +58,18 @@ _stripdelays(char *inbuf, char *outbuf, int size)
if (inbuf == NULL)
return (0);
- else
- while (size && *inbuf)
- if (*inbuf == '$' && *(inbuf+1) == '<')
- /* LINTED */
- while (*inbuf && *inbuf++ != '>');
- else {
- size--;
- *outbuf++ = *inbuf++;
- *outbuf = 0;
- }
- return (saveoutbuf);
+
+ while (size && *inbuf) {
+ if (*inbuf == '$' && *(inbuf+1) == '<') {
+ /* LINTED */
+ while (*inbuf && *inbuf++ != '>');
+ } else {
+ size--;
+ *outbuf++ = *inbuf++;
+ *outbuf = 0;
+ }
+ }
+ return (saveoutbuf);
}
/* generated by sort on caps */
diff --git a/usr/src/lib/libcurses/screen/tparm.c b/usr/src/lib/libcurses/screen/tparm.c
index 99d03d5326..49f2d3852d 100644
--- a/usr/src/lib/libcurses/screen/tparm.c
+++ b/usr/src/lib/libcurses/screen/tparm.c
@@ -135,7 +135,8 @@ pop(STACK *st)
return (st->stack[st->top--]);
}
-/* The following routine was added to make lint shut up about converting from
+/*
+ * The following routine was added to make lint shut up about converting from
* a long to a char *. It is identical to the pop routine, except for the
* cast on the return statement.
*/
@@ -165,16 +166,16 @@ free_stack(STACK *st)
}
-char *
+char *
tparm_p0(char *instring)
{
long p[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
return (tparm(instring, p[0], p[1], p[2], p[3], p[4], p[5], p[6],
- p[7], p[8]));
+ p[7], p[8]));
}
-char *
+char *
tparm_p1(char *instring, long l1)
{
long p[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
@@ -182,10 +183,10 @@ tparm_p1(char *instring, long l1)
p[0] = l1;
return (tparm(instring, p[0], p[1], p[2], p[3], p[4], p[5], p[6],
- p[7], p[8]));
+ p[7], p[8]));
}
-char *
+char *
tparm_p2(char *instring, long l1, long l2)
{
long p[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
@@ -194,10 +195,10 @@ tparm_p2(char *instring, long l1, long l2)
p[1] = l2;
return (tparm(instring, p[0], p[1], p[2], p[3], p[4], p[5], p[6],
- p[7], p[8]));
+ p[7], p[8]));
}
-char *
+char *
tparm_p3(char *instring, long l1, long l2, long l3)
{
long p[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
@@ -207,10 +208,10 @@ tparm_p3(char *instring, long l1, long l2, long l3)
p[2] = l3;
return (tparm(instring, p[0], p[1], p[2], p[3], p[4], p[5], p[6],
- p[7], p[8]));
+ p[7], p[8]));
}
-char *
+char *
tparm_p4(char *instring, long l1, long l2, long l3, long l4)
{
long p[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
@@ -221,12 +222,12 @@ tparm_p4(char *instring, long l1, long l2, long l3, long l4)
p[3] = l4;
return (tparm(instring, p[0], p[1], p[2], p[3], p[4], p[5], p[6],
- p[7], p[8]));
+ p[7], p[8]));
}
-char *
+char *
tparm_p7(char *instring, long l1, long l2, long l3, long l4, long l5, long l6,
- long l7)
+ long l7)
{
long p[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
@@ -239,13 +240,13 @@ tparm_p7(char *instring, long l1, long l2, long l3, long l4, long l5, long l6,
p[6] = l7;
return (tparm(instring, p[0], p[1], p[2], p[3], p[4], p[5], p[6],
- p[7], p[8]));
+ p[7], p[8]));
}
/* VARARGS */
-char *
+char *
tparm(char *instring, long fp1, long fp2, long p3, long p4,
- long p5, long p6, long p7, long p8, long p9)
+ long p5, long p6, long p7, long p8, long p9)
{
static char result[512];
static char added[100];
@@ -257,7 +258,7 @@ tparm(char *instring, long fp1, long fp2, long p3, long p4,
long op;
long op2;
int sign;
- int onrow = 0;
+ volatile int onrow = 0;
volatile long p1 = fp1, p2 = fp2; /* copy in case < 2 actual parms */
char *xp;
char formatbuffer[100];
@@ -386,8 +387,7 @@ tparm(char *instring, long fp1, long fp2, long p3, long p4,
* now.
*/
if (c == 's')
- (void) sprintf(outp, formatbuffer,
- (char *) op);
+ (void) sprintf(outp, formatbuffer, (char *)op);
else
(void) sprintf(outp, formatbuffer, op);
/*
@@ -398,7 +398,7 @@ tparm(char *instring, long fp1, long fp2, long p3, long p4,
* BSD emulations are particularly confusing.
*/
while (*outp)
- outp++;
+ outp++;
(void) pop(&stk);
continue;
@@ -425,24 +425,24 @@ tparm(char *instring, long fp1, long fp2, long p3, long p4,
*/
switch (op) {
/*
- * Null. Problem is that our
- * output is, by convention, null terminated.
- */
+ * Null. Problem is that our
+ * output is, by convention, null terminated.
+ */
case 0:
op = 0200; /* Parity should */
/* be ignored. */
break;
/*
- * Control D. Problem is that certain very
- * ancient hardware hangs up on this, so the
- * current(!) UNIX tty driver doesn't xmit
- * control D's.
- */
+ * Control D. Problem is that certain very
+ * ancient hardware hangs up on this, so the
+ * current(!) UNIX tty driver doesn't xmit
+ * control D's.
+ */
case _CHCTRL('d'):
/*
- * Newline. Problem is that UNIX will expand
- * this to CRLF.
- */
+ * Newline. Problem is that UNIX will expand
+ * this to CRLF.
+ */
case '\n':
xp = (onrow ? cursor_down :
cursor_right);
@@ -486,10 +486,10 @@ tparm(char *instring, long fp1, long fp2, long p3, long p4,
break;
/*
- * %i: shorthand for increment first two parms.
- * Useful for terminals that start numbering from
- * one instead of zero(like ANSI terminals).
- */
+ * %i: shorthand for increment first two parms.
+ * Useful for terminals that start numbering from
+ * one instead of zero(like ANSI terminals).
+ */
case 'i':
p1++;
p2++;
@@ -545,8 +545,8 @@ tparm(char *instring, long fp1, long fp2, long p3, long p4,
} else {
if (*cp >= 'A' && *cp <= 'Z') {
regs[*cp++ - 'A'] =
- /* LINTED */
- (short) pop(&stk);
+ /* LINTED */
+ (short)pop(&stk);
}
#ifdef DEBUG
else if (outf) {
@@ -692,17 +692,17 @@ tparm(char *instring, long fp1, long fp2, long p3, long p4,
/* Sorry, no unary minus, because minus is binary. */
/*
- * If-then-else. Implemented by a low level hack of
- * skipping forward until the match is found, counting
- * nested if-then-elses.
- */
+ * If-then-else. Implemented by a low level hack of
+ * skipping forward until the match is found, counting
+ * nested if-then-elses.
+ */
case '?': /* IF - just a marker */
break;
case 't': /* THEN - branch if false */
if (!pop(&stk))
cp = _branchto(cp, 'e');
- break;
+ break;
case 'e': /* ELSE - branch to ENDIF */
cp = _branchto(cp, ';');
diff --git a/usr/src/lib/libcurses/screen/waddch.c b/usr/src/lib/libcurses/screen/waddch.c
index 31c7627981..91cfa65c42 100644
--- a/usr/src/lib/libcurses/screen/waddch.c
+++ b/usr/src/lib/libcurses/screen/waddch.c
@@ -37,8 +37,6 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*LINTLIBRARY*/
#include <sys/types.h>
@@ -100,12 +98,13 @@ move_to_begin_line:
chtype space = ' ' | rawattrs;
if ((newx = x + (TABSIZE -
- (x % TABSIZE))) > win->_maxx)
+ (x % TABSIZE))) > win->_maxx) {
newx = win->_maxx;
- for (; x < newx; x++)
- if (waddch(win,
- space) == ERR)
- goto next;
+ }
+ for (; x < newx; x++) {
+ if (waddch(win, space) == ERR)
+ goto next;
+ }
} else {
if ((waddch(win, (chtype)
'^'|rawattrs) == ERR) ||
@@ -173,18 +172,22 @@ new_line:
}
#endif /* DEBUG */
break;
- } else
+ } else {
savimmed = 1;
- } else
+ }
+ } else {
y++;
- x = 0;
- } else
+ }
+ x = 0;
+ } else {
savimmed += 2;
+ }
#ifdef FULLDEBUG
- if (outf)
+ if (outf) {
fprintf(outf, "ADDCH: 2: y = %d, x = %d, "
"firstch = %d, lastch = %d\n", y, x,
win->_firstch[y], win->_lastch[y]);
+ }
#endif /* FULLDEBUG */
break;
}
diff --git a/usr/src/lib/libcurses/screen/wnoutref.c b/usr/src/lib/libcurses/screen/wnoutref.c
index 3f9dd35054..8f1e7050c8 100644
--- a/usr/src/lib/libcurses/screen/wnoutref.c
+++ b/usr/src/lib/libcurses/screen/wnoutref.c
@@ -37,8 +37,6 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*LINTLIBRARY*/
#include <string.h>
@@ -53,8 +51,8 @@ wnoutrefresh(WINDOW *win)
short *bch, *ech, *sbch, *sech;
chtype **wcp, **scp, *wc, *sc;
int *hash;
- short y, x, xorg, yorg, scrli, scrco,
- boty, sminy, smaxy, minx, maxx, lo, hi;
+ short y, x, xorg, yorg, scrli, scrco, boty, sminy, smaxy, minx,
+ maxx, lo, hi;
bool doall;
if (win->_parent)
@@ -138,13 +136,13 @@ wnoutrefresh(WINDOW *win)
for (x = lo - 1; x >= minx; --x)
if (!ISCBIT(wc[x]))
break;
- if (x < minx) {
- for (x = lo+1; x <= maxx; ++x)
- if (!ISCBIT(wc[x]))
- break;
- if (x > maxx)
- goto nextline;
- }
+ if (x < minx) {
+ for (x = lo + 1; x <= maxx; ++x)
+ if (!ISCBIT(wc[x]))
+ break;
+ if (x > maxx)
+ goto nextline;
+ }
lo = x;
}
if (ISMBIT(wc[hi])) {
@@ -188,7 +186,7 @@ wnoutrefresh(WINDOW *win)
/* update the image */
wc = *wcp + lo;
sc = *scp + lo + xorg;
- (void) memcpy((char *) sc, (char *) wc, (size_t)
+ (void) memcpy((char *)sc, (char *)wc, (size_t)
(((hi - lo) + 1) * sizeof (chtype)));
/* the hash value of the line */
diff --git a/usr/src/lib/libcurses/screen/wrefresh.c b/usr/src/lib/libcurses/screen/wrefresh.c
index 41a589fbe8..7b704c6d29 100644
--- a/usr/src/lib/libcurses/screen/wrefresh.c
+++ b/usr/src/lib/libcurses/screen/wrefresh.c
@@ -37,8 +37,6 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*LINTLIBRARY*/
#include <sys/types.h>
@@ -146,14 +144,14 @@ wrefresh(WINDOW *win)
* If there is no exit_attribute mode, then vidupdate
* could only possibly turn off one of the below three
* so that's all we ask it turn off.
- */
+ */
vidupdate(A_NORMAL, (A_ALTCHARSET | A_STANDOUT |
A_UNDERLINE), _outch);
SP->fl_endwin = FALSE;
#ifdef _VR2_COMPAT_CODE
- _endwin = (char) FALSE;
+ _endwin = (char)FALSE;
#endif /* _VR2_COMPAT_CODE */
}
@@ -218,7 +216,7 @@ wrefresh(WINDOW *win)
/* there is type-ahead */
if (!curwin && (_INPUTPENDING = _chkinput()) == TRUE) {
/* LINTED */
- _VIRTTOP = (short) wy;
+ _VIRTTOP = (short)wy;
goto done;
}
@@ -263,9 +261,9 @@ next:
if (wy != cy || wx != cx) {
(void) mvcur(cy, cx, wy, wx);
/* LINTED */
- cy = (short) wy;
+ cy = (short)wy;
/* LINTED */
- cx = (short) wx;
+ cx = (short)wx;
}
/* reset the flags */
@@ -298,8 +296,7 @@ _shove(int wy)
/* allocate space for shifted line */
if (length < scrco) {
- if (line)
- free((char *) line);
+ free(line);
line = (chtype *) malloc(scrco * sizeof (chtype));
length = line ? scrco : 0;
}
@@ -371,7 +368,7 @@ _updateln(int wy)
{
chtype *wcp, *scp, *wp, *sp, wc, sc;
int wx, lastx, x, mtch, idch, blnkx, idcx, video_attrx,
- color_attrx, maxi, endns, begns, wx_sav, multi_col;
+ color_attrx, maxi, endns, begns, wx_sav, multi_col;
bool redraw, changed, didcolor, didvideo;
redraw = (_virtscr->_firstch[wy] == _REDRAW);
@@ -565,12 +562,12 @@ _updateln(int wy)
_PUTS(clr_bol, 1);
/* LINTED */
- cy = (short) wy;
+ cy = (short)wy;
/* LINTED */
- cx = (short) x;
+ cx = (short)x;
mtch = x - wx;
- (void) memcpy((char *) scp, (char *) wcp,
+ (void) memcpy(scp, wcp,
(mtch * sizeof (chtype)));
wcp += mtch;
scp += mtch;
@@ -585,9 +582,9 @@ _updateln(int wy)
if (cy != wy || cx != wx)
(void) mvcur(cy, cx, wy, wx);
/* LINTED */
- cy = (short) wy;
+ cy = (short)wy;
/* LINTED */
- cx = (short) wx;
+ cx = (short)wx;
/* update screen image */
while (wx < lastx) {
@@ -609,9 +606,9 @@ _updateln(int wy)
_PUTS(clr_eol, 1);
/* LINTED */
- curscr->_curx = (short) wx;
- /* LINTED */
- curscr->_cury = (short) wy;
+ curscr->_curx = (short)wx;
+ /* LINTED */
+ curscr->_cury = (short)wy;
(void) wclrtoeol(curscr);
if (marks && wx > 0 && _ATTR(*(scp - 1)) !=
@@ -643,15 +640,21 @@ _updateln(int wy)
/* color and video attributes */
if (_ATTR(wc) != curscr->_attrs) {
- bool color_change = FALSE;
- bool video_change = FALSE;
-
- if (marks)
- if (_VIDEO(wc) != _VIDEO(curscr->_attrs))
- video_change = TRUE;
- if (color_marks)
- if (_COLOR(wc) != _COLOR(curscr->_attrs))
- color_change = TRUE;
+ bool color_change = FALSE;
+ bool video_change = FALSE;
+
+ if (marks) {
+ if (_VIDEO(wc) !=
+ _VIDEO(curscr->_attrs)) {
+ video_change = TRUE;
+ }
+ }
+ if (color_marks) {
+ if (_COLOR(wc) !=
+ _COLOR(curscr->_attrs)) {
+ color_change = TRUE;
+ }
+ }
/* the following may occurs when, for */
/* example the application */
@@ -694,8 +697,8 @@ _updateln(int wy)
color_attrx);
/*
* sc = _COLOR(curscr->_y[wy][color_attrx]);
- *_VIDS(sc, (~sc & A_COLOR));
- */
+ * _VIDS(sc, (~sc & A_COLOR));
+ */
_VIDS(_COLOR(_virtscr->_y[wy]
[color_attrx]),
_COLOR(_virtscr->_y[wy]
@@ -762,7 +765,7 @@ done:
if (_DARKCHAR(*scp))
break;
/* LINTED */
- _BEGNS[wy] = (short) wx;
+ _BEGNS[wy] = (short)wx;
if (wx == scrco)
_ENDNS[wy] = -1;
else {
@@ -772,7 +775,7 @@ done:
if (_DARKCHAR(*scp))
break;
/* LINTED */
- _ENDNS[wy] = (short) wx;
+ _ENDNS[wy] = (short)wx;
}
/* update the hash structure */
@@ -925,7 +928,7 @@ do_insert_char:
/* update the screen image */
for (x1 = length - 1, x2 = length - idch - 1; x2 >= 0; --x1, --x2)
scp[x1] = scp[x2];
- (void) memcpy((char *) scp, (char *) wcp, idch * sizeof (chtype));
+ (void) memcpy(scp, wcp, idch * sizeof (chtype));
*id = idch;
return (match + idch);
@@ -1096,7 +1099,7 @@ _rmargin(int wx)
/* update screen image */
/* LINTED */
- cx = (short) wx;
+ cx = (short)wx;
curscr->_y[cy][wx] = wcp[wx];
for (x = wx + 1; x < scrco; ++x) {
(void) _outwch(wcp[x]);
@@ -1205,13 +1208,13 @@ _useceod(int topy, int boty)
_PUTS(clear_screen, scrli);
cy = 0; cx = 0;
(void) werase(curscr);
- } else
+ } else {
/* use clear-to-end-of-display or delete lines */
if (clr_eos || (parm_delete_line && !memory_below)) {
(void) mvcur(cy, cx, topy, 0);
/* LINTED */
- cy = (short) topy;
+ cy = (short)topy;
cx = 0;
/* SS: colors */
if (back_color_erase)
@@ -1221,15 +1224,17 @@ _useceod(int topy, int boty)
/* update curscr */
/* LINTED */
- curscr->_cury = (short) topy;
+ curscr->_cury = (short)topy;
curscr->_curx = 0;
(void) wclrtobot(curscr);
- } else
+ } else {
/* no hardware support */
return;
+ }
+ }
- /* correct the update structure */
- (void) wtouchln(_virtscr, topy, scrli, FALSE);
+ /* correct the update structure */
+ (void) wtouchln(_virtscr, topy, scrli, FALSE);
}