indent: remove redundant parentheses

No functional change.
This commit is contained in:
rillig 2021-03-13 11:27:01 +00:00
parent 0a99ae80ca
commit acec5beac9
3 changed files with 22 additions and 24 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: indent.c,v 1.51 2021/03/13 11:19:43 rillig Exp $ */
/* $NetBSD: indent.c,v 1.52 2021/03/13 11:27:01 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-4-Clause
@ -46,7 +46,7 @@ static char sccsid[] = "@(#)indent.c 5.17 (Berkeley) 6/7/93";
#include <sys/cdefs.h>
#ifndef lint
#if defined(__NetBSD__)
__RCSID("$NetBSD: indent.c,v 1.51 2021/03/13 11:19:43 rillig Exp $");
__RCSID("$NetBSD: indent.c,v 1.52 2021/03/13 11:27:01 rillig Exp $");
#elif defined(__FreeBSD__)
__FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
#endif
@ -604,12 +604,12 @@ main(int argc, char **argv)
exit(found_err);
}
if (
(type_code != comment) &&
(type_code != newline) &&
(type_code != preprocessing) &&
(type_code != form_feed)) {
type_code != comment &&
type_code != newline &&
type_code != preprocessing &&
type_code != form_feed) {
if (force_nl &&
(type_code != semicolon) &&
type_code != semicolon &&
(type_code != lbrace || !opt.btype_2)) {
/* we should force a broken line here */
if (opt.verbose)
@ -1159,9 +1159,7 @@ main(int argc, char **argv)
break;
case preprocessing: /* '#' */
if ((s_com != e_com) ||
(s_lab != e_lab) ||
(s_code != e_code))
if (s_com != e_com || s_lab != e_lab || s_code != e_code)
dump_line();
check_size_label(1);
*e_lab++ = '#'; /* move whole line to 'label' buffer */

View File

@ -1,4 +1,4 @@
/* $NetBSD: lexi.c,v 1.39 2021/03/13 09:21:57 rillig Exp $ */
/* $NetBSD: lexi.c,v 1.40 2021/03/13 11:27:01 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-4-Clause
@ -46,7 +46,7 @@ static char sccsid[] = "@(#)lexi.c 8.1 (Berkeley) 6/6/93";
#include <sys/cdefs.h>
#ifndef lint
#if defined(__NetBSD__)
__RCSID("$NetBSD: lexi.c,v 1.39 2021/03/13 09:21:57 rillig Exp $");
__RCSID("$NetBSD: lexi.c,v 1.40 2021/03/13 11:27:01 rillig Exp $");
#elif defined(__FreeBSD__)
__FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
#endif
@ -502,14 +502,14 @@ stop_lit:
code = ident;
break;
case ('('):
case ('['):
case '(':
case '[':
unary_delim = true;
code = lparen;
break;
case (')'):
case (']'):
case ')':
case ']':
code = rparen;
break;
@ -523,17 +523,17 @@ stop_lit:
code = question;
break;
case (':'):
case ':':
code = colon;
unary_delim = true;
break;
case (';'):
case ';':
unary_delim = true;
code = semicolon;
break;
case ('{'):
case '{':
unary_delim = true;
/*
@ -543,7 +543,7 @@ stop_lit:
code = lbrace;
break;
case ('}'):
case '}':
unary_delim = true;
/* ? code = state->block_init ? rparen : rbrace; */
code = rbrace;
@ -556,7 +556,7 @@ stop_lit:
code = form_feed;
break;
case (','):
case ',':
unary_delim = true;
code = comma;
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pr_comment.c,v 1.26 2021/03/13 11:19:43 rillig Exp $ */
/* $NetBSD: pr_comment.c,v 1.27 2021/03/13 11:27:01 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-4-Clause
@ -46,7 +46,7 @@ static char sccsid[] = "@(#)pr_comment.c 8.1 (Berkeley) 6/6/93";
#include <sys/cdefs.h>
#ifndef lint
#if defined(__NetBSD__)
__RCSID("$NetBSD: pr_comment.c,v 1.26 2021/03/13 11:19:43 rillig Exp $");
__RCSID("$NetBSD: pr_comment.c,v 1.27 2021/03/13 11:27:01 rillig Exp $");
#elif defined(__FreeBSD__)
__FBSDID("$FreeBSD: head/usr.bin/indent/pr_comment.c 334927 2018-06-10 16:44:18Z pstef $");
#endif
@ -147,7 +147,7 @@ pr_comment(void)
* is nonzero (the default). */
break_delim = false;
}
if ( /* ps.bl_line && */ (s_lab == e_lab) && (s_code == e_code)) {
if ( /* ps.bl_line && */ s_lab == e_lab && s_code == e_code) {
/* klg: check only if this line is blank */
/*
* If this (*and previous lines are*) blank, dont put comment way