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: constify detection of function names



details:   https://anonhg.NetBSD.org/src/rev/6c90508dda10
branches:  trunk
changeset: 1024045:6c90508dda10
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Oct 08 19:22:19 2021 +0000

description:
indent: constify detection of function names

No functional change.

diffstat:

 usr.bin/indent/lexi.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 00711f369020 -r 6c90508dda10 usr.bin/indent/lexi.c
--- a/usr.bin/indent/lexi.c     Fri Oct 08 19:03:34 2021 +0000
+++ b/usr.bin/indent/lexi.c     Fri Oct 08 19:22:19 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lexi.c,v 1.79 2021/10/08 16:20:33 rillig Exp $ */
+/*     $NetBSD: lexi.c,v 1.80 2021/10/08 19:22:19 rillig Exp $ */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.79 2021/10/08 16:20:33 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.80 2021/10/08 19:22:19 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -479,8 +479,8 @@
        if (*inp.s == '(' && state->tos <= 1 && state->ind_level == 0 &&
            !state->in_parameter_declaration && !state->block_init) {
 
-           for (char *tp = inp.s; tp < inp.e;)
-               if (*tp++ == ')' && (*tp == ';' || *tp == ','))
+           for (const char *p = inp.s; p < inp.e;)
+               if (*p++ == ')' && (*p == ';' || *p == ','))
                    goto not_proc;
 
            strncpy(state->procname, token.s, sizeof state->procname - 1);



Home | Main Index | Thread Index | Old Index