Module Name:    src
Committed By:   rillig
Date:           Mon May 15 13:37:16 UTC 2023

Modified Files:
        src/usr.bin/indent: debug.c indent.c io.c lexi.c

Log Message:
indent: indent multi-line conditions

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/indent/debug.c
cvs rdiff -u -r1.276 -r1.277 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.169 -r1.170 src/usr.bin/indent/io.c
cvs rdiff -u -r1.188 -r1.189 src/usr.bin/indent/lexi.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/debug.c
diff -u src/usr.bin/indent/debug.c:1.7 src/usr.bin/indent/debug.c:1.8
--- src/usr.bin/indent/debug.c:1.7	Mon May 15 09:00:51 2023
+++ src/usr.bin/indent/debug.c	Mon May 15 13:37:16 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: debug.c,v 1.7 2023/05/15 09:00:51 rillig Exp $	*/
+/*	$NetBSD: debug.c,v 1.8 2023/05/15 13:37:16 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: debug.c,v 1.7 2023/05/15 09:00:51 rillig Exp $");
+__RCSID("$NetBSD: debug.c,v 1.8 2023/05/15 13:37:16 rillig Exp $");
 
 #include <stdarg.h>
 
@@ -210,8 +210,8 @@ ps_paren_has_changed(const struct parser
 
     for (int i = 0; i < ps.nparen; i++) {
 	if (curr[i].indent != prev[i].indent ||
-	    curr[i].maybe_cast != prev[i].maybe_cast ||
-	    curr[i].no_cast != prev[i].no_cast)
+		curr[i].maybe_cast != prev[i].maybe_cast ||
+		curr[i].no_cast != prev[i].no_cast)
 	    return true;
     }
     return false;

Index: src/usr.bin/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.276 src/usr.bin/indent/indent.c:1.277
--- src/usr.bin/indent/indent.c:1.276	Mon May 15 13:33:19 2023
+++ src/usr.bin/indent/indent.c	Mon May 15 13:37:16 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.276 2023/05/15 13:33:19 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.277 2023/05/15 13:37:16 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: indent.c,v 1.276 2023/05/15 13:33:19 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.277 2023/05/15 13:37:16 rillig Exp $");
 
 #include <sys/param.h>
 #include <err.h>
@@ -372,8 +372,8 @@ static void
 process_newline(void)
 {
     if (ps.prev_token == lsym_comma && ps.nparen == 0 && !ps.block_init &&
-	!opt.break_after_comma && break_comma &&
-	com.len == 0)
+	    !opt.break_after_comma && break_comma &&
+	    com.len == 0)
 	goto stay_in_line;
 
     output_line();
@@ -465,7 +465,7 @@ process_rparen_or_rbracket(void)
     }
 
     if (ps.paren[ps.nparen - 1].maybe_cast &&
-	!ps.paren[ps.nparen - 1].no_cast) {
+	    !ps.paren[ps.nparen - 1].no_cast) {
 	ps.next_unary = true;
 	ps.paren[ps.nparen - 1].maybe_cast = false;
 	ps.want_blank = opt.space_after_cast;
@@ -508,7 +508,7 @@ static void
 process_unary_op(void)
 {
     if (!ps.decl_indent_done && ps.in_decl && !ps.block_init &&
-	!ps.is_function_definition && ps.line_start_nparen == 0) {
+	    !ps.is_function_definition && ps.line_start_nparen == 0) {
 	/* pointer declarations */
 	code_add_decl_indent(ps.decl_ind - (int)token.len, ps.tabs_to_var);
 	ps.decl_indent_done = true;
@@ -598,7 +598,7 @@ process_semicolon(void)
     ps.declaration = ps.declaration == decl_begin ? decl_end : decl_no;
 
     if (ps.in_decl && code.len == 0 && !ps.block_init &&
-	!ps.decl_indent_done && ps.line_start_nparen == 0) {
+	    !ps.decl_indent_done && ps.line_start_nparen == 0) {
 	/* indent stray semicolons in declarations */
 	code_add_decl_indent(ps.decl_ind - 1, ps.tabs_to_var);
 	ps.decl_indent_done = true;
@@ -958,11 +958,11 @@ process_preprocessing(void)
 
     } else {
 	if (!substring_equals(dir, "pragma") &&
-	    !substring_equals(dir, "error") &&
-	    !substring_equals(dir, "line") &&
-	    !substring_equals(dir, "undef") &&
-	    !substring_equals(dir, "define") &&
-	    !substring_equals(dir, "include")) {
+		!substring_equals(dir, "error") &&
+		!substring_equals(dir, "line") &&
+		!substring_equals(dir, "undef") &&
+		!substring_equals(dir, "define") &&
+		!substring_equals(dir, "include")) {
 	    diag(1, "Unrecognized cpp directive \"%.*s\"",
 		(int)(dir.e - dir.s), dir.s);
 	    return;

Index: src/usr.bin/indent/io.c
diff -u src/usr.bin/indent/io.c:1.169 src/usr.bin/indent/io.c:1.170
--- src/usr.bin/indent/io.c:1.169	Mon May 15 13:33:19 2023
+++ src/usr.bin/indent/io.c	Mon May 15 13:37:16 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: io.c,v 1.169 2023/05/15 13:33:19 rillig Exp $	*/
+/*	$NetBSD: io.c,v 1.170 2023/05/15 13:37:16 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: io.c,v 1.169 2023/05/15 13:33:19 rillig Exp $");
+__RCSID("$NetBSD: io.c,v 1.170 2023/05/15 13:37:16 rillig Exp $");
 
 #include <stdio.h>
 #include <string.h>
@@ -255,7 +255,7 @@ output_complete_line(char line_terminato
 	    ps.in_stmt_cont = false;	/* this is a class A kludge */
 
 	if (opt.blank_line_after_decl && ps.declaration == decl_end
-	    && ps.tos > 1) {
+		&& ps.tos > 1) {
 	    ps.declaration = decl_no;
 	    ps.blank_line_after_decl = true;
 	}

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.188 src/usr.bin/indent/lexi.c:1.189
--- src/usr.bin/indent/lexi.c:1.188	Mon May 15 09:22:53 2023
+++ src/usr.bin/indent/lexi.c	Mon May 15 13:37:16 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.188 2023/05/15 09:22:53 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.189 2023/05/15 13:37:16 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: lexi.c,v 1.188 2023/05/15 09:22:53 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.189 2023/05/15 13:37:16 rillig Exp $");
 
 #include <stdlib.h>
 #include <string.h>
@@ -295,7 +295,7 @@ static bool
 is_typename(void)
 {
     if (opt.auto_typedefs &&
-	token.len >= 2 && memcmp(token.mem + token.len - 2, "_t", 2) == 0)
+	    token.len >= 2 && memcmp(token.mem + token.len - 2, "_t", 2) == 0)
 	return true;
 
     return bsearch_typenames(token.st) >= 0;
@@ -414,7 +414,7 @@ found_typename:
     }
 
     if (inp_peek() == '(' && ps.tos <= 1 && ps.ind_level == 0 &&
-	!ps.in_func_def_params && !ps.block_init) {
+	    !ps.in_func_def_params && !ps.block_init) {
 
 	if (ps.nparen == 0 && probably_looking_at_definition()) {
 	    ps.is_function_definition = true;

Reply via email to