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: remove unused parameter from forall



details:   https://anonhg.NetBSD.org/src/rev/ab695d3c85e7
branches:  trunk
changeset: 1023177:ab695d3c85e7
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Aug 28 17:11:19 2021 +0000

description:
lint: remove unused parameter from forall

No functional change.

diffstat:

 usr.bin/xlint/lint2/emit2.c    |   6 +++---
 usr.bin/xlint/lint2/externs2.h |   5 ++---
 usr.bin/xlint/lint2/hash.c     |  14 ++++++--------
 usr.bin/xlint/lint2/main2.c    |  10 +++++-----
 4 files changed, 16 insertions(+), 19 deletions(-)

diffs (136 lines):

diff -r 4ab0883aae7f -r ab695d3c85e7 usr.bin/xlint/lint2/emit2.c
--- a/usr.bin/xlint/lint2/emit2.c       Sat Aug 28 16:51:57 2021 +0000
+++ b/usr.bin/xlint/lint2/emit2.c       Sat Aug 28 17:11:19 2021 +0000
@@ -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 @@
        outfiles();
 
        /* write all definitions with external linkage */
-       forall(dumpname);
+       symtab_forall(dumpname);
 
        /* close the output */
        outclose();
diff -r 4ab0883aae7f -r ab695d3c85e7 usr.bin/xlint/lint2/externs2.h
--- a/usr.bin/xlint/lint2/externs2.h    Sat Aug 28 16:51:57 2021 +0000
+++ b/usr.bin/xlint/lint2/externs2.h    Sat Aug 28 17:11:19 2021 +0000
@@ -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 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
diff -r 4ab0883aae7f -r ab695d3c85e7 usr.bin/xlint/lint2/hash.c
--- a/usr.bin/xlint/lint2/hash.c        Sat Aug 28 16:51:57 2021 +0000
+++ b/usr.bin/xlint/lint2/hash.c        Sat Aug 28 17:11:19 2021 +0000
@@ -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 @@
 }
 
 /*
- * 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);
        }
 }
 
diff -r 4ab0883aae7f -r ab695d3c85e7 usr.bin/xlint/lint2/main2.c
--- a/usr.bin/xlint/lint2/main2.c       Sat Aug 28 16:51:57 2021 +0000
+++ b/usr.bin/xlint/lint2/main2.c       Sat Aug 28 17:11:19 2021 +0000
@@ -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 @@
 
        /* write the lint library */
        if (Cflag) {
-               forall(mkstatic);
+               symtab_forall(mkstatic);
                outlib(libname);
        }
 
@@ -182,13 +182,13 @@
        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 */



Home | Main Index | Thread Index | Old Index