Shadowing and const fixes.

This commit is contained in:
jmc 2005-06-16 22:45:46 +00:00
parent 61f16670a4
commit 016a928508
8 changed files with 81 additions and 78 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ncr5380.c,v 1.58 2005/02/21 00:29:06 thorpej Exp $ */
/* $NetBSD: ncr5380.c,v 1.59 2005/06/16 22:45:46 jmc Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ncr5380.c,v 1.58 2005/02/21 00:29:06 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: ncr5380.c,v 1.59 2005/06/16 22:45:46 jmc Exp $");
/*
* Bit mask of targets you want debugging to be shown
@ -908,10 +908,10 @@ scsi_select(SC_REQ *reqp, int code)
*/
if (!reach_msg_out(sc, sizeof(struct scsipi_generic))) {
u_long len = 1;
u_char phase = PH_MSGOUT;
u_char tphase = PH_MSGOUT;
u_char msg = MSG_ABORT;
transfer_pio(&phase, &msg, &len, 0);
transfer_pio(&tphase, &msg, &len, 0);
}
else scsi_reset_verbose(sc, "Connected to unidentified target");
@ -1884,7 +1884,7 @@ run_main(struct ncr_softc *sc)
* Prefix message with full target info.
*/
static void
ncr_tprint(SC_REQ *reqp, char *fmt, ...)
ncr_tprint(SC_REQ *reqp, const char *fmt, ...)
{
va_list ap;
@ -1898,7 +1898,7 @@ ncr_tprint(SC_REQ *reqp, char *fmt, ...)
* Prefix message with adapter info.
*/
static void
ncr_aprint(struct ncr_softc *sc, char *fmt, ...)
ncr_aprint(struct ncr_softc *sc, const char *fmt, ...)
{
va_list ap;
@ -1930,7 +1930,7 @@ show_data_sense(struct scsipi_xfer *xs)
}
static void
show_request(SC_REQ *reqp, char *qtxt)
show_request(SC_REQ *reqp, const char *qtxt)
{
printf("REQ-%s: %d %p[%ld] cmd[0]=%x S=%x M=%x R=%x resid=%d dr_flag=%x %s\n",
qtxt, reqp->targ_id, reqp->xdata_ptr, reqp->xdata_len,
@ -1941,7 +1941,7 @@ show_request(SC_REQ *reqp, char *qtxt)
show_data_sense(reqp->xs);
}
static char *sig_names[] = {
static const char *sig_names[] = {
"PAR", "SEL", "I/O", "C/D", "MSG", "REQ", "BSY", "RST",
"ACK", "ATN", "LBSY", "PMATCH", "IRQ", "EPAR", "DREQ", "EDMA"
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: ncr5380reg.h,v 1.16 2005/01/15 16:00:59 chs Exp $ */
/* $NetBSD: ncr5380reg.h,v 1.17 2005/06/16 22:45:46 jmc Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman.
@ -249,11 +249,11 @@ static void scsi_reset_verbose(struct ncr_softc *, const char *);
static void run_main(struct ncr_softc *);
static void scsi_main(struct ncr_softc *);
static void ncr_ctrl_intr(struct ncr_softc *);
static void ncr_tprint(SC_REQ *, char *, ...);
static void ncr_aprint(struct ncr_softc *, char *, ...);
static void ncr_tprint(SC_REQ *, const char *, ...);
static void ncr_aprint(struct ncr_softc *, const char *, ...);
static void show_data_sense(struct scsipi_xfer *);
static void show_request(SC_REQ *, char *);
static void show_request(SC_REQ *, const char *);
/* static void show_phase(SC_REQ *, int); */
static void show_signals(u_char, u_char);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pm_direct.c,v 1.23 2005/01/15 16:00:59 chs Exp $ */
/* $NetBSD: pm_direct.c,v 1.24 2005/06/16 22:45:46 jmc Exp $ */
/*
* Copyright (C) 1997 Takashi Hamada
@ -32,7 +32,7 @@
/* From: pm_direct.c 1.3 03/18/98 Takashi Hamada */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pm_direct.c,v 1.23 2005/01/15 16:00:59 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: pm_direct.c,v 1.24 2005/06/16 22:45:46 jmc Exp $");
#include "opt_adb.h"
@ -294,13 +294,13 @@ pm_check_adb_devices(int id)
* Wait until PM IC is busy
*/
int
pm_wait_busy(int delay)
pm_wait_busy(int xdelay)
{
while (PM_IS_ON) {
#ifdef PM_GRAB_SI
(void)intr_dispatch(0x70); /* grab any serial interrupts */
#endif
if ((--delay) < 0)
if ((--xdelay) < 0)
return 1; /* timeout */
}
return 0;
@ -311,13 +311,13 @@ pm_wait_busy(int delay)
* Wait until PM IC is free
*/
int
pm_wait_free(int delay)
pm_wait_free(int xdelay)
{
while (PM_IS_OFF) {
#ifdef PM_GRAB_SI
(void)intr_dispatch(0x70); /* grab any serial interrupts */
#endif
if ((--delay) < 0)
if ((--xdelay) < 0)
return 0; /* timeout */
}
return 1;
@ -439,13 +439,13 @@ pm_pmgrop_pm1(PMData *pmdata)
case MACH_MACPB180:
case MACH_MACPB180C:
{
int delay = ADBDelay * 16;
int xdelay = ADBDelay * 16;
via_reg(VIA2, vDirA) = 0x00;
while ((via_reg(VIA2, 0x200) == 0x7f) && (delay >= 0))
delay--;
while ((via_reg(VIA2, 0x200) == 0x7f) && (xdelay >= 0))
xdelay--;
if (delay < 0) { /* timeout */
if (xdelay < 0) { /* timeout */
via_reg(VIA2, vDirA) = 0x00;
/* restore formar value */
via_reg(VIA1, vIER) = via1_vIER;
@ -699,14 +699,14 @@ pm_pmgrop_pm2(PMData *pmdata)
if (HwCfgFlags3 & 0x00200000) {
/* PB 160, PB 165(c), PB 180(c)? */
int delay = ADBDelay * 16;
int xdelay = ADBDelay * 16;
via_reg(VIA2, vDirA) = 0x00;
while ((via_reg(VIA2, 0x200) == 0x07) &&
(delay >= 0))
delay--;
(xdelay >= 0))
xdelay--;
if (delay < 0) {
if (xdelay < 0) {
rval = 0xffffcd38;
break; /* timeout */
}
@ -967,7 +967,7 @@ pm_adb_op(u_char *buffer, void *compRout, void *data, int command)
int i;
int s;
int rval;
int delay;
int xdelay;
PMData pmdata;
struct adbCommand packet;
@ -1033,7 +1033,7 @@ pm_adb_op(u_char *buffer, void *compRout, void *data, int command)
PM_VIA_INTR_ENABLE();
/* wait until the PM interrupt has occurred */
delay = 0x80000;
xdelay = 0x80000;
while (adbWaiting == 1) {
switch (mac68k_machine.machineid) {
case MACH_MACPB150:
@ -1055,7 +1055,7 @@ pm_adb_op(u_char *buffer, void *compRout, void *data, int command)
#ifdef PM_GRAB_SI
(void)intr_dispatch(0x70); /* grab any serial interrupts */
#endif
if ((--delay) < 0) {
if ((--xdelay) < 0) {
splx(s);
return 1;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: intr.c,v 1.21 2005/03/05 17:34:06 chs Exp $ */
/* $NetBSD: intr.c,v 1.22 2005/06/16 22:45:46 jmc Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.21 2005/03/05 17:34:06 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.22 2005/06/16 22:45:46 jmc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -112,7 +112,8 @@ void
intr_init(void)
{
extern long intrnames;
char *inames, *g_inames;
const char *inames;
char *g_inames;
mac68k_ipls[MAC68K_IPL_SOFT] = PSL_S|PSL_IPL1;
mac68k_ipls[MAC68K_IPL_SERIAL] = PSL_S|PSL_IPL4;

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.304 2005/04/25 15:02:06 lukem Exp $ */
/* $NetBSD: machdep.c,v 1.305 2005/06/16 22:45:46 jmc Exp $ */
/*
* Copyright (c) 1982, 1990 The Regents of the University of California.
@ -107,7 +107,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.304 2005/04/25 15:02:06 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.305 2005/06/16 22:45:46 jmc Exp $");
#include "opt_adb.h"
#include "opt_ddb.h"
@ -266,7 +266,7 @@ int cpu_dump(int (*)(dev_t, daddr_t, caddr_t, size_t), daddr_t *);
void cpu_init_kcore_hdr(void);
void getenvvars(u_long, char *);
static long getenv(char *);
static long getenv(const char *);
/* functions called from locore.s */
void dumpsys(void);
@ -423,7 +423,7 @@ cpu_startup(void)
{
int vers;
vaddr_t minaddr, maxaddr;
int delay;
int xdelay;
char pbuf[9];
/*
@ -448,7 +448,7 @@ cpu_startup(void)
printf("Booter version %d.%d is necessary to fully support\n",
CURRENTBOOTERVER / 100, CURRENTBOOTERVER % 100);
printf("this kernel.\n\n");
for (delay = 0; delay < 1000000; delay++);
for (xdelay = 0; xdelay < 1000000; xdelay++);
}
format_bytes(pbuf, sizeof(pbuf), ctob(physmem));
printf("total memory = %s\n", pbuf);
@ -1154,7 +1154,7 @@ getenvvars(u_long flag, char *buf)
}
static long
getenv(char *str)
getenv(const char *str)
{
/*
* Returns the value of the environment variable "str".
@ -1165,7 +1165,8 @@ getenv(char *str)
* there without an "=val".
*/
char *s, *s1;
char *s;
const char *s1;
int val, base;
s = envbuf;
@ -2025,7 +2026,7 @@ static void
identifycpu(void)
{
extern u_int delay_factor;
char *mpu;
const char *mpu;
switch (cputype) {
case CPU_68020:
@ -2427,10 +2428,10 @@ get_physical(u_int addr, u_long * phys)
return 1;
}
static void check_video(char *, u_long, u_long);
static void check_video(const char *, u_long, u_long);
static void
check_video(char *id, u_long limit, u_long maxm)
check_video(const char *id, u_long limit, u_long maxm)
{
u_long addr, phys;

View File

@ -1,4 +1,4 @@
/* $NetBSD: macrom.c,v 1.56 2005/05/22 15:54:46 christos Exp $ */
/* $NetBSD: macrom.c,v 1.57 2005/06/16 22:45:46 jmc Exp $ */
/*-
* Copyright (C) 1994 Bradley A. Grantham
@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: macrom.c,v 1.56 2005/05/22 15:54:46 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: macrom.c,v 1.57 2005/06/16 22:45:46 jmc Exp $");
#include "opt_adb.h"
#include "opt_ddb.h"
@ -111,7 +111,7 @@ u_int32_t mrg_AVInitEgretJT[] = {
caddr_t mrg_romadbintr = (caddr_t)0; /* ROM ADB interrupt */
caddr_t mrg_rompmintr = 0; /* ROM PM (?) interrupt */
char *mrg_romident = NULL; /* ident string for ROMs */
const char *mrg_romident = NULL; /* ident string for ROMs */
caddr_t mrg_ADBAlternateInit = 0;
caddr_t mrg_InitEgret = 0;
caddr_t mrg_ADBIntrPtr = (caddr_t)0x0; /* ADB interrupt taken from MacOS vector table*/
@ -629,10 +629,10 @@ caddr_t mrg_OStraps[256] = {
(caddr_t)mrg_DisposPtr,
(caddr_t)mrg_SetPtrSize,
(caddr_t)mrg_GetPtrSize,
[0x2f] (caddr_t)mrg_PostEvent,
[0x2f] (caddr_t)__UNCONST(mrg_PostEvent), /* XXXGCC ? */
[0x3b] (caddr_t)mrg_Delay,
[0x47] (caddr_t)mrg_SetTrapAddress,
[0x55] (caddr_t)mrg_StripAddress,
[0x55] (caddr_t)__UNCONST(mrg_StripAddress), /* XXXGCC ? */
[0x82] (caddr_t)mrg_DTInstall,
#else
#error "Using a GNU C extension."
@ -803,7 +803,7 @@ extern volatile u_char *sccA;
void
mrg_init(void)
{
char *findername = "MacBSD FakeFinder";
const char *findername = "MacBSD FakeFinder";
int i;
#if defined(MRG_TEST)
caddr_t ptr;
@ -923,7 +923,7 @@ mrg_init(void)
ADBYMM = &mrg_adbstore3[0];
MinusOne = 0xffffffff;
Lo3Bytes = 0x00ffffff;
VIA = (caddr_t)Via1Base;
VIA = (caddr_t)__UNVOLATILE(Via1Base);
MMU32Bit = 1; /* ?means MMU is in 32 bit mode? */
if (TimeDBRA == 0)
TimeDBRA = 0xa3b; /* BARF default is Mac II */
@ -951,8 +951,9 @@ mrg_init(void)
/* probably very dangerous */
jADBOp = (void (*)(void))mrg_OStraps[0x7c];
mrg_VIA2 = (caddr_t)(Via1Base + VIA2 * 0x2000); /* see via.h */
SCCRd = (caddr_t)sccA; /* ser.c ; we run before serinit */
mrg_VIA2 = (caddr_t)((caddr_t)__UNVOLATILE(Via1Base) +
VIA2 * 0x2000); /* see via.h */
SCCRd = (caddr_t)__UNVOLATILE(sccA);/* ser.c ; we run before serinit */
jDTInstall = (caddr_t)mrg_DTInstall;

View File

@ -1,4 +1,4 @@
/* $NetBSD: iwm_fd.c,v 1.32 2005/01/16 00:32:03 chs Exp $ */
/* $NetBSD: iwm_fd.c,v 1.33 2005/06/16 22:45:46 jmc Exp $ */
/*
* Copyright (c) 1997, 1998 Hauke Fath. All rights reserved.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: iwm_fd.c,v 1.32 2005/01/16 00:32:03 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: iwm_fd.c,v 1.33 2005/06/16 22:45:46 jmc Exp $");
#ifdef _LKM
#define IWMCF_DRIVE 0
@ -1141,7 +1141,7 @@ fdstart(fd_softc_t *fd)
{
int st;
static char *stateDesc[] = {
static const char *stateDesc[] = {
"Init",
"Seek",
"Read",
@ -1153,7 +1153,7 @@ fdstart(fd_softc_t *fd)
"Exit",
"Done"
};
int (*state[])(fd_softc_t *fd) = {
int (*state[])(fd_softc_t *) = {
fdstart_Init,
fdstart_Seek,
fdstart_Read,
@ -1896,7 +1896,7 @@ seek(fd_softc_t *fd, int style)
iwm_softc_t *iwm = iwm_cd.cd_devs[0];
#endif
char *stateDesc[] = {
const char *stateDesc[] = {
"Init",
"Seek",
"Recalibrate",
@ -1904,11 +1904,11 @@ seek(fd_softc_t *fd, int style)
"Exit"
};
enum {
state_Init = 0,
state_Seek,
state_Recalibrate,
state_Verify,
state_Exit
seek_state_Init = 0,
seek_state_Seek,
seek_state_Recalibrate,
seek_state_Verify,
seek_state_Exit
};
/* XXX egcs */
done = err = ierr = 0;
@ -1917,14 +1917,14 @@ seek(fd_softc_t *fd, int style)
loc = &fd->pos;
state = state_Init;
state = seek_state_Init;
do {
if (TRACE_STEP)
printf(" seek state %d [%s].\n",
state, stateDesc[state]);
switch (state) {
case state_Init:
case seek_state_Init:
if (TRACE_STEP)
printf("Current track is %d, new track %d.\n",
loc->oldTrack, loc->track);
@ -1933,23 +1933,23 @@ seek(fd_softc_t *fd, int style)
fd->seekRetries = 0;
fd->verifyRetries = 0;
state = (style == IWM_SEEK_RECAL)
? state_Recalibrate : state_Seek;
? seek_state_Recalibrate : seek_state_Seek;
done = 0;
break;
case state_Recalibrate:
case seek_state_Recalibrate:
ierr = iwmTrack00();
if (ierr == 0) {
loc->oldTrack = 0;
state = state_Seek;
state = seek_state_Seek;
} else {
strncpy(action, "Recalibrate (track 0)",
sizeof(action));
state = state_Exit;
state = seek_state_Exit;
}
break;
case state_Seek:
case seek_state_Seek:
ierr = 0;
steps = loc->track - loc->oldTrack;
@ -1958,34 +1958,34 @@ seek(fd_softc_t *fd, int style)
if (ierr == 0) {
/* No error or nothing to do */
state = (style == IWM_SEEK_VERIFY)
? state_Verify : state_Exit;
? seek_state_Verify : seek_state_Exit;
} else {
if (fd->seekRetries++ < iwm->maxRetries)
state = state_Recalibrate;
state = seek_state_Recalibrate;
else {
strncpy(action, "Seek retries",
sizeof(action));
state = state_Exit;
state = seek_state_Exit;
}
}
break;
case state_Verify:
case seek_state_Verify:
ierr = checkTrack(loc, TRACE_STEP);
if (ierr == 0 && loc->track == hdr.track)
state = state_Exit;
state = seek_state_Exit;
else {
if (fd->verifyRetries++ < iwm->maxRetries)
state = state_Recalibrate;
state = seek_state_Recalibrate;
else {
strncpy(action, "Verify retries",
sizeof(action));
state = state_Exit;
state = seek_state_Exit;
}
}
break;
case state_Exit:
case seek_state_Exit:
if (ierr == 0) {
loc->oldTrack = loc->track;
err = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: iwm_fdvar.h,v 1.8 2005/01/15 16:01:00 chs Exp $ */
/* $NetBSD: iwm_fdvar.h,v 1.9 2005/06/16 22:45:46 jmc Exp $ */
/*
* Copyright (c) 1997, 1998 Hauke Fath. All rights reserved.
@ -88,7 +88,7 @@ struct fdInfo {
short stepRate; /* in ms (is a software delay) */
short interleave; /* Sector interleave */
short physFormat; /* GCR, MFM DD, MFM HD */
char *description;
const char *description;
};
typedef struct fdInfo fdInfo_t;