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: rename symt_t constants



details:   https://anonhg.NetBSD.org/src/rev/1f4341081977
branches:  trunk
changeset: 948735:1f4341081977
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Dec 30 10:35:38 2020 +0000

description:
lint: rename symt_t constants

There's no need to abbreviate them, furthermore FMOS was imprecise.

diffstat:

 usr.bin/xlint/lint1/cgram.y |  20 ++++++++++----------
 usr.bin/xlint/lint1/decl.c  |  10 +++++-----
 usr.bin/xlint/lint1/lint1.h |   8 ++++----
 usr.bin/xlint/lint1/scan.l  |  10 +++++-----
 usr.bin/xlint/lint1/tree.c  |   8 ++++----
 5 files changed, 28 insertions(+), 28 deletions(-)

diffs (246 lines):

diff -r 2d095678f2c3 -r 1f4341081977 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Wed Dec 30 10:26:12 2020 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Wed Dec 30 10:35:38 2020 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.119 2020/12/30 10:26:12 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.120 2020/12/30 10:35:38 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.119 2020/12/30 10:26:12 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.120 2020/12/30 10:35:38 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -785,13 +785,13 @@
 member_declaration:
          noclass_declmods deftyp {
                /* too late, i know, but getsym() compensates it */
-               symtyp = FMOS;
+               symtyp = FMEMBER;
          } notype_member_decls opt_type_attribute {
                symtyp = FVFT;
                $$ = $4;
          }
        | noclass_declspecs deftyp {
-               symtyp = FMOS;
+               symtyp = FMEMBER;
          } type_member_decls opt_type_attribute {
                symtyp = FVFT;
                $$ = $4;
@@ -851,7 +851,7 @@
                $$ = declarator_1_struct_union($1);
          }
        | notype_member_decls {
-               symtyp = FMOS;
+               symtyp = FMEMBER;
          } T_COMMA type_member_decl {
                $$ = lnklst($1, declarator_1_struct_union($4));
          }
@@ -862,7 +862,7 @@
                $$ = declarator_1_struct_union($1);
          }
        | type_member_decls {
-               symtyp = FMOS;
+               symtyp = FMEMBER;
          } T_COMMA type_member_decl {
                $$ = lnklst($1, declarator_1_struct_union($4));
          }
@@ -1488,7 +1488,7 @@
 
 label:
          T_NAME T_COLON {
-               symtyp = FLAB;
+               symtyp = FLABEL;
                label(T_NAME, getsym($1), NULL);
          }
        | T_CASE constant T_COLON {
@@ -1753,7 +1753,7 @@
 
 goto:
          T_GOTO {
-               symtyp = FLAB;
+               symtyp = FLABEL;
          }
        ;
 
@@ -1948,7 +1948,7 @@
          }
        | T_BUILTIN_OFFSETOF T_LPARN type_name T_COMMA identifier T_RPARN
                                                    %prec T_BUILTIN_OFFSETOF {
-               symtyp = FMOS;
+               symtyp = FMEMBER;
                $$ = build_offsetof($3, getsym($5));
          }
        | T_SIZEOF term                                 %prec T_SIZEOF {
@@ -2008,7 +2008,7 @@
 
 point_or_arrow:
          T_STROP {
-               symtyp = FMOS;
+               symtyp = FMEMBER;
                $$ = $1;
          }
        ;
diff -r 2d095678f2c3 -r 1f4341081977 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Wed Dec 30 10:26:12 2020 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Wed Dec 30 10:35:38 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.80 2020/12/30 10:26:12 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.81 2020/12/30 10:35:38 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.80 2020/12/30 10:26:12 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.81 2020/12/30 10:35:38 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -1246,7 +1246,7 @@
        if (dsym == NULL) {
                dsym = getblk(sizeof (sym_t));
                dsym->s_name = unnamed;
-               dsym->s_kind = FMOS;
+               dsym->s_kind = FMEMBER;
                dsym->s_scl = MOS;
                dsym->s_type = gettyp(UINT);
                dsym->s_blklev = -1;
@@ -2950,7 +2950,7 @@
                } else {
                        check_variable_usage(novar, sym);
                }
-       } else if (sym->s_kind == FLAB) {
+       } else if (sym->s_kind == FLABEL) {
                check_label_usage(sym);
        } else if (sym->s_kind == FTAG) {
                check_tag_usage(sym);
@@ -3118,7 +3118,7 @@
                } else if (sym->s_kind == FTAG) {
                        check_tag_usage(sym);
                } else {
-                       if (sym->s_kind != FMOS)
+                       if (sym->s_kind != FMEMBER)
                                LERROR("check_global_symbols()");
                }
        }
diff -r 2d095678f2c3 -r 1f4341081977 usr.bin/xlint/lint1/lint1.h
--- a/usr.bin/xlint/lint1/lint1.h       Wed Dec 30 10:26:12 2020 +0000
+++ b/usr.bin/xlint/lint1/lint1.h       Wed Dec 30 10:35:38 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.38 2020/12/30 10:26:12 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.39 2020/12/30 10:35:38 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -184,9 +184,9 @@
  */
 typedef        enum {
        FVFT,           /* variables, functions, type names, enums */
-       FMOS,           /* members of structs or unions */
+       FMEMBER,        /* members of structs or unions */
        FTAG,           /* tags */
-       FLAB            /* labels */
+       FLABEL          /* labels */
 } symt_t;
 
 /*
@@ -219,7 +219,7 @@
        const   char *s_name;
        const   char *s_rename; /* renamed symbol's given name */
        pos_t   s_dpos;         /* position of last (prototype)definition,
-                                  prototypedeclaration, no-prototype-def.,
+                                  prototype declaration, no-prototype-def.,
                                   tentative definition or declaration,
                                   in this order */
        pos_t   s_spos;         /* position of first initialisation */
diff -r 2d095678f2c3 -r 1f4341081977 usr.bin/xlint/lint1/scan.l
--- a/usr.bin/xlint/lint1/scan.l        Wed Dec 30 10:26:12 2020 +0000
+++ b/usr.bin/xlint/lint1/scan.l        Wed Dec 30 10:35:38 2020 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: scan.l,v 1.98 2020/12/29 13:33:03 rillig Exp $ */
+/* $NetBSD: scan.l,v 1.99 2020/12/30 10:35:38 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: scan.l,v 1.98 2020/12/29 13:33:03 rillig Exp $");
+__RCSID("$NetBSD: scan.l,v 1.99 2020/12/30 10:35:38 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -1466,7 +1466,7 @@
         * symbols of type FTAG. Same can happen for labels. Both cases
         * are compensated here.
         */
-       if (symtyp == FMOS || symtyp == FLAB) {
+       if (symtyp == FMEMBER || symtyp == FLABEL) {
                if (sym == NULL || sym->s_kind == FVFT)
                        sym = search(sb);
        }
@@ -1482,7 +1482,7 @@
        /* create a new symbol table entry */
 
        /* labels must always be allocated at level 1 (outhermost block) */
-       if (symtyp == FLAB) {
+       if (symtyp == FLABEL) {
                sym = getlblk(1, sizeof (sym_t));
                s = getlblk(1, sb->sb_len + 1);
                (void)memcpy(s, sb->sb_name, sb->sb_len + 1);
@@ -1501,7 +1501,7 @@
        }
 
        UNIQUE_CURR_POS(sym->s_dpos);
-       if ((sym->s_kind = symtyp) != FLAB)
+       if ((sym->s_kind = symtyp) != FLABEL)
                sym->s_type = gettyp(INT);
 
        symtyp = FVFT;
diff -r 2d095678f2c3 -r 1f4341081977 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Wed Dec 30 10:26:12 2020 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Wed Dec 30 10:35:38 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.101 2020/12/30 10:26:12 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.102 2020/12/30 10:35:38 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.101 2020/12/30 10:26:12 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.102 2020/12/30 10:35:38 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -245,7 +245,7 @@
                }
        }
 
-       if (sym->s_kind != FVFT && sym->s_kind != FMOS)
+       if (sym->s_kind != FVFT && sym->s_kind != FMEMBER)
                LERROR("getnnode(%d)", sym->s_kind);
 
        n = getnode();
@@ -322,7 +322,7 @@
                /* undefined struct/union member: %s */
                error(101, msym->s_name);
                rmsym(msym);
-               msym->s_kind = FMOS;
+               msym->s_kind = FMEMBER;
                msym->s_scl = MOS;
                msym->s_styp = tgetblk(sizeof (str_t));
                msym->s_styp->stag = tgetblk(sizeof (sym_t));



Home | Main Index | Thread Index | Old Index