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: unabbreviate two more members of s...



details:   https://anonhg.NetBSD.org/src/rev/68434ba874c3
branches:  trunk
changeset: 362051:68434ba874c3
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Feb 27 11:14:42 2022 +0000

description:
lint: unabbreviate two more members of sym_t

No functional change.

diffstat:

 usr.bin/xlint/lint1/cgram.y |   6 +++---
 usr.bin/xlint/lint1/decl.c  |  18 +++++++++---------
 usr.bin/xlint/lint1/lint1.h |  11 ++++++-----
 usr.bin/xlint/lint1/tree.c  |  16 ++++++++--------
 4 files changed, 26 insertions(+), 25 deletions(-)

diffs (190 lines):

diff -r 47195f5b4fe7 -r 68434ba874c3 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Sun Feb 27 10:49:15 2022 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Sun Feb 27 11:14:42 2022 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.383 2022/02/27 08:31:26 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.384 2022/02/27 11:14:42 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.383 2022/02/27 08:31:26 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.384 2022/02/27 11:14:42 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -114,7 +114,7 @@
 anonymize(sym_t *s)
 {
        for ( ; s != NULL; s = s->s_next)
-               s->s_styp = NULL;
+               s->s_sou_type = NULL;
 }
 
 #if defined(YYDEBUG) && (defined(YYBYACC) || defined(YYBISON))
diff -r 47195f5b4fe7 -r 68434ba874c3 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Sun Feb 27 10:49:15 2022 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Sun Feb 27 11:14:42 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.248 2022/02/27 10:44:45 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.249 2022/02/27 11:14:42 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.248 2022/02/27 10:44:45 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.249 2022/02/27 11:14:42 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -1157,7 +1157,7 @@
                lint_assert(dcs->d_redeclared_symbol->s_scl == MOS ||
                    dcs->d_redeclared_symbol->s_scl == MOU);
 
-               if (dsym->s_styp == dcs->d_redeclared_symbol->s_styp) {
+               if (dsym->s_sou_type == dcs->d_redeclared_symbol->s_sou_type) {
                        /* duplicate member name: %s */
                        error(33, dsym->s_name);
                        rmsym(dcs->d_redeclared_symbol);
@@ -1513,7 +1513,7 @@
  * Process the name in a declarator.
  * The symbol gets one of the storage classes EXTERN, STATIC, AUTO or
  * TYPEDEF.
- * s_def and s_reg are valid after declarator_name().
+ * s_def and s_register are valid after declarator_name().
  */
 sym_t *
 declarator_name(sym_t *sym)
@@ -1534,7 +1534,7 @@
        case MOS:
        case MOU:
                /* Set parent */
-               sym->s_styp = dcs->d_tagtyp->t_str;
+               sym->s_sou_type = dcs->d_tagtyp->t_str;
                sym->s_def = DEF;
                sym->s_value.v_tspec = INT;
                sc = dcs->d_ctx;
@@ -1568,7 +1568,7 @@
                        sc = AUTO;
                } else {
                        lint_assert(sc == REG);
-                       sym->s_reg = true;
+                       sym->s_register = true;
                        sc = AUTO;
                }
                sym->s_def = DEF;
@@ -1586,7 +1586,7 @@
                } else if (sc == AUTO || sc == STATIC || sc == TYPEDEF) {
                        sym->s_def = DEF;
                } else if (sc == REG) {
-                       sym->s_reg = true;
+                       sym->s_register = true;
                        sc = AUTO;
                        sym->s_def = DEF;
                } else {
@@ -1810,8 +1810,8 @@
        n = 0;
        for (mem = fmem; mem != NULL; mem = mem->s_next) {
                /* bind anonymous members to the structure */
-               if (mem->s_styp == NULL) {
-                       mem->s_styp = sp;
+               if (mem->s_sou_type == NULL) {
+                       mem->s_sou_type = sp;
                        if (mem->s_type->t_bitfield) {
                                sp->sou_size_in_bits += bitfieldsize(&mem);
                                if (mem == NULL)
diff -r 47195f5b4fe7 -r 68434ba874c3 usr.bin/xlint/lint1/lint1.h
--- a/usr.bin/xlint/lint1/lint1.h       Sun Feb 27 10:49:15 2022 +0000
+++ b/usr.bin/xlint/lint1/lint1.h       Sun Feb 27 11:14:42 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.140 2022/02/27 10:49:15 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.141 2022/02/27 11:14:42 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -250,14 +250,15 @@
        bool    s_set:1;        /* variable set, label defined */
        bool    s_used:1;       /* variable/label used */
        bool    s_arg:1;        /* symbol is function argument */
-       bool    s_reg:1;        /* symbol is register variable */
+       bool    s_register:1;   /* symbol is register variable */
        bool    s_defarg:1;     /* undefined symbol in old style function
                                   definition */
        bool    s_return_type_implicit_int:1;
        bool    s_osdef:1;      /* symbol stems from old style function def. */
        bool    s_inline:1;     /* true if this is an inline function */
-       struct  sym *s_ext_sym; /* for local declared external symbols pointer
-                                  to external symbol with same name */
+       struct  sym *s_ext_sym; /* for locally declared external symbols, the
+                                * pointer to the external symbol with the
+                                * same name */
        def_t   s_def;          /* declared, tentative defined, defined */
        scl_t   s_scl;          /* storage class */
        int     s_block_level;  /* level of declaration, -1 if not in symbol
@@ -281,7 +282,7 @@
                                         * level */
 } sym_t;
 
-#define        s_styp  u._s_st
+#define        s_sou_type      u._s_st
 #define        s_tspec u._s_tsp
 #define        s_tqual u._s_tqu
 #define        s_args  u._s_args
diff -r 47195f5b4fe7 -r 68434ba874c3 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sun Feb 27 10:49:15 2022 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sun Feb 27 11:14:42 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.407 2022/02/27 10:44:45 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.408 2022/02/27 11:14:42 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.407 2022/02/27 10:44:45 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.408 2022/02/27 11:14:42 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -355,10 +355,10 @@
                rmsym(msym);
                msym->s_kind = FMEMBER;
                msym->s_scl = MOS;
-               msym->s_styp = expr_zero_alloc(sizeof(*msym->s_styp));
-               msym->s_styp->sou_tag = expr_zero_alloc(
-                   sizeof(*msym->s_styp->sou_tag));
-               msym->s_styp->sou_tag->s_name = unnamed;
+               msym->s_sou_type = expr_zero_alloc(sizeof(*msym->s_sou_type));
+               msym->s_sou_type->sou_tag = expr_zero_alloc(
+                   sizeof(*msym->s_sou_type->sou_tag));
+               msym->s_sou_type->sou_tag->s_name = unnamed;
                msym->s_value.v_tspec = INT;
                return msym;
        }
@@ -382,7 +382,7 @@
                for (sym = msym; sym != NULL; sym = sym->s_symtab_next) {
                        if (sym->s_scl != MOS && sym->s_scl != MOU)
                                continue;
-                       if (sym->s_styp != str)
+                       if (sym->s_sou_type != str)
                                continue;
                        if (strcmp(sym->s_name, msym->s_name) != 0)
                                continue;
@@ -858,7 +858,7 @@
                error(111, mp->m_name);
                return false;
        }
-       if (tn->tn_op == NAME && tn->tn_sym->s_reg) {
+       if (tn->tn_op == NAME && tn->tn_sym->s_register) {
                /* cannot take address of register %s */
                error(113, tn->tn_sym->s_name);
                return false;



Home | Main Index | Thread Index | Old Index