Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/acorn26 Adapt to compiling with -Wcast-qual and -Ws...



details:   https://anonhg.NetBSD.org/src/rev/16f334a2a889
branches:  trunk
changeset: 581883:16f334a2a889
user:      he <he%NetBSD.org@localhost>
date:      Thu Jun 09 08:05:31 2005 +0000

description:
Adapt to compiling with -Wcast-qual and -Wshadow by adding const in
appropriate places and renaming a few local variables.

diffstat:

 sys/arch/acorn26/acorn26/cpu.c          |  10 +++---
 sys/arch/acorn26/acorn26/db_interface.c |  52 ++++++++++++++++----------------
 sys/arch/acorn26/acorn26/db_machdep.c   |  12 +++---
 sys/arch/acorn26/acorn26/except.c       |  12 +++---
 sys/arch/acorn26/acorn26/start.c        |   8 ++--
 sys/arch/acorn26/include/db_machdep.h   |  10 +++---
 6 files changed, 52 insertions(+), 52 deletions(-)

diffs (truncated from 302 to 300 lines):

diff -r 5b95b2f76a26 -r 16f334a2a889 sys/arch/acorn26/acorn26/cpu.c
--- a/sys/arch/acorn26/acorn26/cpu.c    Thu Jun 09 07:18:17 2005 +0000
+++ b/sys/arch/acorn26/acorn26/cpu.c    Thu Jun 09 08:05:31 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.14 2004/08/07 12:07:08 rearnsha Exp $ */
+/* $NetBSD: cpu.c,v 1.15 2005/06/09 08:05:31 he Exp $ */
 
 /*-
  * Copyright (c) 2000, 2001 Ben Harris
@@ -32,7 +32,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.14 2004/08/07 12:07:08 rearnsha Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.15 2005/06/09 08:05:31 he Exp $");
 
 #include <sys/device.h>
 #include <sys/proc.h>
@@ -295,12 +295,12 @@
 static void
 cpu_delay_calibrate(struct device *self)
 {
-       struct timeval start, end, diff;
+       struct timeval startt, end, diff;
 
-       microtime(&start);
+       microtime(&startt);
        cpu_delayloop(10000);
        microtime(&end);
-       timersub(&end, &start, &diff);
+       timersub(&end, &startt, &diff);
        cpu_delay_factor = 10000 / diff.tv_usec + 1;
        printf("%s: 10000 loops in %ld microseconds, delay factor = %d\n",
               self->dv_xname, diff.tv_usec, cpu_delay_factor);
diff -r 5b95b2f76a26 -r 16f334a2a889 sys/arch/acorn26/acorn26/db_interface.c
--- a/sys/arch/acorn26/acorn26/db_interface.c   Thu Jun 09 07:18:17 2005 +0000
+++ b/sys/arch/acorn26/acorn26/db_interface.c   Thu Jun 09 08:05:31 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_interface.c,v 1.6 2004/08/07 11:45:41 rearnsha Exp $        */
+/*     $NetBSD: db_interface.c,v 1.7 2005/06/09 08:05:31 he Exp $      */
 
 /* 
  * Copyright (c) 1996 Scott K. Stevens
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.6 2004/08/07 11:45:41 rearnsha Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.7 2005/06/09 08:05:31 he Exp $");
 
 #include "opt_ddb.h"
 
@@ -220,7 +220,7 @@
 db_write_bytes(addr, size, data)
        vm_offset_t     addr;
        size_t  size;
-       char    *data;
+       const char      *data;
 {
 #if 0
        extern char     _stext_[], _etext[];
@@ -291,54 +291,54 @@
 }
 
 u_int
-db_fetch_reg(reg, db_regs)
+db_fetch_reg(reg, regs)
        int reg;
-       db_regs_t *db_regs;
+       db_regs_t *regs;
 {
 
        switch (reg) {
        case 0:
-               return (db_regs->tf_r0);
+               return (regs->tf_r0);
        case 1:
-               return (db_regs->tf_r1);
+               return (regs->tf_r1);
        case 2:
-               return (db_regs->tf_r2);
+               return (regs->tf_r2);
        case 3:
-               return (db_regs->tf_r3);
+               return (regs->tf_r3);
        case 4:
-               return (db_regs->tf_r4);
+               return (regs->tf_r4);
        case 5:
-               return (db_regs->tf_r5);
+               return (regs->tf_r5);
        case 6:
-               return (db_regs->tf_r6);
+               return (regs->tf_r6);
        case 7:
-               return (db_regs->tf_r7);
+               return (regs->tf_r7);
        case 8:
-               return (db_regs->tf_r8);
+               return (regs->tf_r8);
        case 9:
-               return (db_regs->tf_r9);
+               return (regs->tf_r9);
        case 10:
-               return (db_regs->tf_r10);
+               return (regs->tf_r10);
        case 11:
-               return (db_regs->tf_r11);
+               return (regs->tf_r11);
        case 12:
-               return (db_regs->tf_r12);
+               return (regs->tf_r12);
        case 13:
-               return (db_regs->tf_svc_sp);
+               return (regs->tf_svc_sp);
        case 14:
-               return (db_regs->tf_svc_lr);
+               return (regs->tf_svc_lr);
        case 15:
-               return (db_regs->tf_pc);
+               return (regs->tf_pc);
        default:
                panic("db_fetch_reg: botch");
        }
 }
 
 u_int
-branch_taken(insn, pc, db_regs)
+branch_taken(insn, pc, regs)
        u_int insn;
        u_int pc;
-       db_regs_t *db_regs;
+       db_regs_t *regs;
 {
        u_int addr, nregs;
 
@@ -350,16 +350,16 @@
                        addr |= 0xfc000000;
                return (pc + 8 + addr);
        case 0x7:       /* ldr pc, [pc, reg, lsl #2] */
-               addr = db_fetch_reg(insn & 0xf, db_regs);
+               addr = db_fetch_reg(insn & 0xf, regs);
                addr = pc + 8 + (addr << 2);
                db_read_bytes(addr, 4, (char *)&addr);
                return (addr);
        case 0x1:       /* mov pc, reg */
-               addr = db_fetch_reg(insn & 0xf, db_regs);
+               addr = db_fetch_reg(insn & 0xf, regs);
                return (addr);
        case 0x8:       /* ldmxx reg, {..., pc} */
        case 0x9:
-               addr = db_fetch_reg((insn >> 16) & 0xf, db_regs);
+               addr = db_fetch_reg((insn >> 16) & 0xf, regs);
                nregs = (insn  & 0x5555) + ((insn  >> 1) & 0x5555);
                nregs = (nregs & 0x3333) + ((nregs >> 2) & 0x3333);
                nregs = (nregs + (nregs >> 4)) & 0x0f0f;
diff -r 5b95b2f76a26 -r 16f334a2a889 sys/arch/acorn26/acorn26/db_machdep.c
--- a/sys/arch/acorn26/acorn26/db_machdep.c     Thu Jun 09 07:18:17 2005 +0000
+++ b/sys/arch/acorn26/acorn26/db_machdep.c     Thu Jun 09 08:05:31 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_machdep.c,v 1.2 2003/07/14 22:48:20 lukem Exp $     */
+/*     $NetBSD: db_machdep.c,v 1.3 2005/06/09 08:05:31 he Exp $        */
 
 /* 
  * Copyright (c) 1996 Mark Brinicombe
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.2 2003/07/14 22:48:20 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.3 2005/06/09 08:05:31 he Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -50,7 +50,7 @@
        db_expr_t       addr;
        int             have_addr;
        db_expr_t       count;
-       char            *modif;
+       const char      *modif;
 {
        int s;
        
@@ -67,7 +67,7 @@
        db_expr_t       addr;
        int             have_addr;
        db_expr_t       count;
-       char            *modif;
+       const char      *modif;
 {
        struct trapframe *frame;
 
@@ -95,7 +95,7 @@
        db_expr_t       addr;
        int             have_addr;
        db_expr_t       count;
-       char            *modif;
+       const char      *modif;
 {
        db_expr_t datum;
        bus_space_tag_t iot = 2; /* XXX */
@@ -128,7 +128,7 @@
        db_expr_t       addr;
        int             have_addr;
        db_expr_t       count;
-       char            *modif;
+       const char      *modif;
 {
 
        irq_stat(db_printf);
diff -r 5b95b2f76a26 -r 16f334a2a889 sys/arch/acorn26/acorn26/except.c
--- a/sys/arch/acorn26/acorn26/except.c Thu Jun 09 07:18:17 2005 +0000
+++ b/sys/arch/acorn26/acorn26/except.c Thu Jun 09 08:05:31 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: except.c,v 1.7 2003/11/30 13:22:32 bjh21 Exp $ */
+/* $NetBSD: except.c,v 1.8 2005/06/09 08:05:31 he Exp $ */
 /*-
  * Copyright (c) 1998, 1999, 2000 Ben Harris
  * All rights reserved.
@@ -31,7 +31,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: except.c,v 1.7 2003/11/30 13:22:32 bjh21 Exp $");
+__KERNEL_RCSID(0, "$NetBSD: except.c,v 1.8 2005/06/09 08:05:31 he Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ktrace.h"
@@ -199,7 +199,7 @@
     struct vm_map *map, vaddr_t va, vm_prot_t atype)
 {
        int error;
-       struct pcb *curpcb;
+       struct pcb *cur_pcb;
 
        if (pmap_fault(map->pmap, va, atype))
                return;
@@ -218,11 +218,11 @@
        if (error != 0) {
                ksiginfo_t ksi;
 
-               curpcb = &l->l_addr->u_pcb;
-               if (curpcb->pcb_onfault != NULL) {
+               cur_pcb = &l->l_addr->u_pcb;
+               if (cur_pcb->pcb_onfault != NULL) {
                        tf->tf_r0 = error;
                        tf->tf_r15 = (tf->tf_r15 & ~R15_PC) |
-                           (register_t)curpcb->pcb_onfault;
+                           (register_t)cur_pcb->pcb_onfault;
                        return;
                }
                KSI_INIT_TRAP(&ksi);
diff -r 5b95b2f76a26 -r 16f334a2a889 sys/arch/acorn26/acorn26/start.c
--- a/sys/arch/acorn26/acorn26/start.c  Thu Jun 09 07:18:17 2005 +0000
+++ b/sys/arch/acorn26/acorn26/start.c  Thu Jun 09 08:05:31 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: start.c,v 1.5 2003/12/30 12:33:13 pk Exp $ */
+/* $NetBSD: start.c,v 1.6 2005/06/09 08:05:31 he Exp $ */
 /*-
  * Copyright (c) 1998, 2000 Ben Harris
  * All rights reserved.
@@ -31,7 +31,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: start.c,v 1.5 2003/12/30 12:33:13 pk Exp $");
+__KERNEL_RCSID(0, "$NetBSD: start.c,v 1.6 2005/06/09 08:05:31 he Exp $");
 
 #include <sys/msgbuf.h>
 #include <sys/user.h>
@@ -69,8 +69,8 @@
 extern i2c_tag_t acorn26_i2c_tag;
 
 /* We don't pass a command line yet. */
-char *boot_args = "";
-char *boot_file = "";
+const char *boot_args = "";
+const char *boot_file = "";
 
 #ifdef DIAGNOSTIC
 #define BOOT_SANITY 0x89345846
diff -r 5b95b2f76a26 -r 16f334a2a889 sys/arch/acorn26/include/db_machdep.h
--- a/sys/arch/acorn26/include/db_machdep.h     Thu Jun 09 07:18:17 2005 +0000
+++ b/sys/arch/acorn26/include/db_machdep.h     Thu Jun 09 08:05:31 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.h,v 1.1 2002/03/24 15:46:55 bjh21 Exp $ */
+/* $NetBSD: db_machdep.h,v 1.2 2005/06/09 08:05:31 he Exp $ */
 
 #include <arm/db_machdep.h>
 
@@ -7,7 +7,7 @@
 #define DB_ELF_SYMBOLS
 #define DB_ELFSIZE 32
 
-void db_show_panic_cmd __P((db_expr_t, int, db_expr_t, char *));
-void db_show_frame_cmd __P((db_expr_t, int, db_expr_t, char *));
-void db_bus_write_cmd  __P((db_expr_t, int, db_expr_t, char *));
-void db_irqstat_cmd    __P((db_expr_t, int, db_expr_t, char *));
+void db_show_panic_cmd __P((db_expr_t, int, db_expr_t, const char *));
+void db_show_frame_cmd __P((db_expr_t, int, db_expr_t, const char *));



Home | Main Index | Thread Index | Old Index