Module Name: src Committed By: rillig Date: Wed Dec 22 14:49:11 UTC 2021
Modified Files: src/tests/usr.bin/xlint/lint1: d_c99_init.c decl_struct_member.c src/usr.bin/xlint/common: lint.h src/usr.bin/xlint/lint1: lex.c lint1.h src/usr.bin/xlint/lint2: lint2.h Log Message: lint: remove spaces around bit-field colon As seen in /usr/share/misc/style. No binary change. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/tests/usr.bin/xlint/lint1/d_c99_init.c cvs rdiff -u -r1.12 -r1.13 src/tests/usr.bin/xlint/lint1/decl_struct_member.c cvs rdiff -u -r1.33 -r1.34 src/usr.bin/xlint/common/lint.h cvs rdiff -u -r1.92 -r1.93 src/usr.bin/xlint/lint1/lex.c cvs rdiff -u -r1.131 -r1.132 src/usr.bin/xlint/lint1/lint1.h cvs rdiff -u -r1.20 -r1.21 src/usr.bin/xlint/lint2/lint2.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/usr.bin/xlint/lint1/d_c99_init.c diff -u src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.37 src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.38 --- src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.37 Wed Dec 22 14:32:31 2021 +++ src/tests/usr.bin/xlint/lint1/d_c99_init.c Wed Dec 22 14:49:11 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: d_c99_init.c,v 1.37 2021/12/22 14:32:31 rillig Exp $ */ +/* $NetBSD: d_c99_init.c,v 1.38 2021/12/22 14:49:11 rillig Exp $ */ # 3 "d_c99_init.c" /* @@ -224,7 +224,7 @@ struct geometry geometry = { struct ends_with_unnamed_bit_field { int member; - int : 0; + int:0; } ends_with_unnamed_bit_field = { 12345, /* expect+1: too many struct/union initializers */ @@ -442,7 +442,7 @@ struct point unknown_member_on_scalar = }; struct { - int : 16; + int:16; /* expect+2: warning: structure has no named members [65] */ /* expect+1: error: cannot initialize struct/union with no named member [179] */ } struct_with_only_unnamed_members = { @@ -450,7 +450,7 @@ struct { }; union { - int : 16; + int:16; /* expect+2: warning: union has no named members [65] */ /* expect+1: error: cannot initialize struct/union with no named member [179] */ } union_with_only_unnamed_members = { Index: src/tests/usr.bin/xlint/lint1/decl_struct_member.c diff -u src/tests/usr.bin/xlint/lint1/decl_struct_member.c:1.12 src/tests/usr.bin/xlint/lint1/decl_struct_member.c:1.13 --- src/tests/usr.bin/xlint/lint1/decl_struct_member.c:1.12 Sun Sep 5 11:42:32 2021 +++ src/tests/usr.bin/xlint/lint1/decl_struct_member.c Wed Dec 22 14:49:11 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: decl_struct_member.c,v 1.12 2021/09/05 11:42:32 rillig Exp $ */ +/* $NetBSD: decl_struct_member.c,v 1.13 2021/12/22 14:49:11 rillig Exp $ */ # 3 "decl_struct_member.c" struct multi_attributes { @@ -52,8 +52,8 @@ struct cover_notype_struct_declarators { }; struct cover_notype_struct_declarator_bit_field { - const a: 3, : 0, b: 4; - const : 0; + const a:3, :0, b:4; + const:0; }; /* Index: src/usr.bin/xlint/common/lint.h diff -u src/usr.bin/xlint/common/lint.h:1.33 src/usr.bin/xlint/common/lint.h:1.34 --- src/usr.bin/xlint/common/lint.h:1.33 Mon Nov 1 19:48:51 2021 +++ src/usr.bin/xlint/common/lint.h Wed Dec 22 14:49:11 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lint.h,v 1.33 2021/11/01 19:48:51 rillig Exp $ */ +/* $NetBSD: lint.h,v 1.34 2021/12/22 14:49:11 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -99,13 +99,13 @@ typedef struct { #endif tspec_t tt_signed_counterpart; tspec_t tt_unsigned_counterpart; - bool tt_is_integer : 1; /* integer type */ + bool tt_is_integer:1; /* integer type */ #ifdef IS_LINT1 - bool tt_is_uinteger : 1; /* unsigned integer type */ - bool tt_is_floating : 1; /* floating point type */ - bool tt_is_arithmetic : 1; /* arithmetic type */ - bool tt_is_scalar : 1; /* scalar type */ - bool tt_is_complex : 1; /* complex type */ + bool tt_is_uinteger:1; /* unsigned integer type */ + bool tt_is_floating:1; /* floating point type */ + bool tt_is_arithmetic:1; /* arithmetic type */ + bool tt_is_scalar:1; /* scalar type */ + bool tt_is_complex:1; /* complex type */ #endif const char *tt_name; /* name of the type */ } ttab_t; Index: src/usr.bin/xlint/lint1/lex.c diff -u src/usr.bin/xlint/lint1/lex.c:1.92 src/usr.bin/xlint/lint1/lex.c:1.93 --- src/usr.bin/xlint/lint1/lex.c:1.92 Wed Dec 22 14:38:34 2021 +++ src/usr.bin/xlint/lint1/lex.c Wed Dec 22 14:49:11 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lex.c,v 1.92 2021/12/22 14:38:34 rillig Exp $ */ +/* $NetBSD: lex.c,v 1.93 2021/12/22 14:49:11 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: lex.c,v 1.92 2021/12/22 14:38:34 rillig Exp $"); +__RCSID("$NetBSD: lex.c,v 1.93 2021/12/22 14:49:11 rillig Exp $"); #endif #include <ctype.h> @@ -126,13 +126,13 @@ static struct kwtab { tspec_t kw_tspec; /* type spec. if kw_token * T_TYPE or T_STRUCT_OR_UNION */ tqual_t kw_tqual; /* type qual. if kw_token T_QUAL */ - bool kw_c90 : 1; /* C90 keyword */ - bool kw_c99 : 1; /* C99 keyword */ - bool kw_gcc : 1; /* GCC keyword */ - bool kw_attr : 1; /* GCC attribute, keyword */ - bool kw_plain : 1; /* 'name' */ - bool kw_leading : 1; /* '__name' */ - bool kw_both : 1; /* '__name__' */ + bool kw_c90:1; /* C90 keyword */ + bool kw_c99:1; /* C99 keyword */ + bool kw_gcc:1; /* GCC keyword */ + bool kw_attr:1; /* GCC attribute, keyword */ + bool kw_plain:1; /* 'name' */ + bool kw_leading:1; /* '__name' */ + bool kw_both:1; /* '__name__' */ } kwtab[] = { kwdef_gcc_attr( "alias", T_AT_ALIAS), kwdef_keyword( "_Alignas", T_ALIGNAS), Index: src/usr.bin/xlint/lint1/lint1.h diff -u src/usr.bin/xlint/lint1/lint1.h:1.131 src/usr.bin/xlint/lint1/lint1.h:1.132 --- src/usr.bin/xlint/lint1/lint1.h:1.131 Tue Nov 16 21:01:05 2021 +++ src/usr.bin/xlint/lint1/lint1.h Wed Dec 22 14:49:11 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lint1.h,v 1.131 2021/11/16 21:01:05 rillig Exp $ */ +/* $NetBSD: lint1.h,v 1.132 2021/12/22 14:49:11 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -136,7 +136,7 @@ typedef struct { typedef struct { unsigned int sou_size_in_bits; unsigned short sou_align_in_bits; - bool sou_incomplete : 1; + bool sou_incomplete:1; struct sym *sou_first_member; struct sym *sou_tag; struct sym *sou_first_typedef; @@ -146,7 +146,7 @@ typedef struct { * same as above for enums */ typedef struct { - bool en_incomplete : 1; + bool en_incomplete:1; struct sym *en_first_enumerator; struct sym *en_tag; struct sym *en_first_typedef; @@ -158,13 +158,13 @@ typedef struct { */ struct lint1_type { tspec_t t_tspec; /* type specifier */ - bool t_incomplete_array : 1; - bool t_const : 1; /* const modifier */ - bool t_volatile : 1; /* volatile modifier */ - bool t_proto : 1; /* function prototype (t_args valid) */ - bool t_vararg : 1; /* prototype with '...' */ - bool t_typedef : 1; /* type defined with typedef */ - bool t_bitfield : 1; + bool t_incomplete_array:1; + bool t_const:1; /* const modifier */ + bool t_volatile:1; /* volatile modifier */ + bool t_proto:1; /* function prototype (t_args valid) */ + bool t_vararg:1; /* prototype with '...' */ + bool t_typedef:1; /* type defined with typedef */ + bool t_bitfield:1; /* * Either the type is currently an enum (having t_tspec ENUM), or * it is an integer type (typically INT) that has been implicitly @@ -174,8 +174,8 @@ struct lint1_type { * type checks in expressions such as ((var1 & 0x0001) == var2), to * detect when var1 and var2 are from incompatible enum types. */ - bool t_is_enum : 1; - bool t_packed : 1; + bool t_is_enum:1; + bool t_packed:1; union { int _t_dim; /* dimension (if ARRAY) */ struct_or_union *_t_str; @@ -183,8 +183,8 @@ struct lint1_type { struct sym *_t_args; /* arguments (if t_proto) */ } t_u; struct { - unsigned int _t_flen : 8; /* length of bit-field */ - unsigned int _t_foffs : 24; /* offset of bit-field */ + unsigned int _t_flen:8; /* length of bit-field */ + unsigned int _t_foffs:24; /* offset of bit-field */ } t_b; struct lint1_type *t_subt; /* element type (if ARRAY), * return value (if FUNC), @@ -246,16 +246,16 @@ typedef struct sym { pos_t s_use_pos; /* position of first use */ symt_t s_kind; /* type of symbol */ const struct kwtab *s_keyword; - bool s_bitfield : 1; - 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_defarg : 1; /* undefined symbol in old style function + bool s_bitfield:1; + 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_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 */ + 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 */ def_t s_def; /* declared, tentative defined, defined */ @@ -304,15 +304,15 @@ typedef struct sbuf { typedef struct tnode { op_t tn_op; /* operator */ type_t *tn_type; /* type */ - bool tn_lvalue : 1; /* node is lvalue */ - bool tn_cast : 1; /* if tn_op == CVT, it's an explicit cast */ - bool tn_parenthesized : 1; - bool tn_sys : 1; /* in strict bool mode, allow mixture between + bool tn_lvalue:1; /* node is lvalue */ + bool tn_cast:1; /* if tn_op == CVT, it's an explicit cast */ + bool tn_parenthesized:1; + bool tn_sys:1; /* in strict bool mode, allow mixture between * bool and scalar, for code from system * headers that may be a mixture between * scalar types and bool */ - bool tn_system_dependent : 1; /* depends on sizeof or offsetof */ + bool tn_system_dependent:1; /* depends on sizeof or offsetof */ union { struct { struct tnode *_tn_left; /* (left) operand */ @@ -371,19 +371,19 @@ typedef struct dinfo { unsigned short d_sou_align_in_bits; /* alignment required for current * structure */ scl_t d_ctx; /* context of declaration */ - bool d_const : 1; /* const in declaration specifiers */ - bool d_volatile : 1; /* volatile in declaration specifiers */ - bool d_inline : 1; /* inline in declaration specifiers */ - bool d_multiple_storage_classes : 1; /* reported in end_type */ - bool d_invalid_type_combination : 1; - bool d_nonempty_decl : 1; /* if at least one tag is declared + bool d_const:1; /* const in declaration specifiers */ + bool d_volatile:1; /* volatile in declaration specifiers */ + bool d_inline:1; /* inline in declaration specifiers */ + bool d_multiple_storage_classes:1; /* reported in end_type */ + bool d_invalid_type_combination:1; + bool d_nonempty_decl:1; /* if at least one tag is declared * ... in the current function decl. */ - bool d_vararg : 1; - bool d_proto : 1; /* current function decl. is prototype */ - bool d_notyp : 1; /* set if no type specifier was present */ - bool d_asm : 1; /* set if d_ctx == AUTO and asm() present */ - bool d_packed : 1; - bool d_used : 1; + bool d_vararg:1; + bool d_proto:1; /* current function decl. is prototype */ + bool d_notyp:1; /* set if no type specifier was present */ + bool d_asm:1; /* set if d_ctx == AUTO and asm() present */ + bool d_packed:1; + bool d_used:1; type_t *d_tagtyp; /* tag during member declaration */ sym_t *d_func_args; /* list of arguments during function def. */ pos_t d_func_def_pos; /* position of function definition */ @@ -425,21 +425,21 @@ typedef enum { */ typedef struct control_statement { control_statement_kind c_kind; /* to ensure proper nesting */ - bool c_loop : 1; /* 'continue' and 'break' are valid */ - bool c_switch : 1; /* 'case' and 'break' are valid */ - bool c_break : 1; /* the loop/switch has a reachable + bool c_loop:1; /* 'continue' and 'break' are valid */ + bool c_switch:1; /* 'case' and 'break' are valid */ + bool c_break:1; /* the loop/switch has a reachable * 'break' statement */ - bool c_continue : 1; /* the loop has a reachable 'continue' + bool c_continue:1; /* the loop has a reachable 'continue' * statement */ - bool c_default : 1; /* the switch has a 'default' label */ - bool c_maybe_endless : 1; /* the controlling expression is + bool c_default:1; /* the switch has a 'default' label */ + bool c_maybe_endless:1; /* the controlling expression is * always true (as in 'for (;;)' or * 'while (1)'), there may be break * statements though */ - bool c_always_then : 1; - bool c_reached_end_of_then : 1; - bool c_had_return_noval : 1; /* had "return;" */ - bool c_had_return_value : 1; /* had "return expr;" */ + bool c_always_then:1; + bool c_reached_end_of_then:1; + bool c_had_return_noval:1; /* had "return;" */ + bool c_had_return_value:1; /* had "return expr;" */ type_t *c_switch_type; /* type of switch expression */ tnode_t *c_switch_expr; Index: src/usr.bin/xlint/lint2/lint2.h diff -u src/usr.bin/xlint/lint2/lint2.h:1.20 src/usr.bin/xlint/lint2/lint2.h:1.21 --- src/usr.bin/xlint/lint2/lint2.h:1.20 Mon Nov 1 19:48:51 2021 +++ src/usr.bin/xlint/lint2/lint2.h Wed Dec 22 14:49:11 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lint2.h,v 1.20 2021/11/01 19:48:51 rillig Exp $ */ +/* $NetBSD: lint2.h,v 1.21 2021/12/22 14:49:11 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -39,14 +39,14 @@ */ struct lint2_type { tspec_t t_tspec; /* type specifier */ - bool t_const : 1; /* constant */ - bool t_volatile : 1; /* volatile */ - bool t_vararg : 1; /* function has variable number of arguments */ - bool t_is_enum : 1; - bool t_proto : 1; /* this is a prototype */ - bool t_istag : 1; /* tag with _t_tag valid */ - bool t_istynam : 1; /* tag with _t_tynam valid */ - bool t_isuniqpos : 1; /* tag with _t_uniqpos valid */ + bool t_const:1; /* constant */ + bool t_volatile:1; /* volatile */ + bool t_vararg:1; /* function has variable number of arguments */ + bool t_is_enum:1; + bool t_proto:1; /* this is a prototype */ + bool t_istag:1; /* tag with _t_tag valid */ + bool t_istynam:1; /* tag with _t_tynam valid */ + bool t_isuniqpos:1; /* tag with _t_uniqpos valid */ union { int _t_dim; /* if the type is an ARRAY than this is the dimension of the array. */ @@ -83,10 +83,10 @@ struct lint2_type { */ typedef struct arginf { int a_num; /* # of argument (1..) */ - bool a_zero : 1; /* argument is 0 */ - bool a_pcon : 1; /* msb of argument is not set */ - bool a_ncon : 1; /* msb of argument is set */ - bool a_fmt : 1; /* a_fstrg points to format string */ + bool a_zero:1; /* argument is 0 */ + bool a_pcon:1; /* msb of argument is not set */ + bool a_ncon:1; /* msb of argument is set */ + bool a_fmt:1; /* a_fstrg points to format string */ char *a_fstrg; /* format string */ struct arginf *a_next; /* information for next const. argument */ } arginf_t; @@ -112,13 +112,13 @@ typedef struct sym { #else def_t s_def; #endif - bool s_function_has_return_value : 1; - bool s_inline : 1; - bool s_old_style_function : 1; - bool s_static : 1; - bool s_check_only_first_args : 1; - bool s_printflike : 1; - bool s_scanflike : 1; + bool s_function_has_return_value:1; + bool s_inline:1; + bool s_old_style_function:1; + bool s_static:1; + bool s_check_only_first_args:1; + bool s_printflike:1; + bool s_scanflike:1; unsigned short s_type; /* XXX: gap of 4 bytes on LP64 platforms */ struct sym *s_next; /* next symbol with same name */ @@ -149,8 +149,8 @@ typedef struct sym { */ typedef struct fcall { pos_t f_pos; /* position of call */ - bool f_rused : 1; /* return value used */ - bool f_rdisc : 1; /* return value discarded (casted to void) */ + bool f_rused:1; /* return value used */ + bool f_rdisc:1; /* return value discarded (casted to void) */ unsigned short f_type; /* types of expected return value and args */ arginf_t *f_args; /* information about constant arguments */ struct fcall *f_next; /* next call of same function */ @@ -170,9 +170,9 @@ typedef struct usym { */ typedef struct hte { const char *h_name; /* name */ - bool h_used : 1; /* symbol is used */ - bool h_def : 1; /* symbol is defined */ - bool h_static : 1; /* static symbol */ + bool h_used:1; /* symbol is used */ + bool h_def:1; /* symbol is defined */ + bool h_static:1; /* static symbol */ sym_t *h_syms; /* declarations and definitions */ sym_t **h_lsym; /* points to s_next of last decl./def. */ fcall_t *h_calls; /* function calls */