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): indent some functions in make.c with t...
details: https://anonhg.NetBSD.org/src/rev/cff6f3b560c3
branches: trunk
changeset: 946363:cff6f3b560c3
user: rillig <rillig%NetBSD.org@localhost>
date: Tue Nov 24 23:13:09 2020 +0000
description:
make(1): indent some functions in make.c with tabs instead of spaces
diffstat:
usr.bin/make/make.c | 317 ++++++++++++++++++++++++++-------------------------
1 files changed, 162 insertions(+), 155 deletions(-)
diffs (truncated from 478 to 300 lines):
diff -r 193b8f4b9786 -r cff6f3b560c3 usr.bin/make/make.c
--- a/usr.bin/make/make.c Tue Nov 24 22:58:54 2020 +0000
+++ b/usr.bin/make/make.c Tue Nov 24 23:13:09 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: make.c,v 1.216 2020/11/24 22:58:54 rillig Exp $ */
+/* $NetBSD: make.c,v 1.217 2020/11/24 23:13:09 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -102,7 +102,7 @@
#include "job.h"
/* "@(#)make.c 8.1 (Berkeley) 6/6/93" */
-MAKE_RCSID("$NetBSD: make.c,v 1.216 2020/11/24 22:58:54 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.217 2020/11/24 23:13:09 rillig Exp $");
/* Sequence # to detect recursion. */
static unsigned int checked_seqno = 1;
@@ -116,21 +116,22 @@
void
debug_printf(const char *fmt, ...)
{
- va_list args;
+ va_list args;
- va_start(args, fmt);
- vfprintf(opts.debug_file, fmt, args);
- va_end(args);
+ va_start(args, fmt);
+ vfprintf(opts.debug_file, fmt, args);
+ va_end(args);
}
MAKE_ATTR_DEAD static void
make_abort(GNode *gn, int line)
{
- debug_printf("make_abort from line %d\n", line);
- Targ_PrintNode(gn, 2);
- Targ_PrintNodes(toBeMade, 2);
- Targ_PrintGraph(3);
- abort();
+
+ debug_printf("make_abort from line %d\n", line);
+ Targ_PrintNode(gn, 2);
+ Targ_PrintNodes(toBeMade, 2);
+ Targ_PrintGraph(3);
+ abort();
}
ENUM_VALUE_RTTI_8(GNodeMade,
@@ -173,42 +174,44 @@
Boolean
GNode_ShouldExecute(GNode *gn)
{
- return !((gn->type & OP_MAKE) ? opts.noRecursiveExecute : opts.noExecute);
+ return !((gn->type & OP_MAKE)
+ ? opts.noRecursiveExecute
+ : opts.noExecute);
}
/* Update the youngest child of the node, according to the given child. */
void
GNode_UpdateYoungestChild(GNode *gn, GNode *cgn)
{
- if (gn->youngestChild == NULL || cgn->mtime > gn->youngestChild->mtime)
- gn->youngestChild = cgn;
+ if (gn->youngestChild == NULL || cgn->mtime > gn->youngestChild->mtime)
+ gn->youngestChild = cgn;
}
static Boolean
IsOODateRegular(GNode *gn)
{
- /* These rules are inherited from the original Make. */
+ /* These rules are inherited from the original Make. */
- if (gn->youngestChild != NULL) {
- if (gn->mtime < gn->youngestChild->mtime) {
- DEBUG1(MAKE, "modified before source \"%s\"...",
- GNode_Path(gn->youngestChild));
- return TRUE;
+ if (gn->youngestChild != NULL) {
+ if (gn->mtime < gn->youngestChild->mtime) {
+ DEBUG1(MAKE, "modified before source \"%s\"...",
+ GNode_Path(gn->youngestChild));
+ return TRUE;
+ }
+ return FALSE;
}
- return FALSE;
- }
- if (gn->mtime == 0 && !(gn->type & OP_OPTIONAL)) {
- DEBUG0(MAKE, "non-existent and no sources...");
- return TRUE;
- }
+ if (gn->mtime == 0 && !(gn->type & OP_OPTIONAL)) {
+ DEBUG0(MAKE, "non-existent and no sources...");
+ return TRUE;
+ }
- if (gn->type & OP_DOUBLEDEP) {
- DEBUG0(MAKE, ":: operator and no sources...");
- return TRUE;
- }
+ if (gn->type & OP_DOUBLEDEP) {
+ DEBUG0(MAKE, ":: operator and no sources...");
+ return TRUE;
+ }
- return FALSE;
+ return FALSE;
}
/* See if the node is out of date with respect to its sources.
@@ -336,15 +339,16 @@
static void
PretendAllChildrenAreMade(GNode *pgn)
{
- GNodeListNode *ln;
+ GNodeListNode *ln;
- for (ln = pgn->children->first; ln != NULL; ln = ln->next) {
- GNode *cgn = ln->datum;
+ for (ln = pgn->children->first; ln != NULL; ln = ln->next) {
+ GNode *cgn = ln->datum;
- Dir_UpdateMTime(cgn, FALSE); /* cgn->path may get updated as well */
- GNode_UpdateYoungestChild(pgn, cgn);
- pgn->unmade--;
- }
+ /* This may also update cgn->path. */
+ Dir_UpdateMTime(cgn, FALSE);
+ GNode_UpdateYoungestChild(pgn, cgn);
+ pgn->unmade--;
+ }
}
/* Called by Make_Run and SuffApplyTransform on the downward pass to handle
@@ -452,11 +456,11 @@
static void
HandleUseNodes(GNode *gn)
{
- GNodeListNode *ln, *nln;
- for (ln = gn->children->first; ln != NULL; ln = nln) {
- nln = ln->next;
- MakeHandleUse(ln->datum, gn, ln);
- }
+ GNodeListNode *ln, *nln;
+ for (ln = gn->children->first; ln != NULL; ln = nln) {
+ nln = ln->next;
+ MakeHandleUse(ln->datum, gn, ln);
+ }
}
@@ -543,36 +547,37 @@
static void
UpdateImplicitParentsVars(GNode *cgn, const char *cname)
{
- GNodeListNode *ln;
- const char *cpref = GNode_VarPrefix(cgn);
+ GNodeListNode *ln;
+ const char *cpref = GNode_VarPrefix(cgn);
- for (ln = cgn->implicitParents->first; ln != NULL; ln = ln->next) {
- GNode *pgn = ln->datum;
- if (pgn->flags & REMAKE) {
- Var_Set(IMPSRC, cname, pgn);
- if (cpref != NULL)
- Var_Set(PREFIX, cpref, pgn);
+ for (ln = cgn->implicitParents->first; ln != NULL; ln = ln->next) {
+ GNode *pgn = ln->datum;
+ if (pgn->flags & REMAKE) {
+ Var_Set(IMPSRC, cname, pgn);
+ if (cpref != NULL)
+ Var_Set(PREFIX, cpref, pgn);
+ }
}
- }
}
/* See if a .ORDER rule stops us from building this node. */
static Boolean
IsWaitingForOrder(GNode *gn)
{
- GNodeListNode *ln;
+ GNodeListNode *ln;
- for (ln = gn->order_pred->first; ln != NULL; ln = ln->next) {
- GNode *ogn = ln->datum;
+ for (ln = gn->order_pred->first; ln != NULL; ln = ln->next) {
+ GNode *ogn = ln->datum;
- if (GNode_IsDone(ogn) || !(ogn->flags & REMAKE))
- continue;
+ if (GNode_IsDone(ogn) || !(ogn->flags & REMAKE))
+ continue;
- DEBUG2(MAKE, "IsWaitingForOrder: Waiting for .ORDER node \"%s%s\"\n",
- ogn->name, ogn->cohort_num);
- return TRUE;
- }
- return FALSE;
+ DEBUG2(MAKE,
+ "IsWaitingForOrder: Waiting for .ORDER node \"%s%s\"\n",
+ ogn->name, ogn->cohort_num);
+ return TRUE;
+ }
+ return FALSE;
}
static int MakeBuildParent(GNode *, GNodeListNode *);
@@ -744,12 +749,12 @@
static void
UnmarkChildren(GNode *gn)
{
- GNodeListNode *ln;
+ GNodeListNode *ln;
- for (ln = gn->children->first; ln != NULL; ln = ln->next) {
- GNode *child = ln->datum;
- child->type &= ~OP_MARK;
- }
+ for (ln = gn->children->first; ln != NULL; ln = ln->next) {
+ GNode *child = ln->datum;
+ child->type &= ~OP_MARK;
+ }
}
/* Add a child's name to the ALLSRC and OODATE variables of the given
@@ -835,80 +840,81 @@
void
Make_DoAllVar(GNode *gn)
{
- GNodeListNode *ln;
+ GNodeListNode *ln;
- if (gn->flags & DONE_ALLSRC)
- return;
+ if (gn->flags & DONE_ALLSRC)
+ return;
- UnmarkChildren(gn);
- for (ln = gn->children->first; ln != NULL; ln = ln->next)
- MakeAddAllSrc(ln->datum, gn);
+ UnmarkChildren(gn);
+ for (ln = gn->children->first; ln != NULL; ln = ln->next)
+ MakeAddAllSrc(ln->datum, gn);
- if (!Var_Exists(OODATE, gn))
- Var_Set(OODATE, "", gn);
- if (!Var_Exists(ALLSRC, gn))
- Var_Set(ALLSRC, "", gn);
+ if (!Var_Exists(OODATE, gn))
+ Var_Set(OODATE, "", gn);
+ if (!Var_Exists(ALLSRC, gn))
+ Var_Set(ALLSRC, "", gn);
- if (gn->type & OP_JOIN)
- Var_Set(TARGET, GNode_VarAllsrc(gn), gn);
- gn->flags |= DONE_ALLSRC;
+ if (gn->type & OP_JOIN)
+ Var_Set(TARGET, GNode_VarAllsrc(gn), gn);
+ gn->flags |= DONE_ALLSRC;
}
static int
MakeBuildChild(GNode *cn, GNodeListNode *toBeMadeNext)
{
- if (DEBUG(MAKE)) {
- debug_printf("MakeBuildChild: inspect %s%s, ",
- cn->name, cn->cohort_num);
- GNode_FprintDetails(opts.debug_file, "", cn, "\n");
- }
- if (GNode_IsReady(cn))
- return 0;
+ if (DEBUG(MAKE)) {
+ debug_printf("MakeBuildChild: inspect %s%s, ",
+ cn->name, cn->cohort_num);
+ GNode_FprintDetails(opts.debug_file, "", cn, "\n");
+ }
+ if (GNode_IsReady(cn))
+ return 0;
- /* If this node is on the RHS of a .ORDER, check LHSs. */
- if (IsWaitingForOrder(cn)) {
- /* Can't build this (or anything else in this child list) yet */
- cn->made = DEFERRED;
- return 0; /* but keep looking */
- }
+ /* If this node is on the RHS of a .ORDER, check LHSs. */
+ if (IsWaitingForOrder(cn)) {
+ /* Can't build this (or anything else in this child list) yet */
+ cn->made = DEFERRED;
+ return 0; /* but keep looking */
+ }
- DEBUG2(MAKE, "MakeBuildChild: schedule %s%s\n", cn->name, cn->cohort_num);
Home |
Main Index |
Thread Index |
Old Index