make(1): replace += 1 with ++ and -= 1 with --
Just for visual consistency. The generated code stays exactly the same.
This commit is contained in:
parent
fa2d8ab826
commit
35a8c8e3ca
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: compat.c,v 1.158 2020/09/28 22:23:35 rillig Exp $ */
|
||||
/* $NetBSD: compat.c,v 1.159 2020/09/28 23:13:57 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
|
||||
@ -99,7 +99,7 @@
|
||||
#include "pathnames.h"
|
||||
|
||||
/* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */
|
||||
MAKE_RCSID("$NetBSD: compat.c,v 1.158 2020/09/28 22:23:35 rillig Exp $");
|
||||
MAKE_RCSID("$NetBSD: compat.c,v 1.159 2020/09/28 23:13:57 rillig Exp $");
|
||||
|
||||
static GNode *curTarg = NULL;
|
||||
static void CompatInterrupt(int);
|
||||
@ -721,7 +721,7 @@ Compat_Run(GNodeList *targs)
|
||||
printf("`%s' is up to date.\n", gn->name);
|
||||
} else if (gn->made == ABORTED) {
|
||||
printf("`%s' not remade because of errors.\n", gn->name);
|
||||
errors += 1;
|
||||
errors++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cond.c,v 1.154 2020/09/28 20:46:11 rillig Exp $ */
|
||||
/* $NetBSD: cond.c,v 1.155 2020/09/28 23:13:57 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
|
||||
@ -93,7 +93,7 @@
|
||||
#include "dir.h"
|
||||
|
||||
/* "@(#)cond.c 8.2 (Berkeley) 1/2/94" */
|
||||
MAKE_RCSID("$NetBSD: cond.c,v 1.154 2020/09/28 20:46:11 rillig Exp $");
|
||||
MAKE_RCSID("$NetBSD: cond.c,v 1.155 2020/09/28 23:13:57 rillig Exp $");
|
||||
|
||||
/*
|
||||
* The parsing of conditional expressions is based on this grammar:
|
||||
@ -642,7 +642,7 @@ CondParser_Comparison(CondParser *par, Boolean doEval)
|
||||
if (par->p[1] == '=') {
|
||||
par->p += 2;
|
||||
} else {
|
||||
par->p += 1;
|
||||
par->p++;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: dir.c,v 1.152 2020/09/28 22:23:35 rillig Exp $ */
|
||||
/* $NetBSD: dir.c,v 1.153 2020/09/28 23:13:57 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
|
||||
@ -136,7 +136,7 @@
|
||||
#include "job.h"
|
||||
|
||||
/* "@(#)dir.c 8.2 (Berkeley) 1/2/94" */
|
||||
MAKE_RCSID("$NetBSD: dir.c,v 1.152 2020/09/28 22:23:35 rillig Exp $");
|
||||
MAKE_RCSID("$NetBSD: dir.c,v 1.153 2020/09/28 23:13:57 rillig Exp $");
|
||||
|
||||
#define DIR_DEBUG0(text) DEBUG0(DIR, text)
|
||||
#define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
|
||||
@ -375,12 +375,12 @@ Dir_InitCur(const char *cdname)
|
||||
* Keep this one around too.
|
||||
*/
|
||||
if ((dir = Dir_AddDir(NULL, cdname))) {
|
||||
dir->refCount += 1;
|
||||
dir->refCount++;
|
||||
if (cur && cur != dir) {
|
||||
/*
|
||||
* We've been here before, cleanup.
|
||||
*/
|
||||
cur->refCount -= 1;
|
||||
cur->refCount--;
|
||||
Dir_Destroy(cur);
|
||||
}
|
||||
cur = dir;
|
||||
@ -412,7 +412,7 @@ Dir_InitDot(void)
|
||||
* We always need to have dot around, so we increment its reference count
|
||||
* to make sure it's not destroyed.
|
||||
*/
|
||||
dot->refCount += 1;
|
||||
dot->refCount++;
|
||||
Dir_SetPATH(); /* initialize */
|
||||
}
|
||||
|
||||
@ -422,11 +422,11 @@ Dir_End(void)
|
||||
{
|
||||
#ifdef CLEANUP
|
||||
if (cur) {
|
||||
cur->refCount -= 1;
|
||||
cur->refCount--;
|
||||
Dir_Destroy(cur);
|
||||
}
|
||||
dot->refCount -= 1;
|
||||
dotLast->refCount -= 1;
|
||||
dot->refCount--;
|
||||
dotLast->refCount--;
|
||||
Dir_Destroy(dotLast);
|
||||
Dir_Destroy(dot);
|
||||
Dir_ClearPath(dirSearchPath);
|
||||
@ -900,8 +900,8 @@ DirLookup(CachedDir *dir, const char *name MAKE_ATTR_UNUSED, const char *cp,
|
||||
|
||||
file = str_concat3(dir->name, "/", cp);
|
||||
DIR_DEBUG1(" returning %s\n", file);
|
||||
dir->hits += 1;
|
||||
hits += 1;
|
||||
dir->hits++;
|
||||
hits++;
|
||||
return file;
|
||||
}
|
||||
|
||||
@ -938,7 +938,7 @@ DirLookupSubdir(CachedDir *dir, const char *name)
|
||||
DIR_DEBUG1("checking %s ...\n", file);
|
||||
|
||||
if (cached_stat(file, &mst) == 0) {
|
||||
nearmisses += 1;
|
||||
nearmisses++;
|
||||
return file;
|
||||
}
|
||||
free(file);
|
||||
@ -987,8 +987,8 @@ DirLookupAbs(CachedDir *dir, const char *name, const char *cp)
|
||||
return bmake_strdup("");
|
||||
}
|
||||
|
||||
dir->hits += 1;
|
||||
hits += 1;
|
||||
dir->hits++;
|
||||
hits++;
|
||||
DIR_DEBUG1(" returning %s\n", name);
|
||||
return bmake_strdup(name);
|
||||
}
|
||||
@ -1012,14 +1012,14 @@ DirFindDot(Boolean hasSlash MAKE_ATTR_UNUSED, const char *name, const char *cp)
|
||||
|
||||
if (Hash_FindEntry(&dot->files, cp) != NULL) {
|
||||
DIR_DEBUG0(" in '.'\n");
|
||||
hits += 1;
|
||||
dot->hits += 1;
|
||||
hits++;
|
||||
dot->hits++;
|
||||
return bmake_strdup(name);
|
||||
}
|
||||
if (cur && Hash_FindEntry(&cur->files, cp) != NULL) {
|
||||
DIR_DEBUG1(" in ${.CURDIR} = %s\n", cur->name);
|
||||
hits += 1;
|
||||
cur->hits += 1;
|
||||
hits++;
|
||||
cur->hits++;
|
||||
return str_concat3(cur->name, "/", cp);
|
||||
}
|
||||
|
||||
@ -1067,7 +1067,7 @@ Dir_FindFile(const char *name, SearchPath *path)
|
||||
base = strrchr(name, '/');
|
||||
if (base) {
|
||||
hasSlash = TRUE;
|
||||
base += 1;
|
||||
base++;
|
||||
} else {
|
||||
hasSlash = FALSE;
|
||||
base = name;
|
||||
@ -1077,7 +1077,7 @@ Dir_FindFile(const char *name, SearchPath *path)
|
||||
|
||||
if (path == NULL) {
|
||||
DIR_DEBUG0("couldn't open path, file not found\n");
|
||||
misses += 1;
|
||||
misses++;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -1149,7 +1149,7 @@ Dir_FindFile(const char *name, SearchPath *path)
|
||||
*/
|
||||
if (!hasSlash) {
|
||||
DIR_DEBUG0(" failed.\n");
|
||||
misses += 1;
|
||||
misses++;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -1277,13 +1277,13 @@ Dir_FindFile(const char *name, SearchPath *path)
|
||||
#ifdef notdef
|
||||
if (base == trailing_dot) {
|
||||
base = strrchr(name, '/');
|
||||
base += 1;
|
||||
base++;
|
||||
}
|
||||
base[-1] = '\0';
|
||||
(void)Dir_AddDir(path, name);
|
||||
base[-1] = '/';
|
||||
|
||||
bigmisses += 1;
|
||||
bigmisses++;
|
||||
ln = Lst_Last(path);
|
||||
if (ln == NULL) {
|
||||
return NULL;
|
||||
@ -1299,7 +1299,7 @@ Dir_FindFile(const char *name, SearchPath *path)
|
||||
#else /* !notdef */
|
||||
DIR_DEBUG1(" Looking for \"%s\" ...\n", name);
|
||||
|
||||
bigmisses += 1;
|
||||
bigmisses++;
|
||||
if (cached_stat(name, &mst) == 0) {
|
||||
return bmake_strdup(name);
|
||||
}
|
||||
@ -1508,7 +1508,7 @@ Dir_AddDir(SearchPath *path, const char *name)
|
||||
if (ln != NULL) {
|
||||
dir = LstNode_Datum(ln);
|
||||
if (Lst_FindDatum(path, dir) == NULL) {
|
||||
dir->refCount += 1;
|
||||
dir->refCount++;
|
||||
Lst_Append(path, dir);
|
||||
}
|
||||
return dir;
|
||||
@ -1559,7 +1559,7 @@ void *
|
||||
Dir_CopyDir(void *p)
|
||||
{
|
||||
CachedDir *dir = (CachedDir *)p;
|
||||
dir->refCount += 1;
|
||||
dir->refCount++;
|
||||
|
||||
return p;
|
||||
}
|
||||
@ -1627,7 +1627,7 @@ void
|
||||
Dir_Destroy(void *dirp)
|
||||
{
|
||||
CachedDir *dir = dirp;
|
||||
dir->refCount -= 1;
|
||||
dir->refCount--;
|
||||
|
||||
if (dir->refCount == 0) {
|
||||
CachedDirListNode *node;
|
||||
@ -1695,7 +1695,7 @@ Dir_Concat(SearchPath *path1, SearchPath *path2)
|
||||
for (ln = path2->first; ln != NULL; ln = ln->next) {
|
||||
CachedDir *dir = ln->datum;
|
||||
if (Lst_FindDatum(path1, dir) == NULL) {
|
||||
dir->refCount += 1;
|
||||
dir->refCount++;
|
||||
Lst_Append(path1, dir);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: job.c,v 1.251 2020/09/28 22:23:35 rillig Exp $ */
|
||||
/* $NetBSD: job.c,v 1.252 2020/09/28 23:13:57 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
|
||||
@ -143,7 +143,7 @@
|
||||
#include "trace.h"
|
||||
|
||||
/* "@(#)job.c 8.2 (Berkeley) 3/19/94" */
|
||||
MAKE_RCSID("$NetBSD: job.c,v 1.251 2020/09/28 22:23:35 rillig Exp $");
|
||||
MAKE_RCSID("$NetBSD: job.c,v 1.252 2020/09/28 23:13:57 rillig Exp $");
|
||||
|
||||
# define STATIC static
|
||||
|
||||
@ -634,7 +634,7 @@ JobPrintCommand(void *cmdp, void *jobp)
|
||||
(void)fprintf(job->cmdFILE, fmt, arg); \
|
||||
(void)fflush(job->cmdFILE);
|
||||
|
||||
numCommands += 1;
|
||||
numCommands++;
|
||||
|
||||
Var_Subst(cmd, job->node, VARE_WANTRES, &cmd);
|
||||
/* TODO: handle errors */
|
||||
@ -997,7 +997,7 @@ JobFinish(Job *job, int status)
|
||||
Make_Update(job->node);
|
||||
job->job_state = JOB_ST_FREE;
|
||||
} else if (status != 0) {
|
||||
errors += 1;
|
||||
errors++;
|
||||
job->job_state = JOB_ST_FREE;
|
||||
}
|
||||
|
||||
@ -2327,7 +2327,7 @@ Job_ParseShell(char *line)
|
||||
if (path == NULL) {
|
||||
path = UNCONST(shellPath);
|
||||
} else {
|
||||
path += 1;
|
||||
path++;
|
||||
}
|
||||
if (newShell.name != NULL) {
|
||||
shellName = newShell.name;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: make.c,v 1.155 2020/09/28 23:02:02 rillig Exp $ */
|
||||
/* $NetBSD: make.c,v 1.156 2020/09/28 23:13:57 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1989, 1990, 1993
|
||||
@ -107,7 +107,7 @@
|
||||
#include "job.h"
|
||||
|
||||
/* "@(#)make.c 8.1 (Berkeley) 6/6/93" */
|
||||
MAKE_RCSID("$NetBSD: make.c,v 1.155 2020/09/28 23:02:02 rillig Exp $");
|
||||
MAKE_RCSID("$NetBSD: make.c,v 1.156 2020/09/28 23:13:57 rillig Exp $");
|
||||
|
||||
/* Sequence # to detect recursion. */
|
||||
static unsigned int checked = 1;
|
||||
@ -436,7 +436,7 @@ Make_HandleUse(GNode *cgn, GNode *pgn)
|
||||
|
||||
Lst_Append(pgn->children, gn);
|
||||
Lst_Append(gn->parents, pgn);
|
||||
pgn->unmade += 1;
|
||||
pgn->unmade++;
|
||||
}
|
||||
Lst_Close(cgn->children);
|
||||
|
||||
@ -617,7 +617,7 @@ Make_Update(GNode *cgn)
|
||||
if ((centurion = cgn->centurion) != NULL) {
|
||||
if (!Lst_IsEmpty(cgn->parents))
|
||||
Punt("%s%s: cohort has parents", cgn->name, cgn->cohort_num);
|
||||
centurion->unmade_cohorts -= 1;
|
||||
centurion->unmade_cohorts--;
|
||||
if (centurion->unmade_cohorts < 0)
|
||||
Error("Graph cycles through centurion %s", centurion->name);
|
||||
} else {
|
||||
@ -676,7 +676,7 @@ Make_Update(GNode *cgn)
|
||||
}
|
||||
|
||||
/* One more child of this parent is now made */
|
||||
pgn->unmade -= 1;
|
||||
pgn->unmade--;
|
||||
if (pgn->unmade < 0) {
|
||||
if (DEBUG(MAKE)) {
|
||||
debug_printf("Graph cycles through %s%s\n",
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: parse.c,v 1.342 2020/09/28 22:23:35 rillig Exp $ */
|
||||
/* $NetBSD: parse.c,v 1.343 2020/09/28 23:13:57 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1989, 1990, 1993
|
||||
@ -132,7 +132,7 @@
|
||||
#include "pathnames.h"
|
||||
|
||||
/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */
|
||||
MAKE_RCSID("$NetBSD: parse.c,v 1.342 2020/09/28 22:23:35 rillig Exp $");
|
||||
MAKE_RCSID("$NetBSD: parse.c,v 1.343 2020/09/28 23:13:57 rillig Exp $");
|
||||
|
||||
/* types and constants */
|
||||
|
||||
@ -808,7 +808,7 @@ ParseLinkSrc(void *pgnp, void *data)
|
||||
pgn = LstNode_Datum(Lst_Last(pgn->cohorts));
|
||||
|
||||
Lst_Append(pgn->children, cgn);
|
||||
pgn->unmade += 1;
|
||||
pgn->unmade++;
|
||||
|
||||
if (args->specType == Not)
|
||||
Lst_Append(cgn->parents, pgn);
|
||||
@ -866,7 +866,7 @@ TryApplyDependencyOperator(GNode *gn, GNodeType op)
|
||||
cohort->type = op | OP_INVISIBLE;
|
||||
Lst_Append(gn->cohorts, cohort);
|
||||
cohort->centurion = gn;
|
||||
gn->unmade_cohorts += 1;
|
||||
gn->unmade_cohorts++;
|
||||
snprintf(cohort->cohort_num, sizeof cohort->cohort_num, "#%d",
|
||||
gn->unmade_cohorts);
|
||||
} else {
|
||||
@ -1654,7 +1654,7 @@ ParseDoDependency(char *line)
|
||||
} else {
|
||||
if (*cp) {
|
||||
*cp = '\0';
|
||||
cp += 1;
|
||||
cp++;
|
||||
}
|
||||
|
||||
ParseDoSrc(tOp, line, specType);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: suff.c,v 1.172 2020/09/28 22:23:35 rillig Exp $ */
|
||||
/* $NetBSD: suff.c,v 1.173 2020/09/28 23:13:57 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1989, 1990, 1993
|
||||
@ -129,7 +129,7 @@
|
||||
#include "dir.h"
|
||||
|
||||
/* "@(#)suff.c 8.4 (Berkeley) 3/21/94" */
|
||||
MAKE_RCSID("$NetBSD: suff.c,v 1.172 2020/09/28 22:23:35 rillig Exp $");
|
||||
MAKE_RCSID("$NetBSD: suff.c,v 1.173 2020/09/28 23:13:57 rillig Exp $");
|
||||
|
||||
#define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
|
||||
#define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
|
||||
@ -931,7 +931,7 @@ SuffAddSrc(void *sp, void *lsp)
|
||||
s2->suff = s;
|
||||
s->refCount++;
|
||||
s2->children = 0;
|
||||
targ->children += 1;
|
||||
targ->children++;
|
||||
Lst_Append(ls->l, s2);
|
||||
#ifdef DEBUG_SRC
|
||||
s2->cp = Lst_Init();
|
||||
@ -949,7 +949,7 @@ SuffAddSrc(void *sp, void *lsp)
|
||||
s2->suff = s;
|
||||
s->refCount++;
|
||||
s2->children = 0;
|
||||
targ->children += 1;
|
||||
targ->children++;
|
||||
Lst_Append(ls->l, s2);
|
||||
#ifdef DEBUG_SRC
|
||||
s2->cp = Lst_Init();
|
||||
@ -1172,7 +1172,7 @@ SuffFindCmds(Src *targ, SrcList *slst)
|
||||
ret->parent = targ;
|
||||
ret->node = s;
|
||||
ret->children = 0;
|
||||
targ->children += 1;
|
||||
targ->children++;
|
||||
#ifdef DEBUG_SRC
|
||||
ret->cp = Lst_Init();
|
||||
debug_printf("3 add %p %p\n", targ, ret);
|
||||
@ -1462,7 +1462,7 @@ SuffApplyTransform(GNode *tGn, GNode *sGn, Suff *t, Suff *s)
|
||||
*/
|
||||
Lst_Append(tGn->children, sGn);
|
||||
Lst_Append(sGn->parents, tGn);
|
||||
tGn->unmade += 1;
|
||||
tGn->unmade++;
|
||||
|
||||
/*
|
||||
* Locate the transformation rule itself
|
||||
@ -1564,7 +1564,7 @@ SuffFindArchiveDeps(GNode *gn, SrcList *slst)
|
||||
*/
|
||||
Lst_Append(gn->children, mem);
|
||||
Lst_Append(mem->parents, gn);
|
||||
gn->unmade += 1;
|
||||
gn->unmade++;
|
||||
|
||||
/*
|
||||
* Copy in the variables from the member node to this one.
|
||||
|
Loading…
Reference in New Issue
Block a user