Module Name:    src
Committed By:   rillig
Date:           Sat Jan 30 18:16:45 UTC 2021

Modified Files:
        src/usr.bin/xlint/lint1: decl.c externs1.h func.c init.c tree.c

Log Message:
lint: rename incompl to is_incomplete

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.63 -r1.64 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.65 -r1.66 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.64 -r1.65 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.193 -r1.194 src/usr.bin/xlint/lint1/tree.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.131 src/usr.bin/xlint/lint1/decl.c:1.132
--- src/usr.bin/xlint/lint1/decl.c:1.131	Sun Jan 24 00:15:20 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sat Jan 30 18:16:45 2021
@@ -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 @@ tduptyp(const type_t *tp)
  * struct, union or enum type.
  */
 bool
-incompl(const type_t *tp)
+is_incomplete(const type_t *tp)
 {
 	tspec_t	t;
 
@@ -903,14 +903,14 @@ length(const type_t *tp, const char *nam
 		/* 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 @@ check_type(sym_t *sym)
 				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 @@ newtag(sym_t *tag, scl_t scl, bool decl,
 			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 @@ static void
 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 */

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.63 src/usr.bin/xlint/lint1/externs1.h:1.64
--- src/usr.bin/xlint/lint1/externs1.h:1.63	Sun Jan 24 09:25:16 2021
+++ src/usr.bin/xlint/lint1/externs1.h	Sat Jan 30 18:16:45 2021
@@ -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	void	initdecl(void);
 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 *);

Index: src/usr.bin/xlint/lint1/func.c
diff -u src/usr.bin/xlint/lint1/func.c:1.65 src/usr.bin/xlint/lint1/func.c:1.66
--- src/usr.bin/xlint/lint1/func.c:1.65	Sat Jan 23 22:20:17 2021
+++ src/usr.bin/xlint/lint1/func.c	Sat Jan 30 18:16:45 2021
@@ -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 @@ funcdef(sym_t *fsym)
 	 * 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);
 	}

Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.64 src/usr.bin/xlint/lint1/init.c:1.65
--- src/usr.bin/xlint/lint1/init.c:1.64	Sun Jan 17 15:40:27 2021
+++ src/usr.bin/xlint/lint1/init.c	Sat Jan 30 18:16:45 2021
@@ -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 @@ initstack_init(void)
 	 * 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 @@ again:
 			    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 @@ again:
 			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;

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.193 src/usr.bin/xlint/lint1/tree.c:1.194
--- src/usr.bin/xlint/lint1/tree.c:1.193	Sat Jan 30 18:14:25 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sat Jan 30 18:16:45 2021
@@ -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 @@ build_colon(tnode_t *ln, tnode_t *rn)
 		/* 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 @@ build_assignment(op_t op, tnode_t *ln, t
 	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 @@ plength(type_t *tp)
 			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 @@ tsize(type_t *tp)
 		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 @@ tsize(type_t *tp)
 		}
 		break;
 	case ENUM:
-		if (incompl(tp)) {
+		if (is_incomplete(tp)) {
 			/* cannot take size/alignment of incomplete type */
 			warning(143);
 		}
@@ -3398,7 +3398,7 @@ build_alignof(type_t *tp)
 
 	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 @@ check_function_arguments(type_t *ftp, tn
 			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 @@ check_array_index(tnode_t *tn, bool ampe
 	 * 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 */

Reply via email to