Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint2 lint: remove spaces around bit-field colon



details:   https://anonhg.NetBSD.org/src/rev/d9ee740431bb
branches:  trunk
changeset: 1029129:d9ee740431bb
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Dec 22 14:49:11 2021 +0000

description:
lint: remove spaces around bit-field colon

As seen in /usr/share/misc/style.

No binary change.

diffstat:

 tests/usr.bin/xlint/lint1/d_c99_init.c         |    8 +-
 tests/usr.bin/xlint/lint1/decl_struct_member.c |    6 +-
 usr.bin/xlint/common/lint.h                    |   14 +-
 usr.bin/xlint/lint1/lex.c                      |   18 ++--
 usr.bin/xlint/lint1/lint1.h                    |  100 ++++++++++++------------
 usr.bin/xlint/lint2/lint2.h                    |   50 ++++++------
 6 files changed, 98 insertions(+), 98 deletions(-)

diffs (truncated from 397 to 300 lines):

diff -r 70df37c0a983 -r d9ee740431bb tests/usr.bin/xlint/lint1/d_c99_init.c
--- a/tests/usr.bin/xlint/lint1/d_c99_init.c    Wed Dec 22 14:38:34 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_init.c    Wed Dec 22 14:49:11 2021 +0000
@@ -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 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 {
-       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 @@
 };
 
 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 = {
diff -r 70df37c0a983 -r d9ee740431bb tests/usr.bin/xlint/lint1/decl_struct_member.c
--- a/tests/usr.bin/xlint/lint1/decl_struct_member.c    Wed Dec 22 14:38:34 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/decl_struct_member.c    Wed Dec 22 14:49:11 2021 +0000
@@ -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_declarator_bit_field {
-       const a: 3, : 0, b: 4;
-       const : 0;
+       const a:3, :0, b:4;
+       const:0;
 };
 
 /*
diff -r 70df37c0a983 -r d9ee740431bb usr.bin/xlint/common/lint.h
--- a/usr.bin/xlint/common/lint.h       Wed Dec 22 14:38:34 2021 +0000
+++ b/usr.bin/xlint/common/lint.h       Wed Dec 22 14:49:11 2021 +0000
@@ -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 @@
 #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;
diff -r 70df37c0a983 -r d9ee740431bb usr.bin/xlint/lint1/lex.c
--- a/usr.bin/xlint/lint1/lex.c Wed Dec 22 14:38:34 2021 +0000
+++ b/usr.bin/xlint/lint1/lex.c Wed Dec 22 14:49:11 2021 +0000
@@ -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 @@
        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),
diff -r 70df37c0a983 -r d9ee740431bb usr.bin/xlint/lint1/lint1.h
--- a/usr.bin/xlint/lint1/lint1.h       Wed Dec 22 14:38:34 2021 +0000
+++ b/usr.bin/xlint/lint1/lint1.h       Wed Dec 22 14:49:11 2021 +0000
@@ -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 {
        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 @@
  * 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 @@
  */
 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 @@
         * 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  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 @@
        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 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 @@
        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 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;



Home | Main Index | Thread Index | Old Index