Module Name: src Committed By: rillig Date: Sat Apr 2 22:38:45 UTC 2022
Modified Files: src/usr.bin/xlint/lint1: decl.c init.c tree.c Log Message: lint: clean up style Remove outdated ARGSUSED (the one in tree.c had been wrong since 1995), remove unused argument. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.266 -r1.267 src/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.232 -r1.233 src/usr.bin/xlint/lint1/init.c cvs rdiff -u -r1.416 -r1.417 src/usr.bin/xlint/lint1/tree.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/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.266 src/usr.bin/xlint/lint1/decl.c:1.267 --- src/usr.bin/xlint/lint1/decl.c:1.266 Sat Apr 2 22:15:57 2022 +++ src/usr.bin/xlint/lint1/decl.c Sat Apr 2 22:38:45 2022 @@ -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 eqargs(const type_t *, const 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 @@ add_function(sym_t *decl, sym_t *args) 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 @@ add_function(sym_t *decl, sym_t *args) 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; Index: src/usr.bin/xlint/lint1/init.c diff -u src/usr.bin/xlint/lint1/init.c:1.232 src/usr.bin/xlint/lint1/init.c:1.233 --- src/usr.bin/xlint/lint1/init.c:1.232 Sun Feb 27 10:31:58 2022 +++ src/usr.bin/xlint/lint1/init.c Sat Apr 2 22:38:45 2022 @@ -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 @@ brace_level_advance(brace_level *bl, siz 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 @@ initialization_lbrace(initialization *in 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 @@ initialization_init_array_from_string(in 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); Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.416 src/usr.bin/xlint/lint1/tree.c:1.417 --- src/usr.bin/xlint/lint1/tree.c:1.416 Sat Apr 2 14:28:30 2022 +++ src/usr.bin/xlint/lint1/tree.c Sat Apr 2 22:38:45 2022 @@ -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 @@ check_expr_op(const tnode_t *tn, op_t op 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 @@ end_statement_expr(void) { 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);