Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/alpha/stand/common no point in passing &ret to test...
details: https://anonhg.NetBSD.org/src/rev/ad2d6f1089b5
branches: trunk
changeset: 467923:ad2d6f1089b5
user: cgd <cgd%NetBSD.org@localhost>
date: Wed Mar 31 03:22:57 1999 +0000
description:
no point in passing &ret to test_getchar(); nobody cares! also, no
point in doing the check-for-abort functionality twice in putchar()
(once with a call to test_getchar(), once open coded).
diffstat:
sys/arch/alpha/stand/common/prom.c | 25 ++++++++++---------------
1 files changed, 10 insertions(+), 15 deletions(-)
diffs (70 lines):
diff -r dbe8f5b102c0 -r ad2d6f1089b5 sys/arch/alpha/stand/common/prom.c
--- a/sys/arch/alpha/stand/common/prom.c Wed Mar 31 03:10:56 1999 +0000
+++ b/sys/arch/alpha/stand/common/prom.c Wed Mar 31 03:22:57 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: prom.c,v 1.6 1999/03/31 03:10:00 cgd Exp $ */
+/* $NetBSD: prom.c,v 1.7 1999/03/31 03:22:57 cgd Exp $ */
/*
* Mach Operating System
@@ -35,7 +35,7 @@
int console;
-static int test_getchar(prom_return_t *, int *);
+static int test_getchar(int *);
static void putonechar(int c);
void
@@ -58,23 +58,23 @@
}
static int
-test_getchar(xret, xc)
- prom_return_t *xret;
+test_getchar(xc)
int *xc;
{
- xret->bits = prom_dispatch(PROM_R_GETC, console);
- *xc = xret->u.retval;
- return xret->u.status == 0 || xret->u.status == 1;
+ prom_return_t ret;
+
+ ret.bits = prom_dispatch(PROM_R_GETC, console);
+ *xc = ret.u.retval;
+ return ret.u.status == 0 || ret.u.status == 1;
}
int
getchar()
{
int c;
- prom_return_t ret;
for (;;) {
- if (test_getchar(&ret, &c)) {
+ if (test_getchar(&c)) {
if (c == 3)
halt();
return c;
@@ -98,7 +98,6 @@
putchar(c)
int c;
{
- prom_return_t ret;
int typed_c;
if (c == '\r' || c == '\n') {
@@ -106,11 +105,7 @@
c = '\n';
}
putonechar(c);
- ret.bits = prom_dispatch(PROM_R_GETC, console);
- if (ret.u.status == 0 || ret.u.status == 1)
- if (ret.u.retval == 3)
- halt();
- if (test_getchar(&ret, &typed_c))
+ if (test_getchar(&typed_c))
if (typed_c == 3)
halt();
}
Home |
Main Index |
Thread Index |
Old Index