Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/atari Adapt to compiling with -Wshadow and -Wcast-q...



details:   https://anonhg.NetBSD.org/src/rev/8c60d37cb48b
branches:  trunk
changeset: 581740:8c60d37cb48b
user:      he <he%NetBSD.org@localhost>
date:      Sat Jun 04 14:42:36 2005 +0000

description:
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.

diffstat:

 sys/arch/atari/atari/atari_init.c |   9 +++++----
 sys/arch/atari/atari/fpu.c        |   8 ++++----
 sys/arch/atari/atari/machdep.c    |   6 +++---
 sys/arch/atari/atari/pmap.c       |  28 ++++++++++++++--------------
 sys/arch/atari/atari/trap.c       |   6 +++---
 sys/arch/atari/dev/atari5380.c    |   8 ++++----
 sys/arch/atari/dev/clock.c        |  16 ++++++++--------
 sys/arch/atari/dev/fd.c           |   6 +++---
 sys/arch/atari/dev/grfabs_reg.h   |   4 ++--
 sys/arch/atari/dev/hdfd.c         |  13 +++++++------
 sys/arch/atari/dev/ite.c          |  38 +++++++++++++++++++-------------------
 sys/arch/atari/dev/ncr5380.c      |  18 +++++++++---------
 sys/arch/atari/dev/ncr5380reg.h   |   8 ++++----
 sys/arch/atari/dev/ncr5380var.h   |   4 ++--
 sys/arch/atari/dev/zs.c           |   8 ++++----
 sys/arch/atari/include/cpu.h      |   4 ++--
 sys/arch/atari/pci/pci_vga.c      |   6 +++---
 sys/arch/atari/vme/vmevar.h       |   4 ++--
 18 files changed, 98 insertions(+), 96 deletions(-)

diffs (truncated from 713 to 300 lines):

diff -r bce75b2292d2 -r 8c60d37cb48b sys/arch/atari/atari/atari_init.c
--- a/sys/arch/atari/atari/atari_init.c Sat Jun 04 14:35:53 2005 +0000
+++ b/sys/arch/atari/atari/atari_init.c Sat Jun 04 14:42:36 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atari_init.c,v 1.61 2004/02/13 11:36:11 wiz Exp $      */
+/*     $NetBSD: atari_init.c,v 1.62 2005/06/04 14:42:36 he Exp $       */
 
 /*
  * Copyright (c) 1995 Leo Weppelman
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: atari_init.c,v 1.61 2004/02/13 11:36:11 wiz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atari_init.c,v 1.62 2005/06/04 14:42:36 he Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mbtype.h"
@@ -622,12 +622,13 @@
 
 #else
        stio_addr = 0xff8000;   /* XXX: For TT & Falcon only */
-       if(badbaddr((caddr_t)&MFP2->mf_gpip, sizeof(char))) {
+       if(badbaddr((caddr_t)__UNVOLATILE(&MFP2->mf_gpip), sizeof(char))) {
                /*
                 * Watch out! We can also have a Hades with < 16Mb
                 * RAM here...
                 */
-               if(!badbaddr((caddr_t)&MFP->mf_gpip, sizeof(char))) {
+               if(!badbaddr((caddr_t)__UNVOLATILE(&MFP->mf_gpip),
+                    sizeof(char))) {
                        machineid |= ATARI_FALCON;
                        return;
                }
diff -r bce75b2292d2 -r 8c60d37cb48b sys/arch/atari/atari/fpu.c
--- a/sys/arch/atari/atari/fpu.c        Sat Jun 04 14:35:53 2005 +0000
+++ b/sys/arch/atari/atari/fpu.c        Sat Jun 04 14:42:36 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu.c,v 1.9 2003/07/15 01:19:44 lukem Exp $    */
+/*     $NetBSD: fpu.c,v 1.10 2005/06/04 14:42:36 he Exp $      */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.9 2003/07/15 01:19:44 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.10 2005/06/04 14:42:36 he Exp $");
 
 #include "opt_fpu_emulate.h"
 
@@ -59,7 +59,7 @@
 extern int fpu_type;
 extern int *nofault;
 
-static char *fpu_descr[] = {
+static const char *fpu_descr[] = {
 #ifdef FPU_EMULATE
        " emulated ",           /* 0 */
 #else
@@ -70,7 +70,7 @@
        "/",                    /* 3 68040 internal */
        "??? " };
 
-char *
+const char *
 fpu_describe(type)
 int    type;
 {
diff -r bce75b2292d2 -r 8c60d37cb48b sys/arch/atari/atari/machdep.c
--- a/sys/arch/atari/atari/machdep.c    Sat Jun 04 14:35:53 2005 +0000
+++ b/sys/arch/atari/atari/machdep.c    Sat Jun 04 14:42:36 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.136 2005/04/25 15:02:03 lukem Exp $      */
+/*     $NetBSD: machdep.c,v 1.137 2005/06/04 14:42:36 he Exp $ */
 
 /*
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.136 2005/04/25 15:02:03 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.137 2005/06/04 14:42:36 he Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -332,7 +332,7 @@
 static void
 identifycpu()
 {
-       char    *mach, *mmu, *fpu, *cpu;
+       const char *mach, *mmu, *fpu, *cpu;
 
        switch (machineid & ATARI_ANYMACH) {
                case ATARI_TT:
diff -r bce75b2292d2 -r 8c60d37cb48b sys/arch/atari/atari/pmap.c
--- a/sys/arch/atari/atari/pmap.c       Sat Jun 04 14:35:53 2005 +0000
+++ b/sys/arch/atari/atari/pmap.c       Sat Jun 04 14:42:36 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.90 2005/05/29 15:56:59 chs Exp $    */
+/*     $NetBSD: pmap.c,v 1.91 2005/06/04 14:42:36 he Exp $     */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -107,7 +107,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.90 2005/05/29 15:56:59 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.91 2005/06/04 14:42:36 he Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2038,31 +2038,31 @@
                 */
                if (refs == 0 && (flags & PRM_KEEPPTPAGE) == 0) {
 #ifdef DIAGNOSTIC
-                       struct pv_entry *pv;
+                       struct pv_entry *pve;
 #endif
-                       paddr_t pa;
+                       paddr_t paddr;
 
-                       pa = pmap_pte_pa(pmap_pte(pmap_kernel(), ptpva));
+                       paddr = pmap_pte_pa(pmap_pte(pmap_kernel(), ptpva));
 #ifdef DIAGNOSTIC
-                       if (PAGE_IS_MANAGED(pa) == 0)
+                       if (PAGE_IS_MANAGED(paddr) == 0)
                                panic("pmap_remove_mapping: unmanaged PT page");
-                       pv = pa_to_pvh(pa);
-                       if (pv->pv_ptste == NULL)
+                       pve = pa_to_pvh(paddr);
+                       if (pve->pv_ptste == NULL)
                                panic("pmap_remove_mapping: ptste == NULL");
-                       if (pv->pv_pmap != pmap_kernel() ||
-                           pv->pv_va != ptpva ||
-                           pv->pv_next != NULL)
+                       if (pve->pv_pmap != pmap_kernel() ||
+                           pve->pv_va != ptpva ||
+                           pve->pv_next != NULL)
                                panic("pmap_remove_mapping: "
                                    "bad PT page pmap %p, va 0x%lx, next %p",
-                                   pv->pv_pmap, pv->pv_va, pv->pv_next);
+                                   pve->pv_pmap, pve->pv_va, pve->pv_next);
 #endif
                        pmap_remove_mapping(pmap_kernel(), ptpva,
                            NULL, PRM_TFLUSH|PRM_CFLUSH);
-                       uvm_pagefree(PHYS_TO_VM_PAGE(pa));
+                       uvm_pagefree(PHYS_TO_VM_PAGE(paddr));
 #ifdef DEBUG
                        if (pmapdebug & (PDB_REMOVE|PDB_PTPAGE))
                            printf("remove: PT page 0x%lx (0x%lx) freed\n",
-                                   ptpva, pa);
+                                   ptpva, paddr);
 #endif
                }
        }
diff -r bce75b2292d2 -r 8c60d37cb48b sys/arch/atari/atari/trap.c
--- a/sys/arch/atari/atari/trap.c       Sat Jun 04 14:35:53 2005 +0000
+++ b/sys/arch/atari/atari/trap.c       Sat Jun 04 14:42:36 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.77 2004/08/28 17:53:01 jdolecek Exp $       */
+/*     $NetBSD: trap.c,v 1.78 2005/06/04 14:42:36 he Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.77 2004/08/28 17:53:01 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.78 2005/06/04 14:42:36 he Exp $");
 
 #include "opt_ddb.h"
 #include "opt_execfmt.h"
@@ -136,7 +136,7 @@
 static int  writeback __P((struct frame *, int));
 #endif /* M68040 */
 
-char   *trap_type[] = {
+const char *trap_type[] = {
        "Bus error",
        "Address error",
        "Illegal instruction",
diff -r bce75b2292d2 -r 8c60d37cb48b sys/arch/atari/dev/atari5380.c
--- a/sys/arch/atari/dev/atari5380.c    Sat Jun 04 14:35:53 2005 +0000
+++ b/sys/arch/atari/dev/atari5380.c    Sat Jun 04 14:42:36 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atari5380.c,v 1.36 2003/07/15 01:19:47 lukem Exp $     */
+/*     $NetBSD: atari5380.c,v 1.37 2005/06/04 14:42:36 he Exp $        */
 
 /*
  * Copyright (c) 1995 Leo Weppelman.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: atari5380.c,v 1.36 2003/07/15 01:19:47 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atari5380.c,v 1.37 2005/06/04 14:42:36 he Exp $");
 
 #include "opt_atariscsi.h"
 
@@ -138,14 +138,14 @@
 
 #define        set_scsi_dma(addr, val) (void)(                                 \
        {                                                               \
-       u_char  *address = (u_char*)addr+1;                             \
+       u_char  *address = (u_char*)__UNVOLATILE(addr+1);               \
        u_long  nval     = (u_long)val;                                 \
        __asm("movepl   %0, %1@(0)": :"d" (nval), "a" (address));       \
        })
 
 #define        get_scsi_dma(addr, res) (                                       \
        {                                                               \
-       u_char  *address = (u_char*)addr+1;                             \
+       u_char  *address = (u_char*)__UNVOLATILE(addr+1);               \
        u_long  nval;                                                   \
        __asm("movepl   %1@(0), %0": "=d" (nval) : "a" (address));      \
        res = (u_long)nval;                                             \
diff -r bce75b2292d2 -r 8c60d37cb48b sys/arch/atari/dev/clock.c
--- a/sys/arch/atari/dev/clock.c        Sat Jun 04 14:35:53 2005 +0000
+++ b/sys/arch/atari/dev/clock.c        Sat Jun 04 14:42:36 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clock.c,v 1.34 2003/08/07 16:26:58 agc Exp $   */
+/*     $NetBSD: clock.c,v 1.35 2005/06/04 14:42:36 he Exp $    */
 
 /*
  * Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.34 2003/08/07 16:26:58 agc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.35 2005/06/04 14:42:36 he Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -336,7 +336,7 @@
 delay(n)
 int    n;
 {
-       int     tick, otick;
+       int     ticks, otick;
 
        /*
         * Read the counter first, so that the rest of the setup overhead is
@@ -362,11 +362,11 @@
        }
 
        while(n > 0) {
-               tick = MFP->mf_tbdr;
-               if(tick > otick)
-                       n -= TIMB_LIMIT - (tick - otick);
-               else n -= otick - tick;
-               otick = tick;
+               ticks = MFP->mf_tbdr;
+               if(ticks > otick)
+                       n -= TIMB_LIMIT - (ticks - otick);
+               else n -= otick - ticks;
+               otick = ticks;
        }
 }
 
diff -r bce75b2292d2 -r 8c60d37cb48b sys/arch/atari/dev/fd.c
--- a/sys/arch/atari/dev/fd.c   Sat Jun 04 14:35:53 2005 +0000
+++ b/sys/arch/atari/dev/fd.c   Sat Jun 04 14:42:36 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fd.c,v 1.49 2004/10/28 07:07:36 yamt Exp $     */
+/*     $NetBSD: fd.c,v 1.50 2005/06/04 14:42:36 he Exp $       */
 
 /*
  * Copyright (c) 1995 Leo Weppelman.
@@ -49,7 +49,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.49 2004/10/28 07:07:36 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.50 2005/06/04 14:42:36 he Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -128,7 +128,7 @@
 static short   fd_state = FLP_IDLE;    /* Current driver state         */
 static int     lock_stat= 0;           /* DMA locking status           */
 static short   fd_cmd   = 0;           /* command being executed       */
-static char    *fd_error= NULL;        /* error from fd_xfer_ok()      */
+static const char *fd_error= NULL;     /* error from fd_xfer_ok()      */
 
 /*
  * Private per device data
diff -r bce75b2292d2 -r 8c60d37cb48b sys/arch/atari/dev/grfabs_reg.h
--- a/sys/arch/atari/dev/grfabs_reg.h   Sat Jun 04 14:35:53 2005 +0000
+++ b/sys/arch/atari/dev/grfabs_reg.h   Sat Jun 04 14:42:36 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: grfabs_reg.h,v 1.11 1998/12/20 14:32:53 thomas Exp $   */
+/*     $NetBSD: grfabs_reg.h,v 1.12 2005/06/04 14:42:36 he Exp $       */
 
 /*



Home | Main Index | Thread Index | Old Index