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: fix typos and other minor stylistic issues



details:   https://anonhg.NetBSD.org/src/rev/c64d77eb9f39
branches:  trunk
changeset: 949204:c64d77eb9f39
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Jan 04 22:26:50 2021 +0000

description:
lint: fix typos and other minor stylistic issues

diffstat:

 usr.bin/xlint/common/tyname.c |   6 +++---
 usr.bin/xlint/lint1/decl.c    |  14 +++++++-------
 usr.bin/xlint/lint1/emit1.c   |  10 +++++-----
 usr.bin/xlint/lint1/func.c    |  18 +++++++++++-------
 usr.bin/xlint/lint1/lint1.h   |  10 +++++-----
 usr.bin/xlint/lint1/main1.c   |   6 +++---
 usr.bin/xlint/lint1/scan.l    |   6 +++---
 usr.bin/xlint/lint1/tree.c    |   6 +++---
 usr.bin/xlint/lint2/chk.c     |  26 +++++++++++++-------------
 usr.bin/xlint/lint2/main2.c   |   6 +++---
 usr.bin/xlint/lint2/read.c    |  12 ++++++------
 usr.bin/xlint/xlint/xlint.c   |   6 +++---
 12 files changed, 65 insertions(+), 61 deletions(-)

diffs (truncated from 521 to 300 lines):

diff -r 4f193decde83 -r c64d77eb9f39 usr.bin/xlint/common/tyname.c
--- a/usr.bin/xlint/common/tyname.c     Mon Jan 04 22:09:35 2021 +0000
+++ b/usr.bin/xlint/common/tyname.c     Mon Jan 04 22:26:50 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tyname.c,v 1.21 2021/01/03 15:55:18 rillig Exp $       */
+/*     $NetBSD: tyname.c,v 1.22 2021/01/04 22:26:50 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.21 2021/01/03 15:55:18 rillig Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.22 2021/01/04 22:26:50 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -280,7 +280,7 @@
 #endif
        }
        if (tp->t_vararg) {
-               buf_add(buf, sep), sep = ", ";
+               buf_add(buf, sep);
                buf_add(buf, "...");
        }
        buf_add(buf, ") returning ");
diff -r 4f193decde83 -r c64d77eb9f39 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Mon Jan 04 22:09:35 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Mon Jan 04 22:26:50 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.110 2021/01/03 20:14:38 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.111 2021/01/04 22:26:50 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.110 2021/01/03 20:14:38 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.111 2021/01/04 22:26:50 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -50,7 +50,7 @@
 
 const  char *unnamed = "<unnamed>";
 
-/* shared type structures for arithmtic types and void */
+/* shared type structures for arithmetic types and void */
 static type_t  *typetab;
 
 /* value of next enumerator during declaration of enum types */
@@ -672,7 +672,7 @@
  *
  * This is used to mark compound statements which have, possibly in
  * nested compound statements, asm statements. For these compound
- * statements no warnings about unused or unitialized variables are
+ * statements no warnings about unused or uninitialized variables are
  * printed.
  *
  * There is no need to clear d_asm in dinfo structs with context AUTO,
@@ -877,7 +877,7 @@
 /*
  * Return the length of a type in bits.
  *
- * Printing a message if the outhermost dimension of an array is 0 must
+ * Printing a message if the outermost dimension of an array is 0 must
  * be done by the caller. All other problems are reported by length()
  * if name is not NULL.
  */
@@ -977,7 +977,7 @@
  * message if it is not.
  *
  * Invalid types are:
- * - arrays of incomlete types or functions
+ * - arrays of incomplete types or functions
  * - functions returning arrays or functions
  * - void types other than type of function or pointer
  */
@@ -1898,7 +1898,7 @@
        if (plibflg && llibflg &&
            dsym->s_type->t_tspec == FUNC && dsym->s_type->t_proto) {
                /*
-                * With both LINTLIBRARY and PROTOLIB the prototyp is
+                * With both LINTLIBRARY and PROTOLIB the prototype is
                 * written as a function definition to the output file.
                 */
                rval = dsym->s_type->t_subt->t_tspec != VOID;
diff -r 4f193decde83 -r c64d77eb9f39 usr.bin/xlint/lint1/emit1.c
--- a/usr.bin/xlint/lint1/emit1.c       Mon Jan 04 22:09:35 2021 +0000
+++ b/usr.bin/xlint/lint1/emit1.c       Mon Jan 04 22:26:50 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: emit1.c,v 1.33 2021/01/03 20:14:38 rillig Exp $ */
+/* $NetBSD: emit1.c,v 1.34 2021/01/04 22:26:50 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: emit1.c,v 1.33 2021/01/03 20:14:38 rillig Exp $");
+__RCSID("$NetBSD: emit1.c,v 1.34 2021/01/04 22:26:50 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -88,7 +88,7 @@
  *                             2 n typename            only type name
  *
  * spaces are only for better readability
- * additionaly it is possible to prepend the characters 'c' (for const)
+ * additionally it is possible to prepend the characters 'c' (for const)
  * and 'v' (for volatile)
  */
 void
@@ -401,7 +401,7 @@
  * write out all information necessary for lint2 to check function
  * calls
  *
- * rvused is set if the return value is used (asigned to a variable)
+ * rvused is set if the return value is used (assigned to a variable)
  * rvdisc is set if the return value is not used and not ignored
  * (casted to void)
  */
@@ -490,7 +490,7 @@
 
 /*
  * extracts potential format specifiers for printf() and scanf() and
- * writes them, enclosed in "" and qouted if necessary, to the output buffer
+ * writes them, enclosed in "" and quoted if necessary, to the output buffer
  */
 static void
 outfstrg(strg_t *strg)
diff -r 4f193decde83 -r c64d77eb9f39 usr.bin/xlint/lint1/func.c
--- a/usr.bin/xlint/lint1/func.c        Mon Jan 04 22:09:35 2021 +0000
+++ b/usr.bin/xlint/lint1/func.c        Mon Jan 04 22:26:50 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: func.c,v 1.49 2021/01/03 20:14:38 rillig Exp $ */
+/*     $NetBSD: func.c,v 1.50 2021/01/04 22:26:50 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.49 2021/01/03 20:14:38 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.50 2021/01/04 22:26:50 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -62,7 +62,7 @@
 int    rchflg;
 
 /*
- * In conjunction with reached ontrols printing of "fallthrough on ..."
+ * In conjunction with reached, controls printing of "fallthrough on ..."
  * warnings.
  * Reset by each statement and set by FALLTHROUGH, switch (switch1())
  * and case (label()).
@@ -70,7 +70,7 @@
  * Control statements if, for, while and switch do not reset ftflg because
  * this must be done by the controlled statement. At least for if this is
  * important because ** FALLTHROUGH ** after "if (expr) stmnt" is evaluated
- * before the following token, wich causes reduction of above.
+ * before the following token, which causes reduction of above.
  * This means that ** FALLTHROUGH ** after "if ..." would always be ignored.
  */
 int    ftflg;
@@ -294,8 +294,12 @@
                         * be printed in check_func_lint_directives().
                         */
                        if (dowarn && !fsym->s_osdef) {
-                               /* redeclaration of %s */
-                               (*(sflag ? error : warning))(27, fsym->s_name);
+                               if (sflag)
+                                       /* redeclaration of %s */
+                                       error(27, fsym->s_name);
+                               else
+                                       /* redeclaration of %s */
+                                       warning(27, fsym->s_name);
                                print_previous_declaration(-1, rdsym);
                        }
 
@@ -1188,7 +1192,7 @@
 }
 
 /*
- * Set the linenumber for a CONSTCOND comment. At this and the following
+ * Set the line number for a CONSTCOND comment. At this and the following
  * line no warnings about constants in conditional contexts are printed.
  */
 /* ARGSUSED */
diff -r 4f193decde83 -r c64d77eb9f39 usr.bin/xlint/lint1/lint1.h
--- a/usr.bin/xlint/lint1/lint1.h       Mon Jan 04 22:09:35 2021 +0000
+++ b/usr.bin/xlint/lint1/lint1.h       Mon Jan 04 22:26:50 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.52 2021/01/03 20:04:08 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.53 2021/01/04 22:26:50 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -51,9 +51,9 @@
 #define WORST_ALIGN(x) (((x) + AVAL) & ~AVAL)
 #endif
 
-#define LWARN_BAD      -3
-#define LWARN_ALL      -2
-#define LWARN_NONE     -1
+#define LWARN_BAD      (-3)
+#define LWARN_ALL      (-2)
+#define LWARN_NONE     (-1)
 
 /*
  * Describes the position of a declaration or anything else.
@@ -116,7 +116,7 @@
 #define v_ldbl v_u._v_ldbl
 
 /*
- * Structures of type str_t uniqely identify structures. This can't
+ * Structures of type str_t uniquely identify structures. This can't
  * be done in structures of type type_t, because these are copied
  * if they must be modified. So it would not be possible to check
  * if two structures are identical by comparing the pointers to
diff -r 4f193decde83 -r c64d77eb9f39 usr.bin/xlint/lint1/main1.c
--- a/usr.bin/xlint/lint1/main1.c       Mon Jan 04 22:09:35 2021 +0000
+++ b/usr.bin/xlint/lint1/main1.c       Mon Jan 04 22:26:50 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main1.c,v 1.31 2020/12/29 11:35:11 rillig Exp $        */
+/*     $NetBSD: main1.c,v 1.32 2021/01/04 22:26:50 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: main1.c,v 1.31 2020/12/29 11:35:11 rillig Exp $");
+__RCSID("$NetBSD: main1.c,v 1.32 2021/01/04 22:26:50 rillig Exp $");
 #endif
 
 #include <sys/types.h>
@@ -55,7 +55,7 @@
 int    yflag;
 
 /*
- * Print warnings if an assignment of an integertype to another integertype
+ * Print warnings if an assignment of an integer type to another integer type
  * causes an implicit narrowing conversion. If aflag is 1, these warnings
  * are printed only if the source type is at least as wide as long. If aflag
  * is greater than 1, they are always printed.
diff -r 4f193decde83 -r c64d77eb9f39 usr.bin/xlint/lint1/scan.l
--- a/usr.bin/xlint/lint1/scan.l        Mon Jan 04 22:09:35 2021 +0000
+++ b/usr.bin/xlint/lint1/scan.l        Mon Jan 04 22:26:50 2021 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: scan.l,v 1.111 2021/01/03 17:42:45 rillig Exp $ */
+/* $NetBSD: scan.l,v 1.112 2021/01/04 22:26:50 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: scan.l,v 1.111 2021/01/03 17:42:45 rillig Exp $");
+__RCSID("$NetBSD: scan.l,v 1.112 2021/01/04 22:26:50 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -1340,7 +1340,7 @@
 }
 
 /*
- * Strings are stored in a dynamically alloceted buffer and passed
+ * Strings are stored in a dynamically allocated buffer and passed
  * in yylval.y_xstrg to the parser. The parser or the routines called
  * by the parser are responsible for freeing this buffer.
  */
diff -r 4f193decde83 -r c64d77eb9f39 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Mon Jan 04 22:09:35 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Mon Jan 04 22:26:50 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.126 2021/01/04 21:30:06 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.127 2021/01/04 22:26:50 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.126 2021/01/04 21:30:06 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.127 2021/01/04 22:26:50 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -1345,7 +1345,7 @@



Home | Main Index | Thread Index | Old Index