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 type.t_isfield to t_bitfield



details:   https://anonhg.NetBSD.org/src/rev/70af23454873
branches:  trunk
changeset: 958402:70af23454873
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jan 03 19:10:47 2021 +0000

description:
lint: rename type.t_isfield to t_bitfield

diffstat:

 usr.bin/xlint/lint1/decl.c  |  14 +++++++-------
 usr.bin/xlint/lint1/init.c  |   8 ++++----
 usr.bin/xlint/lint1/lint1.h |   4 ++--
 usr.bin/xlint/lint1/tree.c  |  30 +++++++++++++++---------------
 4 files changed, 28 insertions(+), 28 deletions(-)

diffs (244 lines):

diff -r 0fe98acca1b2 -r 70af23454873 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Sun Jan 03 18:48:37 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Sun Jan 03 19:10:47 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.107 2021/01/03 18:48:37 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.108 2021/01/03 19:10:47 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.107 2021/01/03 18:48:37 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.108 2021/01/03 19:10:47 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -494,7 +494,7 @@
 bitfieldsize(sym_t **mem)
 {
        size_t len = (*mem)->s_type->t_flen;
-       while (*mem && (*mem)->s_type->t_isfield) {
+       while (*mem && (*mem)->s_type->t_bitfield) {
                len += (*mem)->s_type->t_flen;
                *mem = (*mem)->s_next;
        }
@@ -513,7 +513,7 @@
                sp = tp->t_str;
                sp->size = 0;
                for (mem = sp->memb; mem != NULL; mem = mem->s_next) {
-                       if (mem->s_type->t_isfield) {
+                       if (mem->s_type->t_bitfield) {
                                sp->size += bitfieldsize(&mem);
                                if (mem == NULL)
                                        break;
@@ -1148,7 +1148,7 @@
                if (dsym->s_scl == MOU) {
                        /* illegal use of bit-field */
                        error(41);
-                       dsym->s_type->t_isfield = 0;
+                       dsym->s_type->t_bitfield = false;
                        dsym->s_bitfield = 0;
                }
        } else if (t == FUNC) {
@@ -1238,7 +1238,7 @@
                dsym->s_blklev = -1;
        }
        dsym->s_type = duptyp(dsym->s_type);
-       dsym->s_type->t_isfield = 1;
+       dsym->s_type->t_bitfield = true;
        dsym->s_type->t_flen = len;
        dsym->s_bitfield = 1;
        return dsym;
@@ -1787,7 +1787,7 @@
                /* bind anonymous members to the structure */
                if (mem->s_styp == NULL) {
                        mem->s_styp = sp;
-                       if (mem->s_type->t_isfield) {
+                       if (mem->s_type->t_bitfield) {
                                sp->size += bitfieldsize(&mem);
                                if (mem == NULL)
                                        break;
diff -r 0fe98acca1b2 -r 70af23454873 usr.bin/xlint/lint1/init.c
--- a/usr.bin/xlint/lint1/init.c        Sun Jan 03 18:48:37 2021 +0000
+++ b/usr.bin/xlint/lint1/init.c        Sun Jan 03 19:10:47 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init.c,v 1.58 2021/01/03 17:42:45 rillig Exp $ */
+/*     $NetBSD: init.c,v 1.59 2021/01/03 19:10:47 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.58 2021/01/03 17:42:45 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.59 2021/01/03 19:10:47 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -633,7 +633,7 @@
        expr(tn, 1, 0, 1);
        trestor(tmem);
 
-       if (tspec_is_int(lt) && ln->tn_type->t_isfield && !tspec_is_int(rt)) {
+       if (tspec_is_int(lt) && ln->tn_type->t_bitfield && !tspec_is_int(rt)) {
                /*
                 * Bit-fields can be initialized in trad. C only by integer
                 * constants.
@@ -643,7 +643,7 @@
                        warning(186);
        }
 
-       if (lt != rt || (initstk->i_type->t_isfield && tn->tn_op == CON))
+       if (lt != rt || (initstk->i_type->t_bitfield && tn->tn_op == CON))
                tn = convert(INIT, 0, initstk->i_type, tn);
 
        if (tn != NULL && tn->tn_op != CON) {
diff -r 0fe98acca1b2 -r 70af23454873 usr.bin/xlint/lint1/lint1.h
--- a/usr.bin/xlint/lint1/lint1.h       Sun Jan 03 18:48:37 2021 +0000
+++ b/usr.bin/xlint/lint1/lint1.h       Sun Jan 03 19:10:47 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.49 2021/01/03 18:48:37 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.50 2021/01/03 19:10:47 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -156,7 +156,7 @@
        bool    t_proto : 1;    /* function prototype (t_args valid) */
        bool    t_vararg : 1;   /* prototype with ... */
        bool    t_typedef : 1;  /* type defined with typedef */
-       bool    t_isfield : 1;  /* type is bitfield */
+       bool    t_bitfield : 1;
        bool    t_isenum : 1;   /* type is (or was) enum (t_enum valid) */
        bool    t_ispacked : 1; /* type is packed */
        union {
diff -r 0fe98acca1b2 -r 70af23454873 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sun Jan 03 18:48:37 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sun Jan 03 19:10:47 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.119 2021/01/03 18:35:51 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.120 2021/01/03 19:10:47 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.119 2021/01/03 18:35:51 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.120 2021/01/03 19:10:47 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -759,7 +759,7 @@
                 * struct_or_union_member().
                 * Here we only must check for totally wrong things.
                 */
-               if (lt == FUNC || lt == VOID || ltp->t_isfield ||
+               if (lt == FUNC || lt == VOID || ltp->t_bitfield ||
                    ((lt != STRUCT && lt != UNION) && !ln->tn_lvalue)) {
                        /* Without tflag we got already an error */
                        if (tflag)
@@ -815,7 +815,7 @@
                        error(114, "", mp->m_name);
                        return 0;
                } else if (tspec_is_scalar(lt)) {
-                       if (ltp->t_isfield) {
+                       if (ltp->t_bitfield) {
                                /* cannot take address of bit-field */
                                error(112);
                                return 0;
@@ -1530,7 +1530,7 @@
                 * if INT can represent all possible values of the previous
                 * type.
                 */
-               if (tn->tn_type->t_isfield) {
+               if (tn->tn_type->t_bitfield) {
                        len = tn->tn_type->t_flen;
                        if (size(INT) > len) {
                                t = INT;
@@ -2028,14 +2028,14 @@
        case LCOMPLEX:
                break;
        default:
-               sz = tp->t_isfield ? tp->t_flen : size(nt);
+               sz = tp->t_bitfield ? tp->t_flen : size(nt);
                nv->v_quad = xsign(nv->v_quad, nt, sz);
                break;
        }
 
        if (rchk && op != CVT) {
                osz = size(ot);
-               nsz = tp->t_isfield ? tp->t_flen : size(nt);
+               nsz = tp->t_bitfield ? tp->t_flen : size(nt);
                xmask = qlmasks[nsz] ^ qlmasks[osz];
                xmsk1 = qlmasks[nsz] ^ qlmasks[osz - 1];
                /*
@@ -2107,13 +2107,13 @@
                         *      i = c;                  ** yields -128 **
                         *      i = (unsigned char)c;   ** yields 128 **
                         */
-                       if (op == ASSIGN && tp->t_isfield) {
+                       if (op == ASSIGN && tp->t_bitfield) {
                                /* precision lost in bit-field assignment */
                                warning(166);
                        } else if (op == ASSIGN) {
                                /* constant truncated by assignment */
                                warning(165);
-                       } else if (op == INIT && tp->t_isfield) {
+                       } else if (op == INIT && tp->t_bitfield) {
                                /* bit-field initializer does not fit */
                                warning(180);
                        } else if (op == INIT) {
@@ -2132,10 +2132,10 @@
                                    type_name(gettyp(ot)), type_name(tp));
                        }
                } else if (nv->v_quad != v->v_quad) {
-                       if (op == ASSIGN && tp->t_isfield) {
+                       if (op == ASSIGN && tp->t_bitfield) {
                                /* precision lost in bit-field assignment */
                                warning(166);
-                       } else if (op == INIT && tp->t_isfield) {
+                       } else if (op == INIT && tp->t_bitfield) {
                                /* bit-field initializer out of range */
                                warning(11);
                        } else if (op == CASE) {
@@ -2309,7 +2309,7 @@
        if (ln->tn_op == CON)
                ntn = fold(ntn);
 
-       if (rn->tn_type->t_isfield) {
+       if (rn->tn_type->t_bitfield) {
                ntn = new_tnode(FSEL, ntn->tn_type->t_subt, ntn, NULL);
        } else {
                ntn = new_tnode(STAR, ntn->tn_type->t_subt, ntn, NULL);
@@ -2591,7 +2591,7 @@
        } else if (op != SHRASS) {
                if (op == ASSIGN || lt != PTR) {
                        if (lt != rt ||
-                           (ln->tn_type->t_isfield && rn->tn_op == CON)) {
+                           (ln->tn_type->t_bitfield && rn->tn_op == CON)) {
                                rn = convert(op, 0, ln->tn_type, rn);
                                rt = lt;
                        }
@@ -3046,7 +3046,7 @@
                }
                /* FALLTHROUGH */
        default:
-               if (tp->t_isfield) {
+               if (tp->t_bitfield) {
                        /* cannot take size/alignment of bit-field */
                        error(145);
                }
@@ -3092,7 +3092,7 @@
        case ENUM:
                break;
        default:
-               if (tp->t_isfield) {
+               if (tp->t_bitfield) {
                        /* cannot take size/alignment of bit-field */
                        error(145);
                        return 0;



Home | Main Index | Thread Index | Old Index