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 incompl to is_incomplete



details:   https://anonhg.NetBSD.org/src/rev/c6176193eeae
branches:  trunk
changeset: 950758:c6176193eeae
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jan 30 18:16:45 2021 +0000

description:
lint: rename incompl to is_incomplete

No functional change.

diffstat:

 usr.bin/xlint/lint1/decl.c     |  16 ++++++++--------
 usr.bin/xlint/lint1/externs1.h |   4 ++--
 usr.bin/xlint/lint1/func.c     |   6 +++---
 usr.bin/xlint/lint1/init.c     |  13 +++++++------
 usr.bin/xlint/lint1/tree.c     |  22 +++++++++++-----------
 5 files changed, 31 insertions(+), 30 deletions(-)

diffs (267 lines):

diff -r 4db3812bc0c9 -r c6176193eeae usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Sat Jan 30 18:14:25 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Sat Jan 30 18:16:45 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.131 2021/01/24 00:15:20 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.132 2021/01/30 18:16:45 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.131 2021/01/24 00:15:20 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.132 2021/01/30 18:16:45 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -172,7 +172,7 @@
  * struct, union or enum type.
  */
 bool
-incompl(const type_t *tp)
+is_incomplete(const type_t *tp)
 {
        tspec_t t;
 
@@ -903,14 +903,14 @@
                /* NOTREACHED */
        case STRUCT:
        case UNION:
-               if (incompl(tp) && name != NULL) {
+               if (is_incomplete(tp) && name != NULL) {
                        /* incomplete structure or union %s: %s */
                        error(31, tp->t_str->stag->s_name, name);
                }
                elsz = tp->t_str->size;
                break;
        case ENUM:
-               if (incompl(tp) && name != NULL) {
+               if (is_incomplete(tp) && name != NULL) {
                        /* incomplete enum type: %s */
                        warning(13, name);
                }
@@ -1034,7 +1034,7 @@
                                error(18);
                                *tpp = gettyp(INT);
 #if 0  /* errors are produced by length() */
-                       } else if (incompl(tp)) {
+                       } else if (is_incomplete(tp)) {
                                /* array of incomplete type */
                                if (sflag) {
                                        /* array of incomplete type */
@@ -1724,7 +1724,7 @@
                        print_previous_declaration(-1, tag);
                        tag = pushdown(tag);
                        dcs->d_next->d_nedecl = true;
-               } else if (decl && !incompl(tag->s_type)) {
+               } else if (decl && !is_incomplete(tag->s_type)) {
                        /* (%s) tag redeclared */
                        error(46, storage_class_name(tag->s_scl));
                        print_previous_declaration(-1, tag);
@@ -3071,7 +3071,7 @@
 check_tag_usage(sym_t *sym)
 {
 
-       if (!incompl(sym->s_type))
+       if (!is_incomplete(sym->s_type))
                return;
 
        /* always complain about incomplete tags declared inside blocks */
diff -r 4db3812bc0c9 -r c6176193eeae usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h    Sat Jan 30 18:14:25 2021 +0000
+++ b/usr.bin/xlint/lint1/externs1.h    Sat Jan 30 18:16:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: externs1.h,v 1.63 2021/01/24 09:25:16 rillig Exp $     */
+/*     $NetBSD: externs1.h,v 1.64 2021/01/30 18:16:45 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -141,7 +141,7 @@
 extern type_t  *gettyp(tspec_t);
 extern type_t  *duptyp(const type_t *);
 extern type_t  *tduptyp(const type_t *);
-extern bool    incompl(const type_t *);
+extern bool    is_incomplete(const type_t *);
 extern void    setcomplete(type_t *, bool);
 extern void    add_storage_class(scl_t);
 extern void    add_type(type_t *);
diff -r 4db3812bc0c9 -r c6176193eeae usr.bin/xlint/lint1/func.c
--- a/usr.bin/xlint/lint1/func.c        Sat Jan 30 18:14:25 2021 +0000
+++ b/usr.bin/xlint/lint1/func.c        Sat Jan 30 18:16:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: func.c,v 1.65 2021/01/23 22:20:17 rillig Exp $ */
+/*     $NetBSD: func.c,v 1.66 2021/01/30 18:16:45 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.65 2021/01/23 22:20:17 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.66 2021/01/30 18:16:45 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -245,7 +245,7 @@
         * incomplete return values (these are allowed in declarations)
         */
        if (fsym->s_type->t_subt->t_tspec != VOID &&
-           incompl(fsym->s_type->t_subt)) {
+           is_incomplete(fsym->s_type->t_subt)) {
                /* cannot return incomplete type */
                error(67);
        }
diff -r 4db3812bc0c9 -r c6176193eeae usr.bin/xlint/lint1/init.c
--- a/usr.bin/xlint/lint1/init.c        Sat Jan 30 18:14:25 2021 +0000
+++ b/usr.bin/xlint/lint1/init.c        Sat Jan 30 18:16:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init.c,v 1.64 2021/01/17 15:40:27 rillig Exp $ */
+/*     $NetBSD: init.c,v 1.65 2021/01/30 18:16:45 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.64 2021/01/17 15:40:27 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.65 2021/01/30 18:16:45 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -196,7 +196,7 @@
         * If the type which is to be initialized is an incomplete type,
         * it must be duplicated.
         */
-       if (initsym->s_type->t_tspec == ARRAY && incompl(initsym->s_type))
+       if (initsym->s_type->t_tspec == ARRAY && is_incomplete(initsym->s_type))
                initsym->s_type = duptyp(initsym->s_type);
 
        istk = initstk = xcalloc(1, sizeof (istk_t));
@@ -350,14 +350,15 @@
                            istk->i_brace, istk->i_next->i_namedmem));
                }
 
-               if (incompl(istk->i_type) && istk->i_next->i_next != NULL) {
+               if (is_incomplete(istk->i_type) &&
+                   istk->i_next->i_next != NULL) {
                        /* initialisation of an incomplete type */
                        error(175);
                        initerr = true;
                        return;
                }
                istk->i_subt = istk->i_type->t_subt;
-               istk->i_nolimit = incompl(istk->i_type);
+               istk->i_nolimit = is_incomplete(istk->i_type);
                istk->i_remaining = istk->i_type->t_dim;
                DPRINTF(("%s: elements array %s[%d] %s\n", __func__,
                    type_name(istk->i_subt), istk->i_remaining,
@@ -369,7 +370,7 @@
                        warning(238);
                /* FALLTHROUGH */
        case STRUCT:
-               if (incompl(istk->i_type)) {
+               if (is_incomplete(istk->i_type)) {
                        /* initialisation of an incomplete type */
                        error(175);
                        initerr = true;
diff -r 4db3812bc0c9 -r c6176193eeae usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sat Jan 30 18:14:25 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sat Jan 30 18:16:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.193 2021/01/30 18:14:25 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.194 2021/01/30 18:16:45 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.193 2021/01/30 18:14:25 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.194 2021/01/30 18:16:45 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -2846,7 +2846,7 @@
                /* Both types must be identical. */
                lint_assert(rt == STRUCT || rt == UNION);
                lint_assert(ln->tn_type->t_str == rn->tn_type->t_str);
-               if (incompl(ln->tn_type)) {
+               if (is_incomplete(ln->tn_type)) {
                        /* unknown operand size, op %s */
                        error(138, modtab[COLON].m_name);
                        return NULL;
@@ -2918,7 +2918,7 @@
        if ((op == ASSIGN || op == RETURN) && (lt == STRUCT || rt == STRUCT)) {
                lint_assert(lt == rt);
                lint_assert(ln->tn_type->t_str == rn->tn_type->t_str);
-               if (incompl(ln->tn_type)) {
+               if (is_incomplete(ln->tn_type)) {
                        if (op == RETURN) {
                                /* cannot return incomplete type */
                                error(212);
@@ -2986,7 +2986,7 @@
                        error(136);
                break;
        case ENUM:
-               if (incompl(tp)) {
+               if (is_incomplete(tp)) {
                        /* cannot do pointer arithmetic on operand of ... */
                        warning(136);
                }
@@ -3351,7 +3351,7 @@
                break;
        case STRUCT:
        case UNION:
-               if (incompl(tp)) {
+               if (is_incomplete(tp)) {
                        /* cannot take size/alignment of incomplete type */
                        error(143);
                        elsz = 1;
@@ -3360,7 +3360,7 @@
                }
                break;
        case ENUM:
-               if (incompl(tp)) {
+               if (is_incomplete(tp)) {
                        /* cannot take size/alignment of incomplete type */
                        warning(143);
                }
@@ -3398,7 +3398,7 @@
 
        case STRUCT:
        case UNION:
-               if (incompl(tp)) {
+               if (is_incomplete(tp)) {
                        /* cannot take size/alignment of incomplete type */
                        error(143);
                        return 0;
@@ -3611,13 +3611,13 @@
                        error(151, n);
                        return NULL;
                } else if ((at == STRUCT || at == UNION) &&
-                          incompl(arg->tn_left->tn_type)) {
+                          is_incomplete(arg->tn_left->tn_type)) {
                        /* argument cannot have unknown size, arg #%d */
                        error(152, n);
                        return NULL;
                } else if (is_integer(at) &&
                           arg->tn_left->tn_type->t_isenum &&
-                          incompl(arg->tn_left->tn_type)) {
+                          is_incomplete(arg->tn_left->tn_type)) {
                        /* argument cannot have unknown size, arg #%d */
                        warning(152, n);
                }
@@ -4083,7 +4083,7 @@
         * For incomplete array types, we can print a warning only if
         * the index is negative.
         */
-       if (incompl(ln->tn_left->tn_type) && rn->tn_val->v_quad >= 0)
+       if (is_incomplete(ln->tn_left->tn_type) && rn->tn_val->v_quad >= 0)
                return;
 
        /* Get the size of one array element */



Home | Main Index | Thread Index | Old Index