Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/pmppc Rename local variables to avoid shadowing, an...
details: https://anonhg.NetBSD.org/src/rev/5835be6737ab
branches: trunk
changeset: 581745:5835be6737ab
user: he <he%NetBSD.org@localhost>
date: Sat Jun 04 20:33:57 2005 +0000
description:
Rename local variables to avoid shadowing, and add a few const qualifications.
diffstat:
sys/arch/pmppc/dev/ds17485.c | 10 +++++-----
sys/arch/pmppc/pmppc/clock.c | 16 ++++++++--------
sys/arch/pmppc/pmppc/disksubr.c | 6 +++---
sys/arch/pmppc/pmppc/extintr.c | 8 ++++----
4 files changed, 20 insertions(+), 20 deletions(-)
diffs (158 lines):
diff -r 0443c7e41b9b -r 5835be6737ab sys/arch/pmppc/dev/ds17485.c
--- a/sys/arch/pmppc/dev/ds17485.c Sat Jun 04 20:19:47 2005 +0000
+++ b/sys/arch/pmppc/dev/ds17485.c Sat Jun 04 20:33:57 2005 +0000
@@ -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 @@
*/
#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 @@
{
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 @@
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)
diff -r 0443c7e41b9b -r 5835be6737ab sys/arch/pmppc/pmppc/clock.c
--- a/sys/arch/pmppc/pmppc/clock.c Sat Jun 04 20:19:47 2005 +0000
+++ b/sys/arch/pmppc/pmppc/clock.c Sat Jun 04 20:33:57 2005 +0000
@@ -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 @@
decr_intr(struct clockframe *frame)
{
u_long tb;
- long tick;
+ long ticks;
int nticks;
int pri, msr;
@@ -80,10 +80,10 @@
* 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 @@
* start of this tick interval.
*/
asm ("mftb %0" : "=r"(tb));
- lasttb = tb + tick - ticks_per_intr;
+ lasttb = tb + ticks - ticks_per_intr;
/*
* Reenable interrupts
diff -r 0443c7e41b9b -r 5835be6737ab sys/arch/pmppc/pmppc/disksubr.c
--- a/sys/arch/pmppc/pmppc/disksubr.c Sat Jun 04 20:19:47 2005 +0000
+++ b/sys/arch/pmppc/pmppc/disksubr.c Sat Jun 04 20:33:57 2005 +0000
@@ -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 @@
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 */
diff -r 0443c7e41b9b -r 5835be6737ab sys/arch/pmppc/pmppc/extintr.c
--- a/sys/arch/pmppc/pmppc/extintr.c Sat Jun 04 20:19:47 2005 +0000
+++ b/sys/arch/pmppc/pmppc/extintr.c Sat Jun 04 20:33:57 2005 +0000
@@ -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 @@
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 @@
#endif
}
-char *
+const char *
intr_typename(type)
{
switch (type) {
Home |
Main Index |
Thread Index |
Old Index