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: clean up function names



details:   https://anonhg.NetBSD.org/src/rev/23306825c9d1
branches:  trunk
changeset: 376697:23306825c9d1
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Jun 29 09:58:36 2023 +0000

description:
lint: clean up function names

No functional change.

diffstat:

 usr.bin/xlint/lint1/cgram.y    |  68 +++++++++++++++---------------
 usr.bin/xlint/lint1/decl.c     |  14 +----
 usr.bin/xlint/lint1/externs1.h |  36 ++++++++--------
 usr.bin/xlint/lint1/func.c     |  91 +++++++++--------------------------------
 4 files changed, 76 insertions(+), 133 deletions(-)

diffs (truncated from 562 to 300 lines):

diff -r ce7d12e4c341 -r 23306825c9d1 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Thu Jun 29 05:47:41 2023 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Thu Jun 29 09:58:36 2023 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.437 2023/06/29 05:03:03 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.438 2023/06/29 09:58:36 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID)
-__RCSID("$NetBSD: cgram.y,v 1.437 2023/06/29 05:03:03 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.438 2023/06/29 09:58:36 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -988,23 +988,23 @@ struct_declaration:               /* C99 6.7.2.1 */
 
 notype_struct_declarators:
          notype_struct_declarator {
-               $$ = declarator_1_struct_union($1);
+               $$ = declare_member($1);
          }
        | notype_struct_declarators {
                symtyp = FMEMBER;
          } T_COMMA type_struct_declarator {
-               $$ = concat_lists($1, declarator_1_struct_union($4));
+               $$ = concat_lists($1, declare_member($4));
          }
        ;
 
 type_struct_declarators:
          type_struct_declarator {
-               $$ = declarator_1_struct_union($1);
+               $$ = declare_member($1);
          }
        | type_struct_declarators {
                symtyp = FMEMBER;
          } T_COMMA type_struct_declarator {
-               $$ = concat_lists($1, declarator_1_struct_union($4));
+               $$ = concat_lists($1, declare_member($4));
          }
        ;
 
@@ -1387,16 +1387,16 @@ type_name:                      /* C99 6.7.6 */
 
 abstract_declaration:          /* specific to lint */
          begin_type_qualifier_list end_type {
-               $$ = declare_1_abstract(abstract_name());
+               $$ = declare_abstract_type(abstract_name());
          }
        | begin_type_specifier_qualifier_list end_type {
-               $$ = declare_1_abstract(abstract_name());
+               $$ = declare_abstract_type(abstract_name());
          }
        | begin_type_qualifier_list end_type abstract_declarator {
-               $$ = declare_1_abstract($3);
+               $$ = declare_abstract_type($3);
          }
        | begin_type_specifier_qualifier_list end_type abstract_declarator {
-               $$ = declare_1_abstract($3);
+               $$ = declare_abstract_type($3);
          }
        ;
 
@@ -1726,27 +1726,27 @@ expression_statement:           /* C99 6.8.3 */
 selection_statement:           /* C99 6.8.4 */
          if_without_else %prec T_THEN {
                save_warning_flags();
-               if2();
-               if3(false);
+               stmt_if_then_stmt();
+               stmt_if_else_stmt(false);
          }
        | if_without_else T_ELSE {
                save_warning_flags();
-               if2();
+               stmt_if_then_stmt();
          } statement {
                clear_warning_flags();
-               if3(true);
+               stmt_if_else_stmt(true);
          }
        | if_without_else T_ELSE error {
                clear_warning_flags();
-               if3(false);
+               stmt_if_else_stmt(false);
          }
        | switch_expr statement {
                clear_warning_flags();
-               switch2();
+               stmt_switch_expr_stmt();
          }
        | switch_expr error {
                clear_warning_flags();
-               switch2();
+               stmt_switch_expr_stmt();
          }
        ;
 
@@ -1757,14 +1757,14 @@ if_without_else:                /* see C99 6.8.4 */
 
 if_expr:                       /* see C99 6.8.4 */
          T_IF T_LPAREN expression T_RPAREN {
-               if1($3);
+               stmt_if_expr($3);
                clear_warning_flags();
          }
        ;
 
 switch_expr:                   /* see C99 6.8.4 */
          T_SWITCH T_LPAREN expression T_RPAREN {
-               switch1($3);
+               stmt_switch_expr($3);
                clear_warning_flags();
          }
        ;
@@ -1772,29 +1772,29 @@ switch_expr:                    /* see C99 6.8.4 */
 iteration_statement:           /* C99 6.8.5 */
          while_expr statement {
                clear_warning_flags();
-               while2();
+               stmt_while_expr_stmt();
          }
        | while_expr error {
                clear_warning_flags();
-               while2();
+               stmt_while_expr_stmt();
          }
        | do_statement do_while_expr {
-               do2($2);
+               stmt_do_while_expr($2);
                seen_fallthrough = false;
          }
        | do error {
                clear_warning_flags();
-               do2(NULL);
+               stmt_do_while_expr(NULL);
          }
        | for_exprs statement {
                clear_warning_flags();
-               for2();
+               stmt_for_exprs_stmt();
                end_declaration_level();
                block_level--;
          }
        | for_exprs error {
                clear_warning_flags();
-               for2();
+               stmt_for_exprs_stmt();
                end_declaration_level();
                block_level--;
          }
@@ -1802,7 +1802,7 @@ iteration_statement:              /* C99 6.8.5 */
 
 while_expr:                    /* see C99 6.8.5 */
          T_WHILE T_LPAREN expression T_RPAREN {
-               while1($3);
+               stmt_while_expr($3);
                clear_warning_flags();
          }
        ;
@@ -1815,7 +1815,7 @@ do_statement:                     /* see C99 6.8.5 */
 
 do:                            /* see C99 6.8.5 */
          T_DO {
-               do1();
+               stmt_do();
          }
        ;
 
@@ -1840,36 +1840,36 @@ for_exprs:                      /* see C99 6.8.5 */
            expression_opt T_RPAREN {
                /* variable declaration in for loop */
                c99ism(325);
-               for1(NULL, $6, $8);
+               stmt_for_exprs(NULL, $6, $8);
                clear_warning_flags();
            }
        | for_start
            expression_opt T_SEMI
            expression_opt T_SEMI
            expression_opt T_RPAREN {
-               for1($2, $4, $6);
+               stmt_for_exprs($2, $4, $6);
                clear_warning_flags();
          }
        ;
 
 jump_statement:                        /* C99 6.8.6 */
          goto identifier T_SEMI {
-               do_goto(getsym($2));
+               stmt_goto(getsym($2));
          }
        | goto error T_SEMI {
                symtyp = FVFT;
          }
        | T_CONTINUE T_SEMI {
-               do_continue();
+               stmt_continue();
          }
        | T_BREAK T_SEMI {
-               do_break();
+               stmt_break();
          }
        | T_RETURN sys T_SEMI {
-               do_return($2, NULL);
+               stmt_return($2, NULL);
          }
        | T_RETURN sys expression T_SEMI {
-               do_return($2, $3);
+               stmt_return($2, $3);
          }
        ;
 
diff -r ce7d12e4c341 -r 23306825c9d1 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Thu Jun 29 05:47:41 2023 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Thu Jun 29 09:58:36 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.319 2023/06/29 05:03:03 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.320 2023/06/29 09:58:36 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID)
-__RCSID("$NetBSD: decl.c,v 1.319 2023/06/29 05:03:03 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.320 2023/06/29 09:58:36 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -1103,11 +1103,8 @@ declare_bit_field(sym_t *dsym, tspec_t *
        }
 }
 
-/*
- * Process the declarator of a struct/union element.
- */
 sym_t *
-declarator_1_struct_union(sym_t *dsym)
+declare_member(sym_t *dsym)
 {
        type_t *tp;
        tspec_t t;
@@ -2945,11 +2942,8 @@ global_clean_up(void)
        global_clean_up_decl(true);
 }
 
-/*
- * Process an abstract type declaration
- */
 sym_t *
-declare_1_abstract(sym_t *sym)
+declare_abstract_type(sym_t *sym)
 {
 
        check_function_definition(sym, true);
diff -r ce7d12e4c341 -r 23306825c9d1 usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h    Thu Jun 29 05:47:41 2023 +0000
+++ b/usr.bin/xlint/lint1/externs1.h    Thu Jun 29 09:58:36 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: externs1.h,v 1.179 2023/06/29 05:03:03 rillig Exp $    */
+/*     $NetBSD: externs1.h,v 1.180 2023/06/29 09:58:36 rillig Exp $    */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -203,7 +203,7 @@ int length_in_bits(const type_t *, const
 unsigned int alignment_in_bits(const type_t *);
 sym_t  *concat_lists(sym_t *, sym_t *);
 void   check_type(sym_t *);
-sym_t  *declarator_1_struct_union(sym_t *);
+sym_t  *declare_member(sym_t *);
 sym_t  *set_bit_field_width(sym_t *, int);
 qual_ptr *merge_qualified_pointer(qual_ptr *, qual_ptr *);
 sym_t  *add_pointer(sym_t *, qual_ptr *);
@@ -230,7 +230,7 @@ void        check_func_old_style_arguments(void
 void   declare_local(sym_t *, bool);
 sym_t  *abstract_name(void);
 void   global_clean_up(void);
-sym_t  *declare_1_abstract(sym_t *);
+sym_t  *declare_abstract_type(sym_t *);
 void   check_size(sym_t *);
 void   mark_as_set(sym_t *);
 void   mark_as_used(sym_t *, bool, bool);
@@ -309,21 +309,21 @@ void      end_function(void);
 void   named_label(sym_t *);
 void   case_label(tnode_t *);
 void   default_label(void);
-void   if1(tnode_t *);
-void   if2(void);
-void   if3(bool);
-void   switch1(tnode_t *);
-void   switch2(void);
-void   while1(tnode_t *);
-void   while2(void);



Home | Main Index | Thread Index | Old Index