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: clean up alignment_in_bits



details:   https://anonhg.NetBSD.org/src/rev/020a9d1e8d94
branches:  trunk
changeset: 1023159:020a9d1e8d94
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Aug 28 12:06:08 2021 +0000

description:
lint: clean up alignment_in_bits

The given type can never be NULL, and an array can never have NULL as
subtype.

diffstat:

 usr.bin/xlint/lint1/decl.c |  9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diffs (32 lines):

diff -r fed1bbc005b6 -r 020a9d1e8d94 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Sat Aug 28 10:47:45 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Sat Aug 28 12:06:08 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.222 2021/08/16 06:49:56 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.223 2021/08/28 12:06:08 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.222 2021/08/16 06:49:56 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.223 2021/08/28 12:06:08 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -957,12 +957,9 @@
        size_t  a;
        tspec_t t;
 
-       while (tp != NULL && tp->t_tspec == ARRAY)
+       while (tp->t_tspec == ARRAY)
                tp = tp->t_subt;
 
-       if (tp == NULL)
-               return -1;
-
        if ((t = tp->t_tspec) == STRUCT || t == UNION) {
                a = tp->t_str->sou_align_in_bits;
        } else if (t == FUNC) {



Home | Main Index | Thread Index | Old Index