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: use consistent indentation for statements...



details:   https://anonhg.NetBSD.org/src/rev/411bd6cec671
branches:  trunk
changeset: 1027683:411bd6cec671
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Dec 15 12:24:13 2021 +0000

description:
make: use consistent indentation for statements and continuations

No binary change, except for line numbers in assertions in suff.c.

diffstat:

 usr.bin/make/arch.c   |  25 +++++++++++++------------
 usr.bin/make/compat.c |   8 ++++----
 usr.bin/make/cond.c   |  13 ++++++-------
 usr.bin/make/dir.c    |  21 +++++++++++----------
 usr.bin/make/hash.c   |   6 +++---
 usr.bin/make/job.c    |   6 +++---
 usr.bin/make/job.h    |  11 +++++------
 usr.bin/make/lst.h    |   8 +++++---
 usr.bin/make/main.c   |  15 ++++++++-------
 usr.bin/make/suff.c   |   7 +++----
 usr.bin/make/util.c   |  36 ++++++++++++++++++------------------
 11 files changed, 79 insertions(+), 77 deletions(-)

diffs (truncated from 520 to 300 lines):

diff -r 1860a034ae9c -r 411bd6cec671 usr.bin/make/arch.c
--- a/usr.bin/make/arch.c       Wed Dec 15 12:08:25 2021 +0000
+++ b/usr.bin/make/arch.c       Wed Dec 15 12:24:13 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arch.c,v 1.207 2021/12/12 23:47:21 rillig Exp $        */
+/*     $NetBSD: arch.c,v 1.208 2021/12/15 12:24:13 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -126,7 +126,7 @@
 #include "config.h"
 
 /*     "@(#)arch.c     8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: arch.c,v 1.207 2021/12/12 23:47:21 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.208 2021/12/15 12:24:13 rillig Exp $");
 
 typedef struct List ArchList;
 typedef struct ListNode ArchListNode;
@@ -287,8 +287,8 @@
                 */
                if (*cp == '\0') {
                        Parse_Error(PARSE_FATAL,
-                                   "No closing parenthesis "
-                                   "in archive specification");
+                           "No closing parenthesis "
+                           "in archive specification");
                        return false;
                }
 
@@ -625,7 +625,7 @@
 
                if (ar->fnametab != NULL) {
                        DEBUG0(ARCH,
-                              "Attempted to redefine an SVR4 name table\n");
+                           "Attempted to redefine an SVR4 name table\n");
                        return -1;
                }
 
@@ -646,8 +646,9 @@
                                entry++;
                                *ptr = '\0';
                        }
-               DEBUG1(ARCH, "Found svr4 archive name table with %lu entries\n",
-                      (unsigned long)entry);
+               DEBUG1(ARCH,
+                   "Found svr4 archive name table with %lu entries\n",
+                   (unsigned long)entry);
                return 0;
        }
 
@@ -661,7 +662,7 @@
        }
        if (entry >= ar->fnamesize) {
                DEBUG2(ARCH, "SVR4 entry offset %s is greater than %lu\n",
-                      inout_name, (unsigned long)ar->fnamesize);
+                   inout_name, (unsigned long)ar->fnamesize);
                return 2;
        }
 
@@ -762,9 +763,9 @@
                }
 
                DEBUG5(ARCH, "Reading archive %s member %.*s mtime %.*s\n",
-                      archive,
-                      (int)sizeof out_arh->ar_name, out_arh->ar_name,
-                      (int)sizeof out_arh->ar_date, out_arh->ar_date);
+                   archive,
+                   (int)sizeof out_arh->ar_name, out_arh->ar_name,
+                   (int)sizeof out_arh->ar_date, out_arh->ar_date);
 
                if (ArchiveMember_HasName(out_arh, member, len)) {
                        /*
@@ -865,7 +866,7 @@
        struct ar_hdr arh;
 
        f = ArchFindMember(GNode_VarArchive(gn), GNode_VarMember(gn), &arh,
-                          "r+");
+           "r+");
        if (f == NULL)
                return;
 
diff -r 1860a034ae9c -r 411bd6cec671 usr.bin/make/compat.c
--- a/usr.bin/make/compat.c     Wed Dec 15 12:08:25 2021 +0000
+++ b/usr.bin/make/compat.c     Wed Dec 15 12:24:13 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat.c,v 1.230 2021/12/15 10:04:49 rillig Exp $      */
+/*     $NetBSD: compat.c,v 1.231 2021/12/15 12:24:13 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.230 2021/12/15 10:04:49 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.231 2021/12/15 12:24:13 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -404,7 +404,7 @@
                status = WEXITSTATUS(reason);   /* exited */
 #if defined(USE_META) && defined(USE_FILEMON_ONCE)
                if (useMeta) {
-                   meta_cmd_finish(NULL);
+                       meta_cmd_finish(NULL);
                }
 #endif
                if (status != 0) {
@@ -734,7 +734,7 @@
                        printf("`%s' is up to date.\n", gn->name);
                } else if (gn->made == ABORTED) {
                        printf("`%s' not remade because of errors.\n",
-                              gn->name);
+                           gn->name);
                }
                if (GNode_IsError(gn) && errorNode == NULL)
                        errorNode = gn;
diff -r 1860a034ae9c -r 411bd6cec671 usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Wed Dec 15 12:08:25 2021 +0000
+++ b/usr.bin/make/cond.c       Wed Dec 15 12:24:13 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.304 2021/12/13 07:47:07 rillig Exp $        */
+/*     $NetBSD: cond.c,v 1.305 2021/12/15 12:24:13 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -95,7 +95,7 @@
 #include "dir.h"
 
 /*     "@(#)cond.c     8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: cond.c,v 1.304 2021/12/13 07:47:07 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.305 2021/12/15 12:24:13 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -317,7 +317,7 @@
 
        path = Dir_FindFile(arg, &dirSearchPath);
        DEBUG2(COND, "exists(%s) result is \"%s\"\n",
-              arg, path != NULL ? path : "");
+           arg, path != NULL ? path : "");
        result = path != NULL;
        free(path);
        return result;
@@ -1212,7 +1212,7 @@
                        } else {
                                if (state & IFS_SEEN_ELSE)
                                        Parse_Error(PARSE_WARNING,
-                                                   "extra else");
+                                           "extra else");
                                state = IFS_WAS_ACTIVE | IFS_SEEN_ELSE;
                        }
                        cond_states[cond_depth] = state;
@@ -1261,8 +1261,7 @@
                         */
                        cond_states_cap += 32;
                        cond_states = bmake_realloc(cond_states,
-                                                   cond_states_cap *
-                                                   sizeof *cond_states);
+                           cond_states_cap * sizeof *cond_states);
                }
                state = cond_states[cond_depth];
                cond_depth++;
@@ -1301,7 +1300,7 @@
 
        if (open_conds != 0 || saved_depth > cond_depth) {
                Parse_Error(PARSE_FATAL, "%u open conditional%s",
-                           open_conds, open_conds == 1 ? "" : "s");
+                   open_conds, open_conds == 1 ? "" : "s");
                cond_depth = cond_min_depth;
        }
 
diff -r 1860a034ae9c -r 411bd6cec671 usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Wed Dec 15 12:08:25 2021 +0000
+++ b/usr.bin/make/dir.c        Wed Dec 15 12:24:13 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.275 2021/11/28 21:46:17 rillig Exp $ */
+/*     $NetBSD: dir.c,v 1.276 2021/12/15 12:24:13 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -138,7 +138,7 @@
 #include "job.h"
 
 /*     "@(#)dir.c      8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: dir.c,v 1.275 2021/11/28 21:46:17 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.276 2021/12/15 12:24:13 rillig Exp $");
 
 /*
  * A search path is a list of CachedDir structures. A CachedDir has in it the
@@ -672,8 +672,8 @@
 
                {
                        char *fullName = isDot
-                                        ? bmake_strdup(base)
-                                        : str_concat3(dirName, "/", base);
+                           ? bmake_strdup(base)
+                           : str_concat3(dirName, "/", base);
                        Lst_Append(expansions, fullName);
                }
        }
@@ -792,7 +792,7 @@
                size_t piece_len = (size_t)(piece_end - piece);
 
                char *file = concat3(prefix, prefix_len, piece, piece_len,
-                                    suffix, suffix_len);
+                   suffix, suffix_len);
 
                if (contains_wildcard(file)) {
                        SearchPath_Expand(path, file, expansions);
@@ -984,8 +984,9 @@
 DirLookupSubdir(CachedDir *dir, const char *name)
 {
        struct cached_stat cst;
-       char *file = dir == dot ? bmake_strdup(name)
-                               : str_concat3(dir->name, "/", name);
+       char *file = dir == dot
+           ? bmake_strdup(name)
+           : str_concat3(dir->name, "/", name);
 
        DEBUG1(DIR, "checking %s ...\n", file);
 
@@ -1424,9 +1425,9 @@
        gn->path = bmake_strdup(fullName);
        if (!Job_RunTarget(".STALE", gn->fname))
                fprintf(stdout, /* XXX: Why stdout? */
-                       "%s: %s, %d: ignoring stale %s for %s, found %s\n",
-                       progname, gn->fname, gn->lineno,
-                       makeDependfile, gn->name, fullName);
+                   "%s: %s, %d: ignoring stale %s for %s, found %s\n",
+                   progname, gn->fname, gn->lineno,
+                   makeDependfile, gn->name, fullName);
 
        return fullName;
 }
diff -r 1860a034ae9c -r 411bd6cec671 usr.bin/make/hash.c
--- a/usr.bin/make/hash.c       Wed Dec 15 12:08:25 2021 +0000
+++ b/usr.bin/make/hash.c       Wed Dec 15 12:24:13 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hash.c,v 1.67 2021/12/15 10:07:53 rillig Exp $ */
+/*     $NetBSD: hash.c,v 1.68 2021/12/15 12:24:13 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -74,7 +74,7 @@
 #include "make.h"
 
 /*     "@(#)hash.c     8.1 (Berkeley) 6/6/93"  */
-MAKE_RCSID("$NetBSD: hash.c,v 1.67 2021/12/15 10:07:53 rillig Exp $");
+MAKE_RCSID("$NetBSD: hash.c,v 1.68 2021/12/15 12:24:13 rillig Exp $");
 
 /*
  * The ratio of # entries to # buckets at which we rebuild the table to
@@ -360,5 +360,5 @@
 HashTable_DebugStats(HashTable *t, const char *name)
 {
        DEBUG4(HASH, "HashTable %s: size=%u numEntries=%u maxchain=%u\n",
-              name, t->bucketsSize, t->numEntries, t->maxchain);
+           name, t->bucketsSize, t->numEntries, t->maxchain);
 }
diff -r 1860a034ae9c -r 411bd6cec671 usr.bin/make/job.c
--- a/usr.bin/make/job.c        Wed Dec 15 12:08:25 2021 +0000
+++ b/usr.bin/make/job.c        Wed Dec 15 12:24:13 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.441 2021/12/15 10:04:49 rillig Exp $ */
+/*     $NetBSD: job.c,v 1.442 2021/12/15 12:24:13 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -142,7 +142,7 @@
 #include "trace.h"
 
 /*     "@(#)job.c      8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.441 2021/12/15 10:04:49 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.442 2021/12/15 12:24:13 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -2818,7 +2818,7 @@
        JobSigLock(&mask);
        fd = mkTempFile(pattern, tfile, tfile_sz);
        if (tfile != NULL && !DEBUG(SCRIPT))
-           unlink(tfile);
+               unlink(tfile);
        JobSigUnlock(&mask);
 
        return fd;
diff -r 1860a034ae9c -r 411bd6cec671 usr.bin/make/job.h
--- a/usr.bin/make/job.h        Wed Dec 15 12:08:25 2021 +0000
+++ b/usr.bin/make/job.h        Wed Dec 15 12:24:13 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.h,v 1.75 2021/12/15 12:08:25 rillig Exp $  */
+/*     $NetBSD: job.h,v 1.76 2021/12/15 12:24:13 rillig Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -92,16 +92,15 @@
 #define pollfd emul_pollfd
 
 struct emul_pollfd {



Home | Main Index | Thread Index | Old Index