Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xlint/lint2 lint: fix type of local variable in inpq...



details:   https://anonhg.NetBSD.org/src/rev/bbbdb7e0ab09
branches:  trunk
changeset: 1022756:bbbdb7e0ab09
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Aug 05 06:54:16 2021 +0000

description:
lint: fix type of local variable in inpqstrg

Noted by Clang-Tidy.

diffstat:

 usr.bin/xlint/lint2/read.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r 08ddcd3217e7 -r bbbdb7e0ab09 usr.bin/xlint/lint2/read.c
--- a/usr.bin/xlint/lint2/read.c        Thu Aug 05 06:45:37 2021 +0000
+++ b/usr.bin/xlint/lint2/read.c        Thu Aug 05 06:54:16 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.47 2021/08/05 06:45:37 rillig Exp $ */
+/* $NetBSD: read.c,v 1.48 2021/08/05 06:54:16 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: read.c,v 1.47 2021/08/05 06:45:37 rillig Exp $");
+__RCSID("$NetBSD: read.c,v 1.48 2021/08/05 06:54:16 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -1057,7 +1057,7 @@
 {
        char    *strg, *dst;
        size_t  slen;
-       int     c;
+       char    c;
        int     v;
 
        dst = strg = xmalloc(slen = 32);
@@ -1110,7 +1110,7 @@
                                if ((c = *src++) < '0' || c > '7')
                                        inperr("not octal: %c", c);
                                v |= c - '0';
-                               c = (u_char)v;
+                               c = (char)v;
                                break;
                        default:
                                inperr("bad \\ escape: %c", c);
@@ -1122,7 +1122,7 @@
                        dst = strg + (slen - 1);
                        slen *= 2;
                }
-               *dst++ = (char)c;
+               *dst++ = c;
                if ((c = *src++) == '\0')
                        inperr("missing closing quote");
        }



Home | Main Index | Thread Index | Old Index