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): use postfix increment where possible



details:   https://anonhg.NetBSD.org/src/rev/df5e2f2c4991
branches:  trunk
changeset: 957082:df5e2f2c4991
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Nov 16 18:28:27 2020 +0000

description:
make(1): use postfix increment where possible

diffstat:

 usr.bin/make/job.c  |   6 +++---
 usr.bin/make/main.c |  14 +++++++-------
 usr.bin/make/str.c  |   6 +++---
 usr.bin/make/util.c |   6 +++---
 4 files changed, 16 insertions(+), 16 deletions(-)

diffs (127 lines):

diff -r 63c72d257156 -r df5e2f2c4991 usr.bin/make/job.c
--- a/usr.bin/make/job.c        Mon Nov 16 16:15:37 2020 +0000
+++ b/usr.bin/make/job.c        Mon Nov 16 18:28:27 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.325 2020/11/14 17:04:01 rillig Exp $ */
+/*     $NetBSD: job.c,v 1.326 2020/11/16 18:28:27 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -143,7 +143,7 @@
 #include "trace.h"
 
 /*     "@(#)job.c      8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.325 2020/11/14 17:04:01 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.326 2020/11/16 18:28:27 rillig Exp $");
 
 /* A shell defines how the commands are run.  All commands for a target are
  * written into a single file, which is then given to the shell to execute
@@ -1964,7 +1964,7 @@
        default:
            abort();
        }
-       --nready;
+       nready--;
     }
 
     Job_CatchChildren();
diff -r 63c72d257156 -r df5e2f2c4991 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Mon Nov 16 16:15:37 2020 +0000
+++ b/usr.bin/make/main.c       Mon Nov 16 18:28:27 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.474 2020/11/15 09:54:16 rillig Exp $        */
+/*     $NetBSD: main.c,v 1.475 2020/11/16 18:28:27 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "trace.h"
 
 /*     "@(#)main.c     8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.474 2020/11/15 09:54:16 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.475 2020/11/16 18:28:27 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
            "The Regents of the University of California.  "
@@ -276,13 +276,13 @@
                case 'g':
                        if (modules[1] == '1') {
                                debug |= DEBUG_GRAPH1;
-                               ++modules;
+                               modules++;
                        } else if (modules[1] == '2') {
                                debug |= DEBUG_GRAPH2;
-                               ++modules;
+                               modules++;
                        } else if (modules[1] == '3') {
                                debug |= DEBUG_GRAPH3;
-                               ++modules;
+                               modules++;
                        }
                        break;
                case 'h':
@@ -607,8 +607,8 @@
                arginc = 0;
                if (inOption) {
                        if (c == '\0') {
-                               ++argv;
-                               --argc;
+                               argv++;
+                               argc--;
                                inOption = FALSE;
                                continue;
                        }
diff -r 63c72d257156 -r df5e2f2c4991 usr.bin/make/str.c
--- a/usr.bin/make/str.c        Mon Nov 16 16:15:37 2020 +0000
+++ b/usr.bin/make/str.c        Mon Nov 16 18:28:27 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: str.c,v 1.73 2020/11/15 12:02:44 rillig Exp $  */
+/*     $NetBSD: str.c,v 1.74 2020/11/16 18:28:27 rillig Exp $  */
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -71,7 +71,7 @@
 #include "make.h"
 
 /*     "@(#)str.c      5.8 (Berkeley) 6/1/90"  */
-MAKE_RCSID("$NetBSD: str.c,v 1.73 2020/11/15 12:02:44 rillig Exp $");
+MAKE_RCSID("$NetBSD: str.c,v 1.74 2020/11/16 18:28:27 rillig Exp $");
 
 /* Return the concatenation of s1 and s2, freshly allocated. */
 char *
@@ -236,7 +236,7 @@
                        case '\n':
                                /* hmmm; fix it up as best we can */
                                ch = '\\';
-                               --str_p;
+                               str_p--;
                                break;
                        case 'b':
                                ch = '\b';
diff -r 63c72d257156 -r df5e2f2c4991 usr.bin/make/util.c
--- a/usr.bin/make/util.c       Mon Nov 16 16:15:37 2020 +0000
+++ b/usr.bin/make/util.c       Mon Nov 16 18:28:27 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.c,v 1.67 2020/11/08 08:53:22 rillig Exp $ */
+/*     $NetBSD: util.c,v 1.68 2020/11/16 18:29:49 rillig Exp $ */
 
 /*
  * Missing stuff from OS's
@@ -15,7 +15,7 @@
 
 #include "make.h"
 
-MAKE_RCSID("$NetBSD: util.c,v 1.67 2020/11/08 08:53:22 rillig Exp $");
+MAKE_RCSID("$NetBSD: util.c,v 1.68 2020/11/16 18:29:49 rillig Exp $");
 
 #if !defined(MAKE_NATIVE) && !defined(HAVE_STRERROR)
 extern int errno, sys_nerr;
@@ -97,7 +97,7 @@
        }
 
        if (*value == '=')                      /* no `=' in value */
-               ++value;
+               value++;
        l_value = strlen(value);
 
        /* find if already exists */



Home | Main Index | Thread Index | Old Index