Module Name: src Committed By: rillig Date: Sat Aug 28 17:11:19 UTC 2021
Modified Files: src/usr.bin/xlint/lint2: emit2.c externs2.h hash.c main2.c Log Message: lint: remove unused parameter from forall No functional change. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/usr.bin/xlint/lint2/emit2.c cvs rdiff -u -r1.12 -r1.13 src/usr.bin/xlint/lint2/externs2.h cvs rdiff -u -r1.17 -r1.18 src/usr.bin/xlint/lint2/hash.c cvs rdiff -u -r1.19 -r1.20 src/usr.bin/xlint/lint2/main2.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/emit2.c diff -u src/usr.bin/xlint/lint2/emit2.c:1.20 src/usr.bin/xlint/lint2/emit2.c:1.21 --- src/usr.bin/xlint/lint2/emit2.c:1.20 Tue Aug 24 21:30:52 2021 +++ src/usr.bin/xlint/lint2/emit2.c Sat Aug 28 17:11:19 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: emit2.c,v 1.20 2021/08/24 21:30:52 rillig Exp $ */ +/* $NetBSD: emit2.c,v 1.21 2021/08/28 17:11:19 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.20 2021/08/24 21:30:52 rillig Exp $"); +__RCSID("$NetBSD: emit2.c,v 1.21 2021/08/28 17:11:19 rillig Exp $"); #endif #include "lint2.h" @@ -246,7 +246,7 @@ outlib(const char *name) outfiles(); /* write all definitions with external linkage */ - forall(dumpname); + symtab_forall(dumpname); /* close the output */ outclose(); Index: src/usr.bin/xlint/lint2/externs2.h diff -u src/usr.bin/xlint/lint2/externs2.h:1.12 src/usr.bin/xlint/lint2/externs2.h:1.13 --- src/usr.bin/xlint/lint2/externs2.h:1.12 Sun Aug 22 14:50:06 2021 +++ src/usr.bin/xlint/lint2/externs2.h Sat Aug 28 17:11:19 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: externs2.h,v 1.12 2021/08/22 14:50:06 rillig Exp $ */ +/* $NetBSD: externs2.h,v 1.13 2021/08/28 17:11:19 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -52,12 +52,11 @@ extern bool Tflag; */ extern void _inithash(hte_t ***); extern hte_t *_hsearch(hte_t **, const char *, bool); -extern void _forall(hte_t **, void (*)(hte_t *)); +extern void symtab_forall(void (*)(hte_t *)); extern void _destroyhash(hte_t **); #define inithash() _inithash(NULL); #define hsearch(a, b) _hsearch(NULL, (a), (b)) -#define forall(a) _forall(NULL, (a)) /* * read.c Index: src/usr.bin/xlint/lint2/hash.c diff -u src/usr.bin/xlint/lint2/hash.c:1.17 src/usr.bin/xlint/lint2/hash.c:1.18 --- src/usr.bin/xlint/lint2/hash.c:1.17 Sat Aug 28 12:21:53 2021 +++ src/usr.bin/xlint/lint2/hash.c Sat Aug 28 17:11:19 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: hash.c,v 1.17 2021/08/28 12:21:53 rillig Exp $ */ +/* $NetBSD: hash.c,v 1.18 2021/08/28 17:11:19 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: hash.c,v 1.17 2021/08/28 12:21:53 rillig Exp $"); +__RCSID("$NetBSD: hash.c,v 1.18 2021/08/28 17:11:19 rillig Exp $"); #endif /* @@ -128,20 +128,18 @@ _hsearch(hte_t **table, const char *s, b } /* - * Call function f for each name in the hash table. + * Call the action for each name in the hash table. */ void -_forall(hte_t **table, void (*f)(hte_t *)) +symtab_forall(void (*action)(hte_t *)) { int i; hte_t *hte; - - if (table == NULL) - table = htab; + hte_t **table = htab; for (i = 0; i < HSHSIZ2; i++) { for (hte = table[i]; hte != NULL; hte = hte->h_link) - (*f)(hte); + action(hte); } } Index: src/usr.bin/xlint/lint2/main2.c diff -u src/usr.bin/xlint/lint2/main2.c:1.19 src/usr.bin/xlint/lint2/main2.c:1.20 --- src/usr.bin/xlint/lint2/main2.c:1.19 Sun Aug 22 04:43:44 2021 +++ src/usr.bin/xlint/lint2/main2.c Sat Aug 28 17:11:19 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: main2.c,v 1.19 2021/08/22 04:43:44 rillig Exp $ */ +/* $NetBSD: main2.c,v 1.20 2021/08/28 17:11:19 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: main2.c,v 1.19 2021/08/22 04:43:44 rillig Exp $"); +__RCSID("$NetBSD: main2.c,v 1.20 2021/08/28 17:11:19 rillig Exp $"); #endif #include <stdio.h> @@ -174,7 +174,7 @@ main(int argc, char *argv[]) /* write the lint library */ if (Cflag) { - forall(mkstatic); + symtab_forall(mkstatic); outlib(libname); } @@ -182,13 +182,13 @@ main(int argc, char *argv[]) for (i = 0; libs[i] != NULL; i++) readfile(libs[i]); - forall(mkstatic); + symtab_forall(mkstatic); mainused(); /* perform all tests */ /* TODO: sort the names; hashcode order looks chaotic. */ - forall(check_name); + symtab_forall(check_name); exit(0); /* NOTREACHED */