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: reduce code for beginning an initi...
details: https://anonhg.NetBSD.org/src/rev/868f52ab3343
branches: trunk
changeset: 1027735:868f52ab3343
user: rillig <rillig%NetBSD.org@localhost>
date: Fri Dec 17 17:27:19 2021 +0000
description:
lint: reduce code for beginning an initialization
No functional change.
diffstat:
usr.bin/xlint/lint1/init.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diffs (49 lines):
diff -r 11f3a06603ec -r 868f52ab3343 usr.bin/xlint/lint1/init.c
--- a/usr.bin/xlint/lint1/init.c Fri Dec 17 17:21:48 2021 +0000
+++ b/usr.bin/xlint/lint1/init.c Fri Dec 17 17:27:19 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: init.c,v 1.216 2021/12/17 17:21:48 rillig Exp $ */
+/* $NetBSD: init.c,v 1.217 2021/12/17 17:27:19 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.216 2021/12/17 17:21:48 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.217 2021/12/17 17:27:19 rillig Exp $");
#endif
#include <stdlib.h>
@@ -637,12 +637,13 @@
static struct initialization *
-initialization_new(sym_t *sym)
+initialization_new(sym_t *sym, struct initialization *enclosing)
{
struct initialization *in;
in = xcalloc(1, sizeof(*in));
in->in_sym = sym;
+ in->in_enclosing = enclosing;
return in;
}
@@ -961,14 +962,11 @@
void
begin_initialization(sym_t *sym)
{
- struct initialization *in;
debug_step("begin initialization of '%s'", type_name(sym->s_type));
debug_indent_inc();
- in = initialization_new(sym);
- in->in_enclosing = init;
- init = in;
+ init = initialization_new(sym, init);
}
void
Home |
Main Index |
Thread Index |
Old Index