Module Name:    src
Committed By:   rillig
Date:           Wed Dec 30 10:56:51 UTC 2020

Modified Files:
        src/usr.bin/xlint/lint1: cgram.y emit1.c init.c lint1.h print.c scan.l
            tree.c

Log Message:
lint: un-abbreviate parenthesized and _strg


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/xlint/lint1/emit1.c
cvs rdiff -u -r1.46 -r1.47 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.41 -r1.42 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/xlint/lint1/print.c
cvs rdiff -u -r1.101 -r1.102 src/usr.bin/xlint/lint1/scan.l
cvs rdiff -u -r1.103 -r1.104 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/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.120 src/usr.bin/xlint/lint1/cgram.y:1.121
--- src/usr.bin/xlint/lint1/cgram.y:1.120	Wed Dec 30 10:35:38 2020
+++ src/usr.bin/xlint/lint1/cgram.y	Wed Dec 30 10:56:51 2020
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.120 2020/12/30 10:35:38 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.121 2020/12/30 10:56:51 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.120 2020/12/30 10:35:38 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.121 2020/12/30 10:56:51 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -133,7 +133,7 @@ anonymize(sym_t *s)
 	type_t	*y_type;
 	tnode_t	*y_tnode;
 	range_t	y_range;
-	strg_t	*y_strg;
+	strg_t	*y_string;
 	pqinf_t	*y_pqinf;
 };
 
@@ -265,7 +265,7 @@ anonymize(sym_t *s)
 %token	<y_sb>		T_NAME
 %token	<y_sb>		T_TYPENAME
 %token	<y_val>		T_CON
-%token	<y_strg>	T_STRING
+%token	<y_string>	T_STRING
 
 %type	<y_sym>		func_decl
 %type	<y_sym>		notype_decl
@@ -323,8 +323,8 @@ anonymize(sym_t *s)
 %type	<y_sym>		abstract_declaration
 %type	<y_tnode>	do_while_expr
 %type	<y_tnode>	opt_expr
-%type	<y_strg>	string
-%type	<y_strg>	string2
+%type	<y_string>	string
+%type	<y_string>	string2
 %type	<y_sb>		opt_asm_or_symbolrename
 %type	<y_range>	range
 %type	<y_range>	lorange
@@ -1857,7 +1857,7 @@ term:
 	  }
 	| T_LPARN expr T_RPARN {
 		if ($2 != NULL)
-			$2->tn_parn = 1;
+			$2->tn_parenthesized = 1;
 		$$ = $2;
 	  }
 	| T_LPARN comp_stmnt_lbrace declaration_list expr_stmnt_list {

Index: src/usr.bin/xlint/lint1/emit1.c
diff -u src/usr.bin/xlint/lint1/emit1.c:1.27 src/usr.bin/xlint/lint1/emit1.c:1.28
--- src/usr.bin/xlint/lint1/emit1.c:1.27	Wed Dec 30 10:46:11 2020
+++ src/usr.bin/xlint/lint1/emit1.c	Wed Dec 30 10:56:51 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: emit1.c,v 1.27 2020/12/30 10:46:11 rillig Exp $ */
+/* $NetBSD: emit1.c,v 1.28 2020/12/30 10:56:51 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: emit1.c,v 1.27 2020/12/30 10:46:11 rillig Exp $");
+__RCSID("$NetBSD: emit1.c,v 1.28 2020/12/30 10:56:51 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -461,11 +461,11 @@ outcall(tnode_t *tn, int rvused, int rvd
 			}
 		} else if (arg->tn_op == AMPER &&
 			   arg->tn_left->tn_op == STRING &&
-			   arg->tn_left->tn_strg->st_tspec == CHAR) {
+			   arg->tn_left->tn_string->st_tspec == CHAR) {
 			/* constant string, write all format specifiers */
 			outchar('s');
 			outint(n);
-			outfstrg(arg->tn_left->tn_strg);
+			outfstrg(arg->tn_left->tn_string);
 		}
 
 	}

Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.46 src/usr.bin/xlint/lint1/init.c:1.47
--- src/usr.bin/xlint/lint1/init.c:1.46	Wed Dec 30 10:46:11 2020
+++ src/usr.bin/xlint/lint1/init.c	Wed Dec 30 10:56:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.46 2020/12/30 10:46:11 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.47 2020/12/30 10:56:51 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.46 2020/12/30 10:46:11 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.47 2020/12/30 10:56:51 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -622,7 +622,7 @@ initstack_string(tnode_t *tn)
 		return 0;
 
 	istk = initstk;
-	strg = tn->tn_strg;
+	strg = tn->tn_string;
 
 	/*
 	 * Check if we have an array type which can be initialized by

Index: src/usr.bin/xlint/lint1/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.41 src/usr.bin/xlint/lint1/lint1.h:1.42
--- src/usr.bin/xlint/lint1/lint1.h:1.41	Wed Dec 30 10:49:10 2020
+++ src/usr.bin/xlint/lint1/lint1.h	Wed Dec 30 10:56:51 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.41 2020/12/30 10:49:10 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.42 2020/12/30 10:56:51 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -285,8 +285,8 @@ typedef	struct tnode {
 	op_t	tn_op;		/* operator */
 	type_t	*tn_type;	/* type */
 	u_int	tn_lvalue : 1;	/* node is lvalue */
-	u_int	tn_cast : 1;	/* if tn_op == CVT its an explicit cast */
-	u_int	tn_parn : 1;	/* node parenthesized */
+	u_int	tn_cast : 1;	/* if tn_op == CVT, it's an explicit cast */
+	u_int	tn_parenthesized : 1; /* node parenthesized */
 	union {
 		struct {
 			struct	tnode *_tn_left;	/* (left) operand */
@@ -294,7 +294,7 @@ typedef	struct tnode {
 		} tn_s;
 		sym_t	*_tn_sym;	/* symbol if op == NAME */
 		val_t	*_tn_val;	/* value if op == CON */
-		strg_t	*_tn_strg;	/* string if op == STRING */
+		strg_t	*_tn_string;	/* string if op == STRING */
 	} tn_u;
 } tnode_t;
 
@@ -302,7 +302,7 @@ typedef	struct tnode {
 #define tn_right tn_u.tn_s._tn_right
 #define tn_sym	tn_u._tn_sym
 #define	tn_val	tn_u._tn_val
-#define	tn_strg	tn_u._tn_strg
+#define	tn_string	tn_u._tn_string
 
 /*
  * For nested declarations a stack exists, which holds all information

Index: src/usr.bin/xlint/lint1/print.c
diff -u src/usr.bin/xlint/lint1/print.c:1.6 src/usr.bin/xlint/lint1/print.c:1.7
--- src/usr.bin/xlint/lint1/print.c:1.6	Tue Dec 29 13:33:03 2020
+++ src/usr.bin/xlint/lint1/print.c	Wed Dec 30 10:56:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: print.c,v 1.6 2020/12/29 13:33:03 rillig Exp $	*/
+/*	$NetBSD: print.c,v 1.7 2020/12/30 10:56:51 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: print.c,v 1.6 2020/12/29 13:33:03 rillig Exp $");
+__RCSID("$NetBSD: print.c,v 1.7 2020/12/30 10:56:51 rillig Exp $");
 #endif
 
 #include <stdio.h>
@@ -134,7 +134,7 @@ print_tnode(char *buf, size_t bufsiz, co
 		break;
 
 	case STRING:
-		st = tn->tn_strg;
+		st = tn->tn_string;
 		switch (st->st_tspec) {
 		case CHAR:
 		case SCHAR:

Index: src/usr.bin/xlint/lint1/scan.l
diff -u src/usr.bin/xlint/lint1/scan.l:1.101 src/usr.bin/xlint/lint1/scan.l:1.102
--- src/usr.bin/xlint/lint1/scan.l:1.101	Wed Dec 30 10:49:10 2020
+++ src/usr.bin/xlint/lint1/scan.l	Wed Dec 30 10:56:51 2020
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: scan.l,v 1.101 2020/12/30 10:49:10 rillig Exp $ */
+/* $NetBSD: scan.l,v 1.102 2020/12/30 10:56:51 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: scan.l,v 1.101 2020/12/30 10:49:10 rillig Exp $");
+__RCSID("$NetBSD: scan.l,v 1.102 2020/12/30 10:56:51 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -1376,7 +1376,7 @@ string(void)
 	strg->st_len = len;
 	strg->st_cp = s;
 
-	yylval.y_strg = strg;
+	yylval.y_string = strg;
 	return T_STRING;
 }
 
@@ -1433,7 +1433,7 @@ wcstrg(void)
 	strg->st_len = wlen;
 	strg->st_wcp = ws;
 
-	yylval.y_strg = strg;
+	yylval.y_string = strg;
 	return T_STRING;
 }
 

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.103 src/usr.bin/xlint/lint1/tree.c:1.104
--- src/usr.bin/xlint/lint1/tree.c:1.103	Wed Dec 30 10:49:10 2020
+++ src/usr.bin/xlint/lint1/tree.c	Wed Dec 30 10:56:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.103 2020/12/30 10:49:10 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.104 2020/12/30 10:56:51 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.103 2020/12/30 10:49:10 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.104 2020/12/30 10:56:51 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -282,17 +282,17 @@ getsnode(strg_t *strg)
 	n->tn_type->t_dim = len + 1;
 	n->tn_lvalue = 1;
 
-	n->tn_strg = tgetblk(sizeof (strg_t));
-	n->tn_strg->st_tspec = strg->st_tspec;
-	n->tn_strg->st_len = len;
+	n->tn_string = tgetblk(sizeof (strg_t));
+	n->tn_string->st_tspec = strg->st_tspec;
+	n->tn_string->st_len = len;
 
 	if (strg->st_tspec == CHAR) {
-		n->tn_strg->st_cp = tgetblk(len + 1);
-		(void)memcpy(n->tn_strg->st_cp, strg->st_cp, len + 1);
+		n->tn_string->st_cp = tgetblk(len + 1);
+		(void)memcpy(n->tn_string->st_cp, strg->st_cp, len + 1);
 		free(strg->st_cp);
 	} else {
-		n->tn_strg->st_wcp = tgetblk((len + 1) * sizeof (wchar_t));
-		(void)memcpy(n->tn_strg->st_wcp, strg->st_wcp,
+		n->tn_string->st_wcp = tgetblk((len + 1) * sizeof (wchar_t));
+		(void)memcpy(n->tn_string->st_wcp, strg->st_wcp,
 			     (len + 1) * sizeof (wchar_t));
 		free(strg->st_wcp);
 	}
@@ -3601,14 +3601,14 @@ display_expression(tnode_t *tn, int offs
 		(void)printf("0x%0*lx ", (int)(sizeof (void *) * CHAR_BIT / 4),
 			     (u_long)tn->tn_val->v_quad);
 	} else if (tn->tn_op == STRING) {
-		if (tn->tn_strg->st_tspec == CHAR) {
-			(void)printf("\"%s\"", tn->tn_strg->st_cp);
+		if (tn->tn_string->st_tspec == CHAR) {
+			(void)printf("\"%s\"", tn->tn_string->st_cp);
 		} else {
 			char	*s;
 			size_t	n;
-			n = MB_CUR_MAX * (tn->tn_strg->st_len + 1);
+			n = MB_CUR_MAX * (tn->tn_string->st_len + 1);
 			s = xmalloc(n);
-			(void)wcstombs(s, tn->tn_strg->st_wcp, n);
+			(void)wcstombs(s, tn->tn_string->st_wcp, n);
 			(void)printf("L\"%s\"", s);
 			free(s);
 		}
@@ -4072,15 +4072,15 @@ check_precedence_confusion(tnode_t *tn)
 
 	lparn = 0;
 	for (ln = tn->tn_left; ln->tn_op == CVT; ln = ln->tn_left)
-		lparn |= ln->tn_parn;
-	lparn |= ln->tn_parn;
+		lparn |= ln->tn_parenthesized;
+	lparn |= ln->tn_parenthesized;
 	lop = ln->tn_op;
 
 	if (mp->m_binary) {
 		rparn = 0;
 		for (rn = tn->tn_right; tn->tn_op == CVT; rn = rn->tn_left)
-			rparn |= rn->tn_parn;
-		rparn |= rn->tn_parn;
+			rparn |= rn->tn_parenthesized;
+		rparn |= rn->tn_parenthesized;
 		rop = rn->tn_op;
 	}
 

Reply via email to