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 fields in mod_t



details:   https://anonhg.NetBSD.org/src/rev/74dd65b22636
branches:  trunk
changeset: 1017472:74dd65b22636
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Dec 28 19:38:54 2020 +0000

description:
lint: rename fields in mod_t

diffstat:

 usr.bin/xlint/lint1/op.h   |  28 ++++++++++++++--------------
 usr.bin/xlint/lint1/tree.c |  26 ++++++++++++--------------
 2 files changed, 26 insertions(+), 28 deletions(-)

diffs (126 lines):

diff -r b3a9fdd346a0 -r 74dd65b22636 usr.bin/xlint/lint1/op.h
--- a/usr.bin/xlint/lint1/op.h  Mon Dec 28 19:31:43 2020 +0000
+++ b/usr.bin/xlint/lint1/op.h  Mon Dec 28 19:38:54 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: op.h,v 1.6 2011/02/05 17:14:14 christos Exp $  */
+/*     $NetBSD: op.h,v 1.7 2020/12/28 19:38:54 rillig Exp $    */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -35,24 +35,24 @@
  * Various information about operators
  */
 typedef        struct {
-       u_int   m_binary : 1;   /* binary op. */
-       u_int   m_logop : 1;    /* logical op., result is int */
-       u_int   m_rqint : 1;    /* operands must have integer type */
-       u_int   m_rqsclt : 1;   /* operands must have scalar type */
-       u_int   m_rqatyp : 1;   /* operands must have arithmetic type */
+       u_int   m_binary : 1;   /* binary operator */
+       u_int   m_logical : 1;  /* logical operator, result is int */
+       u_int   m_requires_integer : 1;
+       u_int   m_requires_scalar : 1;
+       u_int   m_requires_arith : 1;
        u_int   m_fold : 1;     /* operands should be folded */
        u_int   m_vctx : 1;     /* value context for left operand */
        u_int   m_tctx : 1;     /* test context for left operand */
-       u_int   m_balance : 1;  /* op. requires balancing */
-       u_int   m_sideeff : 1;  /* op. has side effect */
-       u_int   m_tlansiu : 1;  /* warning if left op. is unsign. in ANSI C */
-       u_int   m_transiu : 1;  /* warning if right op. is unsign. in ANSI C */
+       u_int   m_balance : 1;  /* operator requires balancing */
+       u_int   m_sideeff : 1;  /* operator has side effect */
+       u_int   m_tlansiu : 1;  /* warn if left op. is unsign. in ANSI C */
+       u_int   m_transiu : 1;  /* warn if right op. is unsign. in ANSI C */
        u_int   m_tpconf : 1;   /* test possible precedence confusion */
-       u_int   m_comp : 1;     /* op. performs comparison */
-       u_int   m_enumop : 1;   /* valid operation on enums */
-       u_int   m_badeop : 1;   /* dubious operation on enums */
+       u_int   m_comp : 1;     /* operator performs comparison */
+       u_int   m_valid_on_enum : 1;    /* valid operation on enums */
+       u_int   m_bad_on_enum : 1;      /* dubious operation on enums */
        u_int   m_eqwarn : 1;   /* warning if on operand stems from == */
-       u_int   m_rqintcomp : 1;/* operands must be integer or complex */
+       u_int   m_requires_integer_or_complex : 1;
        const char *m_name;     /* name of op. */
 } mod_t;
 
diff -r b3a9fdd346a0 -r 74dd65b22636 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Mon Dec 28 19:31:43 2020 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Mon Dec 28 19:38:54 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.92 2020/12/28 19:07:43 rillig Exp $ */
+/*     $NetBSD: tree.c,v 1.93 2020/12/28 19:38:54 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.92 2020/12/28 19:07:43 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.93 2020/12/28 19:38:54 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -591,7 +591,7 @@
                ntn = bldri(op, ln);
                break;
        default:
-               rtp = mp->m_logop ? gettyp(INT) : ln->tn_type;
+               rtp = mp->m_logical ? gettyp(INT) : ln->tn_type;
                if (!mp->m_binary && rn != NULL)
                        LERROR("build()");
                ntn = mktnode(op, rtp, ln, rn);
@@ -712,29 +712,25 @@
                        rst = (rstp = rtp->t_subt)->t_tspec;
        }
 
-       if (mp->m_rqint) {
-               /* integer types required */
+       if (mp->m_requires_integer) {
                if (!tspec_is_int(lt) || (mp->m_binary && !tspec_is_int(rt))) {
                        incompat(op, lt, rt);
                        return (0);
                }
-       } else if (mp->m_rqintcomp) {
-               /* integer or complex types required */
+       } else if (mp->m_requires_integer_or_complex) {
                if ((!tspec_is_int(lt) && !tspec_is_complex(lt)) ||
                    (mp->m_binary &&
                     (!tspec_is_int(rt) && !tspec_is_complex(rt)))) {
                        incompat(op, lt, rt);
                        return (0);
                }
-       } else if (mp->m_rqsclt) {
-               /* scalar types required */
+       } else if (mp->m_requires_scalar) {
                if (!tspec_is_scalar(lt) ||
                    (mp->m_binary && !tspec_is_scalar(rt))) {
                        incompat(op, lt, rt);
                        return (0);
                }
-       } else if (mp->m_rqatyp) {
-               /* arithmetic types required */
+       } else if (mp->m_requires_arith) {
                if (!tspec_is_arith(lt) ||
                    (mp->m_binary && !tspec_is_arith(rt))) {
                        incompat(op, lt, rt);
@@ -1134,12 +1130,14 @@
                break;
        }
 
-       if (mp->m_badeop &&
+       if (mp->m_bad_on_enum &&
            (ltp->t_isenum || (mp->m_binary && rtp->t_isenum))) {
                chkbeop(op, ln, rn);
-       } else if (mp->m_enumop && (ltp->t_isenum && rtp && rtp->t_isenum)) {
+       } else if (mp->m_valid_on_enum &&
+           (ltp->t_isenum && rtp && rtp->t_isenum)) {
                chkeop2(op, arg, ln, rn);
-       } else if (mp->m_enumop && (ltp->t_isenum || (rtp && rtp->t_isenum))) {
+       } else if (mp->m_valid_on_enum &&
+           (ltp->t_isenum || (rtp && rtp->t_isenum))) {
                chkeop1(op, arg, ln, rn);
        }
 



Home | Main Index | Thread Index | Old Index