Module Name:    src
Committed By:   rillig
Date:           Fri Mar 12 23:16:00 UTC 2021

Modified Files:
        src/usr.bin/indent: indent.c indent.h io.c pr_comment.c

Log Message:
indent: replace 'target' with 'indent' in function names

The word 'target' was not as specific as possible.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/indent/io.c
cvs rdiff -u -r1.19 -r1.20 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.45 src/usr.bin/indent/indent.c:1.46
--- src/usr.bin/indent/indent.c:1.45	Fri Mar 12 23:10:18 2021
+++ src/usr.bin/indent/indent.c	Fri Mar 12 23:16:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.45 2021/03/12 23:10:18 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.46 2021/03/12 23:16:00 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -46,7 +46,7 @@ static char sccsid[] = "@(#)indent.c	5.1
 #include <sys/cdefs.h>
 #ifndef lint
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.45 2021/03/12 23:10:18 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.46 2021/03/12 23:16:00 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -1150,7 +1150,7 @@ main(int argc, char **argv)
 		if (ps.block_init_level <= 0)
 		    ps.block_init = 0;
 		if (break_comma && (!opt.leave_comma ||
-		    count_spaces_until(compute_code_target(), s_code, e_code) >
+		    count_spaces_until(compute_code_indent(), s_code, e_code) >
 		    opt.max_col - opt.tabsize))
 		    force_nl = true;
 	    }

Index: src/usr.bin/indent/indent.h
diff -u src/usr.bin/indent/indent.h:1.5 src/usr.bin/indent/indent.h:1.6
--- src/usr.bin/indent/indent.h:1.5	Sun Mar  7 11:32:05 2021
+++ src/usr.bin/indent/indent.h	Fri Mar 12 23:16:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.h,v 1.5 2021/03/07 11:32:05 rillig Exp $	*/
+/*	$NetBSD: indent.h,v 1.6 2021/03/12 23:16:00 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -30,7 +30,7 @@
 
 #if 0
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.h,v 1.5 2021/03/07 11:32:05 rillig Exp $");
+__RCSID("$NetBSD: indent.h,v 1.6 2021/03/12 23:16:00 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.h 336333 2018-07-16 05:46:50Z pstef $");
 #endif
@@ -45,8 +45,8 @@ __FBSDID("$FreeBSD: head/usr.bin/indent/
 
 void	add_typename(const char *);
 void	alloc_typenames(void);
-int	compute_code_target(void);
-int	compute_label_target(void);
+int	compute_code_indent(void);
+int	compute_label_indent(void);
 int	count_spaces(int, char *);
 int	count_spaces_until(int, char *, char *);
 void	init_constant_tt(void);

Index: src/usr.bin/indent/io.c
diff -u src/usr.bin/indent/io.c:1.30 src/usr.bin/indent/io.c:1.31
--- src/usr.bin/indent/io.c:1.30	Fri Mar 12 23:10:18 2021
+++ src/usr.bin/indent/io.c	Fri Mar 12 23:16:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: io.c,v 1.30 2021/03/12 23:10:18 rillig Exp $	*/
+/*	$NetBSD: io.c,v 1.31 2021/03/12 23:16:00 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -46,7 +46,7 @@ static char sccsid[] = "@(#)io.c	8.1 (Be
 #include <sys/cdefs.h>
 #ifndef lint
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: io.c,v 1.30 2021/03/12 23:10:18 rillig Exp $");
+__RCSID("$NetBSD: io.c,v 1.31 2021/03/12 23:16:00 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/io.c 334927 2018-06-10 16:44:18Z pstef $");
 #endif
@@ -62,7 +62,7 @@ __FBSDID("$FreeBSD: head/usr.bin/indent/
 #include "indent.h"
 
 int         comment_open;
-static int  paren_target;
+static int  paren_indent;
 static int pad_output(int current, int target);
 
 static void
@@ -144,7 +144,7 @@ dump_line(void)
 	    while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t'))
 		e_lab--;
 	    *e_lab = '\0';
-	    cur_col = pad_output(1, compute_label_target());
+	    cur_col = pad_output(1, compute_label_indent());
 	    if (s_lab[0] == '#' && (strncmp(s_lab, "#else", 5) == 0
 				    || strncmp(s_lab, "#endif", 6) == 0)) {
 		char *s = s_lab;
@@ -179,7 +179,7 @@ dump_line(void)
 		comment_open = 0;
 		output_string(".*/\n");
 	    }
-	    target_col = compute_code_target();
+	    target_col = compute_code_indent();
 	    {
 		int i;
 
@@ -257,12 +257,12 @@ dump_line(void)
     ps.ind_level = ps.i_l_follow;
     ps.paren_level = ps.p_l_follow;
     if (ps.paren_level > 0)
-	paren_target = -ps.paren_indents[ps.paren_level - 1];
+	paren_indent = -ps.paren_indents[ps.paren_level - 1];
     not_first_line = 1;
 }
 
 int
-compute_code_target(void)
+compute_code_indent(void)
 {
     int target_col = opt.ind_size * ps.ind_level + 1;
 
@@ -271,10 +271,10 @@ compute_code_target(void)
 	    target_col += opt.continuation_indent *
 		(2 * opt.continuation_indent == opt.ind_size ? 1 : ps.paren_level);
 	else if (opt.lineup_to_parens_always)
-	    target_col = paren_target;
+	    target_col = paren_indent;
 	else {
 	    int w;
-	    int t = paren_target;
+	    int t = paren_indent;
 
 	    if ((w = count_spaces(t, s_code) - opt.max_col) > 0
 		    && count_spaces(target_col, s_code) <= opt.max_col) {
@@ -290,7 +290,7 @@ compute_code_target(void)
 }
 
 int
-compute_label_target(void)
+compute_label_indent(void)
 {
     return
 	ps.pcase ? (int) (case_ind * opt.ind_size) + 1

Index: src/usr.bin/indent/pr_comment.c
diff -u src/usr.bin/indent/pr_comment.c:1.19 src/usr.bin/indent/pr_comment.c:1.20
--- src/usr.bin/indent/pr_comment.c:1.19	Fri Mar 12 23:10:18 2021
+++ src/usr.bin/indent/pr_comment.c	Fri Mar 12 23:16:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pr_comment.c,v 1.19 2021/03/12 23:10:18 rillig Exp $	*/
+/*	$NetBSD: pr_comment.c,v 1.20 2021/03/12 23:16:00 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -46,7 +46,7 @@ static char sccsid[] = "@(#)pr_comment.c
 #include <sys/cdefs.h>
 #ifndef lint
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: pr_comment.c,v 1.19 2021/03/12 23:10:18 rillig Exp $");
+__RCSID("$NetBSD: pr_comment.c,v 1.20 2021/03/12 23:16:00 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/pr_comment.c 334927 2018-06-10 16:44:18Z pstef $");
 #endif
@@ -162,11 +162,11 @@ pr_comment(void)
 	    int target_col;
 	    break_delim = false;
 	    if (s_code != e_code)
-		target_col = count_spaces(compute_code_target(), s_code);
+		target_col = count_spaces(compute_code_indent(), s_code);
 	    else {
 		target_col = 1;
 		if (s_lab != e_lab)
-		    target_col = count_spaces(compute_label_target(), s_lab);
+		    target_col = count_spaces(compute_label_indent(), s_lab);
 	    }
 	    ps.com_col = ps.decl_on_line || ps.ind_level == 0 ? opt.decl_com_ind : opt.com_ind;
 	    if (ps.com_col <= target_col)

Reply via email to