Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/shark/shark Appease -Wshadow and -Wcast-qual



details:   https://anonhg.NetBSD.org/src/rev/a2020101f4c5
branches:  trunk
changeset: 581643:a2020101f4c5
user:      scw <scw%NetBSD.org@localhost>
date:      Fri Jun 03 13:14:09 2005 +0000

description:
Appease -Wshadow and -Wcast-qual

diffstat:

 sys/arch/shark/shark/pccons.c |  32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diffs (96 lines):

diff -r 8a70a1f3c44c -r a2020101f4c5 sys/arch/shark/shark/pccons.c
--- a/sys/arch/shark/shark/pccons.c     Fri Jun 03 13:02:35 2005 +0000
+++ b/sys/arch/shark/shark/pccons.c     Fri Jun 03 13:14:09 2005 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: pccons.c,v 1.20 2005/01/05 10:25:43 tsutsui Exp $       */
+/*      $NetBSD: pccons.c,v 1.21 2005/06/03 13:14:09 scw Exp $       */
 
 /*
  * Copyright 1997
@@ -135,7 +135,7 @@
 */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pccons.c,v 1.20 2005/01/05 10:25:43 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pccons.c,v 1.21 2005/06/03 13:14:09 scw Exp $");
 
 #include "opt_ddb.h"
 #include "opt_xserver.h"
@@ -311,7 +311,7 @@
 int                    pcintr              __P((void *));
 char                   *sget               __P((struct pc_softc *));
 void                   sput                __P((struct pc_softc *,
-                                                u_char *, 
+                                                const u_char *, 
                                                 int,
                                                 u_char));
 void                   pcstart             __P((struct tty *));
@@ -2378,10 +2378,10 @@
 */
 #define wrtchar(sc, c, at) \
 do { \
-    char *cp = (char *)crtat; \
+    char *__cp = (char *)crtat; \
 \
-    *cp++    = (c); \
-    *cp      = (at); \
+    *__cp++    = (c); \
+    *__cp      = (at); \
     crtat++; sc->vs.col++; \
 } while (0)
 
@@ -2427,7 +2427,7 @@
 */
 void
 sput(struct pc_softc   *sc,
-     u_char            *cp, 
+     const u_char      *cp, 
      int               n,
      u_char            nowait)
 {
@@ -2439,7 +2439,7 @@
     /* Initialise the display if not done already */
     if (crtat == 0) 
     {
-        u_short volatile *cp;
+        u_short volatile *cp2;
 #ifdef DOESNT_ALWAYS_DO_THE_RIGHT_THING
         u_short was;
 #endif
@@ -2453,19 +2453,19 @@
         ** we operate in color mode otherwise
         ** mono.
         */
-        cp = (void *)((u_long)(CGA_BUF) + vam_mem_data);
+        cp2 = (void *)((u_long)(CGA_BUF) + vam_mem_data);
 #ifdef DOESNT_ALWAYS_DO_THE_RIGHT_THING
-        was = *cp;              /* save whatever is at CGA_BUF */
-        *cp = (u_short) 0xA55A;
-        if (*cp != 0xA55A) 
+        was = *cp2;              /* save whatever is at CGA_BUF */
+        *cp2 = (u_short) 0xA55A;
+        if (*cp2 != 0xA55A) 
         {
-            cp = (void *)((u_long)(MONO_BUF) + vam_mem_data);
+            cp2 = (void *)((u_long)(MONO_BUF) + vam_mem_data);
             addr_6845 = MONO_BASE;
             sc->vs.color = 0;
         } 
         else 
         {
-            *cp = was;          /* restore previous contents of CGA_BUF */
+            *cp2 = was;          /* restore previous contents of CGA_BUF */
             addr_6845 = CGA_BASE;
             sc->vs.color = 1;
         }
@@ -2484,8 +2484,8 @@
         cursor_shape = 0x0012;
 #endif
         /* Save cursor locations */
-        Crtat = (u_short *)cp;
-        crtat = (u_short *)(cp + cursorat);
+        Crtat = __UNVOLATILE(cp2);
+        crtat = __UNVOLATILE(cp2 + cursorat);
         
         /* Set up screen size and colours */
         sc->vs.ncol = COL;



Home | Main Index | Thread Index | Old Index