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: eliminate unnecessary indirection



details:   https://anonhg.NetBSD.org/src/rev/fd40bcb75ef4
branches:  trunk
changeset: 373393:fd40bcb75ef4
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Feb 06 21:01:55 2023 +0000

description:
lint: eliminate unnecessary indirection

No functional change.

diffstat:

 tests/usr.bin/xlint/lint1/t_integration.sh |  5 ++---
 usr.bin/xlint/lint1/cgram.y                |  6 +++---
 usr.bin/xlint/lint1/externs1.h             |  4 ++--
 usr.bin/xlint/lint1/init.c                 |  8 ++++----
 4 files changed, 11 insertions(+), 12 deletions(-)

diffs (97 lines):

diff -r 9b1f6e24cc23 -r fd40bcb75ef4 tests/usr.bin/xlint/lint1/t_integration.sh
--- a/tests/usr.bin/xlint/lint1/t_integration.sh        Mon Feb 06 20:50:34 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/t_integration.sh        Mon Feb 06 21:01:55 2023 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_integration.sh,v 1.76 2022/06/17 20:24:00 rillig Exp $
+# $NetBSD: t_integration.sh,v 1.77 2023/02/06 21:01:55 rillig Exp $
 #
 # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -131,8 +131,7 @@
        fi
 
        # shellcheck disable=SC2086
-       # XXX: -s 'exit:any' would be better
-       atf_check -s 'ignore' -o "save:$exp" \
+       atf_check -s 'exit' -o "save:$exp" \
            "$lint1" $flags "$src" "$wrk_ln"
        atf_check lua "$(atf_get_srcdir)/check-expect.lua" "$src"
 
diff -r 9b1f6e24cc23 -r fd40bcb75ef4 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Mon Feb 06 20:50:34 2023 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Mon Feb 06 21:01:55 2023 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.432 2023/01/29 18:13:56 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.433 2023/02/06 21:01:55 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID)
-__RCSID("$NetBSD: cgram.y,v 1.432 2023/01/29 18:13:56 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.433 2023/02/06 21:01:55 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -470,7 +470,7 @@
                if (!allow_c99)
                         /* compound literals are a C99/GCC extension */
                         gnuism(319);
-               $$ = build_name(*current_initsym(), false);
+               $$ = build_name(current_initsym(), false);
                end_initialization();
          }
        | T_LPAREN compound_statement_lbrace {
diff -r 9b1f6e24cc23 -r fd40bcb75ef4 usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h    Mon Feb 06 20:50:34 2023 +0000
+++ b/usr.bin/xlint/lint1/externs1.h    Mon Feb 06 21:01:55 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: externs1.h,v 1.172 2023/01/29 18:13:56 rillig Exp $    */
+/*     $NetBSD: externs1.h,v 1.173 2023/02/06 21:01:55 rillig Exp $    */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -344,7 +344,7 @@
  */
 extern void    begin_initialization(sym_t *);
 extern void    end_initialization(void);
-extern sym_t   **current_initsym(void);
+extern sym_t   *current_initsym(void);
 
 extern void    init_rbrace(void);
 extern void    init_lbrace(void);
diff -r 9b1f6e24cc23 -r fd40bcb75ef4 usr.bin/xlint/lint1/init.c
--- a/usr.bin/xlint/lint1/init.c        Mon Feb 06 20:50:34 2023 +0000
+++ b/usr.bin/xlint/lint1/init.c        Mon Feb 06 21:01:55 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init.c,v 1.239 2023/02/06 20:50:34 rillig Exp $        */
+/*     $NetBSD: init.c,v 1.240 2023/02/06 21:01:55 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID)
-__RCSID("$NetBSD: init.c,v 1.239 2023/02/06 20:50:34 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.240 2023/02/06 21:01:55 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -1003,11 +1003,11 @@
 static initialization *init;
 
 
-sym_t **
+sym_t *
 current_initsym(void)
 {
 
-       return &init->in_sym;
+       return init->in_sym;
 }
 
 void



Home | Main Index | Thread Index | Old Index