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: clean up lint2



details:   https://anonhg.NetBSD.org/src/rev/7897ddefea5d
branches:  trunk
changeset: 1026299:7897ddefea5d
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Nov 16 22:12:44 2021 +0000

description:
lint: clean up lint2

No functional change.

diffstat:

 usr.bin/xlint/lint2/chk.c   |   8 ++++----
 usr.bin/xlint/lint2/emit2.c |   6 +++---
 usr.bin/xlint/lint2/read.c  |  14 +++++++-------
 3 files changed, 14 insertions(+), 14 deletions(-)

diffs (126 lines):

diff -r 7ee234adfa7e -r 7897ddefea5d usr.bin/xlint/lint2/chk.c
--- a/usr.bin/xlint/lint2/chk.c Tue Nov 16 22:03:12 2021 +0000
+++ b/usr.bin/xlint/lint2/chk.c Tue Nov 16 22:12:44 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: chk.c,v 1.45 2021/08/29 10:13:02 rillig Exp $ */
+/* $NetBSD: chk.c,v 1.46 2021/11/16 22:12:44 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: chk.c,v 1.45 2021/08/29 10:13:02 rillig Exp $");
+__RCSID("$NetBSD: chk.c,v 1.46 2021/11/16 22:12:44 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -607,7 +607,7 @@
 printflike(const hte_t *hte, fcall_t *call, int n, const char *fmt, type_t **ap)
 {
        const   char *fp;
-       int     fc;
+       char    fc;
        bool    fwidth, prec, left, sign, space, alt, zero;
        tspec_t sz, t1, t2 = NOTSPEC;
        type_t  *tp;
@@ -832,7 +832,7 @@
 scanflike(const hte_t *hte, fcall_t *call, int n, const char *fmt, type_t **ap)
 {
        const   char *fp;
-       int     fc;
+       char    fc;
        bool    noasgn, fwidth;
        tspec_t sz, t1 = NOTSPEC, t2 = NOTSPEC;
        type_t  *tp = NULL;
diff -r 7ee234adfa7e -r 7897ddefea5d usr.bin/xlint/lint2/emit2.c
--- a/usr.bin/xlint/lint2/emit2.c       Tue Nov 16 22:03:12 2021 +0000
+++ b/usr.bin/xlint/lint2/emit2.c       Tue Nov 16 22:12:44 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: emit2.c,v 1.26 2021/09/04 18:58:57 rillig Exp $ */
+/* $NetBSD: emit2.c,v 1.27 2021/11/16 22:12:44 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: emit2.c,v 1.26 2021/09/04 18:58:57 rillig Exp $");
+__RCSID("$NetBSD: emit2.c,v 1.27 2021/11/16 22:12:44 rillig Exp $");
 #endif
 
 #include "lint2.h"
@@ -213,7 +213,7 @@
        outstrg(name);
 
        /*
-        * print the names of all files references by unnamed
+        * print the names of all files referenced by unnamed
         * struct/union/enum declarations.
         */
        outfiles();
diff -r 7ee234adfa7e -r 7897ddefea5d usr.bin/xlint/lint2/read.c
--- a/usr.bin/xlint/lint2/read.c        Tue Nov 16 22:03:12 2021 +0000
+++ b/usr.bin/xlint/lint2/read.c        Tue Nov 16 22:12:44 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.68 2021/11/16 22:03:12 rillig Exp $ */
+/* $NetBSD: read.c,v 1.69 2021/11/16 22:12:44 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.68 2021/11/16 22:03:12 rillig Exp $");
+__RCSID("$NetBSD: read.c,v 1.69 2021/11/16 22:12:44 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -102,7 +102,7 @@
 static size_t  gettlen(const char *, const char **);
 static unsigned short findtype(const char *, size_t, int);
 static unsigned short storetyp(type_t *, const char *, size_t, int);
-static int     thash(const char *, size_t);
+static unsigned int thash(const char *, size_t);
 static char    *inpqstrg(const char *, const char **);
 static const   char *inpname(const char *, const char **);
 static int     getfnidx(const char *);
@@ -980,7 +980,7 @@
 /*
  * Hash function for types
  */
-static int
+static unsigned int
 thash(const char *s, size_t len)
 {
        unsigned int v;
@@ -1203,7 +1203,7 @@
        for (symp = &hte->h_syms; (sym = *symp) != NULL; ) {
                if (sym->s_pos.p_src == sym1->s_pos.p_src) {
                        sym->s_static = true;
-                       (*symp) = sym->s_next;
+                       *symp = sym->s_next;
                        if (hte->h_lsym == &sym->s_next)
                                hte->h_lsym = symp;
                        sym->s_next = NULL;
@@ -1215,7 +1215,7 @@
        }
        for (callp = &hte->h_calls; (call = *callp) != NULL; ) {
                if (call->f_pos.p_src == sym1->s_pos.p_src) {
-                       (*callp) = call->f_next;
+                       *callp = call->f_next;
                        if (hte->h_lcall == &call->f_next)
                                hte->h_lcall = callp;
                        call->f_next = NULL;
@@ -1227,7 +1227,7 @@
        }
        for (usymp = &hte->h_usyms; (usym = *usymp) != NULL; ) {
                if (usym->u_pos.p_src == sym1->s_pos.p_src) {
-                       (*usymp) = usym->u_next;
+                       *usymp = usym->u_next;
                        if (hte->h_lusym == &usym->u_next)
                                hte->h_lusym = usymp;
                        usym->u_next = NULL;



Home | Main Index | Thread Index | Old Index