Module Name: src Committed By: rillig Date: Tue Nov 16 22:12:44 UTC 2021
Modified Files: src/usr.bin/xlint/lint2: chk.c emit2.c read.c Log Message: lint: clean up lint2 No functional change. To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/usr.bin/xlint/lint2/chk.c cvs rdiff -u -r1.26 -r1.27 src/usr.bin/xlint/lint2/emit2.c cvs rdiff -u -r1.68 -r1.69 src/usr.bin/xlint/lint2/read.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/xlint/lint2/chk.c diff -u src/usr.bin/xlint/lint2/chk.c:1.45 src/usr.bin/xlint/lint2/chk.c:1.46 --- src/usr.bin/xlint/lint2/chk.c:1.45 Sun Aug 29 10:13:02 2021 +++ src/usr.bin/xlint/lint2/chk.c Tue Nov 16 22:12:44 2021 @@ -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 @@ static void 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 @@ static void 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; Index: src/usr.bin/xlint/lint2/emit2.c diff -u src/usr.bin/xlint/lint2/emit2.c:1.26 src/usr.bin/xlint/lint2/emit2.c:1.27 --- src/usr.bin/xlint/lint2/emit2.c:1.26 Sat Sep 4 18:58:57 2021 +++ src/usr.bin/xlint/lint2/emit2.c Tue Nov 16 22:12:44 2021 @@ -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 @@ outlib(const char *name) 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(); Index: src/usr.bin/xlint/lint2/read.c diff -u src/usr.bin/xlint/lint2/read.c:1.68 src/usr.bin/xlint/lint2/read.c:1.69 --- src/usr.bin/xlint/lint2/read.c:1.68 Tue Nov 16 22:03:12 2021 +++ src/usr.bin/xlint/lint2/read.c Tue Nov 16 22:12:44 2021 @@ -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 unsigned short inptype(const char 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 @@ storetyp(type_t *tp, const char *cp, siz /* * Hash function for types */ -static int +static unsigned int thash(const char *s, size_t len) { unsigned int v; @@ -1203,7 +1203,7 @@ mkstatic(hte_t *hte) 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 @@ mkstatic(hte_t *hte) } 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 @@ mkstatic(hte_t *hte) } 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;