Module Name: src Committed By: rillig Date: Sun Feb 27 11:14:42 UTC 2022
Modified Files: src/usr.bin/xlint/lint1: cgram.y decl.c lint1.h tree.c Log Message: lint: unabbreviate two more members of sym_t No functional change. To generate a diff of this commit: cvs rdiff -u -r1.383 -r1.384 src/usr.bin/xlint/lint1/cgram.y cvs rdiff -u -r1.248 -r1.249 src/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.140 -r1.141 src/usr.bin/xlint/lint1/lint1.h cvs rdiff -u -r1.407 -r1.408 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.383 src/usr.bin/xlint/lint1/cgram.y:1.384 --- src/usr.bin/xlint/lint1/cgram.y:1.383 Sun Feb 27 08:31:26 2022 +++ src/usr.bin/xlint/lint1/cgram.y Sun Feb 27 11:14:42 2022 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.383 2022/02/27 08:31:26 rillig Exp $ */ +/* $NetBSD: cgram.y,v 1.384 2022/02/27 11:14:42 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.383 2022/02/27 08:31:26 rillig Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.384 2022/02/27 11:14:42 rillig Exp $"); #endif #include <limits.h> @@ -114,7 +114,7 @@ static void anonymize(sym_t *s) { for ( ; s != NULL; s = s->s_next) - s->s_styp = NULL; + s->s_sou_type = NULL; } #if defined(YYDEBUG) && (defined(YYBYACC) || defined(YYBISON)) Index: src/usr.bin/xlint/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.248 src/usr.bin/xlint/lint1/decl.c:1.249 --- src/usr.bin/xlint/lint1/decl.c:1.248 Sun Feb 27 10:44:45 2022 +++ src/usr.bin/xlint/lint1/decl.c Sun Feb 27 11:14:42 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.248 2022/02/27 10:44:45 rillig Exp $ */ +/* $NetBSD: decl.c,v 1.249 2022/02/27 11:14:42 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: decl.c,v 1.248 2022/02/27 10:44:45 rillig Exp $"); +__RCSID("$NetBSD: decl.c,v 1.249 2022/02/27 11:14:42 rillig Exp $"); #endif #include <sys/param.h> @@ -1157,7 +1157,7 @@ declarator_1_struct_union(sym_t *dsym) lint_assert(dcs->d_redeclared_symbol->s_scl == MOS || dcs->d_redeclared_symbol->s_scl == MOU); - if (dsym->s_styp == dcs->d_redeclared_symbol->s_styp) { + if (dsym->s_sou_type == dcs->d_redeclared_symbol->s_sou_type) { /* duplicate member name: %s */ error(33, dsym->s_name); rmsym(dcs->d_redeclared_symbol); @@ -1513,7 +1513,7 @@ check_function_definition(sym_t *sym, bo * Process the name in a declarator. * The symbol gets one of the storage classes EXTERN, STATIC, AUTO or * TYPEDEF. - * s_def and s_reg are valid after declarator_name(). + * s_def and s_register are valid after declarator_name(). */ sym_t * declarator_name(sym_t *sym) @@ -1534,7 +1534,7 @@ declarator_name(sym_t *sym) case MOS: case MOU: /* Set parent */ - sym->s_styp = dcs->d_tagtyp->t_str; + sym->s_sou_type = dcs->d_tagtyp->t_str; sym->s_def = DEF; sym->s_value.v_tspec = INT; sc = dcs->d_ctx; @@ -1568,7 +1568,7 @@ declarator_name(sym_t *sym) sc = AUTO; } else { lint_assert(sc == REG); - sym->s_reg = true; + sym->s_register = true; sc = AUTO; } sym->s_def = DEF; @@ -1586,7 +1586,7 @@ declarator_name(sym_t *sym) } else if (sc == AUTO || sc == STATIC || sc == TYPEDEF) { sym->s_def = DEF; } else if (sc == REG) { - sym->s_reg = true; + sym->s_register = true; sc = AUTO; sym->s_def = DEF; } else { @@ -1810,8 +1810,8 @@ complete_tag_struct_or_union(type_t *tp, n = 0; for (mem = fmem; mem != NULL; mem = mem->s_next) { /* bind anonymous members to the structure */ - if (mem->s_styp == NULL) { - mem->s_styp = sp; + if (mem->s_sou_type == NULL) { + mem->s_sou_type = sp; if (mem->s_type->t_bitfield) { sp->sou_size_in_bits += bitfieldsize(&mem); if (mem == NULL) Index: src/usr.bin/xlint/lint1/lint1.h diff -u src/usr.bin/xlint/lint1/lint1.h:1.140 src/usr.bin/xlint/lint1/lint1.h:1.141 --- src/usr.bin/xlint/lint1/lint1.h:1.140 Sun Feb 27 10:49:15 2022 +++ src/usr.bin/xlint/lint1/lint1.h Sun Feb 27 11:14:42 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: lint1.h,v 1.140 2022/02/27 10:49:15 rillig Exp $ */ +/* $NetBSD: lint1.h,v 1.141 2022/02/27 11:14:42 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -250,14 +250,15 @@ typedef struct sym { bool s_set:1; /* variable set, label defined */ bool s_used:1; /* variable/label used */ bool s_arg:1; /* symbol is function argument */ - bool s_reg:1; /* symbol is register variable */ + bool s_register:1; /* symbol is register variable */ bool s_defarg:1; /* undefined symbol in old style function definition */ bool s_return_type_implicit_int:1; bool s_osdef:1; /* symbol stems from old style function def. */ bool s_inline:1; /* true if this is an inline function */ - struct sym *s_ext_sym; /* for local declared external symbols pointer - to external symbol with same name */ + struct sym *s_ext_sym; /* for locally declared external symbols, the + * pointer to the external symbol with the + * same name */ def_t s_def; /* declared, tentative defined, defined */ scl_t s_scl; /* storage class */ int s_block_level; /* level of declaration, -1 if not in symbol @@ -281,7 +282,7 @@ typedef struct sym { * level */ } sym_t; -#define s_styp u._s_st +#define s_sou_type u._s_st #define s_tspec u._s_tsp #define s_tqual u._s_tqu #define s_args u._s_args Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.407 src/usr.bin/xlint/lint1/tree.c:1.408 --- src/usr.bin/xlint/lint1/tree.c:1.407 Sun Feb 27 10:44:45 2022 +++ src/usr.bin/xlint/lint1/tree.c Sun Feb 27 11:14:42 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.407 2022/02/27 10:44:45 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.408 2022/02/27 11:14:42 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.407 2022/02/27 10:44:45 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.408 2022/02/27 11:14:42 rillig Exp $"); #endif #include <float.h> @@ -355,10 +355,10 @@ struct_or_union_member(tnode_t *tn, op_t rmsym(msym); msym->s_kind = FMEMBER; msym->s_scl = MOS; - msym->s_styp = expr_zero_alloc(sizeof(*msym->s_styp)); - msym->s_styp->sou_tag = expr_zero_alloc( - sizeof(*msym->s_styp->sou_tag)); - msym->s_styp->sou_tag->s_name = unnamed; + msym->s_sou_type = expr_zero_alloc(sizeof(*msym->s_sou_type)); + msym->s_sou_type->sou_tag = expr_zero_alloc( + sizeof(*msym->s_sou_type->sou_tag)); + msym->s_sou_type->sou_tag->s_name = unnamed; msym->s_value.v_tspec = INT; return msym; } @@ -382,7 +382,7 @@ struct_or_union_member(tnode_t *tn, op_t for (sym = msym; sym != NULL; sym = sym->s_symtab_next) { if (sym->s_scl != MOS && sym->s_scl != MOU) continue; - if (sym->s_styp != str) + if (sym->s_sou_type != str) continue; if (strcmp(sym->s_name, msym->s_name) != 0) continue; @@ -858,7 +858,7 @@ typeok_address(const mod_t *mp, error(111, mp->m_name); return false; } - if (tn->tn_op == NAME && tn->tn_sym->s_reg) { + if (tn->tn_op == NAME && tn->tn_sym->s_register) { /* cannot take address of register %s */ error(113, tn->tn_sym->s_name); return false;