Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x68k/dev Change the last arg of ite_sendstr() to co...



details:   https://anonhg.NetBSD.org/src/rev/f9e2ab660d49
branches:  trunk
changeset: 581987:f9e2ab660d49
user:      he <he%NetBSD.org@localhost>
date:      Sun Jun 12 23:46:41 2005 +0000

description:
Change the last arg of ite_sendstr() to const char*, so that this builds
under -Wcast-qual.  Also rename a local variable to build with -Wshadow.

diffstat:

 sys/arch/x68k/dev/ite.c |  52 ++++++++++++++++++++++++------------------------
 1 files changed, 26 insertions(+), 26 deletions(-)

diffs (154 lines):

diff -r 4fb88f9c26a1 -r f9e2ab660d49 sys/arch/x68k/dev/ite.c
--- a/sys/arch/x68k/dev/ite.c   Sun Jun 12 23:43:49 2005 +0000
+++ b/sys/arch/x68k/dev/ite.c   Sun Jun 12 23:46:41 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ite.c,v 1.39 2005/01/18 07:27:20 chs Exp $     */
+/*     $NetBSD: ite.c,v 1.40 2005/06/12 23:46:41 he Exp $      */
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -83,7 +83,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.39 2005/01/18 07:27:20 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.40 2005/06/12 23:46:41 he Exp $");
 
 #include "ite.h"
 #if NITE > 0
@@ -149,7 +149,7 @@
 static void itecheckwrap(struct ite_softc *);
 static int ite_argnum(struct ite_softc *);
 static int ite_zargnum(struct ite_softc *);
-static void ite_sendstr(struct ite_softc *, char *);
+static void ite_sendstr(struct ite_softc *, const char *);
 __inline static int atoi(const char *);
 void ite_reset(struct ite_softc *);
 struct ite_softc *getitesp(dev_t);
@@ -941,7 +941,7 @@
 
 /* helper functions, makes the code below more readable */
 __inline static void 
-ite_sendstr(struct ite_softc *ip, char *str)
+ite_sendstr(struct ite_softc *ip, const char *str)
 {
        while (*str)
                itesendch (*str++);
@@ -1909,95 +1909,95 @@
                        case 'm':
                                /* big attribute setter/resetter */
                        {
-                               char *cp;
+                               char *c_p;
                                *ip->ap = 0;
                                /* kludge to make CSIm work (== CSI0m) */
                                if (ip->ap == ip->argbuf)
                                        ip->ap++;
-                               for (cp = ip->argbuf; cp < ip->ap; ) {
-                                       switch (*cp) {
+                               for (c_p = ip->argbuf; c_p < ip->ap; ) {
+                                       switch (*c_p) {
                                        case 0:
                                        case '0':
                                                clr_attr (ip, ATTR_ALL);
                                                ip->fgcolor = 7;
                                                ip->bgcolor = 0;
-                                               cp++;
+                                               c_p++;
                                                break;
 
                                        case '1':
                                                set_attr (ip, ATTR_BOLD);
-                                               cp++;
+                                               c_p++;
                                                break;
 
                                        case '2':
-                                               switch (cp[1]) {
+                                               switch (c_p[1]) {
                                                case '2':
                                                        clr_attr (ip, ATTR_BOLD);
-                                                       cp += 2;
+                                                       c_p += 2;
                                                        break;
 
                                                case '4':
                                                        clr_attr (ip, ATTR_UL);
-                                                       cp += 2;
+                                                       c_p += 2;
                                                        break;
 
                                                case '5':
                                                        clr_attr (ip, ATTR_BLINK);
-                                                       cp += 2;
+                                                       c_p += 2;
                                                        break;
 
                                                case '7':
                                                        clr_attr (ip, ATTR_INV);
-                                                       cp += 2;
+                                                       c_p += 2;
                                                        break;
 
                                                default:
-                                                       cp++;
+                                                       c_p++;
                                                        break;
                                                }
                                                break;
 
                                        case '3':
-                                               switch (cp[1]) {
+                                               switch (c_p[1]) {
                                                case '0': case '1': case '2': case '3':
                                                case '4': case '5': case '6': case '7':
                                                        /* foreground colors */
-                                                       ip->fgcolor = cp[1] - '0';
-                                                       cp += 2;
+                                                       ip->fgcolor = c_p[1] - '0';
+                                                       c_p += 2;
                                                        break;
                                                default:
-                                                       cp++;
+                                                       c_p++;
                                                        break;
                                                }
                                                break;
 
                                        case '4':
-                                               switch (cp[1]) {
+                                               switch (c_p[1]) {
                                                case '0': case '1': case '2': case '3':
                                                case '4': case '5': case '6': case '7':
                                                        /* background colors */
-                                                       ip->bgcolor = cp[1] - '0';
-                                                       cp += 2;
+                                                       ip->bgcolor = c_p[1] - '0';
+                                                       c_p += 2;
                                                        break;
                                                default:
                                                        set_attr (ip, ATTR_UL);
-                                                       cp++;
+                                                       c_p++;
                                                        break;
                                                }
                                                break;
 
                                        case '5':
                                                set_attr (ip, ATTR_BLINK);
-                                               cp++;
+                                               c_p++;
                                                break;
 
                                        case '7':
                                                set_attr (ip, ATTR_INV);
-                                               cp++;
+                                               c_p++;
                                                break;
 
                                        default:
-                                               cp++;
+                                               c_p++;
                                                break;
                                        }
                                }



Home | Main Index | Thread Index | Old Index