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: un-abbreviate s_dpos, s_spos and s...



details:   https://anonhg.NetBSD.org/src/rev/2ec8f46b0827
branches:  trunk
changeset: 948740:2ec8f46b0827
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Dec 30 11:14:03 2020 +0000

description:
lint: un-abbreviate s_dpos, s_spos and s_upos

diffstat:

 usr.bin/xlint/lint1/decl.c  |  50 ++++++++++++++++++++++----------------------
 usr.bin/xlint/lint1/emit1.c |  14 ++++++------
 usr.bin/xlint/lint1/func.c  |  10 ++++----
 usr.bin/xlint/lint1/lint1.h |   8 +++---
 usr.bin/xlint/lint1/scan.l  |   8 +++---
 5 files changed, 45 insertions(+), 45 deletions(-)

diffs (truncated from 344 to 300 lines):

diff -r a7c51e3480ec -r 2ec8f46b0827 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Wed Dec 30 11:04:48 2020 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Wed Dec 30 11:14:03 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.83 2020/12/30 11:04:48 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.84 2020/12/30 11:14:03 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.83 2020/12/30 11:04:48 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.84 2020/12/30 11:14:03 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -1663,7 +1663,7 @@
        } else {
                tag = getblk(sizeof (sym_t));
                tag->s_name = unnamed;
-               UNIQUE_CURR_POS(tag->s_dpos);
+               UNIQUE_CURR_POS(tag->s_def_pos);
                tag->s_kind = FTAG;
                tag->s_scl = scl;
                tag->s_blklev = -1;
@@ -1918,7 +1918,7 @@
                 * written as a function definition to the output file.
                 */
                rval = dsym->s_type->t_subt->t_tspec != VOID;
-               outfdef(dsym, &dsym->s_dpos, rval, 0, NULL);
+               outfdef(dsym, &dsym->s_def_pos, rval, 0, NULL);
        } else {
                outsym(dsym, dsym->s_scl, dsym->s_def);
        }
@@ -1951,7 +1951,7 @@
                        if (rdsym->s_osdef && !dsym->s_type->t_proto) {
                                dsym->s_osdef = rdsym->s_osdef;
                                dsym->s_args = rdsym->s_args;
-                               STRUCT_ASSIGN(dsym->s_dpos, rdsym->s_dpos);
+                               STRUCT_ASSIGN(dsym->s_def_pos, rdsym->s_def_pos);
                        }
 
                        /*
@@ -1961,9 +1961,9 @@
                         * was defined and the new is not.
                         */
                        if (rdsym->s_type->t_proto && !dsym->s_type->t_proto) {
-                               STRUCT_ASSIGN(dsym->s_dpos, rdsym->s_dpos);
+                               STRUCT_ASSIGN(dsym->s_def_pos, rdsym->s_def_pos);
                        } else if (rdsym->s_def == DEF && dsym->s_def != DEF) {
-                               STRUCT_ASSIGN(dsym->s_dpos, rdsym->s_dpos);
+                               STRUCT_ASSIGN(dsym->s_def_pos, rdsym->s_def_pos);
                        }
 
                        /*
@@ -2003,8 +2003,8 @@
 copy_usage_info(sym_t *sym, sym_t *rdsym)
 {
 
-       sym->s_spos = rdsym->s_spos;
-       sym->s_upos = rdsym->s_upos;
+       sym->s_set_pos = rdsym->s_set_pos;
+       sym->s_use_pos = rdsym->s_use_pos;
        sym->s_set = rdsym->s_set;
        sym->s_used = rdsym->s_used;
 }
@@ -2875,7 +2875,7 @@
 
        if (!sym->s_set) {
                sym->s_set = 1;
-               UNIQUE_CURR_POS(sym->s_spos);
+               UNIQUE_CURR_POS(sym->s_set_pos);
        }
 }
 
@@ -2888,7 +2888,7 @@
 
        if (!sym->s_used) {
                sym->s_used = 1;
-               UNIQUE_CURR_POS(sym->s_upos);
+               UNIQUE_CURR_POS(sym->s_use_pos);
        }
        /*
         * for function calls another record is written
@@ -2968,7 +2968,7 @@
                return;
 
        if (!arg->s_used && vflag) {
-               STRUCT_ASSIGN(curr_pos, arg->s_dpos);
+               STRUCT_ASSIGN(curr_pos, arg->s_def_pos);
                /* argument %s unused in function %s */
                warning(231, arg->s_name, funcsym->s_name);
        }
@@ -3001,17 +3001,17 @@
 
        if (sc == EXTERN) {
                if (!sym->s_used && !sym->s_set) {
-                       STRUCT_ASSIGN(curr_pos, sym->s_dpos);
+                       STRUCT_ASSIGN(curr_pos, sym->s_def_pos);
                        /* %s unused in function %s */
                        warning(192, sym->s_name, funcsym->s_name);
                }
        } else {
                if (sym->s_set && !sym->s_used) {
-                       STRUCT_ASSIGN(curr_pos, sym->s_spos);
+                       STRUCT_ASSIGN(curr_pos, sym->s_set_pos);
                        /* %s set but not used in function %s */
                        warning(191, sym->s_name, funcsym->s_name);
                } else if (!sym->s_used) {
-                       STRUCT_ASSIGN(curr_pos, sym->s_dpos);
+                       STRUCT_ASSIGN(curr_pos, sym->s_def_pos);
                        /* %s unused in function %s */
                        warning(192, sym->s_name, funcsym->s_name);
                }
@@ -3031,11 +3031,11 @@
                if ((xsym = sym->s_ext_sym) != NULL) {
                        if (sym->s_used && !xsym->s_used) {
                                xsym->s_used = 1;
-                               STRUCT_ASSIGN(xsym->s_upos, sym->s_upos);
+                               STRUCT_ASSIGN(xsym->s_use_pos, sym->s_use_pos);
                        }
                        if (sym->s_set && !xsym->s_set) {
                                xsym->s_set = 1;
-                               STRUCT_ASSIGN(xsym->s_spos, sym->s_spos);
+                               STRUCT_ASSIGN(xsym->s_set_pos, sym->s_set_pos);
                        }
                }
        }
@@ -3049,11 +3049,11 @@
                LERROR("check_label_usage()");
 
        if (lab->s_set && !lab->s_used) {
-               STRUCT_ASSIGN(curr_pos, lab->s_spos);
+               STRUCT_ASSIGN(curr_pos, lab->s_set_pos);
                /* label %s unused in function %s */
                warning(192, lab->s_name, funcsym->s_name);
        } else if (!lab->s_set) {
-               STRUCT_ASSIGN(curr_pos, lab->s_upos);
+               STRUCT_ASSIGN(curr_pos, lab->s_use_pos);
                /* undefined label %s */
                warning(23, lab->s_name);
        }
@@ -3070,7 +3070,7 @@
        if (!zflag || dcs->d_ctx != EXTERN)
                return;
 
-       STRUCT_ASSIGN(curr_pos, sym->s_dpos);
+       STRUCT_ASSIGN(curr_pos, sym->s_def_pos);
        switch (sym->s_type->t_tspec) {
        case STRUCT:
                /* struct %s never defined */
@@ -3139,13 +3139,13 @@
        if (sym->s_scl == STATIC) {
                if (sym->s_type->t_tspec == FUNC) {
                        if (sym->s_used && sym->s_def != DEF) {
-                               STRUCT_ASSIGN(curr_pos, sym->s_upos);
+                               STRUCT_ASSIGN(curr_pos, sym->s_use_pos);
                                /* static func. called but not def.. */
                                error(225, sym->s_name);
                        }
                }
                if (!sym->s_used) {
-                       STRUCT_ASSIGN(curr_pos, sym->s_dpos);
+                       STRUCT_ASSIGN(curr_pos, sym->s_def_pos);
                        if (sym->s_type->t_tspec == FUNC) {
                                if (sym->s_def == DEF) {
                                        if (!sym->s_inline)
@@ -3164,7 +3164,7 @@
                        }
                }
                if (!tflag && sym->s_def == TDEF && sym->s_type->t_const) {
-                       STRUCT_ASSIGN(curr_pos, sym->s_dpos);
+                       STRUCT_ASSIGN(curr_pos, sym->s_def_pos);
                        /* const object %s should have initializer */
                        warning(227, sym->s_name);
                }
@@ -3182,7 +3182,7 @@
                         * after a function declaration
                         */
                        return;
-               STRUCT_ASSIGN(curr_pos, sym->s_dpos);
+               STRUCT_ASSIGN(curr_pos, sym->s_def_pos);
                if (length(sym->s_type, sym->s_name) == 0 &&
                    sym->s_type->t_tspec == ARRAY && sym->s_type->t_dim == 0) {
                        /* empty array declaration: %s */
@@ -3207,7 +3207,7 @@
                return;
 
        STRUCT_ASSIGN(cpos, curr_pos);
-       STRUCT_ASSIGN(curr_pos, psym->s_dpos);
+       STRUCT_ASSIGN(curr_pos, psym->s_def_pos);
        if (msg != -1) {
                message(msg, psym->s_name);
        } else if (psym->s_def == DEF || psym->s_def == TDEF) {
diff -r a7c51e3480ec -r 2ec8f46b0827 usr.bin/xlint/lint1/emit1.c
--- a/usr.bin/xlint/lint1/emit1.c       Wed Dec 30 11:04:48 2020 +0000
+++ b/usr.bin/xlint/lint1/emit1.c       Wed Dec 30 11:14:03 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: emit1.c,v 1.28 2020/12/30 10:56:51 rillig Exp $ */
+/* $NetBSD: emit1.c,v 1.29 2020/12/30 11:14:03 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.28 2020/12/30 10:56:51 rillig Exp $");
+__RCSID("$NetBSD: emit1.c,v 1.29 2020/12/30 11:14:03 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -210,11 +210,11 @@
                outname(tdef->s_name);
        } else {
                outint(3);
-               outint(tag->s_dpos.p_line);
+               outint(tag->s_def_pos.p_line);
                outchar('.');
-               outint(getfnid(tag->s_dpos.p_file));
+               outint(getfnid(tag->s_def_pos.p_file));
                outchar('.');
-               outint(tag->s_dpos.p_uniq);
+               outint(tag->s_def_pos.p_uniq);
        }
 }
 
@@ -248,9 +248,9 @@
         */
        outint(csrc_pos.p_line);
        outchar('d');
-       outint(getfnid(sym->s_dpos.p_file));
+       outint(getfnid(sym->s_def_pos.p_file));
        outchar('.');
-       outint(sym->s_dpos.p_line);
+       outint(sym->s_def_pos.p_line);
 
        /* flags */
 
diff -r a7c51e3480ec -r 2ec8f46b0827 usr.bin/xlint/lint1/func.c
--- a/usr.bin/xlint/lint1/func.c        Wed Dec 30 11:04:48 2020 +0000
+++ b/usr.bin/xlint/lint1/func.c        Wed Dec 30 11:14:03 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: func.c,v 1.34 2020/12/30 10:49:10 rillig Exp $ */
+/*     $NetBSD: func.c,v 1.35 2020/12/30 11:14:03 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.34 2020/12/30 10:49:10 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.35 2020/12/30 11:14:03 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -281,11 +281,11 @@
        }
 
        /*
-        * We must also remember the position. s_dpos is overwritten
+        * We must also remember the position. s_def_pos is overwritten
         * if this is an old style definition and we had already a
         * prototype.
         */
-       STRUCT_ASSIGN(dcs->d_fdpos, fsym->s_dpos);
+       STRUCT_ASSIGN(dcs->d_fdpos, fsym->s_def_pos);
 
        if ((rdsym = dcs->d_rdcsym) != NULL) {
 
@@ -311,7 +311,7 @@
                         * declaration of the prototype.
                         */
                        if (fsym->s_osdef && rdsym->s_type->t_proto)
-                               STRUCT_ASSIGN(fsym->s_dpos, rdsym->s_dpos);
+                               STRUCT_ASSIGN(fsym->s_def_pos, rdsym->s_def_pos);
 
                        /* complete the type */
                        complete_type(fsym, rdsym);
diff -r a7c51e3480ec -r 2ec8f46b0827 usr.bin/xlint/lint1/lint1.h
--- a/usr.bin/xlint/lint1/lint1.h       Wed Dec 30 11:04:48 2020 +0000
+++ b/usr.bin/xlint/lint1/lint1.h       Wed Dec 30 11:14:03 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.43 2020/12/30 11:04:48 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.44 2020/12/30 11:14:03 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -218,12 +218,12 @@
 typedef        struct sym {
        const   char *s_name;
        const   char *s_rename; /* renamed symbol's given name */
-       pos_t   s_dpos;         /* position of last (prototype) definition,
+       pos_t   s_def_pos;      /* position of last (prototype) definition,
                                   prototype declaration, no-prototype-def.,
                                   tentative definition or declaration,
                                   in this order */



Home | Main Index | Thread Index | Old Index