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 type generic_association_ty...
details: https://anonhg.NetBSD.org/src/rev/b37f737802df
branches: trunk
changeset: 1022141:b37f737802df
user: rillig <rillig%NetBSD.org@localhost>
date: Tue Jul 06 04:44:20 2021 +0000
description:
lint: rename type generic_association_types to generic_association
The word 'types' was misleading and unnecessary.
No functional change.
diffstat:
usr.bin/xlint/lint1/cgram.y | 20 ++++++++++----------
usr.bin/xlint/lint1/externs1.h | 4 ++--
usr.bin/xlint/lint1/lint1.h | 10 +++++-----
usr.bin/xlint/lint1/tree.c | 16 ++++++++--------
4 files changed, 25 insertions(+), 25 deletions(-)
diffs (149 lines):
diff -r 21a6893d9742 -r b37f737802df usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y Tue Jul 06 03:23:03 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y Tue Jul 06 04:44:20 2021 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.252 2021/07/05 19:59:10 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.253 2021/07/06 04:44:20 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.252 2021/07/05 19:59:10 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.253 2021/07/06 04:44:20 rillig Exp $");
#endif
#include <limits.h>
@@ -139,7 +139,7 @@
strg_t *y_string;
qual_ptr *y_qual_ptr;
bool y_seen_statement;
- struct generic_association_types *y_types;
+ struct generic_association *y_generic;
};
%token T_LBRACE T_RBRACE T_LBRACK T_RBRACK T_LPAREN T_RPAREN
@@ -341,8 +341,8 @@
%type <y_range> range
%type <y_seen_statement> block_item_list
%type <y_seen_statement> block_item
-%type <y_types> generic_assoc_list
-%type <y_types> generic_association
+%type <y_generic> generic_assoc_list
+%type <y_generic> generic_association
%%
@@ -1648,7 +1648,7 @@
generic_assoc_list: /* C11 6.5.1.1 */
generic_association
| generic_assoc_list T_COMMA generic_association {
- $3->gat_prev = $1;
+ $3->ga_prev = $1;
$$ = $3;
}
;
@@ -1656,13 +1656,13 @@
generic_association: /* C11 6.5.1.1 */
type_name T_COLON assignment_expression {
$$ = getblk(sizeof(*$$));
- $$->gat_arg = $1;
- $$->gat_result = $3;
+ $$->ga_arg = $1;
+ $$->ga_result = $3;
}
| T_DEFAULT T_COLON assignment_expression {
$$ = getblk(sizeof(*$$));
- $$->gat_arg = NULL;
- $$->gat_result = $3;
+ $$->ga_arg = NULL;
+ $$->ga_result = $3;
}
;
diff -r 21a6893d9742 -r b37f737802df usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h Tue Jul 06 03:23:03 2021 +0000
+++ b/usr.bin/xlint/lint1/externs1.h Tue Jul 06 04:44:20 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: externs1.h,v 1.114 2021/06/29 21:16:54 rillig Exp $ */
+/* $NetBSD: externs1.h,v 1.115 2021/07/06 04:44:20 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -209,7 +209,7 @@
extern tnode_t *new_string_node(strg_t *);
extern sym_t *struct_or_union_member(tnode_t *, op_t, sym_t *);
extern tnode_t *build_generic_selection(const tnode_t *,
- struct generic_association_types *);
+ struct generic_association *);
extern tnode_t *build(op_t, tnode_t *, tnode_t *);
extern tnode_t *cconv(tnode_t *);
diff -r 21a6893d9742 -r b37f737802df usr.bin/xlint/lint1/lint1.h
--- a/usr.bin/xlint/lint1/lint1.h Tue Jul 06 03:23:03 2021 +0000
+++ b/usr.bin/xlint/lint1/lint1.h Tue Jul 06 04:44:20 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.111 2021/07/05 19:48:32 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.112 2021/07/06 04:44:20 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -328,10 +328,10 @@
#define tn_val tn_u._tn_val
#define tn_string tn_u._tn_string
-struct generic_association_types {
- type_t *gat_arg; /* NULL means default or error */
- tnode_t *gat_result; /* NULL means error */
- struct generic_association_types *gat_prev;
+struct generic_association {
+ type_t *ga_arg; /* NULL means default or error */
+ tnode_t *ga_result; /* NULL means error */
+ struct generic_association *ga_prev;
};
/*
diff -r 21a6893d9742 -r b37f737802df usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c Tue Jul 06 03:23:03 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c Tue Jul 06 04:44:20 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.312 2021/07/04 17:28:05 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.313 2021/07/06 04:44:20 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.312 2021/07/04 17:28:05 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.313 2021/07/06 04:44:20 rillig Exp $");
#endif
#include <float.h>
@@ -487,16 +487,16 @@
tnode_t *
build_generic_selection(const tnode_t *expr,
- struct generic_association_types *sel)
+ struct generic_association *sel)
{
tnode_t *default_result = NULL;
- for (; sel != NULL; sel = sel->gat_prev)
+ for (; sel != NULL; sel = sel->ga_prev)
if (expr != NULL &&
- eqtype(sel->gat_arg, expr->tn_type, false, false, NULL))
- return sel->gat_result;
- else if (sel->gat_arg == NULL)
- default_result = sel->gat_result;
+ eqtype(sel->ga_arg, expr->tn_type, false, false, NULL))
+ return sel->ga_result;
+ else if (sel->ga_arg == NULL)
+ default_result = sel->ga_result;
return default_result;
}
Home |
Main Index |
Thread Index |
Old Index