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: rename tenum_t and its members to be mor...



details:   https://anonhg.NetBSD.org/src/rev/004f032b6c55
branches:  trunk
changeset: 952853:004f032b6c55
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Feb 19 22:20:18 2021 +0000

description:
lint: rename tenum_t and its members to be more expressive

diffstat:

 usr.bin/xlint/common/tyname.c |  10 +++++-----
 usr.bin/xlint/lint1/decl.c    |  16 ++++++++--------
 usr.bin/xlint/lint1/emit1.c   |   6 +++---
 usr.bin/xlint/lint1/func.c    |   6 +++---
 usr.bin/xlint/lint1/lint1.h   |  18 +++++++++---------
 5 files changed, 28 insertions(+), 28 deletions(-)

diffs (203 lines):

diff -r 248ee3540dbf -r 004f032b6c55 usr.bin/xlint/common/tyname.c
--- a/usr.bin/xlint/common/tyname.c     Fri Feb 19 22:16:12 2021 +0000
+++ b/usr.bin/xlint/common/tyname.c     Fri Feb 19 22:20:18 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tyname.c,v 1.27 2021/02/19 22:16:12 rillig Exp $       */
+/*     $NetBSD: tyname.c,v 1.28 2021/02/19 22:20:18 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.27 2021/02/19 22:16:12 rillig Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.28 2021/02/19 22:20:18 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -230,8 +230,8 @@
                return sametype(t1->t_subt, t2->t_subt);
        case ENUM:
 #ifdef t_enum
-               return strcmp(t1->t_enum->etag->s_name,
-                   t2->t_enum->etag->s_name) == 0;
+               return strcmp(t1->t_enum->en_tag->s_name,
+                   t2->t_enum->en_tag->s_name) == 0;
 #else
                return true;
 #endif
@@ -339,7 +339,7 @@
        case ENUM:
                buf_add(&buf, " ");
 #ifdef t_enum
-               buf_add(&buf, tp->t_enum->etag->s_name);
+               buf_add(&buf, tp->t_enum->en_tag->s_name);
 #else
                buf_add(&buf,
                    tp->t_isuniqpos ? "*anonymous*" : tp->t_tag->h_name);
diff -r 248ee3540dbf -r 004f032b6c55 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Fri Feb 19 22:16:12 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Fri Feb 19 22:20:18 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.134 2021/02/19 22:16:12 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.135 2021/02/19 22:20:18 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.134 2021/02/19 22:16:12 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.135 2021/02/19 22:20:18 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -183,7 +183,7 @@
        } else if (t == STRUCT || t == UNION) {
                return tp->t_str->sou_incomplete;
        } else if (t == ENUM) {
-               return tp->t_enum->eincompl;
+               return tp->t_enum->en_incomplete;
        }
        return false;
 }
@@ -202,7 +202,7 @@
                tp->t_str->sou_incomplete = !complete;
        } else {
                lint_assert(t == ENUM);
-               tp->t_enum->eincompl = !complete;
+               tp->t_enum->en_incomplete = !complete;
        }
 }
 
@@ -485,8 +485,8 @@
                if (tp->t_str->sou_first_typedef == NULL)
                        tp->t_str->sou_first_typedef = sym;
        } else if (t == ENUM) {
-               if (tp->t_enum->etdef == NULL)
-                       tp->t_enum->etdef = sym;
+               if (tp->t_enum->en_first_typedef == NULL)
+                       tp->t_enum->en_first_typedef = sym;
        }
 }
 
@@ -1667,7 +1667,7 @@
                } else {
                        tp->t_isenum = true;
                        tp->t_enum = getblk(sizeof(*tp->t_enum));
-                       tp->t_enum->etag = tag;
+                       tp->t_enum->en_tag = tag;
                }
                setcomplete(tp, false);
        }
@@ -1813,7 +1813,7 @@
 {
 
        setcomplete(tp, true);
-       tp->t_enum->elem = fmem;
+       tp->t_enum->en_first_enumerator = fmem;
        return tp;
 }
 
diff -r 248ee3540dbf -r 004f032b6c55 usr.bin/xlint/lint1/emit1.c
--- a/usr.bin/xlint/lint1/emit1.c       Fri Feb 19 22:16:12 2021 +0000
+++ b/usr.bin/xlint/lint1/emit1.c       Fri Feb 19 22:20:18 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: emit1.c,v 1.40 2021/02/19 22:16:12 rillig Exp $ */
+/* $NetBSD: emit1.c,v 1.41 2021/02/19 22:20:18 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: emit1.c,v 1.40 2021/02/19 22:16:12 rillig Exp $");
+__RCSID("$NetBSD: emit1.c,v 1.41 2021/02/19 22:20:18 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -140,7 +140,7 @@
                if (ts == ARRAY) {
                        outint(tp->t_dim);
                } else if (ts == ENUM) {
-                       outtt(tp->t_enum->etag, tp->t_enum->etdef);
+                       outtt(tp->t_enum->en_tag, tp->t_enum->en_first_typedef);
                } else if (ts == STRUCT || ts == UNION) {
                        outtt(tp->t_str->sou_tag, tp->t_str->sou_first_typedef);
                } else if (ts == FUNC && tp->t_proto) {
diff -r 248ee3540dbf -r 004f032b6c55 usr.bin/xlint/lint1/func.c
--- a/usr.bin/xlint/lint1/func.c        Fri Feb 19 22:16:12 2021 +0000
+++ b/usr.bin/xlint/lint1/func.c        Fri Feb 19 22:20:18 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: func.c,v 1.69 2021/02/19 21:35:44 rillig Exp $ */
+/*     $NetBSD: func.c,v 1.70 2021/02/19 22:20:18 rillig Exp $ */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: func.c,v 1.69 2021/02/19 21:35:44 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.70 2021/02/19 22:20:18 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -674,7 +674,7 @@
        if (cstmt->c_swtype->t_isenum) {
                nenum = nclab = 0;
                lint_assert(cstmt->c_swtype->t_enum != NULL);
-               for (esym = cstmt->c_swtype->t_enum->elem;
+               for (esym = cstmt->c_swtype->t_enum->en_first_enumerator;
                     esym != NULL; esym = esym->s_next) {
                        nenum++;
                }
diff -r 248ee3540dbf -r 004f032b6c55 usr.bin/xlint/lint1/lint1.h
--- a/usr.bin/xlint/lint1/lint1.h       Fri Feb 19 22:16:12 2021 +0000
+++ b/usr.bin/xlint/lint1/lint1.h       Fri Feb 19 22:20:18 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.62 2021/02/19 22:16:12 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.63 2021/02/19 22:20:18 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -138,11 +138,11 @@
  * same as above for enums
  */
 typedef        struct {
-       bool    eincompl : 1;   /* incomplete enum type */
-       struct  sym *elem;      /* list of enumerators */
-       struct  sym *etag;      /* symbol table entry of tag */
-       struct  sym *etdef;     /* symbol table entry of first typename */
-} tenum_t;
+       bool    en_incomplete : 1;
+       struct  sym *en_first_enumerator;
+       struct  sym *en_tag;
+       struct  sym *en_first_typedef;
+} enumeration;
 
 /*
  * Types are represented by concatenation of structures of type type_t
@@ -161,8 +161,8 @@
        bool    t_packed : 1;
        union {
                int     _t_dim;         /* dimension */
-               struct_or_union *_t_str;        /* struct/union tag */
-               tenum_t *_t_enum;       /* enum tag */
+               struct_or_union *_t_str;
+               enumeration     *_t_enum;
                struct  sym *_t_args;   /* arguments (if t_proto) */
        } t_u;
        struct {
@@ -247,7 +247,7 @@
        val_t   s_value;        /* value (if enum or bool constant) */
        union {
                struct_or_union *_s_st;
-               tenum_t *_s_et; /* tag, if it is an enumerator */
+               enumeration     *_s_et;
                tspec_t _s_tsp; /* type (only for keywords) */
                tqual_t _s_tqu; /* qualifier (only for keywords) */
                struct  sym *_s_args; /* arguments in old style function



Home | Main Index | Thread Index | Old Index