This commit is contained in:
roy 2017-01-06 14:25:41 +00:00
parent 9180469668
commit 84fe414e1f

View File

@ -1,4 +1,4 @@
/* $NetBSD: addbytes.c,v 1.46 2017/01/06 14:06:45 roy Exp $ */
/* $NetBSD: addbytes.c,v 1.47 2017/01/06 14:25:41 roy 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.46 2017/01/06 14:06:45 roy Exp $");
__RCSID("$NetBSD: addbytes.c,v 1.47 2017/01/06 14:25:41 roy Exp $");
#endif
#endif /* not lint */
@ -179,7 +179,7 @@ _cursesi_waddbytes(WINDOW *win, const char *bytes, int count, attr_t attr,
#ifdef DEBUG
__CTRACE(__CTRACE_INPUT,
"ADDBYTES WIDE(0x%x [%s], %x) at (%d, %d), ate %d bytes\n",
(unsigned) wc, unctrl((unsigned) wc), attr, y, x, n);
(unsigned)wc, unctrl((unsigned)wc), attr, y, x, n);
#endif
cc.vals[0] = wc;
cc.elements = 1;
@ -225,11 +225,11 @@ _cursesi_addbyte(WINDOW *win, __LINE **lp, int *y, int *x, int c,
newx = tabsize - (*x % tabsize);
for (i = 0; i < newx; i++) {
if (waddbytes(win, blank, 1) == ERR)
return (ERR);
return ERR;
(*x)++;
}
PSYNCH_IN;
return (OK);
return OK;
case '\n':
PSYNCH_OUT;
@ -241,13 +241,13 @@ _cursesi_addbyte(WINDOW *win, __LINE **lp, int *y, int *x, int c,
case '\r':
*x = 0;
win->curx = *x;
return (OK);
return OK;
case '\b':
if (--(*x) < 0)
*x = 0;
win->curx = *x;
return (OK);
return OK;
}
}
@ -274,7 +274,7 @@ _cursesi_addbyte(WINDOW *win, __LINE **lp, int *y, int *x, int c,
}
*lp = win->alines[*y];
if (c == '\n')
return (OK);
return OK;
}
#ifdef DEBUG
@ -334,7 +334,7 @@ _cursesi_addbyte(WINDOW *win, __LINE **lp, int *y, int *x, int c,
*win->alines[*y]->lastchp);
#endif
__sync(win);
return (OK);
return OK;
}
/*
@ -347,7 +347,7 @@ _cursesi_addwchar(WINDOW *win, __LINE **lnp, int *y, int *x,
const cchar_t *wch, int char_interp)
{
#ifndef HAVE_WCHAR
return (ERR);
return ERR;
#else
int sx = 0, ex = 0, cw = 0, i = 0, newx = 0, tabsize;
__LDATA *lp = &win->alines[*y]->line[*x], *tp = NULL;
@ -593,9 +593,9 @@ _cursesi_addwchar(WINDOW *win, __LINE **lnp, int *y, int *x,
while (ex < win->maxx && WCOL(*tp) < 0) {
#ifdef DEBUG
__CTRACE(__CTRACE_INPUT,
"_cursesi_addwchar: clear "
"remaining of current char (%d,%d)nn",
*y, ex);
"_cursesi_addwchar: clear "
"remaining of current char (%d,%d)nn",
*y, ex);
#endif /* DEBUG */
tp->ch = (wchar_t) btowc((int) win->bch);
if (_cursesi_copy_nsp(win->bnsp, tp) == ERR)