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): clean up code style in compat.c



details:   https://anonhg.NetBSD.org/src/rev/92cc963b036c
branches:  trunk
changeset: 956203:92cc963b036c
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Oct 24 04:40:45 2020 +0000

description:
make(1): clean up code style in compat.c

diffstat:

 usr.bin/make/compat.c |  40 ++++++++++++++--------------------------
 1 files changed, 14 insertions(+), 26 deletions(-)

diffs (106 lines):

diff -r c3824b5d591d -r 92cc963b036c usr.bin/make/compat.c
--- a/usr.bin/make/compat.c     Sat Oct 24 04:31:53 2020 +0000
+++ b/usr.bin/make/compat.c     Sat Oct 24 04:40:45 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat.c,v 1.167 2020/10/23 19:48:17 rillig Exp $      */
+/*     $NetBSD: compat.c,v 1.168 2020/10/24 04:40:45 rillig Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -96,7 +96,7 @@
 #include "pathnames.h"
 
 /*     "@(#)compat.c   8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: compat.c,v 1.167 2020/10/23 19:48:17 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.168 2020/10/24 04:40:45 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -175,7 +175,7 @@
  *     0 if the command succeeded, 1 if an error occurred.
  */
 int
-Compat_RunCommand(const char *cmdp, struct GNode *gn)
+Compat_RunCommand(const char *cmdp, GNode *gn)
 {
     char *cmdStart;            /* Start of expanded command */
     char *bp;
@@ -412,7 +412,7 @@
     }
 
 
-    if (!WIFEXITED(reason) || (status != 0)) {
+    if (!WIFEXITED(reason) || status != 0) {
        if (errCheck) {
 #ifdef USE_META
            if (useMeta) {
@@ -421,16 +421,13 @@
 #endif
            gn->made = ERROR;
            if (keepgoing) {
-               /*
-                * Abort the current target, but let others continue.
-                */
+               /* Abort the current target, but let others continue. */
                printf(" (continuing)\n");
            } else {
                printf("\n");
            }
-           if (deleteOnError) {
-                   CompatDeleteTarget(gn);
-           }
+           if (deleteOnError)
+               CompatDeleteTarget(gn);
        } else {
            /*
             * Continue executing commands for this target.
@@ -544,12 +541,10 @@
         * Alter our type to tell if errors should be ignored or things
         * should not be printed so CompatRunCommand knows what to do.
         */
-       if (Targ_Ignore(gn)) {
+       if (Targ_Ignore(gn))
            gn->type |= OP_IGNORE;
-       }
-       if (Targ_Silent(gn)) {
+       if (Targ_Silent(gn))
            gn->type |= OP_SILENT;
-       }
 
        if (Job_CheckCommands(gn, Fatal)) {
            /*
@@ -598,10 +593,7 @@
            exit(1);
        }
     } else if (gn->made == ERROR) {
-       /*
-        * Already had an error when making this beastie. Tell the parent
-        * to abort.
-        */
+       /* Already had an error when making this. Tell the parent to abort. */
        pgn->flags &= ~(unsigned)REMAKE;
     } else {
        if (Lst_FindDatum(gn->implicitParents, pgn) != NULL) {
@@ -650,18 +642,14 @@
     if (!shellName)
        Shell_Init();
 
-    if (bmake_signal(SIGINT, SIG_IGN) != SIG_IGN) {
+    if (bmake_signal(SIGINT, SIG_IGN) != SIG_IGN)
        bmake_signal(SIGINT, CompatInterrupt);
-    }
-    if (bmake_signal(SIGTERM, SIG_IGN) != SIG_IGN) {
+    if (bmake_signal(SIGTERM, SIG_IGN) != SIG_IGN)
        bmake_signal(SIGTERM, CompatInterrupt);
-    }
-    if (bmake_signal(SIGHUP, SIG_IGN) != SIG_IGN) {
+    if (bmake_signal(SIGHUP, SIG_IGN) != SIG_IGN)
        bmake_signal(SIGHUP, CompatInterrupt);
-    }
-    if (bmake_signal(SIGQUIT, SIG_IGN) != SIG_IGN) {
+    if (bmake_signal(SIGQUIT, SIG_IGN) != SIG_IGN)
        bmake_signal(SIGQUIT, CompatInterrupt);
-    }
 
     /* Create the .END node now, to keep the (debug) output of the
      * counter.mk test the same as before 2020-09-23.  This implementation



Home | Main Index | Thread Index | Old Index