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: replace 'target' with 'indent' in fun...
details: https://anonhg.NetBSD.org/src/rev/74ea459fb90d
branches: trunk
changeset: 953558:74ea459fb90d
user: rillig <rillig%NetBSD.org@localhost>
date: Fri Mar 12 23:16:00 2021 +0000
description:
indent: replace 'target' with 'indent' in function names
The word 'target' was not as specific as possible.
No functional change.
diffstat:
usr.bin/indent/indent.c | 6 +++---
usr.bin/indent/indent.h | 8 ++++----
usr.bin/indent/io.c | 20 ++++++++++----------
usr.bin/indent/pr_comment.c | 8 ++++----
4 files changed, 21 insertions(+), 21 deletions(-)
diffs (170 lines):
diff -r 0df3895b5cb9 -r 74ea459fb90d usr.bin/indent/indent.c
--- a/usr.bin/indent/indent.c Fri Mar 12 23:10:18 2021 +0000
+++ b/usr.bin/indent/indent.c Fri Mar 12 23:16:00 2021 +0000
@@ -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 @@
#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 @@
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;
}
diff -r 0df3895b5cb9 -r 74ea459fb90d usr.bin/indent/indent.h
--- a/usr.bin/indent/indent.h Fri Mar 12 23:10:18 2021 +0000
+++ b/usr.bin/indent/indent.h Fri Mar 12 23:16:00 2021 +0000
@@ -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 @@
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);
diff -r 0df3895b5cb9 -r 74ea459fb90d usr.bin/indent/io.c
--- a/usr.bin/indent/io.c Fri Mar 12 23:10:18 2021 +0000
+++ b/usr.bin/indent/io.c Fri Mar 12 23:16:00 2021 +0000
@@ -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 @@
#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 @@
#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 @@
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 @@
comment_open = 0;
output_string(".*/\n");
}
- target_col = compute_code_target();
+ target_col = compute_code_indent();
{
int i;
@@ -257,12 +257,12 @@
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 @@
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 @@
}
int
-compute_label_target(void)
+compute_label_indent(void)
{
return
ps.pcase ? (int) (case_ind * opt.ind_size) + 1
diff -r 0df3895b5cb9 -r 74ea459fb90d usr.bin/indent/pr_comment.c
--- a/usr.bin/indent/pr_comment.c Fri Mar 12 23:10:18 2021 +0000
+++ b/usr.bin/indent/pr_comment.c Fri Mar 12 23:16:00 2021 +0000
@@ -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 @@
#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 @@
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)
Home |
Main Index |
Thread Index |
Old Index