Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/indent indent: fix spelling in comments
details: https://anonhg.NetBSD.org/src/rev/aa95ac982e0b
branches: trunk
changeset: 988235:aa95ac982e0b
user: rillig <rillig%NetBSD.org@localhost>
date: Tue Oct 05 06:49:19 2021 +0000
description:
indent: fix spelling in comments
diffstat:
usr.bin/indent/indent.c | 22 +++++++++++-----------
usr.bin/indent/pr_comment.c | 15 +++++++--------
2 files changed, 18 insertions(+), 19 deletions(-)
diffs (140 lines):
diff -r 2b6a3d65e471 -r aa95ac982e0b usr.bin/indent/indent.c
--- a/usr.bin/indent/indent.c Tue Oct 05 06:24:06 2021 +0000
+++ b/usr.bin/indent/indent.c Tue Oct 05 06:49:19 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: indent.c,v 1.101 2021/10/05 06:09:42 rillig Exp $ */
+/* $NetBSD: indent.c,v 1.102 2021/10/05 06:49:19 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@
#include <sys/cdefs.h>
#if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.101 2021/10/05 06:09:42 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.102 2021/10/05 06:49:19 rillig Exp $");
#elif defined(__FreeBSD__)
__FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
#endif
@@ -547,7 +547,7 @@
if (opt.verbose)
diag(0, "Line broken");
dump_line();
- ps.want_blank = false; /* dont insert blank at line start */
+ ps.want_blank = false; /* don't insert blank at line start */
*inout_force_nl = false;
}
@@ -676,7 +676,7 @@
*inout_force_nl = true; /* must force newline after if */
ps.last_u_d = true; /* inform lexi that a following operator is
* unary */
- ps.in_stmt = false; /* dont use stmt continuation indentation */
+ ps.in_stmt = false; /* don't use stmt continuation indentation */
parse(hd_type); /* let parser worry about if, or whatever */
}
@@ -807,8 +807,8 @@
}
ps.in_decl = (ps.decl_nest > 0); /* if we were in a first level
- * structure declaration, we arent any
- * more */
+ * structure declaration, we aren't
+ * anymore */
if ((!*inout_sp_sw || hd_type != for_exprs) && ps.p_l_follow > 0) {
@@ -822,7 +822,7 @@
if (*inout_sp_sw) { /* this is a check for an if, while, etc. with
* unbalanced parens */
*inout_sp_sw = false;
- parse(hd_type); /* dont lose the if, or whatever */
+ parse(hd_type); /* don't lose the 'if', or whatever */
}
}
*code.e++ = ';';
@@ -840,7 +840,7 @@
process_lbrace(bool *inout_force_nl, bool *inout_sp_sw, token_type hd_type,
int *di_stack, int di_stack_cap, int *inout_dec_ind)
{
- ps.in_stmt = false; /* dont indent the {} */
+ ps.in_stmt = false; /* don't indent the {} */
if (!ps.block_init)
*inout_force_nl = true; /* force other stuff on same line as '{' onto
* new line */
@@ -876,7 +876,7 @@
}
}
if (code.s == code.e)
- ps.ind_stmt = false; /* dont put extra indentation on line
+ ps.ind_stmt = false; /* don't put extra indentation on a line
* with '{' */
if (ps.in_decl && ps.in_or_st) { /* this is either a structure
* declaration or an init */
@@ -1062,8 +1062,8 @@
{
if (code.e[-1] == ',')
*code.e++ = ' ';
- *code.e++ = '.'; /* move the period into line */
- ps.want_blank = false; /* dont put a blank after a period */
+ *code.e++ = '.';
+ ps.want_blank = false;
}
static void
diff -r 2b6a3d65e471 -r aa95ac982e0b usr.bin/indent/pr_comment.c
--- a/usr.bin/indent/pr_comment.c Tue Oct 05 06:24:06 2021 +0000
+++ b/usr.bin/indent/pr_comment.c Tue Oct 05 06:49:19 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pr_comment.c,v 1.51 2021/10/05 06:15:24 rillig Exp $ */
+/* $NetBSD: pr_comment.c,v 1.52 2021/10/05 06:49:19 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@
#include <sys/cdefs.h>
#if defined(__NetBSD__)
-__RCSID("$NetBSD: pr_comment.c,v 1.51 2021/10/05 06:15:24 rillig Exp $");
+__RCSID("$NetBSD: pr_comment.c,v 1.52 2021/10/05 06:49:19 rillig Exp $");
#elif defined(__FreeBSD__)
__FBSDID("$FreeBSD: head/usr.bin/indent/pr_comment.c 334927 2018-06-10 16:44:18Z pstef $");
#endif
@@ -238,7 +238,7 @@
last_blank = -1;
check_size_comment(4);
if (ps.box_com || ps.last_nl) { /* if this is a boxed comment,
- * we dont ignore the newline */
+ * we handle the newline */
if (com.s == com.e)
*com.e++ = ' ';
if (!ps.box_com && com.e - com.s > 3) {
@@ -257,11 +257,11 @@
}
++line_no; /* keep track of input line number */
if (!ps.box_com) {
- int nstar = 1;
+ int asterisks_to_skip = 1;
do { /* flush any blanks and/or tabs at start of
* next line */
inbuf_skip();
- if (*buf_ptr == '*' && --nstar >= 0) {
+ if (*buf_ptr == '*' && --asterisks_to_skip >= 0) {
inbuf_skip();
if (*buf_ptr == '/')
goto end_of_comment;
@@ -271,11 +271,10 @@
inbuf_skip();
break; /* end of case for newline */
- case '*': /* must check for possibility of being at end
- * of comment */
+ case '*':
inbuf_skip();
check_size_comment(4);
- if (*buf_ptr == '/') { /* it is the end!!! */
+ if (*buf_ptr == '/') { /* end of the comment */
end_of_comment:
inbuf_skip();
if (break_delim) {
Home |
Main Index |
Thread Index |
Old Index