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 d_rdcsym to d_redeclared_sy...



details:   https://anonhg.NetBSD.org/src/rev/8dc2bb158057
branches:  trunk
changeset: 953805:8dc2bb158057
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Mar 21 10:21:07 2021 +0000

description:
lint: rename d_rdcsym to d_redeclared_symbol

No functional change.

diffstat:

 usr.bin/xlint/lint1/decl.c  |  61 +++++++++++++++++++++++---------------------
 usr.bin/xlint/lint1/func.c  |   6 ++--
 usr.bin/xlint/lint1/lint1.h |   4 +-
 3 files changed, 37 insertions(+), 34 deletions(-)

diffs (227 lines):

diff -r 79f12a8b44da -r 8dc2bb158057 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Sun Mar 21 10:16:12 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Sun Mar 21 10:21:07 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.153 2021/03/21 10:16:12 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.154 2021/03/21 10:21:07 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.153 2021/03/21 10:16:12 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.154 2021/03/21 10:21:07 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -1162,15 +1162,15 @@
 
        lint_assert(dsym->s_scl == MOS || dsym->s_scl == MOU);
 
-       if (dcs->d_rdcsym != NULL) {
+       if (dcs->d_redeclared_symbol != NULL) {
                /* should be ensured by storesym() */
-               lint_assert(dcs->d_rdcsym->s_scl == MOS ||
-                   dcs->d_rdcsym->s_scl == MOU);
-
-               if (dsym->s_styp == dcs->d_rdcsym->s_styp) {
+               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) {
                        /* duplicate member name: %s */
                        error(33, dsym->s_name);
-                       rmsym(dcs->d_rdcsym);
+                       rmsym(dcs->d_redeclared_symbol);
                }
        }
 
@@ -1522,12 +1522,12 @@
        scl_t   sc = NOSCL;
 
        if (sym->s_scl == NOSCL) {
-               dcs->d_rdcsym = NULL;
+               dcs->d_redeclared_symbol = NULL;
        } else if (sym->s_defarg) {
                sym->s_defarg = false;
-               dcs->d_rdcsym = NULL;
+               dcs->d_redeclared_symbol = NULL;
        } else {
-               dcs->d_rdcsym = sym;
+               dcs->d_redeclared_symbol = sym;
                sym = pushdown(sym);
        }
 
@@ -1979,7 +1979,7 @@
                outsym(dsym, dsym->s_scl, dsym->s_def);
        }
 
-       if ((rdsym = dcs->d_rdcsym) != NULL) {
+       if ((rdsym = dcs->d_redeclared_symbol) != NULL) {
 
                /*
                 * If the old symbol stems from an old style function
@@ -2080,7 +2080,7 @@
 {
        sym_t   *rsym;
 
-       if ((rsym = dcs->d_rdcsym)->s_scl == CTCONST) {
+       if ((rsym = dcs->d_redeclared_symbol)->s_scl == CTCONST) {
                /* redeclaration of %s */
                error(27, dsym->s_name);
                print_previous_declaration(-1, rsym);
@@ -2407,11 +2407,11 @@
 
        check_type(sym);
 
-       if (dcs->d_rdcsym != NULL &&
-           dcs->d_rdcsym->s_block_level == block_level) {
+       if (dcs->d_redeclared_symbol != NULL &&
+           dcs->d_redeclared_symbol->s_block_level == block_level) {
                /* redeclaration of formal parameter %s */
                error(237, sym->s_name);
-               rmsym(dcs->d_rdcsym);
+               rmsym(dcs->d_redeclared_symbol);
                sym->s_arg = true;
        }
 
@@ -2583,7 +2583,8 @@
                }
                if (msg)
                        /* prototype declaration */
-                       print_previous_declaration(285, dcs->d_rdcsym);
+                       print_previous_declaration(285,
+                           dcs->d_redeclared_symbol);
 
                /* from now on the prototype is valid */
                funcsym->s_osdef = false;
@@ -2677,7 +2678,7 @@
 
        check_type(dsym);
 
-       if (dcs->d_rdcsym != NULL && dsym->s_scl == EXTERN)
+       if (dcs->d_redeclared_symbol != NULL && dsym->s_scl == EXTERN)
                declare_external_in_block(dsym);
 
        if (dsym->s_scl == EXTERN) {
@@ -2692,9 +2693,9 @@
                }
        }
 
-       if (dcs->d_rdcsym != NULL) {
-
-               if (dcs->d_rdcsym->s_block_level == 0) {
+       if (dcs->d_redeclared_symbol != NULL) {
+
+               if (dcs->d_redeclared_symbol->s_block_level == 0) {
 
                        switch (dsym->s_scl) {
                        case AUTO:
@@ -2722,10 +2723,11 @@
                                lint_assert(/*CONSTCOND*/false);
                        }
 
-               } else if (dcs->d_rdcsym->s_block_level == block_level) {
+               } else if (dcs->d_redeclared_symbol->s_block_level ==
+                          block_level) {
 
                        /* no hflag, because it's illegal! */
-                       if (dcs->d_rdcsym->s_arg) {
+                       if (dcs->d_redeclared_symbol->s_arg) {
                                /*
                                 * if !tflag, a "redeclaration of %s" error
                                 * is produced below
@@ -2734,11 +2736,12 @@
                                        if (hflag)
                                                /* decl. hides parameter: %s */
                                                warning(91, dsym->s_name);
-                                       rmsym(dcs->d_rdcsym);
+                                       rmsym(dcs->d_redeclared_symbol);
                                }
                        }
 
-               } else if (dcs->d_rdcsym->s_block_level < block_level) {
+               } else if (dcs->d_redeclared_symbol->s_block_level <
+                          block_level) {
 
                        if (hflag)
                                /* declaration hides earlier one: %s */
@@ -2746,11 +2749,11 @@
 
                }
 
-               if (dcs->d_rdcsym->s_block_level == block_level) {
+               if (dcs->d_redeclared_symbol->s_block_level == block_level) {
 
                        /* redeclaration of %s */
                        error(27, dsym->s_name);
-                       rmsym(dcs->d_rdcsym);
+                       rmsym(dcs->d_redeclared_symbol);
 
                }
 
@@ -2783,7 +2786,7 @@
        sym_t   *esym;
 
        /* look for a symbol with the same name */
-       esym = dcs->d_rdcsym;
+       esym = dcs->d_redeclared_symbol;
        while (esym != NULL && esym->s_block_level != 0) {
                while ((esym = esym->s_link) != NULL) {
                        if (esym->s_kind != FVFT)
@@ -2881,7 +2884,7 @@
                sym->s_arg = true;
 
        sym->s_type = dcs->d_type;
-       dcs->d_rdcsym = NULL;
+       dcs->d_redeclared_symbol = NULL;
        dcs->d_vararg = false;
 
        return sym;
diff -r 79f12a8b44da -r 8dc2bb158057 usr.bin/xlint/lint1/func.c
--- a/usr.bin/xlint/lint1/func.c        Sun Mar 21 10:16:12 2021 +0000
+++ b/usr.bin/xlint/lint1/func.c        Sun Mar 21 10:21:07 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: func.c,v 1.79 2021/03/21 10:08:01 rillig Exp $ */
+/*     $NetBSD: func.c,v 1.80 2021/03/21 10:21:07 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.79 2021/03/21 10:08:01 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.80 2021/03/21 10:21:07 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -284,7 +284,7 @@
         */
        dcs->d_fdpos = fsym->s_def_pos;
 
-       if ((rdsym = dcs->d_rdcsym) != NULL) {
+       if ((rdsym = dcs->d_redeclared_symbol) != NULL) {
 
                if (!check_redeclaration(fsym, (dowarn = false, &dowarn))) {
 
diff -r 79f12a8b44da -r 8dc2bb158057 usr.bin/xlint/lint1/lint1.h
--- a/usr.bin/xlint/lint1/lint1.h       Sun Mar 21 10:16:12 2021 +0000
+++ b/usr.bin/xlint/lint1/lint1.h       Sun Mar 21 10:21:07 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.77 2021/03/21 10:08:01 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.78 2021/03/21 10:21:07 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -332,7 +332,7 @@
        scl_t   d_scl;          /* storage class */
        type_t  *d_type;        /* after deftyp() pointer to the type used
                                   for all declarators */
-       sym_t   *d_rdcsym;      /* redeclared symbol */
+       sym_t   *d_redeclared_symbol;
        int     d_offset;       /* offset of next structure member */
        int     d_stralign;     /* alignment required for current structure */
        scl_t   d_ctx;          /* context of declaration */



Home | Main Index | Thread Index | Old Index