Module Name:    src
Committed By:   rillig
Date:           Fri Jan  1 11:58:03 UTC 2021

Modified Files:
        src/usr.bin/xlint/common: lint.h
        src/usr.bin/xlint/lint1: tree.c
        src/usr.bin/xlint/lint2: chk.c

Log Message:
lint: rename styp and utyp


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/xlint/common/lint.h
cvs rdiff -u -r1.113 -r1.114 src/usr.bin/xlint/lint1/tree.c
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/xlint/lint2/chk.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/common/lint.h
diff -u src/usr.bin/xlint/common/lint.h:1.19 src/usr.bin/xlint/common/lint.h:1.20
--- src/usr.bin/xlint/common/lint.h:1.19	Fri Jan  1 11:51:15 2021
+++ src/usr.bin/xlint/common/lint.h	Fri Jan  1 11:58:03 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lint.h,v 1.19 2021/01/01 11:51:15 rillig Exp $	*/
+/*	$NetBSD: lint.h,v 1.20 2021/01/01 11:58:03 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -93,8 +93,8 @@ typedef	struct {
 	size_t	tt_sz;			/* size in bits */
 	size_t	tt_psz;			/* size, different from tt_sz
 					   if pflag is set */
-	tspec_t	tt_styp;		/* signed counterpart */
-	tspec_t	tt_utyp;		/* unsigned counterpart */
+	tspec_t	tt_signed_counterpart;
+	tspec_t	tt_unsigned_counterpart;
 	u_int	tt_is_int : 1;		/* 1 if integer type */
 	u_int	tt_is_uint : 1;		/* 1 if unsigned integer type */
 	u_int	tt_is_float : 1;	/* 1 if floating point type */
@@ -106,8 +106,8 @@ typedef	struct {
 
 #define size(t)			(ttab[t].tt_sz)
 #define psize(t)		(ttab[t].tt_psz)
-#define styp(t)			(ttab[t].tt_styp)
-#define utyp(t)			(ttab[t].tt_utyp)
+#define signed_type(t)		(ttab[t].tt_signed_counterpart)
+#define unsigned_type(t)	(ttab[t].tt_unsigned_counterpart)
 #define tspec_is_int(t)		(ttab[t].tt_is_int)
 #define tspec_is_uint(t)	(ttab[t].tt_is_uint)
 #define tspec_is_float(t)	(ttab[t].tt_is_float)

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.113 src/usr.bin/xlint/lint1/tree.c:1.114
--- src/usr.bin/xlint/lint1/tree.c:1.113	Fri Jan  1 11:41:01 2021
+++ src/usr.bin/xlint/lint1/tree.c	Fri Jan  1 11:58:03 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.113 2021/01/01 11:41:01 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.114 2021/01/01 11:58:03 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.113 2021/01/01 11:41:01 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.114 2021/01/01 11:58:03 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -1666,7 +1666,7 @@ balance(op_t op, tnode_t **lnp, tnode_t 
 		}
 		t = tl[i];
 		if (u && tspec_is_int(t) && !tspec_is_uint(t))
-			t = utyp(t);
+			t = unsigned_type(t);
 	}
 
 	if (t != lt) {
@@ -1775,7 +1775,7 @@ check_prototype_conversion(int arg, tspe
 		 * and the msb of the argument is not set, print no warning
 		 */
 		if (ptn->tn_op == CON && tspec_is_int(nt) &&
-		    styp(nt) == styp(ot) &&
+		    signed_type(nt) == signed_type(ot) &&
 		    msb(ptn->tn_val->v_quad, ot, -1) == 0) {
 			/* ok */
 		} else {

Index: src/usr.bin/xlint/lint2/chk.c
diff -u src/usr.bin/xlint/lint2/chk.c:1.29 src/usr.bin/xlint/lint2/chk.c:1.30
--- src/usr.bin/xlint/lint2/chk.c:1.29	Wed Dec 30 10:46:11 2020
+++ src/usr.bin/xlint/lint2/chk.c	Fri Jan  1 11:58:03 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: chk.c,v 1.29 2020/12/30 10:46:11 rillig Exp $ */
+/* $NetBSD: chk.c,v 1.30 2021/01/01 11:58:03 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: chk.c,v 1.29 2020/12/30 10:46:11 rillig Exp $");
+__RCSID("$NetBSD: chk.c,v 1.30 2021/01/01 11:58:03 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -519,7 +519,7 @@ chkau(hte_t *hte, int n, sym_t *def, sym
 			}
 		}
 
-		if (styp(t1) == styp(t2)) {
+		if (signed_type(t1) == signed_type(t2)) {
 
 			/*
 			 * types differ only in signedness; get information
@@ -901,7 +901,7 @@ scanflike(hte_t *hte, fcall_t *call, int
 			if (!noasgn) {
 				if (t1 != PTR) {
 					inconarg(hte, call, n);
-				} else if (t2 != styp(sz)) {
+				} else if (t2 != signed_type(sz)) {
 					inconarg(hte, call, n);
 				} else if (hflag && t2 != sz) {
 					inconarg(hte, call, n);
@@ -1242,7 +1242,7 @@ eqtype(type_t *tp1, type_t *tp2, int ign
 			 */
 			if (sflag || hflag || to != PTR)
 				return 0;
-			if (styp(t) != styp(tp2->t_tspec))
+			if (signed_type(t) != signed_type(tp2->t_tspec))
 				return 0;
 		}
 

Reply via email to