Module Name: src Committed By: rillig Date: Sun Mar 28 14:13:18 UTC 2021
Modified Files: src/usr.bin/xlint/lint1: init.c Log Message: lint: clean up type handling in initialization No functional change. To generate a diff of this commit: cvs rdiff -u -r1.162 -r1.163 src/usr.bin/xlint/lint1/init.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/init.c diff -u src/usr.bin/xlint/lint1/init.c:1.162 src/usr.bin/xlint/lint1/init.c:1.163 --- src/usr.bin/xlint/lint1/init.c:1.162 Sun Mar 28 14:01:49 2021 +++ src/usr.bin/xlint/lint1/init.c Sun Mar 28 14:13:18 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: init.c,v 1.162 2021/03/28 14:01:49 rillig Exp $ */ +/* $NetBSD: init.c,v 1.163 2021/03/28 14:13:18 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: init.c,v 1.162 2021/03/28 14:01:49 rillig Exp $"); +__RCSID("$NetBSD: init.c,v 1.163 2021/03/28 14:13:18 rillig Exp $"); #endif #include <stdlib.h> @@ -859,11 +859,10 @@ initialization_push(struct initializatio level = in->brace_level; lint_assert(level->bl_remaining > 0); - in->brace_level = xcalloc(1, sizeof *in->brace_level); + in->brace_level = brace_level_new( + level->bl_subtype != NULL ? level->bl_subtype : level->bl_type, + NULL, 0); in->brace_level->bl_enclosing = level; - in->brace_level->bl_type = level->bl_subtype; - if (in->brace_level->bl_type == NULL) - in->brace_level->bl_type = level->bl_type; lint_assert(in->brace_level->bl_type != NULL); lint_assert(in->brace_level->bl_type->t_tspec != FUNC);