summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/make/arch.h4
-rw-r--r--usr.bin/make/garray.h27
-rw-r--r--usr.bin/make/suff.c4
3 files changed, 22 insertions, 13 deletions
diff --git a/usr.bin/make/arch.h b/usr.bin/make/arch.h
index 2377fd48aea..1dca02cbbf1 100644
--- a/usr.bin/make/arch.h
+++ b/usr.bin/make/arch.h
@@ -1,7 +1,7 @@
#ifndef ARCH_H
#define ARCH_H
/* $OpenPackages$ */
-/* $OpenBSD: arch.h,v 1.3 2007/09/17 09:44:20 espie Exp $ */
+/* $OpenBSD: arch.h,v 1.4 2007/09/17 10:12:35 espie Exp $ */
/*
* Copyright (c) 2001 Marc Espie.
@@ -50,7 +50,7 @@ extern void Arch_End(void);
* nodeLst, one for each member in the spec.
* false is returned if the specification is invalid for some reason.
* Side-effect: begin is bumped to the end of the specification. */
-extern bool Arch_ParseArchive(char **, Lst, SymTable *);
+extern bool Arch_ParseArchive(const char **, Lst, SymTable *);
/* Arch_Touch(node);
* Alter the modification time of the archive member described by node
* to the current time. */
diff --git a/usr.bin/make/garray.h b/usr.bin/make/garray.h
index 0e934800d85..7cc3562b4b4 100644
--- a/usr.bin/make/garray.h
+++ b/usr.bin/make/garray.h
@@ -2,7 +2,7 @@
#define GARRAY_H
/* $OpenPackages$ */
-/* $OpenBSD: garray.h,v 1.2 2007/09/17 09:44:20 espie Exp $ */
+/* $OpenBSD: garray.h,v 1.3 2007/09/17 10:12:35 espie Exp $ */
/* Growable array implementation */
/*
@@ -49,14 +49,15 @@ do { \
#define MAY_INCREASE_STATS
#endif
-#define Array_AtEnd(l, gn) \
-do { \
- if ((l)->n >= (l)->size) { \
- (l)->size *= 2; \
- (l)->a = erealloc((l)->a, sizeof(struct GNode *) * (l)->size); \
- MAY_INCREASE_STATS; \
- } \
- (l)->a[(l)->n++] = (gn); \
+#define Array_AtEnd(l, gn) \
+do { \
+ if ((l)->n >= (l)->size) { \
+ (l)->size *= 2; \
+ (l)->a = erealloc((l)->a, \
+ sizeof(struct GNode *) * (l)->size);\
+ MAY_INCREASE_STATS; \
+ } \
+ (l)->a[(l)->n++] = (gn); \
} while (0)
#define Array_Find(l, func, v) \
@@ -67,6 +68,14 @@ do { \
break; \
} while (0)
+#define Array_FindP(l, func, v) \
+do { \
+ unsigned int i; \
+ for (i = 0; i < (l)->n; i++) \
+ if ((func)(&((l)->a[i]), (v)) == 0) \
+ break; \
+} while (0)
+
#define Array_ForEach(l, func, v) \
do { \
unsigned int i; \
diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c
index aaf4a45140b..6fff700945e 100644
--- a/usr.bin/make/suff.c
+++ b/usr.bin/make/suff.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: suff.c,v 1.67 2007/09/17 09:28:36 espie Exp $ */
+/* $OpenBSD: suff.c,v 1.68 2007/09/17 10:12:35 espie Exp $ */
/* $NetBSD: suff.c,v 1.13 1996/11/06 17:59:25 christos Exp $ */
/*
@@ -1177,7 +1177,7 @@ SuffExpandVarChildren(LstNode after, GNode *cgn, GNode *pgn)
* on the Arch module to find the nodes for us, expanding
* variables in the parent's context.
*/
- char *sacrifice = cp;
+ const char *sacrifice = cp;
(void)Arch_ParseArchive(&sacrifice, &members, &pgn->context);
} else {