Module Name: src Committed By: rillig Date: Sat Oct 17 17:47:15 UTC 2020
Modified Files: src/usr.bin/make: cond.c dir.c lst.c make.c parse.c suff.c var.c Log Message: make(1): fix indentation To generate a diff of this commit: cvs rdiff -u -r1.162 -r1.163 src/usr.bin/make/cond.c cvs rdiff -u -r1.161 -r1.162 src/usr.bin/make/dir.c cvs rdiff -u -r1.74 -r1.75 src/usr.bin/make/lst.c cvs rdiff -u -r1.157 -r1.158 src/usr.bin/make/make.c cvs rdiff -u -r1.372 -r1.373 src/usr.bin/make/parse.c cvs rdiff -u -r1.177 -r1.178 src/usr.bin/make/suff.c cvs rdiff -u -r1.570 -r1.571 src/usr.bin/make/var.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/make/cond.c diff -u src/usr.bin/make/cond.c:1.162 src/usr.bin/make/cond.c:1.163 --- src/usr.bin/make/cond.c:1.162 Mon Oct 5 19:59:07 2020 +++ src/usr.bin/make/cond.c Sat Oct 17 17:47:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cond.c,v 1.162 2020/10/05 19:59:07 rillig Exp $ */ +/* $NetBSD: cond.c,v 1.163 2020/10/17 17:47:14 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.162 2020/10/05 19:59:07 rillig Exp $"); +MAKE_RCSID("$NetBSD: cond.c,v 1.163 2020/10/17 17:47:14 rillig Exp $"); /* * The parsing of conditional expressions is based on this grammar: @@ -448,8 +448,8 @@ CondParser_String(CondParser *par, Boole parseResult = Var_Parse(&nested_p, VAR_CMD, eflags, &str, freeIt); /* TODO: handle errors */ if (str == var_Error) { - if (parseResult & VPR_ANY_MSG) - par->printedError = TRUE; + if (parseResult & VPR_ANY_MSG) + par->printedError = TRUE; if (*freeIt) { free(*freeIt); *freeIt = NULL; Index: src/usr.bin/make/dir.c diff -u src/usr.bin/make/dir.c:1.161 src/usr.bin/make/dir.c:1.162 --- src/usr.bin/make/dir.c:1.161 Mon Oct 5 22:45:47 2020 +++ src/usr.bin/make/dir.c Sat Oct 17 17:47:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.161 2020/10/05 22:45:47 rillig Exp $ */ +/* $NetBSD: dir.c,v 1.162 2020/10/17 17:47:14 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -135,7 +135,7 @@ #include "job.h" /* "@(#)dir.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: dir.c,v 1.161 2020/10/05 22:45:47 rillig Exp $"); +MAKE_RCSID("$NetBSD: dir.c,v 1.162 2020/10/17 17:47:14 rillig Exp $"); #define DIR_DEBUG0(text) DEBUG0(DIR, text) #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1) @@ -236,10 +236,10 @@ OpenDirs_Done(OpenDirs *odirs) { CachedDirListNode *ln = odirs->list->first; while (ln != NULL) { - CachedDirListNode *next = ln->next; - CachedDir *dir = ln->datum; - Dir_Destroy(dir); /* removes the dir from odirs->list */ - ln = next; + CachedDirListNode *next = ln->next; + CachedDir *dir = ln->datum; + Dir_Destroy(dir); /* removes the dir from odirs->list */ + ln = next; } Lst_Free(odirs->list); Hash_DeleteTable(&odirs->table); Index: src/usr.bin/make/lst.c diff -u src/usr.bin/make/lst.c:1.74 src/usr.bin/make/lst.c:1.75 --- src/usr.bin/make/lst.c:1.74 Wed Sep 30 06:27:02 2020 +++ src/usr.bin/make/lst.c Sat Oct 17 17:47:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: lst.c,v 1.74 2020/09/30 06:27:02 rillig Exp $ */ +/* $NetBSD: lst.c,v 1.75 2020/10/17 17:47:14 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -34,7 +34,7 @@ #include "make.h" -MAKE_RCSID("$NetBSD: lst.c,v 1.74 2020/09/30 06:27:02 rillig Exp $"); +MAKE_RCSID("$NetBSD: lst.c,v 1.75 2020/10/17 17:47:14 rillig Exp $"); /* Allocate and initialize a list node. * @@ -313,7 +313,7 @@ Lst_ForEach(List *list, LstActionProc pr { ListNode *node; for (node = list->first; node != NULL; node = node->next) - proc(node->datum, procData); + proc(node->datum, procData); } /* Apply the given function to each element of the given list. The function Index: src/usr.bin/make/make.c diff -u src/usr.bin/make/make.c:1.157 src/usr.bin/make/make.c:1.158 --- src/usr.bin/make/make.c:1.157 Thu Oct 1 22:42:00 2020 +++ src/usr.bin/make/make.c Sat Oct 17 17:47:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: make.c,v 1.157 2020/10/01 22:42:00 rillig Exp $ */ +/* $NetBSD: make.c,v 1.158 2020/10/17 17:47:14 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.157 2020/10/01 22:42:00 rillig Exp $"); +MAKE_RCSID("$NetBSD: make.c,v 1.158 2020/10/17 17:47:14 rillig Exp $"); /* Sequence # to detect recursion. */ static unsigned int checked = 1; @@ -480,7 +480,7 @@ HandleUseNodes(GNode *gn) GNodeListNode *ln, *nln; for (ln = gn->children->first; ln != NULL; ln = nln) { nln = ln->next; - MakeHandleUse(ln->datum, gn, ln); + MakeHandleUse(ln->datum, gn, ln); } } Index: src/usr.bin/make/parse.c diff -u src/usr.bin/make/parse.c:1.372 src/usr.bin/make/parse.c:1.373 --- src/usr.bin/make/parse.c:1.372 Sat Oct 17 17:23:22 2020 +++ src/usr.bin/make/parse.c Sat Oct 17 17:47:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.372 2020/10/17 17:23:22 rillig Exp $ */ +/* $NetBSD: parse.c,v 1.373 2020/10/17 17:47:14 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -131,7 +131,7 @@ #include "pathnames.h" /* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: parse.c,v 1.372 2020/10/17 17:23:22 rillig Exp $"); +MAKE_RCSID("$NetBSD: parse.c,v 1.373 2020/10/17 17:47:14 rillig Exp $"); /* types and constants */ @@ -874,7 +874,7 @@ ApplyDependencyOperator(GNodeType op) { GNodeListNode *ln; for (ln = targets->first; ln != NULL; ln = ln->next) - if (!TryApplyDependencyOperator(ln->datum, op)) + if (!TryApplyDependencyOperator(ln->datum, op)) break; } @@ -1010,14 +1010,14 @@ static void ParseDoSrc(GNodeType tOp, const char *src, ParseSpecial specType) { if (ParseDoSrcKeyword(src, specType)) - return; + return; if (specType == Main) - ParseDoSrcMain(src); + ParseDoSrcMain(src); else if (specType == Order) - ParseDoSrcOrder(src); + ParseDoSrcOrder(src); else - ParseDoSrcOther(src, tOp, specType); + ParseDoSrcOther(src, tOp, specType); } /* If we have yet to decide on a main target to make, in the absence of any @@ -1029,7 +1029,7 @@ FindMainTarget(void) GNodeListNode *ln; if (mainNode != NULL) - return; + return; for (ln = targets->first; ln != NULL; ln = ln->next) { GNode *gn = ln->datum; @@ -1699,13 +1699,13 @@ ParseDoDependency(char *line) curTargs = NULL; if (!Lst_IsEmpty(targets)) - ParseDoDependencyCheckSpec(specType); + ParseDoDependencyCheckSpec(specType); /* * Have now parsed all the target names. Must parse the operator next. */ if (!ParseDoDependencyParseOp(&cp, lstart, &op)) - goto out; + goto out; /* * Apply the operator to the target. This is how we remember which @@ -1733,7 +1733,7 @@ ParseDoDependency(char *line) * a .PATH removes all directories from the search path(s). */ if (!*line) { - ParseDoDependencySourcesEmpty(specType, paths); + ParseDoDependencySourcesEmpty(specType, paths); } else if (specType == MFlags) { /* * Call on functions in main.c to deal with these arguments and @@ -1760,7 +1760,7 @@ ParseDoDependency(char *line) specType == Includes || specType == Libs || specType == Null || specType == ExObjdir) { - ParseDoDependencySourcesSpecial(line, cp, specType, paths); + ParseDoDependencySourcesSpecial(line, cp, specType, paths); if (paths) { Lst_Free(paths); paths = NULL; @@ -1769,8 +1769,8 @@ ParseDoDependency(char *line) Dir_SetPATH(); } else { assert(paths == NULL); - if (!ParseDoDependencySourcesMundane(line, cp, specType, tOp)) - goto out; + if (!ParseDoDependencySourcesMundane(line, cp, specType, tOp)) + goto out; } FindMainTarget(); @@ -1827,7 +1827,7 @@ Parse_IsVar(const char *p, VarAssign *ou if (ch == ' ' || ch == '\t') if (firstSpace == NULL) - firstSpace = p - 1; + firstSpace = p - 1; while (ch == ' ' || ch == '\t') ch = *p++; @@ -1877,8 +1877,8 @@ ParseVarassignOp(VarAssign *var) op--; } else if (op > name && op[-1] == '?') { - op--; - type = VAR_DEFAULT; + op--; + type = VAR_DEFAULT; } else if (op > name && op[-1] == ':') { op--; @@ -1937,7 +1937,7 @@ VarAssign_Eval(VarAssign *var, GNode *ct if (type == VAR_APPEND) { Var_Append(name, uvalue, ctxt); } else if (type == VAR_SUBST) { - char *evalue; + char *evalue; /* * Allow variables in the old value to be undefined, but leave their * expressions alone -- this is done by forcing oldVars to be false. @@ -1968,9 +1968,9 @@ VarAssign_Eval(VarAssign *var, GNode *ct Var_Set(name, avalue, ctxt); } else if (type == VAR_SHELL) { - const char *cmd, *errfmt; - char *cmdOut; - void *cmd_freeIt = NULL; + const char *cmd, *errfmt; + char *cmdOut; + void *cmd_freeIt = NULL; cmd = uvalue; if (strchr(cmd, '$') != NULL) { @@ -2979,7 +2979,7 @@ Parse_File(const char *name, int fd) */ cp = line + 1; shellCommand: - ParseLine_ShellCommand(cp); + ParseLine_ShellCommand(cp); continue; } @@ -3003,7 +3003,7 @@ Parse_File(const char *name, int fd) } #endif { - VarAssign var; + VarAssign var; if (Parse_IsVar(line, &var)) { FinishDependencyGroup(); Parse_DoVar(&var, VAR_GLOBAL); @@ -3088,20 +3088,20 @@ Parse_File(const char *name, int fd) * in which the middle is interpreted as a source, not a target. */ { - /* In lint mode, allow undefined variables to appear in - * dependency lines. - * - * Ideally, only the right-hand side would allow undefined - * variables since it is common to have no dependencies. - * Having undefined variables on the left-hand side is more - * unusual though. Since both sides are expanded in a single - * pass, there is not much choice what to do here. - * - * In normal mode, it does not matter whether undefined - * variables are allowed or not since as of 2020-09-14, - * Var_Parse does not print any parse errors in such a case. - * It simply returns the special empty string var_Error, - * which cannot be detected in the result of Var_Subst. */ + /* In lint mode, allow undefined variables to appear in + * dependency lines. + * + * Ideally, only the right-hand side would allow undefined + * variables since it is common to have no dependencies. + * Having undefined variables on the left-hand side is more + * unusual though. Since both sides are expanded in a single + * pass, there is not much choice what to do here. + * + * In normal mode, it does not matter whether undefined + * variables are allowed or not since as of 2020-09-14, + * Var_Parse does not print any parse errors in such a case. + * It simply returns the special empty string var_Error, + * which cannot be detected in the result of Var_Subst. */ VarEvalFlags eflags = DEBUG(LINT) ? VARE_WANTRES : VARE_UNDEFERR|VARE_WANTRES; Index: src/usr.bin/make/suff.c diff -u src/usr.bin/make/suff.c:1.177 src/usr.bin/make/suff.c:1.178 --- src/usr.bin/make/suff.c:1.177 Mon Oct 5 21:37:07 2020 +++ src/usr.bin/make/suff.c Sat Oct 17 17:47:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: suff.c,v 1.177 2020/10/05 21:37:07 rillig Exp $ */ +/* $NetBSD: suff.c,v 1.178 2020/10/17 17:47:14 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.177 2020/10/05 21:37:07 rillig Exp $"); +MAKE_RCSID("$NetBSD: suff.c,v 1.178 2020/10/17 17:47:14 rillig Exp $"); #define SUFF_DEBUG0(text) DEBUG0(SUFF, text) #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1) @@ -296,9 +296,9 @@ FindSuffByName(const char *name) SuffListNode *ln; for (ln = sufflist->first; ln != NULL; ln = ln->next) { - Suff *suff = ln->datum; - if (strcmp(suff->name, name) == 0) - return suff; + Suff *suff = ln->datum; + if (strcmp(suff->name, name) == 0) + return suff; } return NULL; } Index: src/usr.bin/make/var.c diff -u src/usr.bin/make/var.c:1.570 src/usr.bin/make/var.c:1.571 --- src/usr.bin/make/var.c:1.570 Tue Oct 6 08:13:27 2020 +++ src/usr.bin/make/var.c Sat Oct 17 17:47:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.570 2020/10/06 08:13:27 rillig Exp $ */ +/* $NetBSD: var.c,v 1.571 2020/10/17 17:47:14 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -121,7 +121,7 @@ #include "metachar.h" /* "@(#)var.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: var.c,v 1.570 2020/10/06 08:13:27 rillig Exp $"); +MAKE_RCSID("$NetBSD: var.c,v 1.571 2020/10/17 17:47:14 rillig Exp $"); #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1) #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2) @@ -619,7 +619,7 @@ Var_Export(const char *str, Boolean isEx if (isExport && strncmp(str, "-env", 4) == 0) { str += 4; - flags = 0; + flags = 0; } else if (isExport && strncmp(str, "-literal", 8) == 0) { str += 8; flags = VAR_EXPORT_LITERAL; @@ -1306,7 +1306,7 @@ ModifyWord_Subst(const char *word, SepBu } if (args->lhs[0] == '\0') - goto nosub; + goto nosub; /* unanchored case, may match more than once */ while ((match = strstr(word, args->lhs)) != NULL) { @@ -1817,7 +1817,7 @@ static void ApplyModifiersState_Define(ApplyModifiersState *st) { if (st->exprFlags & VEF_UNDEF) - st->exprFlags |= VEF_DEF; + st->exprFlags |= VEF_DEF; } typedef enum { @@ -3089,7 +3089,7 @@ ApplyModifier(const char **pp, ApplyModi case 'U': return ApplyModifier_Defined(pp, st); case 'L': - return ApplyModifier_Literal(pp, st); + return ApplyModifier_Literal(pp, st); case 'P': return ApplyModifier_Path(pp, st); case '!': @@ -3117,7 +3117,7 @@ ApplyModifier(const char **pp, ApplyModi #endif case 'q': case 'Q': - return ApplyModifier_Quote(pp, st); + return ApplyModifier_Quote(pp, st); case 'T': return ApplyModifier_WordFunc(pp, st, ModifyWord_Tail); case 'H': @@ -3131,7 +3131,7 @@ ApplyModifier(const char **pp, ApplyModi case 'O': return ApplyModifier_Order(pp, st); case 'u': - return ApplyModifier_Unique(pp, st); + return ApplyModifier_Unique(pp, st); #ifdef SUNSHCMD case 's': return ApplyModifier_SunShell(pp, st); @@ -3419,7 +3419,7 @@ ValidShortVarname(char varname, const ch case '$': break; /* and continue below */ default: - return TRUE; + return TRUE; } if (!DEBUG(LINT)) @@ -3598,7 +3598,7 @@ Var_Parse(const char **pp, GNode *ctxt, dynamic = VarIsDynamic(ctxt, varname, namelen); if (!haveModifier) { - p++; /* skip endc */ + p++; /* skip endc */ *pp = p; if (dynamic) { char *pstr = bmake_strsedup(start, p); @@ -3664,9 +3664,9 @@ Var_Parse(const char **pp, GNode *ctxt, */ nstr = Buf_GetAll(&v->val, NULL); if (strchr(nstr, '$') != NULL && (eflags & VARE_WANTRES)) { - VarEvalFlags nested_eflags = eflags; - if (DEBUG(LINT)) - nested_eflags &= ~(unsigned)VARE_UNDEFERR; + VarEvalFlags nested_eflags = eflags; + if (DEBUG(LINT)) + nested_eflags &= ~(unsigned)VARE_UNDEFERR; (void)Var_Subst(nstr, ctxt, nested_eflags, &nstr); /* TODO: handle errors */ *freePtr = nstr; @@ -3702,8 +3702,8 @@ Var_Parse(const char **pp, GNode *ctxt, *pp = p; if (v->flags & VAR_FROM_ENV) { - /* Free the environment variable now since we own it, - * but don't free the variable value if it will be returned. */ + /* Free the environment variable now since we own it, + * but don't free the variable value if it will be returned. */ Boolean keepValue = nstr == Buf_GetAll(&v->val, NULL); if (keepValue) *freePtr = nstr;