Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/config To make -Wconversion happy, cast return value...



details:   https://anonhg.NetBSD.org/src/rev/ae93393f6bd5
branches:  trunk
changeset: 803594:ae93393f6bd5
user:      joerg <joerg%NetBSD.org@localhost>
date:      Tue Nov 04 23:00:35 2014 +0000

description:
To make -Wconversion happy, cast return value of tolower/toupper to
char.

diffstat:

 usr.bin/config/main.c      |   6 +++---
 usr.bin/config/mkheaders.c |  10 +++++-----
 usr.bin/config/sem.c       |   6 +++---
 3 files changed, 11 insertions(+), 11 deletions(-)

diffs (99 lines):

diff -r c9b072bda128 -r ae93393f6bd5 usr.bin/config/main.c
--- a/usr.bin/config/main.c     Tue Nov 04 22:37:09 2014 +0000
+++ b/usr.bin/config/main.c     Tue Nov 04 23:00:35 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.71 2014/10/31 07:38:36 uebayasi Exp $       */
+/*     $NetBSD: main.c,v 1.72 2014/11/04 23:00:35 joerg Exp $  */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: main.c,v 1.71 2014/10/31 07:38:36 uebayasi Exp $");
+__RCSID("$NetBSD: main.c,v 1.72 2014/11/04 23:00:35 joerg Exp $");
 
 #ifndef MAKE_BOOTSTRAP
 #include <sys/cdefs.h>
@@ -1556,7 +1556,7 @@
        char c;
 
        for (n = name, p = low; (c = *n) != '\0'; n++)
-               *p++ = isupper((u_char)c) ? tolower((u_char)c) : c;
+               *p++ = isupper((u_char)c) ? (char)tolower((u_char)c) : c;
        *p = 0;
        return (intern(low));
 }
diff -r c9b072bda128 -r ae93393f6bd5 usr.bin/config/mkheaders.c
--- a/usr.bin/config/mkheaders.c        Tue Nov 04 22:37:09 2014 +0000
+++ b/usr.bin/config/mkheaders.c        Tue Nov 04 23:00:35 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mkheaders.c,v 1.24 2014/10/30 15:13:11 christos Exp $  */
+/*     $NetBSD: mkheaders.c,v 1.25 2014/11/04 23:00:35 joerg Exp $     */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: mkheaders.c,v 1.24 2014/10/30 15:13:11 christos Exp $");
+__RCSID("$NetBSD: mkheaders.c,v 1.25 2014/11/04 23:00:35 joerg Exp $");
 
 #include <sys/param.h>
 #include <ctype.h>
@@ -323,7 +323,7 @@
                locdup = estrdup(name);
                for (cp = locdup; *cp; cp++)
                        if (islower((unsigned char)*cp))
-                               *cp = toupper((unsigned char)*cp);
+                               *cp = (char)toupper((unsigned char)*cp);
                for (i = 0, ll = a->a_locs; ll; ll = ll->ll_next, i++) {
                        if (strchr(ll->ll_name, ' ') != NULL ||
                            strchr(ll->ll_name, '\t') != NULL)
@@ -335,7 +335,7 @@
                        namedup = estrdup(ll->ll_name);
                        for (cp = namedup; *cp; cp++)
                                if (islower((unsigned char)*cp))
-                                       *cp = toupper((unsigned char)*cp);
+                                       *cp = (char)toupper((unsigned char)*cp);
                                else if (*cp == ARRCHR)
                                        *cp = '_';
                        fprintf(fp, "#define %sCF_%s %d\n", locdup, namedup, i);
@@ -533,7 +533,7 @@
        dst = buf;
        *dst++ = 'N';
        while ((c = *src++) != 0)
-               *dst++ = islower((u_char)c) ? toupper((u_char)c) : c;
+               *dst++ = islower((u_char)c) ? (char)toupper((u_char)c) : c;
        *dst = 0;
        return (buf);
 }
diff -r c9b072bda128 -r ae93393f6bd5 usr.bin/config/sem.c
--- a/usr.bin/config/sem.c      Tue Nov 04 22:37:09 2014 +0000
+++ b/usr.bin/config/sem.c      Tue Nov 04 23:00:35 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sem.c,v 1.67 2014/11/01 04:34:27 uebayasi Exp $        */
+/*     $NetBSD: sem.c,v 1.68 2014/11/04 23:00:35 joerg Exp $   */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: sem.c,v 1.67 2014/11/01 04:34:27 uebayasi Exp $");
+__RCSID("$NetBSD: sem.c,v 1.68 2014/11/04 23:00:35 joerg Exp $");
 
 #include <sys/param.h>
 #include <ctype.h>
@@ -398,7 +398,7 @@
                            "lower-case alphanumeric characters");
                        errored = 1;
                }
-               *cp = toupper((unsigned char)*cp);
+               *cp = (char)toupper((unsigned char)*cp);
        }
        a->a_devclass = intern(classenum);
 



Home | Main Index | Thread Index | Old Index