Module Name: src Committed By: rillig Date: Tue Jul 6 04:44:20 UTC 2021
Modified Files: src/usr.bin/xlint/lint1: cgram.y externs1.h lint1.h tree.c Log Message: lint: rename type generic_association_types to generic_association The word 'types' was misleading and unnecessary. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.252 -r1.253 src/usr.bin/xlint/lint1/cgram.y cvs rdiff -u -r1.114 -r1.115 src/usr.bin/xlint/lint1/externs1.h cvs rdiff -u -r1.111 -r1.112 src/usr.bin/xlint/lint1/lint1.h cvs rdiff -u -r1.312 -r1.313 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.252 src/usr.bin/xlint/lint1/cgram.y:1.253 --- src/usr.bin/xlint/lint1/cgram.y:1.252 Mon Jul 5 19:59:10 2021 +++ src/usr.bin/xlint/lint1/cgram.y Tue Jul 6 04:44:20 2021 @@ -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 @@ anonymize(sym_t *s) 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 @@ anonymize(sym_t *s) %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_selection: /* C11 6.5.1.1 */ 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_assoc_list: /* C11 6.5.1.1 */ 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; } ; Index: src/usr.bin/xlint/lint1/externs1.h diff -u src/usr.bin/xlint/lint1/externs1.h:1.114 src/usr.bin/xlint/lint1/externs1.h:1.115 --- src/usr.bin/xlint/lint1/externs1.h:1.114 Tue Jun 29 21:16:54 2021 +++ src/usr.bin/xlint/lint1/externs1.h Tue Jul 6 04:44:20 2021 @@ -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_name_node(sym_t *, i 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 *); Index: src/usr.bin/xlint/lint1/lint1.h diff -u src/usr.bin/xlint/lint1/lint1.h:1.111 src/usr.bin/xlint/lint1/lint1.h:1.112 --- src/usr.bin/xlint/lint1/lint1.h:1.111 Mon Jul 5 19:48:32 2021 +++ src/usr.bin/xlint/lint1/lint1.h Tue Jul 6 04:44:20 2021 @@ -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 @@ typedef struct tnode { #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; }; /* Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.312 src/usr.bin/xlint/lint1/tree.c:1.313 --- src/usr.bin/xlint/lint1/tree.c:1.312 Sun Jul 4 17:28:05 2021 +++ src/usr.bin/xlint/lint1/tree.c Tue Jul 6 04:44:20 2021 @@ -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 @@ struct_or_union_member(tnode_t *tn, op_t 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; }