lint: eliminate unnecessary indirection

No functional change.
This commit is contained in:
rillig 2023-02-06 21:01:55 +00:00
parent 17a1c02c4f
commit 456342a5d0
4 changed files with 11 additions and 12 deletions

View File

@ -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. # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
# All rights reserved. # All rights reserved.
@ -131,8 +131,7 @@ check_lint1()
fi fi
# shellcheck disable=SC2086 # shellcheck disable=SC2086
# XXX: -s 'exit:any' would be better atf_check -s 'exit' -o "save:$exp" \
atf_check -s 'ignore' -o "save:$exp" \
"$lint1" $flags "$src" "$wrk_ln" "$lint1" $flags "$src" "$wrk_ln"
atf_check lua "$(atf_get_srcdir)/check-expect.lua" "$src" atf_check lua "$(atf_get_srcdir)/check-expect.lua" "$src"

View File

@ -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. * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@ -35,7 +35,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#if defined(__RCSID) #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 #endif
#include <limits.h> #include <limits.h>
@ -470,7 +470,7 @@ postfix_expression:
if (!allow_c99) if (!allow_c99)
/* compound literals are a C99/GCC extension */ /* compound literals are a C99/GCC extension */
gnuism(319); gnuism(319);
$$ = build_name(*current_initsym(), false); $$ = build_name(current_initsym(), false);
end_initialization(); end_initialization();
} }
| T_LPAREN compound_statement_lbrace { | T_LPAREN compound_statement_lbrace {

View File

@ -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 * Copyright (c) 1994, 1995 Jochen Pohl
@ -344,7 +344,7 @@ extern void bitfieldtype(int);
*/ */
extern void begin_initialization(sym_t *); extern void begin_initialization(sym_t *);
extern void end_initialization(void); 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_rbrace(void);
extern void init_lbrace(void); extern void init_lbrace(void);

View File

@ -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 * Copyright (c) 1994, 1995 Jochen Pohl
@ -38,7 +38,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#if defined(__RCSID) #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 #endif
#include <stdlib.h> #include <stdlib.h>
@ -1003,11 +1003,11 @@ done:
static initialization *init; static initialization *init;
sym_t ** sym_t *
current_initsym(void) current_initsym(void)
{ {
return &init->in_sym; return init->in_sym;
} }
void void