Module Name: src Committed By: rillig Date: Tue Oct 5 06:49:19 UTC 2021
Modified Files: src/usr.bin/indent: indent.c pr_comment.c Log Message: indent: fix spelling in comments To generate a diff of this commit: cvs rdiff -u -r1.101 -r1.102 src/usr.bin/indent/indent.c cvs rdiff -u -r1.51 -r1.52 src/usr.bin/indent/pr_comment.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/indent/indent.c diff -u src/usr.bin/indent/indent.c:1.101 src/usr.bin/indent/indent.c:1.102 --- src/usr.bin/indent/indent.c:1.101 Tue Oct 5 06:09:42 2021 +++ src/usr.bin/indent/indent.c Tue Oct 5 06:49:19 2021 @@ -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 @@ static char sccsid[] = "@(#)indent.c 5.1 #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 @@ process_comment_in_code(token_type ttype 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 @@ process_rparen_or_rbracket(bool *inout_s *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 @@ process_semicolon(bool *inout_scase, int } 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 @@ process_semicolon(bool *inout_scase, int 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 @@ static void 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 @@ process_lbrace(bool *inout_force_nl, boo } } 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 @@ process_period(void) { 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 Index: src/usr.bin/indent/pr_comment.c diff -u src/usr.bin/indent/pr_comment.c:1.51 src/usr.bin/indent/pr_comment.c:1.52 --- src/usr.bin/indent/pr_comment.c:1.51 Tue Oct 5 06:15:24 2021 +++ src/usr.bin/indent/pr_comment.c Tue Oct 5 06:49:19 2021 @@ -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 @@ static char sccsid[] = "@(#)pr_comment.c #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 @@ process_comment(void) 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 @@ process_comment(void) } ++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 @@ process_comment(void) 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) {