Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint lint: reduce number of ifdef names



details:   https://anonhg.NetBSD.org/src/rev/74693cbec3f2
branches:  trunk
changeset: 1023395:74693cbec3f2
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Sep 05 18:34:50 2021 +0000

description:
lint: reduce number of ifdef names

No functional change.

diffstat:

 usr.bin/xlint/common/tyname.c |  16 ++++++++--------
 usr.bin/xlint/lint1/tree.c    |   6 +++---
 2 files changed, 11 insertions(+), 11 deletions(-)

diffs (99 lines):

diff -r 8bc45ce5a03d -r 74693cbec3f2 usr.bin/xlint/common/tyname.c
--- a/usr.bin/xlint/common/tyname.c     Sun Sep 05 18:17:15 2021 +0000
+++ b/usr.bin/xlint/common/tyname.c     Sun Sep 05 18:34:50 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tyname.c,v 1.49 2021/09/04 14:07:51 rillig Exp $       */
+/*     $NetBSD: tyname.c,v 1.50 2021/09/05 18:34:50 rillig Exp $       */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tyname.c,v 1.49 2021/09/04 14:07:51 rillig Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.50 2021/09/05 18:34:50 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -163,7 +163,7 @@
 
        buf_add(buf, "(");
        if (tp->t_proto) {
-#ifdef t_enum /* lint1 */
+#ifdef IS_LINT1
                sym_t *arg;
 
                arg = tp->t_args;
@@ -173,7 +173,7 @@
                        buf_add(buf, sep), sep = ", ";
                        buf_add(buf, type_name(arg->s_type));
                }
-#else /* lint2 */
+#else
                type_t **argtype;
 
                argtype = tp->t_args;
@@ -197,7 +197,7 @@
 type_name_of_struct_or_union(buffer *buf, const type_t *tp)
 {
        buf_add(buf, " ");
-#ifdef t_str
+#ifdef IS_LINT1
        if (tp->t_str->sou_tag->s_name == unnamed &&
            tp->t_str->sou_first_typedef != NULL) {
                buf_add(buf, "typedef ");
@@ -214,7 +214,7 @@
 type_name_of_enum(buffer *buf, const type_t *tp)
 {
        buf_add(buf, " ");
-#ifdef t_enum
+#ifdef IS_LINT1
        if (tp->t_enum->en_tag->s_name == unnamed &&
            tp->t_enum->en_first_typedef != NULL) {
                buf_add(buf, "typedef ");
@@ -231,7 +231,7 @@
 type_name_of_array(buffer *buf, const type_t *tp)
 {
        buf_add(buf, "[");
-#ifdef t_str /* lint1 */
+#ifdef IS_LINT1
        if (tp->t_incomplete_array)
                buf_add(buf, "unknown_size");
        else
@@ -263,7 +263,7 @@
        if (tp->t_volatile)
                buf_add(&buf, "volatile ");
 
-#ifdef t_str
+#ifdef IS_LINT1
        if ((t == STRUCT || t == UNION) && tp->t_str->sou_incomplete)
                buf_add(&buf, "incomplete ");
 #endif
diff -r 8bc45ce5a03d -r 74693cbec3f2 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sun Sep 05 18:17:15 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sun Sep 05 18:34:50 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.379 2021/09/05 17:49:55 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.380 2021/09/05 18:34:50 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.379 2021/09/05 17:49:55 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.380 2021/09/05 18:34:50 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -4321,7 +4321,7 @@
                    (!is_integer(ot) && ot != PTR)) {
                        return false;
                }
-#ifdef notdef
+#if 0
                /*
                 * consider:
                 *      struct foo {



Home | Main Index | Thread Index | Old Index