Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xlint lint: rename functions with very short names



details:   https://anonhg.NetBSD.org/src/rev/119c6ac93a73
branches:  trunk
changeset: 979465:119c6ac93a73
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Dec 29 13:33:03 2020 +0000

description:
lint: rename functions with very short names

diffstat:

 usr.bin/xlint/common/externs.h |    4 +-
 usr.bin/xlint/common/tyname.c  |   10 +-
 usr.bin/xlint/lint1/cgram.y    |   85 ++++++++++++++++--------------
 usr.bin/xlint/lint1/decl.c     |   61 ++++++++++++----------
 usr.bin/xlint/lint1/externs1.h |   48 ++++++++--------
 usr.bin/xlint/lint1/func.c     |   44 ++++++++--------
 usr.bin/xlint/lint1/init.c     |   25 ++++----
 usr.bin/xlint/lint1/print.c    |    6 +-
 usr.bin/xlint/lint1/scan.l     |   16 ++--
 usr.bin/xlint/lint1/tree.c     |  111 +++++++++++++++++++++-------------------
 10 files changed, 213 insertions(+), 197 deletions(-)

diffs (truncated from 1455 to 300 lines):

diff -r 213f5f27d2f4 -r 119c6ac93a73 usr.bin/xlint/common/externs.h
--- a/usr.bin/xlint/common/externs.h    Tue Dec 29 12:43:36 2020 +0000
+++ b/usr.bin/xlint/common/externs.h    Tue Dec 29 13:33:03 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: externs.h,v 1.7 2020/02/10 04:54:01 christos Exp $     */
+/*     $NetBSD: externs.h,v 1.8 2020/12/29 13:33:03 rillig Exp $       */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -46,7 +46,7 @@
  */
 extern const   char *tyname(char *, size_t, const type_t *);
 extern int     sametype(const type_t *, const type_t *);
-extern const   char *basictyname(tspec_t);
+extern const   char *basic_type_name(tspec_t);
 
 /*
  * mem.c
diff -r 213f5f27d2f4 -r 119c6ac93a73 usr.bin/xlint/common/tyname.c
--- a/usr.bin/xlint/common/tyname.c     Tue Dec 29 12:43:36 2020 +0000
+++ b/usr.bin/xlint/common/tyname.c     Tue Dec 29 13:33:03 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tyname.c,v 1.15 2020/12/29 12:18:42 rillig Exp $       */
+/*     $NetBSD: tyname.c,v 1.16 2020/12/29 13:33:03 rillig Exp $       */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tyname.c,v 1.15 2020/12/29 12:18:42 rillig Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.16 2020/12/29 13:33:03 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -54,7 +54,7 @@
 #endif
 
 const char *
-basictyname(tspec_t t)
+basic_type_name(tspec_t t)
 {
        switch (t) {
        case BOOL:      return "_Bool";
@@ -88,7 +88,7 @@
        case LCOMPLEX:  return "long double _Complex";
        case COMPLEX:   return "_Complex";
        default:
-               LERROR("basictyname(%d)", t);
+               LERROR("basic_type_name(%d)", t);
                return NULL;
        }
 }
@@ -170,7 +170,7 @@
        if ((t = tp->t_tspec) == INT && tp->t_isenum)
                t = ENUM;
 
-       s = basictyname(t);
+       s = basic_type_name(t);
 
        cv[0] = '\0';
        if (tp->t_const)
diff -r 213f5f27d2f4 -r 119c6ac93a73 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Tue Dec 29 12:43:36 2020 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Tue Dec 29 13:33:03 2020 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.113 2020/12/29 12:18:42 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.114 2020/12/29 13:33:03 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.113 2020/12/29 12:18:42 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.114 2020/12/29 13:33:03 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -351,11 +351,11 @@
 ext_decl:
          asm_stmnt
        | func_def {
-               glclup(0);
+               global_clean_up_decl(0);
                CLRWFLGS(__FILE__, __LINE__);
          }
        | data_def {
-               glclup(0);
+               global_clean_up_decl(0);
                CLRWFLGS(__FILE__, __LINE__);
          }
        ;
@@ -400,10 +400,10 @@
          }
        | declspecs deftyp type_init_decls T_SEMI
        | error T_SEMI {
-               globclup();
+               global_clean_up();
          }
        | error T_RBRACE {
-               globclup();
+               global_clean_up();
          }
        ;
 
@@ -573,10 +573,10 @@
        | T_AT_FORMAT T_LPARN type_attribute_format_type T_COMMA
            constant T_COMMA constant T_RPARN
        | T_AT_USED {
-               addused();
+               add_attr_used();
        }
        | T_AT_UNUSED {
-               addused();
+               add_attr_used();
        }
        | T_AT_WARN_UNUSED_RESULT
        | T_AT_WEAK
@@ -624,34 +624,34 @@
 
 declspecs:
          clrtyp_typespec {
-               addtype($1);
+               add_type($1);
          }
        | declmods typespec {
-               addtype($2);
+               add_type($2);
          }
        | type_attribute declspecs
        | declspecs declmod
        | declspecs notype_typespec {
-               addtype($2);
+               add_type($2);
          }
        ;
 
 declmods:
          clrtyp T_QUAL {
-               addqual($2);
+               add_qualifier($2);
          }
        | clrtyp T_SCLASS {
-               addscl($2);
+               add_storage_class($2);
          }
        | declmods declmod
        ;
 
 declmod:
          T_QUAL {
-               addqual($1);
+               add_qualifier($1);
          }
        | T_SCLASS {
-               addscl($1);
+               add_storage_class($1);
          }
        | type_attribute_list
        ;
@@ -705,12 +705,12 @@
        | struct struct_tag {
                dcs->d_tagtyp = mktag($2, $1, 1, 0);
          } struct_declaration {
-               $$ = compltag(dcs->d_tagtyp, $4);
+               $$ = complete_tag(dcs->d_tagtyp, $4);
          }
        | struct {
                dcs->d_tagtyp = mktag(NULL, $1, 1, 0);
          } struct_declaration {
-               $$ = compltag(dcs->d_tagtyp, $3);
+               $$ = complete_tag(dcs->d_tagtyp, $3);
          }
        | struct error {
                symtyp = FVFT;
@@ -820,27 +820,27 @@
 
 noclass_declspecs:
          clrtyp_typespec {
-               addtype($1);
+               add_type($1);
          }
        | type_attribute noclass_declspecs
        | noclass_declmods typespec {
-               addtype($2);
+               add_type($2);
          }
        | noclass_declspecs T_QUAL {
-               addqual($2);
+               add_qualifier($2);
          }
        | noclass_declspecs notype_typespec {
-               addtype($2);
+               add_type($2);
          }
        | noclass_declspecs type_attribute
        ;
 
 noclass_declmods:
          clrtyp T_QUAL {
-               addqual($2);
+               add_qualifier($2);
          }
        | noclass_declmods T_QUAL {
-               addqual($2);
+               add_qualifier($2);
          }
        ;
 
@@ -901,12 +901,12 @@
        | enum enum_tag {
                dcs->d_tagtyp = mktag($2, ENUM, 1, 0);
          } enum_declaration {
-               $$ = compltag(dcs->d_tagtyp, $4);
+               $$ = complete_tag(dcs->d_tagtyp, $4);
          }
        | enum {
                dcs->d_tagtyp = mktag(NULL, ENUM, 1, 0);
          } enum_declaration {
-               $$ = compltag(dcs->d_tagtyp, $3);
+               $$ = complete_tag(dcs->d_tagtyp, $3);
          }
        | enum error {
                symtyp = FVFT;
@@ -1361,7 +1361,7 @@
        | point identifier {
                if (!Sflag)
                        warning(313);
-               memberpush($2);
+               push_member($2);
          }
        ;
 
@@ -1374,19 +1374,19 @@
          init_field_list T_ASSIGN
        | identifier T_COLON {
                gnuism(315);
-               memberpush($1);
+               push_member($1);
          }
        ;
 
 init_lbrace:
          T_LBRACE {
-               initlbr();
+               init_lbrace();
          }
        ;
 
 init_rbrace:
          T_RBRACE {
-               initrbr();
+               init_rbrace();
          }
        ;
 
@@ -1908,12 +1908,18 @@
        | term point_or_arrow T_NAME {
                if ($1 != NULL) {
                        sym_t   *msym;
-                       /* XXX strmemb should be integrated in build() */
+                       /*
+                        * XXX struct_or_union_member should be integrated
+                        * in build()
+                        */
                        if ($2 == ARROW) {
-                               /* must to this before strmemb is called */
+                               /*
+                                * must do this before struct_or_union_member
+                                * is called
+                                */
                                $1 = cconv($1);
                        }
-                       msym = strmemb($1, $2, getsym($3));
+                       msym = struct_or_union_member($1, $2, getsym($3));
                        $$ = build($2, $1, getnnode(msym, 0));
                } else {
                        $$ = NULL;
@@ -1937,17 +1943,18 @@
        | T_BUILTIN_OFFSETOF T_LPARN type_name T_COMMA identifier T_RPARN
                                                    %prec T_BUILTIN_OFFSETOF {
                symtyp = FMOS;
-               $$ = bldoffsetof($3, getsym($5));
+               $$ = build_offsetof($3, getsym($5));
          }
        | T_SIZEOF term                                 %prec T_SIZEOF {
-               if (($$ = $2 == NULL ? NULL : bldszof($2->tn_type)) != NULL)
-                       chkmisc($2, 0, 0, 0, 0, 0, 1);
+               $$ = $2 == NULL ? NULL : build_sizeof($2->tn_type);
+               if ($$ != NULL)
+                       check_expr_misc($2, 0, 0, 0, 0, 0, 1);
          }
        | T_SIZEOF T_LPARN type_name T_RPARN            %prec T_SIZEOF {
-               $$ = bldszof($3);
+               $$ = build_sizeof($3);
          }



Home | Main Index | Thread Index | Old Index