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 parenthesized and _strg



details:   https://anonhg.NetBSD.org/src/rev/c2e301d128ef
branches:  trunk
changeset: 979496:c2e301d128ef
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Dec 30 10:56:51 2020 +0000

description:
lint: un-abbreviate parenthesized and _strg

diffstat:

 usr.bin/xlint/lint1/cgram.y |  14 +++++++-------
 usr.bin/xlint/lint1/emit1.c |   8 ++++----
 usr.bin/xlint/lint1/init.c  |   6 +++---
 usr.bin/xlint/lint1/lint1.h |  10 +++++-----
 usr.bin/xlint/lint1/print.c |   6 +++---
 usr.bin/xlint/lint1/scan.l  |   8 ++++----
 usr.bin/xlint/lint1/tree.c  |  34 +++++++++++++++++-----------------
 7 files changed, 43 insertions(+), 43 deletions(-)

diffs (300 lines):

diff -r be8e4f9eb05c -r c2e301d128ef usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Wed Dec 30 10:49:10 2020 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Wed Dec 30 10:56:51 2020 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.120 2020/12/30 10:35:38 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.121 2020/12/30 10:56:51 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.120 2020/12/30 10:35:38 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.121 2020/12/30 10:56:51 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -133,7 +133,7 @@
        type_t  *y_type;
        tnode_t *y_tnode;
        range_t y_range;
-       strg_t  *y_strg;
+       strg_t  *y_string;
        pqinf_t *y_pqinf;
 };
 
@@ -265,7 +265,7 @@
 %token <y_sb>          T_NAME
 %token <y_sb>          T_TYPENAME
 %token <y_val>         T_CON
-%token <y_strg>        T_STRING
+%token <y_string>      T_STRING
 
 %type  <y_sym>         func_decl
 %type  <y_sym>         notype_decl
@@ -323,8 +323,8 @@
 %type  <y_sym>         abstract_declaration
 %type  <y_tnode>       do_while_expr
 %type  <y_tnode>       opt_expr
-%type  <y_strg>        string
-%type  <y_strg>        string2
+%type  <y_string>      string
+%type  <y_string>      string2
 %type  <y_sb>          opt_asm_or_symbolrename
 %type  <y_range>       range
 %type  <y_range>       lorange
@@ -1857,7 +1857,7 @@
          }
        | T_LPARN expr T_RPARN {
                if ($2 != NULL)
-                       $2->tn_parn = 1;
+                       $2->tn_parenthesized = 1;
                $$ = $2;
          }
        | T_LPARN comp_stmnt_lbrace declaration_list expr_stmnt_list {
diff -r be8e4f9eb05c -r c2e301d128ef usr.bin/xlint/lint1/emit1.c
--- a/usr.bin/xlint/lint1/emit1.c       Wed Dec 30 10:49:10 2020 +0000
+++ b/usr.bin/xlint/lint1/emit1.c       Wed Dec 30 10:56:51 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: emit1.c,v 1.27 2020/12/30 10:46:11 rillig Exp $ */
+/* $NetBSD: emit1.c,v 1.28 2020/12/30 10:56:51 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.27 2020/12/30 10:46:11 rillig Exp $");
+__RCSID("$NetBSD: emit1.c,v 1.28 2020/12/30 10:56:51 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -461,11 +461,11 @@
                        }
                } else if (arg->tn_op == AMPER &&
                           arg->tn_left->tn_op == STRING &&
-                          arg->tn_left->tn_strg->st_tspec == CHAR) {
+                          arg->tn_left->tn_string->st_tspec == CHAR) {
                        /* constant string, write all format specifiers */
                        outchar('s');
                        outint(n);
-                       outfstrg(arg->tn_left->tn_strg);
+                       outfstrg(arg->tn_left->tn_string);
                }
 
        }
diff -r be8e4f9eb05c -r c2e301d128ef usr.bin/xlint/lint1/init.c
--- a/usr.bin/xlint/lint1/init.c        Wed Dec 30 10:49:10 2020 +0000
+++ b/usr.bin/xlint/lint1/init.c        Wed Dec 30 10:56:51 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init.c,v 1.46 2020/12/30 10:46:11 rillig Exp $ */
+/*     $NetBSD: init.c,v 1.47 2020/12/30 10:56:51 rillig Exp $ */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.46 2020/12/30 10:46:11 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.47 2020/12/30 10:56:51 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -622,7 +622,7 @@
                return 0;
 
        istk = initstk;
-       strg = tn->tn_strg;
+       strg = tn->tn_string;
 
        /*
         * Check if we have an array type which can be initialized by
diff -r be8e4f9eb05c -r c2e301d128ef usr.bin/xlint/lint1/lint1.h
--- a/usr.bin/xlint/lint1/lint1.h       Wed Dec 30 10:49:10 2020 +0000
+++ b/usr.bin/xlint/lint1/lint1.h       Wed Dec 30 10:56:51 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.41 2020/12/30 10:49:10 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.42 2020/12/30 10:56:51 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -285,8 +285,8 @@
        op_t    tn_op;          /* operator */
        type_t  *tn_type;       /* type */
        u_int   tn_lvalue : 1;  /* node is lvalue */
-       u_int   tn_cast : 1;    /* if tn_op == CVT its an explicit cast */
-       u_int   tn_parn : 1;    /* node parenthesized */
+       u_int   tn_cast : 1;    /* if tn_op == CVT, it's an explicit cast */
+       u_int   tn_parenthesized : 1; /* node parenthesized */
        union {
                struct {
                        struct  tnode *_tn_left;        /* (left) operand */
@@ -294,7 +294,7 @@
                } tn_s;
                sym_t   *_tn_sym;       /* symbol if op == NAME */
                val_t   *_tn_val;       /* value if op == CON */
-               strg_t  *_tn_strg;      /* string if op == STRING */
+               strg_t  *_tn_string;    /* string if op == STRING */
        } tn_u;
 } tnode_t;
 
@@ -302,7 +302,7 @@
 #define tn_right tn_u.tn_s._tn_right
 #define tn_sym tn_u._tn_sym
 #define        tn_val  tn_u._tn_val
-#define        tn_strg tn_u._tn_strg
+#define        tn_string       tn_u._tn_string
 
 /*
  * For nested declarations a stack exists, which holds all information
diff -r be8e4f9eb05c -r c2e301d128ef usr.bin/xlint/lint1/print.c
--- a/usr.bin/xlint/lint1/print.c       Wed Dec 30 10:49:10 2020 +0000
+++ b/usr.bin/xlint/lint1/print.c       Wed Dec 30 10:56:51 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: print.c,v 1.6 2020/12/29 13:33:03 rillig Exp $ */
+/*     $NetBSD: print.c,v 1.7 2020/12/30 10:56:51 rillig Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: print.c,v 1.6 2020/12/29 13:33:03 rillig Exp $");
+__RCSID("$NetBSD: print.c,v 1.7 2020/12/30 10:56:51 rillig Exp $");
 #endif
 
 #include <stdio.h>
@@ -134,7 +134,7 @@
                break;
 
        case STRING:
-               st = tn->tn_strg;
+               st = tn->tn_string;
                switch (st->st_tspec) {
                case CHAR:
                case SCHAR:
diff -r be8e4f9eb05c -r c2e301d128ef usr.bin/xlint/lint1/scan.l
--- a/usr.bin/xlint/lint1/scan.l        Wed Dec 30 10:49:10 2020 +0000
+++ b/usr.bin/xlint/lint1/scan.l        Wed Dec 30 10:56:51 2020 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: scan.l,v 1.101 2020/12/30 10:49:10 rillig Exp $ */
+/* $NetBSD: scan.l,v 1.102 2020/12/30 10:56:51 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.101 2020/12/30 10:49:10 rillig Exp $");
+__RCSID("$NetBSD: scan.l,v 1.102 2020/12/30 10:56:51 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -1376,7 +1376,7 @@
        strg->st_len = len;
        strg->st_cp = s;
 
-       yylval.y_strg = strg;
+       yylval.y_string = strg;
        return T_STRING;
 }
 
@@ -1433,7 +1433,7 @@
        strg->st_len = wlen;
        strg->st_wcp = ws;
 
-       yylval.y_strg = strg;
+       yylval.y_string = strg;
        return T_STRING;
 }
 
diff -r be8e4f9eb05c -r c2e301d128ef usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Wed Dec 30 10:49:10 2020 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Wed Dec 30 10:56:51 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.103 2020/12/30 10:49:10 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.104 2020/12/30 10:56:51 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.103 2020/12/30 10:49:10 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.104 2020/12/30 10:56:51 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -282,17 +282,17 @@
        n->tn_type->t_dim = len + 1;
        n->tn_lvalue = 1;
 
-       n->tn_strg = tgetblk(sizeof (strg_t));
-       n->tn_strg->st_tspec = strg->st_tspec;
-       n->tn_strg->st_len = len;
+       n->tn_string = tgetblk(sizeof (strg_t));
+       n->tn_string->st_tspec = strg->st_tspec;
+       n->tn_string->st_len = len;
 
        if (strg->st_tspec == CHAR) {
-               n->tn_strg->st_cp = tgetblk(len + 1);
-               (void)memcpy(n->tn_strg->st_cp, strg->st_cp, len + 1);
+               n->tn_string->st_cp = tgetblk(len + 1);
+               (void)memcpy(n->tn_string->st_cp, strg->st_cp, len + 1);
                free(strg->st_cp);
        } else {
-               n->tn_strg->st_wcp = tgetblk((len + 1) * sizeof (wchar_t));
-               (void)memcpy(n->tn_strg->st_wcp, strg->st_wcp,
+               n->tn_string->st_wcp = tgetblk((len + 1) * sizeof (wchar_t));
+               (void)memcpy(n->tn_string->st_wcp, strg->st_wcp,
                             (len + 1) * sizeof (wchar_t));
                free(strg->st_wcp);
        }
@@ -3601,14 +3601,14 @@
                (void)printf("0x%0*lx ", (int)(sizeof (void *) * CHAR_BIT / 4),
                             (u_long)tn->tn_val->v_quad);
        } else if (tn->tn_op == STRING) {
-               if (tn->tn_strg->st_tspec == CHAR) {
-                       (void)printf("\"%s\"", tn->tn_strg->st_cp);
+               if (tn->tn_string->st_tspec == CHAR) {
+                       (void)printf("\"%s\"", tn->tn_string->st_cp);
                } else {
                        char    *s;
                        size_t  n;
-                       n = MB_CUR_MAX * (tn->tn_strg->st_len + 1);
+                       n = MB_CUR_MAX * (tn->tn_string->st_len + 1);
                        s = xmalloc(n);
-                       (void)wcstombs(s, tn->tn_strg->st_wcp, n);
+                       (void)wcstombs(s, tn->tn_string->st_wcp, n);
                        (void)printf("L\"%s\"", s);
                        free(s);
                }
@@ -4072,15 +4072,15 @@
 
        lparn = 0;
        for (ln = tn->tn_left; ln->tn_op == CVT; ln = ln->tn_left)
-               lparn |= ln->tn_parn;
-       lparn |= ln->tn_parn;
+               lparn |= ln->tn_parenthesized;
+       lparn |= ln->tn_parenthesized;
        lop = ln->tn_op;
 
        if (mp->m_binary) {
                rparn = 0;
                for (rn = tn->tn_right; tn->tn_op == CVT; rn = rn->tn_left)
-                       rparn |= rn->tn_parn;
-               rparn |= rn->tn_parn;
+                       rparn |= rn->tn_parenthesized;
+               rparn |= rn->tn_parenthesized;
                rop = rn->tn_op;
        }
 



Home | Main Index | Thread Index | Old Index