diff options
author | jmallett <jmallett@FreeBSD.org> | 2002-09-17 22:31:26 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2002-09-17 22:31:26 +0000 |
commit | 7fd8427cf78ed3d6ed80aafb4dd8b2ae5c85715b (patch) | |
tree | e9bbc739d9ad215c67355ae9b0a1a298016a17b9 /usr.bin/make/for.c | |
parent | 086f36bd966184831309cca6a2187aa38f6b0393 (diff) | |
download | FreeBSD-src-7fd8427cf78ed3d6ed80aafb4dd8b2ae5c85715b.zip FreeBSD-src-7fd8427cf78ed3d6ed80aafb4dd8b2ae5c85715b.tar.gz |
Move common use of if (DEBUG(FOO)) printf... to DEBUGF(FOO, ...), using
variable length arguments to a macro. Bump version as this makes DEBUG
statements *always* go to stderr rather than sometimes stdout. There are
a few stragglers, which I will take care of as soon as I can. Mostly these
relate to the need-for-death-of some of the remote job code.
Nearby stylistic nits and XXX added/fixed where appropriate.
Diffstat (limited to 'usr.bin/make/for.c')
-rw-r--r-- | usr.bin/make/for.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/usr.bin/make/for.c b/usr.bin/make/for.c index de34812..d5aa54d 100644 --- a/usr.bin/make/for.c +++ b/usr.bin/make/for.c @@ -192,8 +192,7 @@ For_Eval (line) ptr++; wrd = ptr--; } - if (DEBUG(FOR)) - (void) fprintf(stderr, "For: Iterator %s List %s\n", forVar, sub); + DEBUGF(FOR, "For: Iterator %s List %s\n", forVar, sub); if (ptr - wrd > 0) ADDWORD(); else @@ -211,8 +210,7 @@ For_Eval (line) if (strncmp(ptr, "endfor", 6) == 0 && (isspace((unsigned char) ptr[6]) || !ptr[6])) { - if (DEBUG(FOR)) - (void) fprintf(stderr, "For: end for %d\n", forLevel); + DEBUGF(FOR, "For: end for %d\n", forLevel); if (--forLevel < 0) { Parse_Error (level, "for-less endfor"); return 0; @@ -221,8 +219,7 @@ For_Eval (line) else if (strncmp(ptr, "for", 3) == 0 && isspace((unsigned char) ptr[3])) { forLevel++; - if (DEBUG(FOR)) - (void) fprintf(stderr, "For: new loop %d\n", forLevel); + DEBUGF(FOR, "For: new loop %d\n", forLevel); } } @@ -258,8 +255,7 @@ ForExec(namep, argp) For *arg = (For *) argp; int len; Var_Set(arg->var, name, VAR_GLOBAL); - if (DEBUG(FOR)) - (void) fprintf(stderr, "--- %s = %s\n", arg->var, name); + DEBUGF(FOR, "--- %s = %s\n", arg->var, name); Parse_FromString(Var_Subst(arg->var, (char *) Buf_GetAll(arg->buf, &len), VAR_GLOBAL, FALSE)); Var_Delete(arg->var, VAR_GLOBAL); |