Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sandpoint Fix variable shadowing and adapt to -Wcon...



details:   https://anonhg.NetBSD.org/src/rev/840651d25b41
branches:  trunk
changeset: 581545:840651d25b41
user:      he <he%NetBSD.org@localhost>
date:      Thu Jun 02 14:11:19 2005 +0000

description:
Fix variable shadowing and adapt to -Wconst-qual.

diffstat:

 sys/arch/sandpoint/isa/isa_machdep.c    |  10 +++++-----
 sys/arch/sandpoint/isa/isaclock.c       |  10 +++++-----
 sys/arch/sandpoint/sandpoint/clock.c    |  16 ++++++++--------
 sys/arch/sandpoint/sandpoint/disksubr.c |   6 +++---
 sys/arch/sandpoint/sandpoint/extintr.c  |   8 ++++----
 5 files changed, 25 insertions(+), 25 deletions(-)

diffs (199 lines):

diff -r 662222544adb -r 840651d25b41 sys/arch/sandpoint/isa/isa_machdep.c
--- a/sys/arch/sandpoint/isa/isa_machdep.c      Thu Jun 02 14:03:20 2005 +0000
+++ b/sys/arch/sandpoint/isa/isa_machdep.c      Thu Jun 02 14:11:19 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: isa_machdep.c,v 1.6 2003/08/07 16:29:22 agc Exp $      */
+/*     $NetBSD: isa_machdep.c,v 1.7 2005/06/02 14:11:19 he Exp $       */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.6 2003/08/07 16:29:22 agc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.7 2005/06/02 14:11:19 he Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -280,13 +280,13 @@
        void *arg;
 {
        struct intrhand *ih = arg;
-       int irq = ih->ih_irq, cpl;
+       int irq = ih->ih_irq, s;
        struct intrhand **p, *q;
 
        if (irq < 0 || irq > 15)
                panic("intr_disestablish: bogus irq");
 
-       cpl = splhigh();
+       s = splhigh();
        for (p = &isa_intrhand[irq]; (q = *p) != NULL && q != ih;
            p = &q->ih_next)
                ;
@@ -301,7 +301,7 @@
        if (isa_intrhand[irq] == NULL) {
                isa_intrtype[irq] = IST_NONE;
        }
-       splx(cpl);
+       splx(s);
 }
 
 #define SUPERIO_CONF_IDX               0x15C
diff -r 662222544adb -r 840651d25b41 sys/arch/sandpoint/isa/isaclock.c
--- a/sys/arch/sandpoint/isa/isaclock.c Thu Jun 02 14:03:20 2005 +0000
+++ b/sys/arch/sandpoint/isa/isaclock.c Thu Jun 02 14:11:19 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: isaclock.c,v 1.4 2003/08/07 16:29:22 agc Exp $ */
+/*     $NetBSD: isaclock.c,v 1.5 2005/06/02 14:11:19 he Exp $  */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -121,7 +121,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isaclock.c,v 1.4 2003/08/07 16:29:22 agc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isaclock.c,v 1.5 2005/06/02 14:11:19 he Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -295,7 +295,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;
 
@@ -322,14 +322,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 662222544adb -r 840651d25b41 sys/arch/sandpoint/sandpoint/clock.c
--- a/sys/arch/sandpoint/sandpoint/clock.c      Thu Jun 02 14:03:20 2005 +0000
+++ b/sys/arch/sandpoint/sandpoint/clock.c      Thu Jun 02 14:11:19 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clock.c,v 1.6 2004/06/29 12:01:11 kleink Exp $ */
+/*     $NetBSD: clock.c,v 1.7 2005/06/02 14:11:19 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.6 2004/06/29 12:01:11 kleink Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.7 2005/06/02 14:11:19 he Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -59,7 +59,7 @@
        int msr;
        int pri;
        u_long tb;
-       long tick;
+       long ticks;
        int nticks;
        extern long intrcnt[];
 
@@ -73,16 +73,16 @@
         * Based on the actual time delay since the last decrementer reload,
         * we arrange for earlier interrupt next time.
         */
-       asm ("mftb %0; mfdec %1" : "=r"(tb), "=r"(tick));
-       for (nticks = 0; tick < 0; nticks++)
-               tick += ticks_per_intr;
-       asm volatile ("mtdec %0" :: "r"(tick));
+       asm ("mftb %0; mfdec %1" : "=r"(tb), "=r"(ticks));
+       for (nticks = 0; ticks < 0; nticks++)
+               ticks += ticks_per_intr;
+       asm volatile ("mtdec %0" :: "r"(ticks));
 
        /*
         * lasttb is used during microtime. Set it to the virtual
         * start of this tick interval.
         */
-       lasttb = tb + tick - ticks_per_intr;
+       lasttb = tb + ticks - ticks_per_intr;
 
        intrcnt[CNT_CLOCK]++;
 
diff -r 662222544adb -r 840651d25b41 sys/arch/sandpoint/sandpoint/disksubr.c
--- a/sys/arch/sandpoint/sandpoint/disksubr.c   Thu Jun 02 14:03:20 2005 +0000
+++ b/sys/arch/sandpoint/sandpoint/disksubr.c   Thu Jun 02 14:11:19 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disksubr.c,v 1.9 2003/10/08 04:25:46 lukem Exp $       */
+/*     $NetBSD: disksubr.c,v 1.10 2005/06/02 14:11:19 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.9 2003/10/08 04:25:46 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.10 2005/06/02 14:11:19 he Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -136,7 +136,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 662222544adb -r 840651d25b41 sys/arch/sandpoint/sandpoint/extintr.c
--- a/sys/arch/sandpoint/sandpoint/extintr.c    Thu Jun 02 14:03:20 2005 +0000
+++ b/sys/arch/sandpoint/sandpoint/extintr.c    Thu Jun 02 14:11:19 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: extintr.c,v 1.8 2004/02/13 11:36:17 wiz Exp $  */
+/*     $NetBSD: extintr.c,v 1.9 2005/06/02 14:11:19 he Exp $   */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.8 2004/02/13 11:36:17 wiz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.9 2005/06/02 14:11:19 he Exp $");
 
 #include "opt_openpic.h"
 
@@ -107,7 +107,7 @@
 void intr_calculatemasks __P((void));
 int fakeintr __P((void *));
 void ext_intr __P((void));
-char *intr_typename __P((int));
+const char *intr_typename __P((int));
 
 int
 fakeintr(arg)
@@ -162,7 +162,7 @@
        splx(pcpl);/* Will also process pendings if necessary */
 }
 
-char *
+const char *
 intr_typename(type)
        int     type;
 {



Home | Main Index | Thread Index | Old Index