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: rename functions with short names



details:   https://anonhg.NetBSD.org/src/rev/78eb7b635f42
branches:  trunk
changeset: 949354:78eb7b635f42
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jan 10 14:07:34 2021 +0000

description:
lint: rename functions with short names

diffstat:

 usr.bin/xlint/lint1/cgram.y    |  20 ++++++++++----------
 usr.bin/xlint/lint1/decl.c     |  27 ++++++++++++++-------------
 usr.bin/xlint/lint1/externs1.h |   6 +++---
 3 files changed, 27 insertions(+), 26 deletions(-)

diffs (205 lines):

diff -r fadb61d92ba5 -r 78eb7b635f42 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Sun Jan 10 13:54:13 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Sun Jan 10 14:07:34 2021 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.137 2021/01/10 00:05:46 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.138 2021/01/10 14:07:34 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.137 2021/01/10 00:05:46 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.138 2021/01/10 14:07:34 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -1281,13 +1281,13 @@
 
 parameter_declaration:
          declmods deftyp {
-               $$ = decl1arg(abstract_name(), 0);
+               $$ = declare_argument(abstract_name(), 0);
          }
        | declspecs deftyp {
-               $$ = decl1arg(abstract_name(), 0);
+               $$ = declare_argument(abstract_name(), 0);
          }
        | declmods deftyp notype_param_decl {
-               $$ = decl1arg($3, 0);
+               $$ = declare_argument($3, 0);
          }
        /*
         * param_decl is needed because of following conflict:
@@ -1297,13 +1297,13 @@
         * This grammar realizes the second case.
         */
        | declspecs deftyp param_decl {
-               $$ = decl1arg($3, 0);
+               $$ = declare_argument($3, 0);
          }
        | declmods deftyp abs_decl {
-               $$ = decl1arg($3, 0);
+               $$ = declare_argument($3, 0);
          }
        | declspecs deftyp abs_decl {
-               $$ = decl1arg($3, 0);
+               $$ = declare_argument($3, 0);
          }
        ;
 
@@ -2157,7 +2157,7 @@
                        freeyyv(&renaming, T_NAME);
                        break;
                }
-               (void)decl1arg(decl, initflg);
+               (void)declare_argument(decl, initflg);
                break;
        case AUTO:
                if (renaming != NULL) {
@@ -2166,7 +2166,7 @@
                        freeyyv(&renaming, T_NAME);
                        break;
                }
-               decl1loc(decl, initflg);
+               declare_local(decl, initflg);
                break;
        default:
                LERROR("idecl(%d)", dcs->d_ctx);
diff -r fadb61d92ba5 -r 78eb7b635f42 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Sun Jan 10 13:54:13 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Sun Jan 10 14:07:34 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.115 2021/01/10 13:54:13 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.116 2021/01/10 14:07:34 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.115 2021/01/10 13:54:13 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.116 2021/01/10 14:07:34 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -73,7 +73,7 @@
 static int     check_prototype_declaration(sym_t *, sym_t *);
 static sym_t   *new_style_function(sym_t *, sym_t *);
 static void    old_style_function(sym_t *, sym_t *);
-static void    ledecl(sym_t *);
+static void    declare_external_in_block(sym_t *);
 static int     check_init(sym_t *);
 static void    check_argument_usage(int, sym_t *);
 static void    check_variable_usage(int, sym_t *);
@@ -1549,8 +1549,8 @@
                        /*
                         * XXX somewhat ugly because we dont know whether
                         * this is AUTO or EXTERN (functions). If we are
-                        * wrong it must be corrected in decl1loc(), where
-                        * we have the necessary type information.
+                        * wrong it must be corrected in declare_local(),
+                        * where we have the necessary type information.
                         */
                        sc = AUTO;
                        sym->s_def = DEF;
@@ -2074,7 +2074,7 @@
 }
 
 static int
-chkqual(type_t *tp1, type_t *tp2, int ignqual)
+qualifiers_correspond(type_t *tp1, type_t *tp2, int ignqual)
 {
        if (tp1->t_const != tp2->t_const && !ignqual && !tflag)
                return 0;
@@ -2091,7 +2091,7 @@
        if (tp1->t_tspec != VOID && tp2->t_tspec != VOID)
                return 0;
 
-       if (!chkqual(tp1, tp2, ignqual))
+       if (!qualifiers_correspond(tp1, tp2, ignqual))
                return 0;
 
        return 1;
@@ -2133,7 +2133,7 @@
                if (t != tp2->t_tspec)
                        return 0;
 
-               if (!chkqual(tp1, tp2, ignqual))
+               if (!qualifiers_correspond(tp1, tp2, ignqual))
                        return 0;
 
                if (t == STRUCT || t == UNION)
@@ -2324,7 +2324,7 @@
  * Completes the declaration of a single argument.
  */
 sym_t *
-decl1arg(sym_t *sym, int initflg)
+declare_argument(sym_t *sym, int initflg)
 {
        tspec_t t;
 
@@ -2558,7 +2558,7 @@
  * Completes a single local declaration/definition.
  */
 void
-decl1loc(sym_t *dsym, int initflg)
+declare_local(sym_t *dsym, int initflg)
 {
 
        /* Correct a mistake done in declarator_name(). */
@@ -2601,7 +2601,7 @@
        check_type(dsym);
 
        if (dcs->d_rdcsym != NULL && dsym->s_scl == EXTERN)
-               ledecl(dsym);
+               declare_external_in_block(dsym);
 
        if (dsym->s_scl == EXTERN) {
                /*
@@ -2637,7 +2637,8 @@
                                break;
                        case EXTERN:
                                /*
-                                * Warnings and errors are printed in ledecl()
+                                * Warnings and errors are printed in
+                                * declare_external_in_block()
                                 */
                                break;
                        default:
@@ -2699,7 +2700,7 @@
  * Processes (re)declarations of external symbols inside blocks.
  */
 static void
-ledecl(sym_t *dsym)
+declare_external_in_block(sym_t *dsym)
 {
        int     eqt, dowarn;
        sym_t   *esym;
diff -r fadb61d92ba5 -r 78eb7b635f42 usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h    Sun Jan 10 13:54:13 2021 +0000
+++ b/usr.bin/xlint/lint1/externs1.h    Sun Jan 10 14:07:34 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: externs1.h,v 1.51 2021/01/10 11:17:53 rillig Exp $     */
+/*     $NetBSD: externs1.h,v 1.52 2021/01/10 14:07:34 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -177,11 +177,11 @@
 extern int     eqptrtype(type_t *, type_t *, int);
 extern int     eqtype(type_t *, type_t *, int, int, int *);
 extern void    complete_type(sym_t *, sym_t *);
-extern sym_t   *decl1arg(sym_t *, int);
+extern sym_t   *declare_argument(sym_t *, int);
 extern void    check_func_lint_directives(void);
 extern void    check_func_old_style_arguments(void);
 
-extern void    decl1loc(sym_t *, int);
+extern void    declare_local(sym_t *, int);
 extern sym_t   *abstract_name(void);
 extern void    global_clean_up(void);
 extern sym_t   *declare_1_abstract(sym_t *);



Home | Main Index | Thread Index | Old Index