Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xlint/lint1 lint: clean up style



details:   https://anonhg.NetBSD.org/src/rev/4105a6a6e1c5
branches:  trunk
changeset: 364652:4105a6a6e1c5
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Apr 02 22:38:45 2022 +0000

description:
lint: clean up style

Remove outdated ARGSUSED (the one in tree.c had been wrong since 1995),
remove unused argument.

No functional change.

diffstat:

 usr.bin/xlint/lint1/decl.c |  14 +++++---------
 usr.bin/xlint/lint1/init.c |  10 +++++-----
 usr.bin/xlint/lint1/tree.c |   7 +++----
 3 files changed, 13 insertions(+), 18 deletions(-)

diffs (130 lines):

diff -r 027de4a5978d -r 4105a6a6e1c5 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Sat Apr 02 22:15:57 2022 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Sat Apr 02 22:38:45 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.266 2022/04/02 22:15:57 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.267 2022/04/02 22:38:45 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: decl.c,v 1.266 2022/04/02 22:15:57 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.267 2022/04/02 22:38:45 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -70,7 +70,7 @@
 static bool    mnoarg(const type_t *, bool *);
 static bool    check_old_style_definition(sym_t *, sym_t *);
 static bool    check_prototype_declaration(sym_t *, sym_t *);
-static sym_t   *new_style_function(sym_t *, sym_t *);
+static sym_t   *new_style_function(sym_t *);
 static void    old_style_function(sym_t *, sym_t *);
 static void    declare_external_in_block(sym_t *);
 static bool    check_init(sym_t *);
@@ -1396,7 +1396,7 @@
                if (tflag)
                        /* function prototypes are illegal in traditional C */
                        warning(270);
-               args = new_style_function(decl, args);
+               args = new_style_function(args);
        } else {
                old_style_function(decl, args);
        }
@@ -1445,12 +1445,8 @@
        return decl;
 }
 
-/*
- * Called for new style function declarations.
- */
-/* ARGSUSED */
 static sym_t *
-new_style_function(sym_t *decl, sym_t *args)
+new_style_function(sym_t *args)
 {
        sym_t   *arg, *sym;
        scl_t   sc;
diff -r 027de4a5978d -r 4105a6a6e1c5 usr.bin/xlint/lint1/init.c
--- a/usr.bin/xlint/lint1/init.c        Sat Apr 02 22:15:57 2022 +0000
+++ b/usr.bin/xlint/lint1/init.c        Sat Apr 02 22:38:45 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init.c,v 1.232 2022/02/27 10:31:58 rillig Exp $        */
+/*     $NetBSD: init.c,v 1.233 2022/04/02 22:38:45 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.232 2022/02/27 10:31:58 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.233 2022/04/02 22:38:45 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -568,7 +568,7 @@
        tp = designation_parent_type(dn, bl->bl_type);
 
        if (bl->bl_designation.dn_len == 0)
-               designation_descend(dn, bl->bl_type);
+               (void)designation_descend(dn, bl->bl_type);
        dr = designation_last(dn);
        /* TODO: try to switch on dr->dr_kind instead */
        switch (tp->t_tspec) {
@@ -792,7 +792,7 @@
 
        if (outer_bl != NULL && outer_bl->bl_designation.dn_len == 0) {
                designation *dn = &outer_bl->bl_designation;
-               designation_descend(dn, outer_bl->bl_type);
+               (void)designation_descend(dn, outer_bl->bl_type);
                tp = designation_type(dn, outer_bl->bl_type);
        }
 
@@ -972,7 +972,7 @@
 
        bl = in->in_brace_level;
        if (bl != NULL && bl->bl_designation.dn_len == 0)
-               designation_descend(&bl->bl_designation, bl->bl_type);
+               (void)designation_descend(&bl->bl_designation, bl->bl_type);
        if (bl != NULL)
                brace_level_advance(bl, &in->in_max_subscript);
 
diff -r 027de4a5978d -r 4105a6a6e1c5 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sat Apr 02 22:15:57 2022 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sat Apr 02 22:38:45 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.416 2022/04/02 14:28:30 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.417 2022/04/02 22:38:45 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.416 2022/04/02 14:28:30 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.417 2022/04/02 22:38:45 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -4156,7 +4156,6 @@
        return true;
 }
 
-/* ARGSUSED */
 void
 check_expr_misc(const tnode_t *tn, bool vctx, bool tctx,
                bool eqwarn, bool fcall, bool retval_discarded, bool szof)
@@ -4560,7 +4559,7 @@
 {
        stmt_expr *se = stmt_exprs;
        tnode_t *tn = build_name(se->se_sym, false);
-       expr_save_memory();     /* leak */
+       (void)expr_save_memory();       /* leak */
        expr_restore_memory(se->se_mem);
        stmt_exprs = se->se_enclosing;
        free(se);



Home | Main Index | Thread Index | Old Index