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: spell out abbreviations in comments



details:   https://anonhg.NetBSD.org/src/rev/fc673567002a
branches:  trunk
changeset: 985681:fc673567002a
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Sep 04 12:30:46 2021 +0000

description:
lint: spell out abbreviations in comments

No functional change.

diffstat:

 usr.bin/xlint/lint1/cgram.y        |   6 +++---
 usr.bin/xlint/lint1/check-msgs.lua |  20 ++------------------
 usr.bin/xlint/lint1/decl.c         |  17 ++++++++---------
 usr.bin/xlint/lint1/func.c         |   6 +++---
 usr.bin/xlint/lint1/init.c         |   6 +++---
 usr.bin/xlint/lint1/tree.c         |  20 ++++++++++----------
 6 files changed, 29 insertions(+), 46 deletions(-)

diffs (276 lines):

diff -r 059de604e78d -r fc673567002a usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Sat Sep 04 12:05:54 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Sat Sep 04 12:30:46 2021 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.359 2021/08/28 13:29:26 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.360 2021/09/04 12:30:46 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.359 2021/08/28 13:29:26 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.360 2021/09/04 12:30:46 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -1559,7 +1559,7 @@
          T_LBRACK range T_RBRACK {
                add_designator_subscript($2);
                if (!Sflag)
-                       /* array initializer with des.s is a C9X feature */
+                       /* array initializer with designators is a C9X ... */
                        warning(321);
          }
        | T_POINT identifier {
diff -r 059de604e78d -r fc673567002a usr.bin/xlint/lint1/check-msgs.lua
--- a/usr.bin/xlint/lint1/check-msgs.lua        Sat Sep 04 12:05:54 2021 +0000
+++ b/usr.bin/xlint/lint1/check-msgs.lua        Sat Sep 04 12:30:46 2021 +0000
@@ -1,9 +1,9 @@
 #! /usr/bin/lua
--- $NetBSD: check-msgs.lua,v 1.11 2021/06/15 08:37:56 rillig Exp $
+-- $NetBSD: check-msgs.lua,v 1.12 2021/09/04 12:30:46 rillig Exp $
 
 --[[
 
-usage: lua ./check-msgs.lua *.c
+usage: lua ./check-msgs.lua *.c *.y
 
 Check that the message text in the comments of the C source code matches the
 actual user-visible message text in err.c.
@@ -48,22 +48,6 @@
   msg = msg:gsub("%*/", "**")
   msg = msg:gsub("\\(.)", "%1")
 
-  -- allow a few abbreviations to be used in the code
-  comment = comment:gsub("arg%.", "argument")
-  comment = comment:gsub("comb%.", "combination")
-  comment = comment:gsub("conv%.", "conversion")
-  comment = comment:gsub("decl%.", "declaration")
-  comment = comment:gsub("defn%.", "definition")
-  comment = comment:gsub("des%.s", "designators")
-  comment = comment:gsub("expr%.", "expression")
-  comment = comment:gsub("func%.", "function")
-  comment = comment:gsub("incomp%.", "incompatible")
-  comment = comment:gsub("init%.", "initialize")
-  comment = comment:gsub("param%.", "parameter")
-  comment = comment:gsub("req%.", "requires")
-  comment = comment:gsub("poss%.", "possibly")
-  comment = comment:gsub("trad%.", "traditional")
-
   if comment == msg then
     return
   end
diff -r 059de604e78d -r fc673567002a usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Sat Sep 04 12:05:54 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Sat Sep 04 12:30:46 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.229 2021/09/04 12:05:54 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.230 2021/09/04 12:30:46 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.229 2021/09/04 12:05:54 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.230 2021/09/04 12:30:46 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -1070,7 +1070,7 @@
                        if (dcs->d_ctx == PROTO_ARG) {
                                if (sym->s_scl != ABSTRACT) {
                                        lint_assert(sym->s_name != unnamed);
-                                       /* void param. cannot have name: %s */
+                                       /* void parameter cannot have ... */
                                        error(61, sym->s_name);
                                        *tpp = gettyp(INT);
                                }
@@ -1741,7 +1741,7 @@
                        /* "struct a;" */
                        if (!tflag) {
                                if (!sflag)
-                                       /* decl. introduces new type ... */
+                                       /* declaration introduces new ... */
                                        warning(44, storage_class_name(scl),
                                            tag->s_name);
                                tag = pushdown(tag);
@@ -1762,9 +1762,8 @@
                        /* base type is really '%s %s' */
                        warning(45, storage_class_name(tag->s_scl),
                            tag->s_name);
-                       /* declaration introduces new type in ANSI C: %s %s */
                        if (!sflag) {
-                               /* decl. introduces new type in ANSI C: %s %s */
+                               /* declaration introduces new type in ... */
                                warning(44, storage_class_name(scl),
                                    tag->s_name);
                        }
@@ -2360,7 +2359,7 @@
                 */
                if (!eqtype(arg->s_type, parg->s_type, true, true, &dowarn) ||
                    dowarn) {
-                       /* prototype does not match old style defn., arg #%d */
+                       /* prototype does not match old style ... */
                        error(299, n);
                        msg = true;
                }
@@ -2542,7 +2541,7 @@
                if (arg->s_type->t_tspec != PTR ||
                    ((t = arg->s_type->t_subt->t_tspec) != CHAR &&
                     t != UCHAR && t != SCHAR)) {
-                       /* arg. %d must be 'char *' for PRINTFLIKE/SCANFLIKE */
+                       /* argument %d must be 'char *' for PRINTFLIKE/... */
                        warning(293, narg);
                        printflike_argnum = scanflike_argnum = -1;
                }
@@ -2697,7 +2696,7 @@
                         */
                        if (tflag) {
                                if (hflag)
-                                       /* decl. hides parameter: %s */
+                                       /* declaration hides parameter: %s */
                                        warning(91, dsym->s_name);
                                rmsym(rsym);
                        }
diff -r 059de604e78d -r fc673567002a usr.bin/xlint/lint1/func.c
--- a/usr.bin/xlint/lint1/func.c        Sat Sep 04 12:05:54 2021 +0000
+++ b/usr.bin/xlint/lint1/func.c        Sat Sep 04 12:30:46 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: func.c,v 1.122 2021/08/28 13:29:26 rillig Exp $        */
+/*     $NetBSD: func.c,v 1.123 2021/09/04 12:30:46 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: func.c,v 1.122 2021/08/28 13:29:26 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.123 2021/09/04 12:30:46 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -697,7 +697,7 @@
        if (tn != NULL && tflag) {
                t = tn->tn_type->t_tspec;
                if (t == LONG || t == ULONG || t == QUAD || t == UQUAD) {
-                       /* switch expr. must be of type 'int' in trad. C */
+                       /* switch expression must be of type 'int' in ... */
                        warning(271);
                }
        }
diff -r 059de604e78d -r fc673567002a usr.bin/xlint/lint1/init.c
--- a/usr.bin/xlint/lint1/init.c        Sat Sep 04 12:05:54 2021 +0000
+++ b/usr.bin/xlint/lint1/init.c        Sat Sep 04 12:30:46 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init.c,v 1.208 2021/08/14 12:46:23 rillig Exp $        */
+/*     $NetBSD: init.c,v 1.209 2021/09/04 12:30:46 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.208 2021/08/14 12:46:23 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.209 2021/09/04 12:30:46 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -319,7 +319,7 @@
 
        if (has_automatic_storage_duration(sym) &&
            !is_scalar(sym->s_type->t_tspec)) {
-               /* no automatic aggregate initialization in trad. C */
+               /* no automatic aggregate initialization in traditional C */
                warning(188);
        }
 }
diff -r 059de604e78d -r fc673567002a usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sat Sep 04 12:05:54 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sat Sep 04 12:30:46 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.376 2021/09/04 10:09:19 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.377 2021/09/04 12:30:46 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.376 2021/09/04 10:09:19 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.377 2021/09/04 12:30:46 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -1067,7 +1067,7 @@
        if ((lst == VOID && rst == FUNC) || (lst == FUNC && rst == VOID)) {
                /* (void *)0 handled above */
                if (sflag)
-                       /* ANSI C forbids conv. of %s to %s, op %s */
+                       /* ANSI C forbids conversion of %s to %s, op %s */
                        warning(305, "function pointer", "'void *'",
                            mp->m_name);
                return;
@@ -1465,11 +1465,11 @@
                warning(303, rts, lts);
                break;
        case FARG:
-               /* ANSI C forbids conv. of %s to %s, arg #%d */
+               /* ANSI C forbids conversion of %s to %s, arg #%d */
                warning(304, rts, lts, arg);
                break;
        default:
-               /* ANSI C forbids conv. of %s to %s, op %s */
+               /* ANSI C forbids conversion of %s to %s, op %s */
                warning(305, rts, lts, op_name(op));
                break;
        }
@@ -1535,7 +1535,7 @@
                warning(183, lx, type_name(ltp), rx, type_name(rtp));
                break;
        case FARG:
-               /* illegal comb. of %s (%s) and %s (%s), arg #%d */
+               /* illegal combination of %s (%s) and %s (%s), arg #%d */
                warning(154,
                    lx, type_name(ltp), rx, type_name(rtp), arg);
                break;
@@ -2141,11 +2141,11 @@
                /* conversion from '%s' may lose accuracy */
                if (aflag > 0) {
                        if (op == FARG) {
-                               /* conv. from '%s' to '%s' may lose ... */
+                               /* conversion from '%s' to '%s' may ... */
                                warning(298,
                                    type_name(tn->tn_type), type_name(tp), arg);
                        } else {
-                               /* conv. from '%s' to '%s' may lose accuracy */
+                               /* conversion from '%s' to '%s' may ... */
                                warning(132,
                                    type_name(tn->tn_type), type_name(tp));
                        }
@@ -2297,7 +2297,7 @@
        if (v->v_ldbl > max || v->v_ldbl < min) {
                lint_assert(nt != LDOUBLE);
                if (op == FARG) {
-                       /* conv. of '%s' to '%s' is out of range, ... */
+                       /* conversion of '%s' to '%s' is out of range, ... */
                        warning(295,
                            type_name(gettyp(ot)), type_name(tp), arg);
                } else {
@@ -2346,7 +2346,7 @@
                                   uint64_t xmask, op_t op)
 {
        if (nsz < osz && (v->v_quad & xmask) != 0) {
-               /* constant truncated by conv., op %s */
+               /* constant truncated by conversion, op %s */
                warning(306, op_name(op));
        }
 }



Home | Main Index | Thread Index | Old Index