Constify, shadow resolution and some volatile casts

This commit is contained in:
jmc 2005-06-10 16:41:38 +00:00
parent e71965e518
commit af862ab038
3 changed files with 21 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: extintr.c,v 1.21 2004/03/13 07:05:54 jmc Exp $ */
/* $NetBSD: extintr.c,v 1.22 2005/06/10 16:41:38 jmc Exp $ */
/* $OpenBSD: isabus.c,v 1.1 1997/10/11 11:53:00 pefo Exp $ */
/*-
@ -74,7 +74,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.21 2004/03/13 07:05:54 jmc Exp $");
__KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.22 2005/06/10 16:41:38 jmc Exp $");
#include <sys/param.h>
#include <sys/malloc.h>
@ -217,14 +217,14 @@ out:
}
void
bebox_intr_mask(imen)
int imen;
bebox_intr_mask(in)
int in;
{
int i;
int mask = 0;
for (i = 0; i < BEBOX_INTR_SIZE; i++)
if (!(imen & (1 << (i + BEBOX_ISA_INTR))))
if (!(in & (1 << (i + BEBOX_ISA_INTR))))
mask |= bebox_intr_map[i];
*(unsigned int *)(bebox_mb_reg + CPU0_INT_MASK) = BEBOX_INTR_MASK;

View File

@ -1,4 +1,4 @@
/* $NetBSD: isaclock.c,v 1.10 2003/08/07 16:27:10 agc Exp $ */
/* $NetBSD: isaclock.c,v 1.11 2005/06/10 16:41:38 jmc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -121,7 +121,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: isaclock.c,v 1.10 2003/08/07 16:27:10 agc Exp $");
__KERNEL_RCSID(0, "$NetBSD: isaclock.c,v 1.11 2005/06/10 16:41:38 jmc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -293,7 +293,7 @@ inittodr(base)
{
mc_todregs rtclk;
time_t n;
int sec, min, hr, dom, mon, yr;
int sec, mn, hr, dom, mon, yr;
int i, days = 0;
int s;
@ -320,14 +320,14 @@ inittodr(base)
splx(s);
sec = hexdectodec(rtclk[MC_SEC]);
min = hexdectodec(rtclk[MC_MIN]);
mn = hexdectodec(rtclk[MC_MIN]);
hr = hexdectodec(rtclk[MC_HOUR]);
dom = hexdectodec(rtclk[MC_DOM]);
mon = hexdectodec(rtclk[MC_MONTH]);
yr = hexdectodec(rtclk[MC_YEAR]);
yr = (yr < 70) ? yr+100 : yr;
n = sec + 60 * min + 3600 * hr;
n = sec + 60 * mn + 3600 * hr;
n += (dom - 1) * 3600 * 24;
if (yeartoday(yr) == 366)

View File

@ -1,4 +1,4 @@
/* $NetBSD: pccons.c,v 1.33 2004/03/13 17:31:33 bjh21 Exp $ */
/* $NetBSD: pccons.c,v 1.34 2005/06/10 16:41:48 jmc Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pccons.c,v 1.33 2004/03/13 17:31:33 bjh21 Exp $");
__KERNEL_RCSID(0, "$NetBSD: pccons.c,v 1.34 2005/06/10 16:41:48 jmc Exp $");
#include "opt_ddb.h"
#include "opt_xserver.h"
@ -274,7 +274,7 @@ static unsigned int addr_6845 = MONO_BASE;
char *sget __P((void));
#endif
char *strans __P((u_char));
void sput __P((u_char *, int));
void sput __P((const u_char *, int));
#ifdef XSERVER
void pc_xmode_on __P((void));
void pc_xmode_off __P((void));
@ -401,9 +401,9 @@ kbc_put8042cmd(val)
* Pass command to keyboard itself
*/
int
kbd_cmd(val, polling)
kbd_cmd(val, do_polling)
u_char val;
u_char polling;
u_char do_polling;
{
u_int retries = 3;
register u_int i;
@ -413,7 +413,7 @@ kbd_cmd(val, polling)
return (0);
ack = nak = 0;
isa_outb(IO_KBD + KBOUTP, val);
if (polling)
if (do_polling)
for (i = 100000; i; i--) {
if (isa_inb(IO_KBD + KBSTATP) & KBS_DIB) {
register u_char c;
@ -1302,8 +1302,8 @@ pcinit()
cursor_shape = 0x0012;
#endif
Crtat = (u_short *)cp;
crtat = (u_short *)(cp + cursorat);
Crtat = __UNVOLATILE(cp);
crtat = (u_short*)(__UNVOLATILE(cp)) + cursorat;
vs.ncol = COL;
vs.nrow = ROW;
@ -1319,7 +1319,8 @@ pcinit()
}
#define wrtchar(c, at) do {\
char *cp = (char *)crtat; *cp++ = (c); *cp = (at); crtat++; vs.col++; \
char *_cp = (char *)crtat; *_cp++ = (c); *_cp = (at); crtat++; \
vs.col++; \
} while (0)
/* translate ANSI color codes to standard pc ones */
@ -1360,7 +1361,7 @@ static u_char iso2ibm437[] =
*/
void
sput(cp, n)
u_char *cp;
const u_char *cp;
int n;
{
u_char c, scroll = 0;