Module Name:    src
Committed By:   rillig
Date:           Sun Mar 21 10:08:02 UTC 2021

Modified Files:
        src/usr.bin/xlint/lint1: func.c lint1.h

Log Message:
lint: rename clst to case_labels

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.76 -r1.77 src/usr.bin/xlint/lint1/lint1.h

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/func.c
diff -u src/usr.bin/xlint/lint1/func.c:1.78 src/usr.bin/xlint/lint1/func.c:1.79
--- src/usr.bin/xlint/lint1/func.c:1.78	Sat Mar 20 16:16:32 2021
+++ src/usr.bin/xlint/lint1/func.c	Sun Mar 21 10:08:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: func.c,v 1.78 2021/03/20 16:16:32 rillig Exp $	*/
+/*	$NetBSD: func.c,v 1.79 2021/03/21 10:08:01 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.78 2021/03/20 16:16:32 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.79 2021/03/21 10:08:01 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -170,7 +170,7 @@ void
 popctrl(int env)
 {
 	cstk_t	*ci;
-	clst_t	*cl, *next;
+	case_label_t *cl, *next;
 
 	lint_assert(cstmt != NULL);
 	lint_assert(cstmt->c_env == env);
@@ -178,7 +178,7 @@ popctrl(int env)
 	ci = cstmt;
 	cstmt = ci->c_surrounding;
 
-	for (cl = ci->c_clst; cl != NULL; cl = next) {
+	for (cl = ci->c_case_labels; cl != NULL; cl = next) {
 		next = cl->cl_next;
 		free(cl);
 	}
@@ -447,7 +447,7 @@ check_case_label_enum(const tnode_t *tn,
 static void
 check_case_label(tnode_t *tn, cstk_t *ci)
 {
-	clst_t	*cl;
+	case_label_t *cl;
 	val_t	*v;
 	val_t	nv;
 	tspec_t	t;
@@ -498,7 +498,7 @@ check_case_label(tnode_t *tn, cstk_t *ci
 	free(v);
 
 	/* look if we had this value already */
-	for (cl = ci->c_clst; cl != NULL; cl = cl->cl_next) {
+	for (cl = ci->c_case_labels; cl != NULL; cl = cl->cl_next) {
 		if (cl->cl_val.v_quad == nv.v_quad)
 			break;
 	}
@@ -515,10 +515,10 @@ check_case_label(tnode_t *tn, cstk_t *ci
 		 * append the value to the list of
 		 * case values
 		 */
-		cl = xcalloc(1, sizeof (clst_t));
+		cl = xcalloc(1, sizeof *cl);
 		cl->cl_val = nv;
-		cl->cl_next = ci->c_clst;
-		ci->c_clst = cl;
+		cl->cl_next = ci->c_case_labels;
+		ci->c_case_labels = cl;
 	}
 }
 
@@ -694,7 +694,7 @@ switch2(void)
 {
 	int	nenum = 0, nclab = 0;
 	sym_t	*esym;
-	clst_t	*cl;
+	case_label_t *cl;
 
 	lint_assert(cstmt->c_swtype != NULL);
 
@@ -710,7 +710,7 @@ switch2(void)
 		     esym != NULL; esym = esym->s_next) {
 			nenum++;
 		}
-		for (cl = cstmt->c_clst; cl != NULL; cl = cl->cl_next)
+		for (cl = cstmt->c_case_labels; cl != NULL; cl = cl->cl_next)
 			nclab++;
 		if (hflag && eflag && nenum != nclab && !cstmt->c_default) {
 			/* enumeration value(s) not handled in switch */

Index: src/usr.bin/xlint/lint1/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.76 src/usr.bin/xlint/lint1/lint1.h:1.77
--- src/usr.bin/xlint/lint1/lint1.h:1.76	Sat Mar 20 13:00:43 2021
+++ src/usr.bin/xlint/lint1/lint1.h	Sun Mar 21 10:08:01 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.76 2021/03/20 13:00:43 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.77 2021/03/21 10:08:01 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -370,12 +370,12 @@ typedef	struct pqinf {
 } pqinf_t;
 
 /*
- * Case values are stored in a list of type clst_t.
+ * Case values are stored in a list of type case_label_t.
  */
-typedef	struct clst {
+typedef	struct case_label {
 	val_t	cl_val;
-	struct	clst *cl_next;
-} clst_t;
+	struct case_label *cl_next;
+} case_label_t;
 
 /*
  * Used to keep information about nested control statements.
@@ -393,7 +393,7 @@ typedef struct control_statement {
 	bool	c_had_return_noval : 1;	/* had "return;" */
 	bool	c_had_return_value : 1;	/* had "return (e);" */
 	type_t	*c_swtype;		/* type of switch expression */
-	clst_t	*c_clst;		/* list of case values */
+	case_label_t *c_case_labels;	/* list of case values */
 	struct	mbl *c_fexprm;		/* saved memory for end of loop
 					   expression in for() */
 	tnode_t	*c_f3expr;		/* end of loop expr in for() */

Reply via email to