bcopy -> memmove

This commit is contained in:
wiz 2001-07-22 14:57:50 +00:00
parent 3ed1e031ab
commit fda9343e10
2 changed files with 19 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pccons.c,v 1.7 2001/06/15 15:53:27 nonaka Exp $ */
/* $NetBSD: pccons.c,v 1.8 2001/07/22 14:57:50 wiz Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -1290,9 +1290,9 @@ sput(cp, n)
else if (cx > nrow)
cx = nrow;
if (cx < nrow)
bcopy(crtAt + vs.ncol * cx,
crtAt, vs.ncol * (nrow -
cx) * CHR);
memmove(crtAt, crtAt +
vs.ncol * cx, vs.ncol *
(nrow - cx) * CHR);
fillw((vs.at << 8) | ' ',
crtAt + vs.ncol * (nrow - cx),
vs.ncol * cx);
@ -1306,9 +1306,9 @@ sput(cp, n)
else if (cx > vs.nrow)
cx = vs.nrow;
if (cx < vs.nrow)
bcopy(Crtat + vs.ncol * cx,
Crtat, vs.ncol * (vs.nrow -
cx) * CHR);
memmove(Crtat, Crtat +
vs.ncol * cx, vs.ncol *
(vs.nrow - cx) * CHR);
fillw((vs.at << 8) | ' ',
Crtat + vs.ncol * (vs.nrow - cx),
vs.ncol * cx);
@ -1328,10 +1328,9 @@ sput(cp, n)
else if (cx > nrow)
cx = nrow;
if (cx < nrow)
bcopy(crtAt,
crtAt + vs.ncol * cx,
vs.ncol * (nrow - cx) *
CHR);
memmove(crtAt + vs.ncol * cx,
crtAt, vs.ncol * (nrow -
cx) * CHR);
fillw((vs.at << 8) | ' ',
crtAt, vs.ncol * cx);
vs.state = 0;
@ -1344,10 +1343,9 @@ sput(cp, n)
else if (cx > vs.nrow)
cx = vs.nrow;
if (cx < vs.nrow)
bcopy(Crtat,
Crtat + vs.ncol * cx,
vs.ncol * (vs.nrow - cx) *
CHR);
memmove(Crtat + vs.ncol * cx,
Crtat, vs.ncol * (vs.nrow -
cx) * CHR);
fillw((vs.at << 8) | ' ',
Crtat, vs.ncol * cx);
#if 0
@ -1412,7 +1410,7 @@ sput(cp, n)
scroll = 0;
/* scroll check */
if (crtat >= Crtat + vs.nchr) {
bcopy(Crtat + vs.ncol, Crtat,
memmove(Crtat, Crtat + vs.ncol,
(vs.nchr - vs.ncol) * CHR);
fillw((vs.at << 8) | ' ',
Crtat + vs.nchr - vs.ncol,

View File

@ -1,4 +1,4 @@
/* $NetBSD: vga.c,v 1.1 2000/02/29 15:21:51 nonaka Exp $ */
/* $NetBSD: vga.c,v 1.2 2001/07/22 14:57:51 wiz Exp $ */
/*-
* Copyright (C) 1995-1997 Gary Thomas (gdt@linuxppc.org)
@ -285,16 +285,17 @@ vga_putc(int c)
case 'L': /* Insert line */
i = (d->cp - base) / COL;
/* avoid deficiency of bcopy implementation */
/* XXX: comment and hack relevant? */
pp = base + COL * (ROW-2);
for (j = ROW - 1 - i; j--; pp -= COL)
bcopy(pp, pp + COL, COL * CHR);
memmove(pp + COL, pp, COL * CHR);
fillw(d->color|(' '<<8), base + i * COL, COL);
break;
case 'M': /* Delete line */
i = (d->cp - base) / COL;
pp = base + i * COL;
bcopy(pp + COL, pp, (ROW-1 - i)*COL*CHR);
memmove(pp, pp + COL, (ROW-1 - i)*COL*CHR);
fillw(d->color|(' '<<8), base + COL * (ROW - 1), COL);
break;
@ -387,7 +388,7 @@ vga_putc(int c)
break;
}
if (d->cp >= base + (COL * ROW)) { /* scroll check */
bcopy(base + COL, base, COL * (ROW - 1) * CHR);
memmove(base, base + COL, COL * (ROW - 1) * CHR);
fillw(d->color|(' '<<8), base + COL * (ROW - 1), COL);
d->cp -= COL;
}