summaryrefslogtreecommitdiff
path: root/suff.c
diff options
context:
space:
mode:
Diffstat (limited to 'suff.c')
-rw-r--r--suff.c44
1 files changed, 26 insertions, 18 deletions
diff --git a/suff.c b/suff.c
index 97f745b07e47..eb9b818d3a8c 100644
--- a/suff.c
+++ b/suff.c
@@ -1,4 +1,4 @@
-/* $NetBSD: suff.c,v 1.81 2016/03/15 18:30:14 matthias Exp $ */
+/* $NetBSD: suff.c,v 1.84 2016/06/30 05:34:04 dholland Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: suff.c,v 1.81 2016/03/15 18:30:14 matthias Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.84 2016/06/30 05:34:04 dholland Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94";
#else
-__RCSID("$NetBSD: suff.c,v 1.81 2016/03/15 18:30:14 matthias Exp $");
+__RCSID("$NetBSD: suff.c,v 1.84 2016/06/30 05:34:04 dholland Exp $");
#endif
#endif /* not lint */
#endif
@@ -766,6 +766,8 @@ Suff_EndTransform(void *gnp, void *dummy)
{
GNode *gn = (GNode *)gnp;
+ (void)dummy;
+
if ((gn->type & OP_DOUBLEDEP) && !Lst_IsEmpty (gn->cohorts))
gn = (GNode *)Lst_Datum(Lst_Last(gn->cohorts));
if ((gn->type & OP_TRANSFORM) && Lst_IsEmpty(gn->commands) &&
@@ -809,7 +811,7 @@ Suff_EndTransform(void *gnp, void *dummy)
fprintf(debug_file, "transformation %s complete\n", gn->name);
}
- return(dummy ? 0 : 0);
+ return 0;
}
/*-
@@ -1215,7 +1217,7 @@ SuffAddSrc(void *sp, void *lsp)
#ifdef DEBUG_SRC
s2->cp = Lst_Init(FALSE);
Lst_AtEnd(targ->cp, s2);
- fprintf(debug_file, "1 add %x %x to %x:", targ, s2, ls->l);
+ fprintf(debug_file, "1 add %p %p to %p:", targ, s2, ls->l);
Lst_ForEach(ls->l, PrintAddr, NULL);
fprintf(debug_file, "\n");
#endif
@@ -1233,7 +1235,7 @@ SuffAddSrc(void *sp, void *lsp)
#ifdef DEBUG_SRC
s2->cp = Lst_Init(FALSE);
Lst_AtEnd(targ->cp, s2);
- fprintf(debug_file, "2 add %x %x to %x:", targ, s2, ls->l);
+ fprintf(debug_file, "2 add %p %p to %p:", targ, s2, ls->l);
Lst_ForEach(ls->l, PrintAddr, NULL);
fprintf(debug_file, "\n");
#endif
@@ -1305,14 +1307,14 @@ SuffRemoveSrc(Lst l)
free(s->pref);
else {
#ifdef DEBUG_SRC
- LstNode ln = Lst_Member(s->parent->cp, s);
- if (ln != NULL)
- Lst_Remove(s->parent->cp, ln);
+ LstNode ln2 = Lst_Member(s->parent->cp, s);
+ if (ln2 != NULL)
+ Lst_Remove(s->parent->cp, ln2);
#endif
--s->parent->children;
}
#ifdef DEBUG_SRC
- fprintf(debug_file, "free: [l=%x] p=%x %d\n", l, s, s->children);
+ fprintf(debug_file, "free: [l=%p] p=%p %d\n", l, s, s->children);
Lst_Destroy(s->cp, NULL);
#endif
Lst_Remove(l, ln);
@@ -1323,7 +1325,7 @@ SuffRemoveSrc(Lst l)
}
#ifdef DEBUG_SRC
else {
- fprintf(debug_file, "keep: [l=%x] p=%x %d: ", l, s, s->children);
+ fprintf(debug_file, "keep: [l=%p] p=%p %d: ", l, s, s->children);
Lst_ForEach(s->cp, PrintAddr, NULL);
fprintf(debug_file, "\n");
}
@@ -1372,7 +1374,7 @@ SuffFindThem(Lst srcs, Lst slst)
*/
if (Targ_FindNode(s->file, TARG_NOCREATE) != NULL) {
#ifdef DEBUG_SRC
- fprintf(debug_file, "remove %x from %x\n", s, srcs);
+ fprintf(debug_file, "remove %p from %p\n", s, srcs);
#endif
rs = s;
break;
@@ -1381,7 +1383,7 @@ SuffFindThem(Lst srcs, Lst slst)
if ((ptr = Dir_FindFile(s->file, s->suff->searchPath)) != NULL) {
rs = s;
#ifdef DEBUG_SRC
- fprintf(debug_file, "remove %x from %x\n", s, srcs);
+ fprintf(debug_file, "remove %p from %p\n", s, srcs);
#endif
free(ptr);
break;
@@ -1497,7 +1499,7 @@ SuffFindCmds(Src *targ, Lst slst)
targ->children += 1;
#ifdef DEBUG_SRC
ret->cp = Lst_Init(FALSE);
- fprintf(debug_file, "3 add %x %x\n", targ, ret);
+ fprintf(debug_file, "3 add %p %p\n", targ, ret);
Lst_AtEnd(targ->cp, ret);
#endif
Lst_AtEnd(slst, ret);
@@ -1616,7 +1618,7 @@ SuffExpandChildren(LstNode cln, GNode *pgn)
}
free(freeIt);
- } else if (*cp == '\\' && *cp != '\0') {
+ } else if (*cp == '\\' && cp[1] != '\0') {
/*
* Escaped something -- skip over it
*/
@@ -2597,8 +2599,10 @@ Suff_End(void)
static int SuffPrintName(void *s, void *dummy)
{
+ (void)dummy;
+
fprintf(debug_file, "%s ", ((Suff *)s)->name);
- return (dummy ? 0 : 0);
+ return 0;
}
static int
@@ -2608,6 +2612,8 @@ SuffPrintSuff(void *sp, void *dummy)
int flags;
int flag;
+ (void)dummy;
+
fprintf(debug_file, "# `%s' [%d] ", s->name, s->refCount);
flags = s->flags;
@@ -2640,7 +2646,7 @@ SuffPrintSuff(void *sp, void *dummy)
fprintf(debug_file, "#\tSearch Path: ");
Dir_PrintPath(s->searchPath);
fputc('\n', debug_file);
- return (dummy ? 0 : 0);
+ return 0;
}
static int
@@ -2648,12 +2654,14 @@ SuffPrintTrans(void *tp, void *dummy)
{
GNode *t = (GNode *)tp;
+ (void)dummy;
+
fprintf(debug_file, "%-16s: ", t->name);
Targ_PrintType(t->type);
fputc('\n', debug_file);
Lst_ForEach(t->commands, Targ_PrintCmd, NULL);
fputc('\n', debug_file);
- return(dummy ? 0 : 0);
+ return 0;
}
void