Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): remove unnecessary UNCONST



details:   https://anonhg.NetBSD.org/src/rev/bf1574480dfc
branches:  trunk
changeset: 1012027:bf1574480dfc
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jul 19 22:22:01 2020 +0000

description:
make(1): remove unnecessary UNCONST

diffstat:

 usr.bin/make/var.c |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (68 lines):

diff -r 57f98b9f8d63 -r bf1574480dfc usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sun Jul 19 22:04:27 2020 +0000
+++ b/usr.bin/make/var.c        Sun Jul 19 22:22:01 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.276 2020/07/19 22:04:27 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.277 2020/07/19 22:22:01 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.276 2020/07/19 22:04:27 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.277 2020/07/19 22:22:01 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c      8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.276 2020/07/19 22:04:27 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.277 2020/07/19 22:22:01 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1225,7 +1225,7 @@
  *
  *-----------------------------------------------------------------------
  */
-static char *
+static const char *
 Str_SYSVMatch(const char *word, const char *pattern, size_t *len,
     Boolean *hasPercent)
 {
@@ -1237,7 +1237,7 @@
     if (*p == '\0') {
        /* Null pattern is the whole string */
        *len = strlen(w);
-       return UNCONST(w);
+       return w;
     }
 
     if ((m = strchr(p, '%')) != NULL) {
@@ -1256,19 +1256,19 @@
        if (*++p == '\0') {
            /* No more pattern, return the rest of the string */
            *len = strlen(w);
-           return UNCONST(w);
+           return w;
        }
     }
 
     m = w;
 
     /* Find a matching tail */
-    do
+    do {
        if (strcmp(p, w) == 0) {
            *len = w - m;
-           return UNCONST(m);
+           return m;
        }
-    while (*w++ != '\0');
+    } while (*w++ != '\0');
 
     return NULL;
 }



Home | Main Index | Thread Index | Old Index