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): flatten #ifdef in InitVarMachineArch



details:   https://anonhg.NetBSD.org/src/rev/61af201cde45
branches:  trunk
changeset: 956984:61af201cde45
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Nov 13 08:21:37 2020 +0000

description:
make(1): flatten #ifdef in InitVarMachineArch

Without proper indentation, that chain of nested #ifndef directives was
really hard to read.

diffstat:

 usr.bin/make/main.c |  14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diffs (39 lines):

diff -r 42baced5a48f -r 61af201cde45 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Fri Nov 13 07:52:03 2020 +0000
+++ b/usr.bin/make/main.c       Fri Nov 13 08:21:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.456 2020/11/12 23:35:21 sjg Exp $   */
+/*     $NetBSD: main.c,v 1.457 2020/11/13 08:21:37 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.456 2020/11/12 23:35:21 sjg Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.457 2020/11/13 08:21:37 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
            "The Regents of the University of California.  "
@@ -1022,17 +1022,13 @@
 
                return machine_arch_buf;
        }
-#else
-#ifndef MACHINE_ARCH
-#ifdef MAKE_MACHINE_ARCH
+#elif defined(MACHINE_ARCH)
+       return MACHINE_ARCH;
+#elif defined(MAKE_MACHINE_ARCH)
        return MAKE_MACHINE_ARCH;
 #else
        return "unknown";
 #endif
-#else
-       return MACHINE_ARCH;
-#endif
-#endif
 }
 
 #ifndef NO_PWD_OVERRIDE



Home | Main Index | Thread Index | Old Index