summaryrefslogtreecommitdiff
path: root/make.c
diff options
context:
space:
mode:
Diffstat (limited to 'make.c')
-rw-r--r--make.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/make.c b/make.c
index b636800d33cb..53f7b35754ba 100644
--- a/make.c
+++ b/make.c
@@ -1,4 +1,4 @@
-/* $NetBSD: make.c,v 1.259 2023/02/14 21:38:31 rillig Exp $ */
+/* $NetBSD: make.c,v 1.262 2024/01/05 23:22:06 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -104,7 +104,7 @@
#include "job.h"
/* "@(#)make.c 8.1 (Berkeley) 6/6/93" */
-MAKE_RCSID("$NetBSD: make.c,v 1.259 2023/02/14 21:38:31 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.262 2024/01/05 23:22:06 rillig Exp $");
/* Sequence # to detect recursion. */
static unsigned int checked_seqno = 1;
@@ -132,7 +132,7 @@ GNodeType_ToString(GNodeType type, void **freeIt)
{
Buffer buf;
- Buf_InitSize(&buf, 32);
+ Buf_Init(&buf);
#define ADD(flag) Buf_AddFlag(&buf, (type & (flag)) != OP_NONE, #flag)
ADD(OP_DEPENDS);
ADD(OP_FORCE);
@@ -174,7 +174,7 @@ GNodeFlags_ToString(GNodeFlags flags, void **freeIt)
{
Buffer buf;
- Buf_InitSize(&buf, 32);
+ Buf_Init(&buf);
Buf_AddFlag(&buf, flags.remake, "REMAKE");
Buf_AddFlag(&buf, flags.childMade, "CHILDMADE");
Buf_AddFlag(&buf, flags.force, "FORCE");
@@ -330,13 +330,12 @@ GNode_IsOODate(GNode *gn)
* out-of-date.
*/
if (DEBUG(MAKE)) {
- if (gn->type & OP_FORCE) {
+ if (gn->type & OP_FORCE)
debug_printf("! operator...");
- } else if (gn->type & OP_PHONY) {
+ else if (gn->type & OP_PHONY)
debug_printf(".PHONY node...");
- } else {
+ else
debug_printf(".EXEC node...");
- }
}
oodate = true;
} else if (IsOODateRegular(gn)) {
@@ -440,11 +439,10 @@ Make_HandleUse(GNode *cgn, GNode *pgn)
* We don't need to do this for commands.
* They get expanded properly when we execute.
*/
- if (gn->uname == NULL) {
+ if (gn->uname == NULL)
gn->uname = gn->name;
- } else {
+ else
free(gn->name);
- }
gn->name = Var_Subst(gn->uname, pgn, VARE_WANTRES);
/* TODO: handle errors */
if (gn->uname != NULL && strcmp(gn->name, gn->uname) != 0) {
@@ -546,9 +544,8 @@ Make_Recheck(GNode *gn)
* depend on FRC to be made, so we have to check for gn->children
* being empty as well.
*/
- if (!Lst_IsEmpty(gn->commands) || Lst_IsEmpty(gn->children)) {
+ if (!Lst_IsEmpty(gn->commands) || Lst_IsEmpty(gn->children))
gn->mtime = now;
- }
#else
/*
* This is what Make does and it's actually a good thing, as it
@@ -689,9 +686,8 @@ Make_Update(GNode *cgn)
* now -- some rules won't actually update the file. If the file
* still doesn't exist, make its mtime now.
*/
- if (cgn->made != UPTODATE) {
+ if (cgn->made != UPTODATE)
mtime = Make_Recheck(cgn);
- }
/*
* If this is a `::' node, we must consult its first instance
@@ -1224,7 +1220,7 @@ MakePrintStatusList(GNodeList *gnodes, int *errors)
static void
ExamineLater(GNodeList *examine, GNodeList *toBeExamined)
{
- ListNode *ln;
+ GNodeListNode *ln;
for (ln = toBeExamined->first; ln != NULL; ln = ln->next) {
GNode *gn = ln->datum;