Rename local variables to avoid shadowing, and add a few const qualifications.

This commit is contained in:
he 2005-06-04 20:33:57 +00:00
parent fb96dc834d
commit 5f9bd2c9a7
4 changed files with 20 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ds17485.c,v 1.6 2003/08/07 16:29:16 agc Exp $ */
/* $NetBSD: ds17485.c,v 1.7 2005/06/04 20:33:57 he Exp $ */
/*
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -157,7 +157,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ds17485.c,v 1.6 2003/08/07 16:29:16 agc Exp $");
__KERNEL_RCSID(0, "$NetBSD: ds17485.c,v 1.7 2005/06/04 20:33:57 he Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -336,7 +336,7 @@ inittodr(time_t base)
{
mc_todregs rtclk;
time_t n;
int sec, min, hr, dom, mon, yr;
int sec, mins, hr, dom, mon, yr;
int i, days = 0;
int s;
@ -363,14 +363,14 @@ inittodr(time_t base)
splx(s);
sec = hexdectodec(rtclk[MC_SEC]);
min = hexdectodec(rtclk[MC_MIN]);
mins = 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 * mins + 3600 * hr;
n += (dom - 1) * 3600 * 24;
if (yeartoday(yr) == 366)

View File

@ -1,4 +1,4 @@
/* $NetBSD: clock.c,v 1.5 2004/06/29 12:01:11 kleink Exp $ */
/* $NetBSD: clock.c,v 1.6 2005/06/04 20:33:57 he Exp $ */
/* $OpenBSD: clock.c,v 1.3 1997/10/13 13:42:53 pefo Exp $ */
/*
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.5 2004/06/29 12:01:11 kleink Exp $");
__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.6 2005/06/04 20:33:57 he Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -55,7 +55,7 @@ void
decr_intr(struct clockframe *frame)
{
u_long tb;
long tick;
long ticks;
int nticks;
int pri, msr;
@ -80,10 +80,10 @@ decr_intr(struct clockframe *frame)
* Based on the actual time delay since the last decrementer reload,
* we arrange for earlier interrupt next time.
*/
asm ("mfdec %0" : "=r"(tick));
for (nticks = 0; tick < 0; nticks++)
tick += ticks_per_intr;
asm volatile ("mtdec %0" :: "r"(tick));
asm ("mfdec %0" : "=r"(ticks));
for (nticks = 0; ticks < 0; nticks++)
ticks += ticks_per_intr;
asm volatile ("mtdec %0" :: "r"(ticks));
uvmexp.intrs++;
intrcnt[CNT_CLOCK]++;
@ -100,7 +100,7 @@ decr_intr(struct clockframe *frame)
* start of this tick interval.
*/
asm ("mftb %0" : "=r"(tb));
lasttb = tb + tick - ticks_per_intr;
lasttb = tb + ticks - ticks_per_intr;
/*
* Reenable interrupts

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.8 2003/10/08 04:25:46 lukem Exp $ */
/* $NetBSD: disksubr.c,v 1.9 2005/06/04 20:33:57 he Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.8 2003/10/08 04:25:46 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.9 2005/06/04 20:33:57 he Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -133,7 +133,7 @@ readdisklabel(dev_t dev,
struct dkbad *bdp;
struct buf *bp;
struct disklabel *dlp;
char *msg = NULL;
const char *msg = NULL;
int dospartoff, cyl, i, *ip;
/* minimal requirements for archtypal disk label */

View File

@ -1,4 +1,4 @@
/* $NetBSD: extintr.c,v 1.10 2003/08/07 16:29:17 agc Exp $ */
/* $NetBSD: extintr.c,v 1.11 2005/06/04 20:33:57 he Exp $ */
/*
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -109,7 +109,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.10 2003/08/07 16:29:17 agc Exp $");
__KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.11 2005/06/04 20:33:57 he Exp $");
#include <sys/param.h>
#include <sys/malloc.h>
@ -157,7 +157,7 @@ struct intrhand *intrhand[ICU_LEN];
void intr_calculatemasks(void);
int fakeintr(void *);
void ext_intr(void);
char *intr_typename(int);
const char *intr_typename(int);
int
fakeintr(void *arg)
@ -228,7 +228,7 @@ ext_intr()
#endif
}
char *
const char *
intr_typename(type)
{
switch (type) {