diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2000-09-14 13:32:11 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2000-09-14 13:32:11 +0000 |
commit | 28df6ffac43fe362569ebdb390fe1e7dd994c877 (patch) | |
tree | 306f06672ccb6c8ba9c67d1b19544e6b70551f16 /usr.bin/make | |
parent | 912ebd4a27f63943fb63420edfac122743be32ca (diff) |
Some systematic clean-up.
- UNUSED macro that expands to __attribute__((unused)) for gcc
- move rcsid around so that they can be tagged UNUSED.
- activate -Wunused.
- use UNUSED instead of kludgy junk for function arguments.
- add extern to all extern prototypes.
- update comments in lst.h.
- clean up var.c a little bit, constifying arguments, updating comments...
Diffstat (limited to 'usr.bin/make')
49 files changed, 582 insertions, 721 deletions
diff --git a/usr.bin/make/Makefile b/usr.bin/make/Makefile index 47b42941883..4fc77dcace0 100644 --- a/usr.bin/make/Makefile +++ b/usr.bin/make/Makefile @@ -1,7 +1,7 @@ -# $OpenBSD: Makefile,v 1.21 2000/07/17 23:09:06 espie Exp $ +# $OpenBSD: Makefile,v 1.22 2000/09/14 13:32:05 espie Exp $ PROG= make -CFLAGS+= -I${.OBJDIR} -I${.CURDIR} -Wall -Wno-char-subscripts -Wno-unused -Wstrict-prototypes#-Wmissing-prototypes -Wstrict-prototypes +CFLAGS+= -I${.OBJDIR} -I${.CURDIR} -Wall -Wno-char-subscripts -Wstrict-prototypes .if (${MACHINE_ARCH} == "m88k") CFLAGS+=-O0 diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c index ab5eb6971ce..939473d4ec5 100644 --- a/usr.bin/make/arch.c +++ b/usr.bin/make/arch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arch.c,v 1.31 2000/06/23 16:20:01 espie Exp $ */ +/* $OpenBSD: arch.c,v 1.32 2000/09/14 13:32:05 espie Exp $ */ /* $NetBSD: arch.c,v 1.17 1996/11/06 17:58:59 christos Exp $ */ /* @@ -39,14 +39,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; -#else -static char rcsid[] = "$OpenBSD: arch.c,v 1.31 2000/06/23 16:20:01 espie Exp $"; -#endif -#endif /* not lint */ - /*- * arch.c -- * Functions to manipulate libraries, archives and their members. @@ -110,6 +102,15 @@ static char rcsid[] = "$OpenBSD: arch.c,v 1.31 2000/06/23 16:20:01 espie Exp $"; #include "dir.h" #include "config.h" +#ifndef lint +#if 0 +static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; +#else +UNUSED +static char rcsid[] = "$OpenBSD: arch.c,v 1.32 2000/09/14 13:32:05 espie Exp $"; +#endif +#endif /* not lint */ + #ifdef TARGET_MACHINE #undef MACHINE #define MACHINE TARGET_MACHINE @@ -1008,9 +1009,8 @@ Arch_MTime (gn) GNode *gn; /* Node describing archive member */ { struct ar_hdr *arhPtr; /* Header of desired member */ - time_t modTime; /* Modification time as an integer */ - arhPtr = ArchStatMember (Varq_Value(ARCHIVE_INDEX, gn), + arhPtr = ArchStatMember(Varq_Value(ARCHIVE_INDEX, gn), Varq_Value(MEMBER_INDEX, gn), TRUE); if (arhPtr != NULL) { diff --git a/usr.bin/make/bit.h b/usr.bin/make/bit.h index e8165439389..e69de29bb2d 100644 --- a/usr.bin/make/bit.h +++ b/usr.bin/make/bit.h @@ -1,103 +0,0 @@ -/* $OpenBSD: bit.h,v 1.5 1998/12/05 00:06:27 espie Exp $ */ -/* $NetBSD: bit.h,v 1.5 1995/11/08 02:30:53 christos Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. - * Copyright (c) 1988, 1989 by Adam de Boor - * Copyright (c) 1989 by Berkeley Softworks - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)bit.h 5.3 (Berkeley) 6/1/90 - */ - -/* - * bit.h -- - * - * Definition of macros for setting and clearing bits in an array - * of integers. - * - * It is assumed that "int" is 32 bits wide. - */ - -#ifndef _BIT -#define _BIT - -#include "sprite.h" - -#define BIT_NUM_BITS_PER_INT 32 -#define BIT_NUM_BITS_PER_BYTE 8 - -#define Bit_NumInts(numBits) \ - (((numBits)+BIT_NUM_BITS_PER_INT -1)/BIT_NUM_BITS_PER_INT) - -#define Bit_NumBytes(numBits) \ - (Bit_NumInts(numBits) * sizeof(int)) - -#define Bit_Alloc(numBits, bitArrayPtr) \ - bitArrayPtr = (int *) emalloc((unsigned)Bit_NumBytes(numBits)); \ - Bit_Zero((numBits), (bitArrayPtr)) - -#define Bit_Free(bitArrayPtr) \ - free((char *)bitArrayPtr) - -#define Bit_Set(numBits, bitArrayPtr) \ - ((bitArrayPtr)[(numBits)/BIT_NUM_BITS_PER_INT] |= \ - (1 << ((numBits) % BIT_NUM_BITS_PER_INT))) - -#define Bit_IsSet(numBits, bitArrayPtr) \ - ((bitArrayPtr)[(numBits)/BIT_NUM_BITS_PER_INT] & \ - (1 << ((numBits) % BIT_NUM_BITS_PER_INT))) - -#define Bit_Clear(numBits, bitArrayPtr) \ - ((bitArrayPtr)[(numBits)/BIT_NUM_BITS_PER_INT] &= \ - ~(1 << ((numBits) % BIT_NUM_BITS_PER_INT))) - -#define Bit_IsClear(numBits, bitArrayPtr) \ - (!(Bit_IsSet((numBits), (bitArrayPtr)))) - -#define Bit_Copy(numBits, srcArrayPtr, destArrayPtr) \ - memmove((char *)(destArrayPtr), (char *)(srcArrayPtr), \ - Bit_NumBytes(numBits)) - -#define Bit_Zero(numBits, bitArrayPtr) \ - memset((char *)(bitArrayPtr), 0, Bit_NumBytes(numBits)) - -extern int Bit_FindFirstSet(); -extern int Bit_FindFirstClear(); -extern Boolean Bit_Intersect(); -extern Boolean Bit_Union(); -extern Boolean Bit_AnySet(); -extern int *Bit_Expand(); - -#endif /* _BIT */ diff --git a/usr.bin/make/buf.c b/usr.bin/make/buf.c index 4f9f0fce2af..dd6b1b22617 100644 --- a/usr.bin/make/buf.c +++ b/usr.bin/make/buf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buf.c,v 1.12 1999/12/16 17:02:45 espie Exp $ */ +/* $OpenBSD: buf.c,v 1.13 2000/09/14 13:32:05 espie Exp $ */ /* $NetBSD: buf.c,v 1.9 1996/12/31 17:53:21 christos Exp $ */ /* @@ -66,14 +66,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)buf.c 8.1 (Berkeley) 6/6/93"; -#else -static char rcsid[] = "$OpenBSD: buf.c,v 1.12 1999/12/16 17:02:45 espie Exp $"; -#endif -#endif /* not lint */ - /*- * buf.c -- * Functions for automatically-expanded buffers. @@ -83,6 +75,15 @@ static char rcsid[] = "$OpenBSD: buf.c,v 1.12 1999/12/16 17:02:45 espie Exp $"; #include "make.h" #include "buf.h" +#ifndef lint +#if 0 +static char sccsid[] = "@(#)buf.c 8.1 (Berkeley) 6/6/93"; +#else +UNUSED +static char rcsid[] = "$OpenBSD: buf.c,v 1.13 2000/09/14 13:32:05 espie Exp $"; +#endif +#endif /* not lint */ + /* BufExpand -- * Expand the given buffer to hold the given number of additional * chars. Makes sure there's room for an extra '\0' char at diff --git a/usr.bin/make/buf.h b/usr.bin/make/buf.h index 42ad72beed4..2bb21b827d8 100644 --- a/usr.bin/make/buf.h +++ b/usr.bin/make/buf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: buf.h,v 1.11 1999/12/16 17:02:45 espie Exp $ */ +/* $OpenBSD: buf.h,v 1.12 2000/09/14 13:32:06 espie Exp $ */ /* $NetBSD: buf.h,v 1.7 1996/12/31 17:53:22 christos Exp $ */ /* @@ -60,7 +60,7 @@ typedef struct Buffer_ { typedef BUFFER *Buffer; /* Internal support for Buf_AddChar. */ -void BufOverflow __P((Buffer)); +extern void BufOverflow __P((Buffer)); /* User interface */ @@ -75,7 +75,7 @@ do { \ #define BUF_ERROR 256 /* Buf_AddChars -- Add a number of chars to the buffer. */ -void Buf_AddChars __P((Buffer, size_t, const char *)); +extern void Buf_AddChars __P((Buffer, size_t, const char *)); /* Buf_Reset -- Remove all chars from a buffer. */ #define Buf_Reset(bp) ((void)((bp)->inPtr = (bp)->buffer)) /* Buf_AddSpace -- Add a space to buffer. */ @@ -94,10 +94,10 @@ void Buf_AddChars __P((Buffer, size_t, const char *)); /* Buf_Init -- Initialize a buffer. If no initial size is given, * a reasonable default is used. */ -void Buf_Init __P((Buffer, size_t)); +extern void Buf_Init __P((Buffer, size_t)); /* Buf_Destroy -- Nuke a buffer and all its resources. */ -void Buf_Destroy __P((Buffer)); +extern void Buf_Destroy __P((Buffer)); /* Buf_ReplaceLastChar -- Replace the last char in a buffer. */ -void Buf_ReplaceLastChar __P((Buffer, char)); +extern void Buf_ReplaceLastChar __P((Buffer, char)); #endif /* _BUF_H */ diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c index 2df969be983..7dbe71f423b 100644 --- a/usr.bin/make/compat.c +++ b/usr.bin/make/compat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compat.c,v 1.32 2000/06/30 23:26:25 espie Exp $ */ +/* $OpenBSD: compat.c,v 1.33 2000/09/14 13:32:06 espie Exp $ */ /* $NetBSD: compat.c,v 1.14 1996/11/06 17:59:01 christos Exp $ */ /* @@ -39,14 +39,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; -#else -static char rcsid[] = "$OpenBSD: compat.c,v 1.32 2000/06/30 23:26:25 espie Exp $"; -#endif -#endif /* not lint */ - /*- * compat.c -- * The routines in this file implement the full-compatibility @@ -72,6 +64,15 @@ static char rcsid[] = "$OpenBSD: compat.c,v 1.32 2000/06/30 23:26:25 espie Exp $ #include "dir.h" #include "job.h" +#ifndef lint +#if 0 +static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; +#else +UNUSED +static char rcsid[] = "$OpenBSD: compat.c,v 1.33 2000/09/14 13:32:06 espie Exp $"; +#endif +#endif /* not lint */ + /* * The following array is used to make a fast determination of which * characters are interpreted specially by the shell. If a command diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c index 4c4669d947c..80c013cbc2c 100644 --- a/usr.bin/make/cond.c +++ b/usr.bin/make/cond.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cond.c,v 1.20 2000/07/17 23:54:26 espie Exp $ */ +/* $OpenBSD: cond.c,v 1.21 2000/09/14 13:32:06 espie Exp $ */ /* $NetBSD: cond.c,v 1.7 1996/11/06 17:59:02 christos Exp $ */ /* @@ -39,14 +39,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94"; -#else -static char rcsid[] = "$OpenBSD: cond.c,v 1.20 2000/07/17 23:54:26 espie Exp $"; -#endif -#endif /* not lint */ - /*- * cond.c -- * Functions to handle conditionals in a makefile. @@ -63,6 +55,15 @@ static char rcsid[] = "$OpenBSD: cond.c,v 1.20 2000/07/17 23:54:26 espie Exp $"; #include "dir.h" #include "buf.h" +#ifndef lint +#if 0 +static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94"; +#else +UNUSED +static char rcsid[] = "$OpenBSD: cond.c,v 1.21 2000/09/14 13:32:06 espie Exp $"; +#endif +#endif /* not lint */ + /* * The parsing of conditional expressions is based on this grammar: * E -> F || E diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c index 0d48b31f5f4..b19c5578a34 100644 --- a/usr.bin/make/dir.c +++ b/usr.bin/make/dir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dir.c,v 1.23 2000/06/23 16:41:52 espie Exp $ */ +/* $OpenBSD: dir.c,v 1.24 2000/09/14 13:32:06 espie Exp $ */ /* $NetBSD: dir.c,v 1.14 1997/03/29 16:51:26 christos Exp $ */ /* @@ -39,14 +39,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; -#else -static char rcsid[] = "$OpenBSD: dir.c,v 1.23 2000/06/23 16:41:52 espie Exp $"; -#endif -#endif /* not lint */ - /*- * dir.c -- * Directory searching using wildcards and/or normal names... @@ -98,6 +90,15 @@ static char rcsid[] = "$OpenBSD: dir.c,v 1.23 2000/06/23 16:41:52 espie Exp $"; #include "hash.h" #include "dir.h" +#ifndef lint +#if 0 +static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; +#else +UNUSED +static char rcsid[] = "$OpenBSD: dir.c,v 1.24 2000/09/14 13:32:06 espie Exp $"; +#endif +#endif /* not lint */ + /* * A search path consists of a Lst of Path structures. A Path structure * has in it the name of the directory and a hash table of all the files diff --git a/usr.bin/make/dir.h b/usr.bin/make/dir.h index 114895faafb..a53ab24faaf 100644 --- a/usr.bin/make/dir.h +++ b/usr.bin/make/dir.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dir.h,v 1.6 2000/06/10 01:41:05 espie Exp $ */ +/* $OpenBSD: dir.h,v 1.7 2000/09/14 13:32:06 espie Exp $ */ /* $NetBSD: dir.h,v 1.4 1996/11/06 17:59:05 christos Exp $ */ /* @@ -55,19 +55,19 @@ typedef struct Path { Hash_Table files; /* Hash table of files in directory */ } Path; -void Dir_Init __P((void)); -void Dir_End __P((void)); -Boolean Dir_HasWildcards __P((char *)); -void Dir_Expand __P((char *, Lst, Lst)); -char *Dir_FindFile __P((char *, Lst)); -Boolean Dir_MTime __P((GNode *)); -void Dir_AddDir __P((Lst, char *)); -char *Dir_MakeFlags __P((char *, Lst)); -void Dir_ClearPath __P((Lst)); -void Dir_Concat __P((Lst, Lst)); -void Dir_PrintDirectories __P((void)); -void Dir_PrintPath __P((Lst)); -void Dir_Destroy __P((void *)); -void *Dir_CopyDir __P((void *)); +extern void Dir_Init __P((void)); +extern void Dir_End __P((void)); +extern Boolean Dir_HasWildcards __P((char *)); +extern void Dir_Expand __P((char *, Lst, Lst)); +extern char *Dir_FindFile __P((char *, Lst)); +extern Boolean Dir_MTime __P((GNode *)); +extern void Dir_AddDir __P((Lst, char *)); +extern char *Dir_MakeFlags __P((char *, Lst)); +extern void Dir_ClearPath __P((Lst)); +extern void Dir_Concat __P((Lst, Lst)); +extern void Dir_PrintDirectories __P((void)); +extern void Dir_PrintPath __P((Lst)); +extern void Dir_Destroy __P((void *)); +extern void *Dir_CopyDir __P((void *)); #endif /* _DIR */ diff --git a/usr.bin/make/error.h b/usr.bin/make/error.h index d8db3f3658f..6e54c70e3fd 100644 --- a/usr.bin/make/error.h +++ b/usr.bin/make/error.h @@ -1,4 +1,4 @@ -/* $OpenBSD: error.h,v 1.2 2000/06/23 16:27:29 espie Exp $ */ +/* $OpenBSD: error.h,v 1.3 2000/09/14 13:32:06 espie Exp $ */ /*- * Copyright (c) 1988, 1989, 1990, 1993 @@ -41,18 +41,18 @@ */ #ifndef ERROR_H #define ERROR_H -void *emalloc __P((size_t)); -char *estrdup __P((const char *)); -void *erealloc __P((void *, size_t)); -void *ecalloc __P((size_t, size_t)); -int eunlink __P((const char *)); +extern void *emalloc __P((size_t)); +extern char *estrdup __P((const char *)); +extern void *erealloc __P((void *, size_t)); +extern void *ecalloc __P((size_t, size_t)); +extern int eunlink __P((const char *)); /* efree(x) works when x==NULL. STDC behavior, may need some different * definition for cross-builds on deficient systems */ #define efree free -void *hash_alloc __P((size_t, void *)); -void hash_free __P((void *, size_t, void *)); -void *element_alloc __P((size_t, void *)); +extern void *hash_alloc __P((size_t, void *)); +extern void hash_free __P((void *, size_t, void *)); +extern void *element_alloc __P((size_t, void *)); #endif /* ERROR_H */ diff --git a/usr.bin/make/extern.h b/usr.bin/make/extern.h index cb5dcbe0dbd..195104511b0 100644 --- a/usr.bin/make/extern.h +++ b/usr.bin/make/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.29 2000/07/18 20:17:19 espie Exp $ */ +/* $OpenBSD: extern.h,v 1.30 2000/09/14 13:32:06 espie Exp $ */ /* $NetBSD: nonints.h,v 1.12 1996/11/06 17:59:19 christos Exp $ */ /*- @@ -42,123 +42,123 @@ */ /* arch.c */ -ReturnStatus Arch_ParseArchive __P((char **, Lst, SymTable *)); -void Arch_Touch __P((GNode *)); -void Arch_TouchLib __P((GNode *)); -Boolean Arch_MTime __P((GNode *)); -Boolean Arch_MemMTime __P((GNode *)); -void Arch_FindLib __P((GNode *, Lst)); -Boolean Arch_LibOODate __P((GNode *)); -void Arch_Init __P((void)); -void Arch_End __P((void)); -int Arch_IsLib __P((GNode *)); +extern ReturnStatus Arch_ParseArchive __P((char **, Lst, SymTable *)); +extern void Arch_Touch __P((GNode *)); +extern void Arch_TouchLib __P((GNode *)); +extern Boolean Arch_MTime __P((GNode *)); +extern Boolean Arch_MemMTime __P((GNode *)); +extern void Arch_FindLib __P((GNode *, Lst)); +extern Boolean Arch_LibOODate __P((GNode *)); +extern void Arch_Init __P((void)); +extern void Arch_End __P((void)); +extern int Arch_IsLib __P((GNode *)); /* compat.c */ -void Compat_Run __P((Lst)); +extern void Compat_Run __P((Lst)); /* cond.c */ -int Cond_Eval __P((char *)); -void Cond_End __P((void)); +extern int Cond_Eval __P((char *)); +extern void Cond_End __P((void)); #include "error.h" /* for.c */ typedef struct For_ For; -For *For_Eval __P((char *)); -Boolean For_Accumulate __P((For *, const char *)); -void For_Run __P((For *)); +extern For *For_Eval __P((char *)); +extern Boolean For_Accumulate __P((For *, const char *)); +extern void For_Run __P((For *)); /* main.c */ -void Main_ParseArgLine __P((char *)); -char *Cmd_Exec __P((char *, char **)); -void Error __P((char *, ...)); -void Fatal __P((char *, ...)); -void Punt __P((char *, ...)); -void DieHorribly __P((void)); -void PrintAddr __P((void *)); -void Finish __P((int)); +extern void Main_ParseArgLine __P((char *)); +extern char *Cmd_Exec __P((char *, char **)); +extern void Error __P((char *, ...)); +extern void Fatal __P((char *, ...)); +extern void Punt __P((char *, ...)); +extern void DieHorribly __P((void)); +extern void PrintAddr __P((void *)); +extern void Finish __P((int)); /* make.c */ -void Make_TimeStamp __P((GNode *, GNode *)); -Boolean Make_OODate __P((GNode *)); -void Make_HandleUse __P((GNode *, GNode *)); -void Make_Update __P((GNode *)); -void Make_DoAllVar __P((GNode *)); -Boolean Make_Run __P((Lst)); +extern void Make_TimeStamp __P((GNode *, GNode *)); +extern Boolean Make_OODate __P((GNode *)); +extern void Make_HandleUse __P((GNode *, GNode *)); +extern void Make_Update __P((GNode *)); +extern void Make_DoAllVar __P((GNode *)); +extern Boolean Make_Run __P((Lst)); /* parse.c */ -void Parse_Error __P((int, char *, ...)); -Boolean Parse_AnyExport __P((void)); -Boolean Parse_IsVar __P((char *)); -void Parse_DoVar __P((char *, GSymT *)); -void Parse_AddIncludeDir __P((char *)); -void Parse_File __P((char *, FILE *)); -void Parse_Init __P((void)); -void Parse_End __P((void)); -void Parse_FromString __P((char *, unsigned long)); -void Parse_MainName __P((Lst)); -unsigned long Parse_Getlineno __P((void)); -const char *Parse_Getfilename __P((void)); +extern void Parse_Error __P((int, char *, ...)); +extern Boolean Parse_AnyExport __P((void)); +extern Boolean Parse_IsVar __P((char *)); +extern void Parse_DoVar __P((char *, GSymT *)); +extern void Parse_AddIncludeDir __P((char *)); +extern void Parse_File __P((char *, FILE *)); +extern void Parse_Init __P((void)); +extern void Parse_End __P((void)); +extern void Parse_FromString __P((char *, unsigned long)); +extern void Parse_MainName __P((Lst)); +extern unsigned long Parse_Getlineno __P((void)); +extern const char *Parse_Getfilename __P((void)); /* str.c */ -void str_init __P((void)); -void str_end __P((void)); -char *str_concat __P((const char *, const char *, char)); -char **brk_string __P((const char *, int *, Boolean, char **)); -int Str_Match __P((const char *, const char *)); -const char *Str_SYSVMatch __P((const char *, const char *, size_t *len)); -void Str_SYSVSubst __P((Buffer, const char *, const char *, size_t)); -char *interval_dup __P((const char *begin, const char *end)); +extern void str_init __P((void)); +extern void str_end __P((void)); +extern char *str_concat __P((const char *, const char *, char)); +extern char **brk_string __P((const char *, int *, Boolean, char **)); +extern int Str_Match __P((const char *, const char *)); +extern const char *Str_SYSVMatch __P((const char *, const char *, size_t *len)); +extern void Str_SYSVSubst __P((Buffer, const char *, const char *, size_t)); +extern char *interval_dup __P((const char *begin, const char *end)); /* suff.c */ -void Suff_ClearSuffixes __P((void)); -Boolean Suff_IsTransform __P((char *)); -GNode *Suff_AddTransform __P((char *)); -void Suff_EndTransform __P((void *)); -void Suff_AddSuffix __P((char *)); -Lst Suff_GetPath __P((char *)); -void Suff_DoPaths __P((void)); -void Suff_AddInclude __P((char *)); -void Suff_AddLib __P((char *)); -void Suff_FindDeps __P((GNode *)); -void Suff_SetNull __P((char *)); -void Suff_Init __P((void)); -void Suff_End __P((void)); -void Suff_PrintAll __P((void)); +extern void Suff_ClearSuffixes __P((void)); +extern Boolean Suff_IsTransform __P((char *)); +extern GNode *Suff_AddTransform __P((char *)); +extern void Suff_EndTransform __P((void *)); +extern void Suff_AddSuffix __P((char *)); +extern Lst Suff_GetPath __P((char *)); +extern void Suff_DoPaths __P((void)); +extern void Suff_AddInclude __P((char *)); +extern void Suff_AddLib __P((char *)); +extern void Suff_FindDeps __P((GNode *)); +extern void Suff_SetNull __P((char *)); +extern void Suff_Init __P((void)); +extern void Suff_End __P((void)); +extern void Suff_PrintAll __P((void)); /* targ.c */ -void Targ_Init __P((void)); -void Targ_End __P((void)); -GNode *Targ_NewGN __P((char *)); -GNode *Targ_FindNode __P((char *, int)); -void Targ_FindList __P((Lst, Lst)); -Boolean Targ_Ignore __P((GNode *)); -Boolean Targ_Silent __P((GNode *)); -Boolean Targ_Precious __P((GNode *)); -void Targ_SetMain __P((GNode *)); -void Targ_PrintCmd __P((void *)); -char *Targ_FmtTime __P((time_t)); -void Targ_PrintType __P((int)); -void Targ_PrintGraph __P((int)); +extern void Targ_Init __P((void)); +extern void Targ_End __P((void)); +extern GNode *Targ_NewGN __P((char *)); +extern GNode *Targ_FindNode __P((char *, int)); +extern void Targ_FindList __P((Lst, Lst)); +extern Boolean Targ_Ignore __P((GNode *)); +extern Boolean Targ_Silent __P((GNode *)); +extern Boolean Targ_Precious __P((GNode *)); +extern void Targ_SetMain __P((GNode *)); +extern void Targ_PrintCmd __P((void *)); +extern char *Targ_FmtTime __P((time_t)); +extern void Targ_PrintType __P((int)); +extern void Targ_PrintGraph __P((int)); /* var.c */ -void Var_Delete __P((char *, GSymT *)); -void Var_Set __P((char *, char *, GSymT *)); -void Varq_Set __P((int, char *, GNode *)); -void Var_Append __P((char *, char *, GSymT *)); -void Varq_Append __P((int, char *, GNode *)); -Boolean Var_Exists __P((char *, GSymT *)); -Boolean Varq_Exists __P((int, GNode *)); -char *Var_Value __P((char *, GSymT *)); -char *Varq_Value __P((int, GNode *)); -char *Var_Parse __P((char *, SymTable *, Boolean, size_t *, Boolean *)); -char *Var_Subst __P((char *, SymTable *, Boolean)); -void Var_SubstVar __P((Buffer, char *, const char *, GSymT *)); -char *Var_GetTail __P((char *)); -char *Var_GetHead __P((char *)); -void Var_Init __P((void)); -void Var_End __P((void)); -void Var_Dump __P((GSymT *)); -void SymTable_Init __P((SymTable *)); -void SymTable_Destroy __P((SymTable *)); +extern void Var_Delete __P((const char *, GSymT *)); +extern void Var_Set __P((const char *, const char *, GSymT *)); +extern void Varq_Set __P((int, const char *, GNode *)); +extern void Var_Append __P((const char *, const char *, GSymT *)); +extern void Varq_Append __P((int, const char *, GNode *)); +extern Boolean Var_Exists __P((const char *, GSymT *)); +extern Boolean Varq_Exists __P((int, GNode *)); +extern char *Var_Value __P((const char *, GSymT *)); +extern char *Varq_Value __P((int, GNode *)); +extern char *Var_Parse __P((char *, SymTable *, Boolean, size_t *, Boolean *)); +extern char *Var_Subst __P((char *, SymTable *, Boolean)); +extern void Var_SubstVar __P((Buffer, char *, const char *, GSymT *)); +extern char *Var_GetTail __P((char *)); +extern char *Var_GetHead __P((char *)); +extern void Var_Init __P((void)); +extern void Var_End __P((void)); +extern void Var_Dump __P((GSymT *)); +extern void SymTable_Init __P((SymTable *)); +extern void SymTable_Destroy __P((SymTable *)); extern void Var_AddCmdline __P((const char *)); diff --git a/usr.bin/make/for.c b/usr.bin/make/for.c index 11ef0441afd..96df436b6c7 100644 --- a/usr.bin/make/for.c +++ b/usr.bin/make/for.c @@ -1,4 +1,4 @@ -/* $OpenBSD: for.c,v 1.20 2000/07/17 21:48:40 espie Exp $ */ +/* $OpenBSD: for.c,v 1.21 2000/09/14 13:32:06 espie Exp $ */ /* $NetBSD: for.c,v 1.4 1996/11/06 17:59:05 christos Exp $ */ /* @@ -82,7 +82,8 @@ #if 0 static char sccsid[] = "@(#)for.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: for.c,v 1.20 2000/07/17 21:48:40 espie Exp $"; +UNUSED +static char rcsid[] = "$OpenBSD: for.c,v 1.21 2000/09/14 13:32:06 espie Exp $"; #endif #endif /* not lint */ diff --git a/usr.bin/make/hash.c b/usr.bin/make/hash.c index 6e07ac1ab85..9a135f37744 100644 --- a/usr.bin/make/hash.c +++ b/usr.bin/make/hash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hash.c,v 1.5 1999/12/18 21:53:32 espie Exp $ */ +/* $OpenBSD: hash.c,v 1.6 2000/09/14 13:32:06 espie Exp $ */ /* $NetBSD: hash.c,v 1.6 1996/11/06 17:59:06 christos Exp $ */ /* @@ -39,14 +39,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)hash.c 8.1 (Berkeley) 6/6/93"; -#else -static char rcsid[] = "$OpenBSD: hash.c,v 1.5 1999/12/18 21:53:32 espie Exp $"; -#endif -#endif /* not lint */ - /* hash.c -- * * This module contains routines to manipulate a hash table. @@ -58,6 +50,15 @@ static char rcsid[] = "$OpenBSD: hash.c,v 1.5 1999/12/18 21:53:32 espie Exp $"; #include "make.h" #include "hash.h" +#ifndef lint +#if 0 +static char sccsid[] = "@(#)hash.c 8.1 (Berkeley) 6/6/93"; +#else +UNUSED +static char rcsid[] = "$OpenBSD: hash.c,v 1.6 2000/09/14 13:32:06 espie Exp $"; +#endif +#endif /* not lint */ + /* * Forward references to local procedures that are used before they're * defined: diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index f91d2bde0bb..3571ce8f2ba 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -1,4 +1,4 @@ -/* $OpenBSD: job.c,v 1.34 2000/06/30 23:26:25 espie Exp $ */ +/* $OpenBSD: job.c,v 1.35 2000/09/14 13:32:06 espie Exp $ */ /* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */ /* @@ -39,14 +39,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; -#else -static char rcsid[] = "$OpenBSD: job.c,v 1.34 2000/06/30 23:26:25 espie Exp $"; -#endif -#endif /* not lint */ - /*- * job.c -- * handle the creation etc. of our child processes. @@ -128,6 +120,14 @@ static char rcsid[] = "$OpenBSD: job.c,v 1.34 2000/06/30 23:26:25 espie Exp $"; # define STATIC static #endif +#ifndef lint +#if 0 +static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; +#else +UNUSED +static char rcsid[] = "$OpenBSD: job.c,v 1.35 2000/09/14 13:32:06 espie Exp $"; +#endif +#endif /* not lint */ /* * error handling variables diff --git a/usr.bin/make/job.h b/usr.bin/make/job.h index 07955d14492..40aa45ce3f7 100644 --- a/usr.bin/make/job.h +++ b/usr.bin/make/job.h @@ -1,4 +1,4 @@ -/* $OpenBSD: job.h,v 1.7 2000/06/17 14:38:17 espie Exp $ */ +/* $OpenBSD: job.h,v 1.8 2000/09/14 13:32:07 espie Exp $ */ /* $NetBSD: job.h,v 1.5 1996/11/06 17:59:10 christos Exp $ */ /* @@ -219,19 +219,19 @@ extern LIST stoppedJobs; /* List of jobs that are stopped or didn't extern Boolean jobFull; /* Non-zero if no more jobs should/will start*/ -void Job_Touch __P((GNode *, Boolean)); -Boolean Job_CheckCommands __P((GNode *, void (*abortProc )(char *, ...))); -void Job_CatchChildren __P((Boolean)); -void Job_CatchOutput __P((void)); -void Job_Make __P((GNode *)); -void Job_Init __P((int, int)); -Boolean Job_Full __P((void)); -Boolean Job_Empty __P((void)); -ReturnStatus Job_ParseShell __P((char *)); -int Job_Finish __P((void)); -void Job_End __P((void)); -void Job_Wait __P((void)); -void Job_AbortAll __P((void)); -void JobFlagForMigration __P((int)); +extern void Job_Touch __P((GNode *, Boolean)); +extern Boolean Job_CheckCommands __P((GNode *, void (*abortProc )(char *, ...))); +extern void Job_CatchChildren __P((Boolean)); +extern void Job_CatchOutput __P((void)); +extern void Job_Make __P((GNode *)); +extern void Job_Init __P((int, int)); +extern Boolean Job_Full __P((void)); +extern Boolean Job_Empty __P((void)); +extern ReturnStatus Job_ParseShell __P((char *)); +extern int Job_Finish __P((void)); +extern void Job_End __P((void)); +extern void Job_Wait __P((void)); +extern void Job_AbortAll __P((void)); +extern void JobFlagForMigration __P((int)); #endif /* _JOB_H_ */ diff --git a/usr.bin/make/lowparse.c b/usr.bin/make/lowparse.c index 9234727cca7..01d9c660e88 100644 --- a/usr.bin/make/lowparse.c +++ b/usr.bin/make/lowparse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lowparse.c,v 1.3 2000/07/17 23:54:26 espie Exp $ */ +/* $OpenBSD: lowparse.c,v 1.4 2000/09/14 13:32:07 espie Exp $ */ /* low-level parsing functions. */ @@ -61,11 +61,9 @@ static IFile *new_ifile __P((char *, FILE *)); static IFile *new_istring __P((char *, char *, unsigned long)); static void free_ifile __P((IFile *)); static void ParseVErrorInternal __P((char *, unsigned long, int, char *, va_list)); -static int skiptoendofline __P((void)); static int newline __P((void)); #define ParseReadc() current->ptr < current->end ? *current->ptr++ : newline() static void ParseUnreadc __P((char)); -static int ParseSkipEmptyLines __P((Buffer)); static int fatals = 0; /*- diff --git a/usr.bin/make/lst.h b/usr.bin/make/lst.h index 12c6cd92202..05f58935f32 100644 --- a/usr.bin/make/lst.h +++ b/usr.bin/make/lst.h @@ -1,4 +1,4 @@ -/* $OpenBSD: lst.h,v 1.17 2000/06/23 16:15:49 espie Exp $ */ +/* $OpenBSD: lst.h,v 1.18 2000/09/14 13:32:07 espie Exp $ */ /* $NetBSD: lst.h,v 1.7 1996/11/06 17:59:12 christos Exp $ */ /* @@ -104,96 +104,91 @@ typedef void * (*DuplicateProc) __P((void *)); #define NOCOPY ((DuplicateProc)0) /* - * Creation/destruction functions + * Constructors/destructors */ -/* CTOR/DTOR, ala C++ */ /* Create a new list */ -void Lst_Init __P((Lst)); +extern void Lst_Init __P((Lst)); /* Destroy an old one */ -void Lst_Destroy __P((Lst, SimpleProc)); +extern void Lst_Destroy __P((Lst, SimpleProc)); /* Duplicate an existing list */ -Lst Lst_Clone __P((Lst, Lst, DuplicateProc)); +extern Lst Lst_Clone __P((Lst, Lst, DuplicateProc)); /* True if list is empty */ -Boolean Lst_IsEmpty __P((Lst)); +extern Boolean Lst_IsEmpty __P((Lst)); /* - * Functions to modify a list + * List modifications */ /* Insert an element before another */ -void Lst_Insert __P((Lst, LstNode, void *)); +extern void Lst_Insert __P((Lst, LstNode, void *)); /* Insert an element after another */ -void Lst_Append __P((Lst, LstNode, void *)); +extern void Lst_Append __P((Lst, LstNode, void *)); /* Place an element at the front of a lst. */ -void Lst_AtFront __P((Lst, void *)); +extern void Lst_AtFront __P((Lst, void *)); /* Place an element at the end of a lst. */ -void Lst_AtEnd __P((Lst, void *)); +extern void Lst_AtEnd __P((Lst, void *)); /* Remove an element */ -void Lst_Remove __P((Lst, LstNode)); +extern void Lst_Remove __P((Lst, LstNode)); /* Replace a node with a new value */ -void Lst_Replace __P((LstNode, void *)); +extern void Lst_Replace __P((LstNode, void *)); /* Concatenate two lists, destructive. */ -void Lst_ConcatDestroy __P((Lst, Lst)); +extern void Lst_ConcatDestroy __P((Lst, Lst)); /* Concatenate two lists, non destructive */ -void Lst_Concat __P((Lst, Lst)); +extern void Lst_Concat __P((Lst, Lst)); /* - * Node-specific functions + * Node handling */ /* Return first element in list */ #define Lst_First(l) ((l)->firstPtr) /* Return last element in list */ #define Lst_Last(l) ((l)->lastPtr) /* Return successor to given element */ -LstNode Lst_Succ __P((LstNode)); +extern LstNode Lst_Succ __P((LstNode)); /* Return successor to existing element */ #define Lst_Adv(ln) ((ln)->nextPtr) /* Get datum from LstNode */ #define Lst_Datum(ln) ((ln)->datum) /* - * Functions for entire lists + * Apply to entire lists */ /* Find an element in a list */ #define Lst_Find(l, cProc, d) Lst_FindFrom(Lst_First(l), cProc, d) /* Find an element starting from somewhere */ -LstNode Lst_FindFrom __P((LstNode, FindProc, void *)); +extern LstNode Lst_FindFrom __P((LstNode, FindProc, void *)); /* Apply a function to all elements of a lst */ #define Lst_ForEach(l, proc, d) Lst_ForEachFrom(Lst_First(l), proc, d) /* Apply a function to all elements of a lst starting from a certain point. */ -void Lst_ForEachFrom __P((LstNode, ForEachProc, void *)); -void Lst_Every __P((Lst, SimpleProc)); +extern void Lst_ForEachFrom __P((LstNode, ForEachProc, void *)); +extern void Lst_Every __P((Lst, SimpleProc)); -/* - * See if the given datum is on the list. Returns the LstNode containing - * the datum - */ -LstNode Lst_Member __P((Lst, void *)); +/* Find datum in a list. Returns the LstNode containing the datum */ +extern LstNode Lst_Member __P((Lst, void *)); /* - * these functions are for dealing with a list as a table, of sorts. - * An idea of the "current element" is kept and used by all the functions - * between Lst_Open() and Lst_Close(). + * Visitor-like pattern. Except the visitor is kept in the list. + * Error-prone and wasteful (used by only a few lists), to be killed. */ /* Open the list */ -void Lst_Open __P((Lst)); +extern void Lst_Open __P((Lst)); /* Next element please */ -LstNode Lst_Next __P((Lst)); +extern LstNode Lst_Next __P((Lst)); /* Done yet? */ -Boolean Lst_IsAtEnd __P((Lst)); +extern Boolean Lst_IsAtEnd __P((Lst)); /* Finish table access */ -void Lst_Close __P((Lst)); +extern void Lst_Close __P((Lst)); /* - * for using the list as a queue + * Queue manipulators */ /* Place an element at tail of queue */ -void Lst_EnQueue __P((Lst, void *)); +extern void Lst_EnQueue __P((Lst, void *)); /* Remove an element from head of queue */ -void * Lst_DeQueue __P((Lst)); +extern void * Lst_DeQueue __P((Lst)); #endif /* _LST_H_ */ diff --git a/usr.bin/make/lst.lib/lstAppend.c b/usr.bin/make/lst.lib/lstAppend.c index cc4a494fcb3..f0ecb75dc19 100644 --- a/usr.bin/make/lst.lib/lstAppend.c +++ b/usr.bin/make/lst.lib/lstAppend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstAppend.c,v 1.10 2000/06/17 14:43:38 espie Exp $ */ +/* $OpenBSD: lstAppend.c,v 1.11 2000/09/14 13:32:08 espie Exp $ */ /* $NetBSD: lstAppend.c,v 1.5 1996/11/06 17:59:31 christos Exp $ */ /* @@ -37,20 +37,21 @@ * SUCH DAMAGE. */ +/*- + * LstAppend.c -- + * Add a new node with a new datum after an existing node + */ + +#include "lstInt.h" #ifndef lint #if 0 static char sccsid[] = "@(#)lstAppend.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstAppend.c,v 1.10 2000/06/17 14:43:38 espie Exp $"; +UNUSED +static char rcsid[] = "$OpenBSD: lstAppend.c,v 1.11 2000/09/14 13:32:08 espie Exp $"; #endif #endif /* not lint */ -/*- - * LstAppend.c -- - * Add a new node with a new datum after an existing node - */ - -#include "lstInt.h" /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/lst.lib/lstAtEnd.c b/usr.bin/make/lst.lib/lstAtEnd.c index 63684eb27b7..45b39a49a7c 100644 --- a/usr.bin/make/lst.lib/lstAtEnd.c +++ b/usr.bin/make/lst.lib/lstAtEnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstAtEnd.c,v 1.6 2000/06/10 01:41:06 espie Exp $ */ +/* $OpenBSD: lstAtEnd.c,v 1.7 2000/09/14 13:32:08 espie Exp $ */ /* $NetBSD: lstAtEnd.c,v 1.5 1996/11/06 17:59:32 christos Exp $ */ /* @@ -37,20 +37,21 @@ * SUCH DAMAGE. */ +/*- + * LstAtEnd.c -- + * Add a node at the end of the list + */ + +#include "lstInt.h" #ifndef lint #if 0 static char sccsid[] = "@(#)lstAtEnd.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstAtEnd.c,v 1.6 2000/06/10 01:41:06 espie Exp $"; +UNUSED +static char rcsid[] = "$OpenBSD: lstAtEnd.c,v 1.7 2000/09/14 13:32:08 espie Exp $"; #endif #endif /* not lint */ -/*- - * LstAtEnd.c -- - * Add a node at the end of the list - */ - -#include "lstInt.h" /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/lst.lib/lstAtFront.c b/usr.bin/make/lst.lib/lstAtFront.c index 51b3860bcf6..070bea0e9ff 100644 --- a/usr.bin/make/lst.lib/lstAtFront.c +++ b/usr.bin/make/lst.lib/lstAtFront.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstAtFront.c,v 1.6 2000/06/10 01:41:06 espie Exp $ */ +/* $OpenBSD: lstAtFront.c,v 1.7 2000/09/14 13:32:08 espie Exp $ */ /* $NetBSD: lstAtFront.c,v 1.5 1996/11/06 17:59:33 christos Exp $ */ /* @@ -37,20 +37,21 @@ * SUCH DAMAGE. */ +/*- + * LstAtFront.c -- + * Add a node at the front of the list + */ + +#include "lstInt.h" #ifndef lint #if 0 static char sccsid[] = "@(#)lstAtFront.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstAtFront.c,v 1.6 2000/06/10 01:41:06 espie Exp $"; +UNUSED +static char rcsid[] = "$OpenBSD: lstAtFront.c,v 1.7 2000/09/14 13:32:08 espie Exp $"; #endif #endif /* not lint */ -/*- - * LstAtFront.c -- - * Add a node at the front of the list - */ - -#include "lstInt.h" /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/lst.lib/lstClose.c b/usr.bin/make/lst.lib/lstClose.c index 9c804260a88..05fc360bb77 100644 --- a/usr.bin/make/lst.lib/lstClose.c +++ b/usr.bin/make/lst.lib/lstClose.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstClose.c,v 1.6 2000/06/17 14:43:38 espie Exp $ */ +/* $OpenBSD: lstClose.c,v 1.7 2000/09/14 13:32:08 espie Exp $ */ /* $NetBSD: lstClose.c,v 1.5 1996/11/06 17:59:34 christos Exp $ */ /* @@ -37,14 +37,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstClose.c 8.1 (Berkeley) 6/6/93"; -#else -static char rcsid[] = "$OpenBSD: lstClose.c,v 1.6 2000/06/17 14:43:38 espie Exp $"; -#endif -#endif /* not lint */ - /*- * LstClose.c -- * Close a list for sequential access. @@ -56,6 +48,15 @@ static char rcsid[] = "$OpenBSD: lstClose.c,v 1.6 2000/06/17 14:43:38 espie Exp */ #include "lstInt.h" +#ifndef lint +#if 0 +static char sccsid[] = "@(#)lstClose.c 8.1 (Berkeley) 6/6/93"; +#else +UNUSED +static char rcsid[] = "$OpenBSD: lstClose.c,v 1.7 2000/09/14 13:32:08 espie Exp $"; +#endif +#endif /* not lint */ + /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/lst.lib/lstConcat.c b/usr.bin/make/lst.lib/lstConcat.c index bde8253bc84..15618b47f81 100644 --- a/usr.bin/make/lst.lib/lstConcat.c +++ b/usr.bin/make/lst.lib/lstConcat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstConcat.c,v 1.10 2000/06/17 14:43:38 espie Exp $ */ +/* $OpenBSD: lstConcat.c,v 1.11 2000/09/14 13:32:08 espie Exp $ */ /* $NetBSD: lstConcat.c,v 1.6 1996/11/06 17:59:34 christos Exp $ */ /* @@ -37,20 +37,21 @@ * SUCH DAMAGE. */ +/*- + * listConcat.c -- + * Function to concatentate two lists. + */ + +#include "lstInt.h" #ifndef lint #if 0 static char sccsid[] = "@(#)lstConcat.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstConcat.c,v 1.10 2000/06/17 14:43:38 espie Exp $"; +UNUSED +static char rcsid[] = "$OpenBSD: lstConcat.c,v 1.11 2000/09/14 13:32:08 espie Exp $"; #endif #endif /* not lint */ -/*- - * listConcat.c -- - * Function to concatentate two lists. - */ - -#include "lstInt.h" /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/lst.lib/lstConcatDestroy.c b/usr.bin/make/lst.lib/lstConcatDestroy.c index 5f53abd51d1..b45df54a8c3 100644 --- a/usr.bin/make/lst.lib/lstConcatDestroy.c +++ b/usr.bin/make/lst.lib/lstConcatDestroy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstConcatDestroy.c,v 1.1 2000/06/17 14:44:26 espie Exp $ */ +/* $OpenBSD: lstConcatDestroy.c,v 1.2 2000/09/14 13:32:08 espie Exp $ */ /* $NetBSD: lstConcat.c,v 1.6 1996/11/06 17:59:34 christos Exp $ */ /* @@ -37,20 +37,21 @@ * SUCH DAMAGE. */ +/*- + * listConcatDestroy.c -- + * Function to concatentate two lists. + */ + +#include "lstInt.h" #ifndef lint #if 0 static char sccsid[] = "@(#)lstConcat.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstConcatDestroy.c,v 1.1 2000/06/17 14:44:26 espie Exp $"; +UNUSED +static char rcsid[] = "$OpenBSD: lstConcatDestroy.c,v 1.2 2000/09/14 13:32:08 espie Exp $"; #endif #endif /* not lint */ -/*- - * listConcatDestroy.c -- - * Function to concatentate two lists. - */ - -#include "lstInt.h" /*- *----------------------------------------------------------------------- @@ -72,11 +73,6 @@ Lst_ConcatDestroy(l1, l2) Lst l1; /* The list to which l2 is to be appended */ Lst l2; /* The list to append to l1 */ { - LstNode ln; /* original LstNode */ - LstNode nln; /* new LstNode */ - LstNode last; /* the last element in the list. Keeps - * bookkeeping until the end */ - if (l2->firstPtr != NULL) { /* * We set the nextPtr of the diff --git a/usr.bin/make/lst.lib/lstDeQueue.c b/usr.bin/make/lst.lib/lstDeQueue.c index 1389c411bb6..3c09db5e7dc 100644 --- a/usr.bin/make/lst.lib/lstDeQueue.c +++ b/usr.bin/make/lst.lib/lstDeQueue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstDeQueue.c,v 1.9 2000/06/17 14:34:07 espie Exp $ */ +/* $OpenBSD: lstDeQueue.c,v 1.10 2000/09/14 13:32:09 espie Exp $ */ /* $NetBSD: lstDeQueue.c,v 1.5 1996/11/06 17:59:36 christos Exp $ */ /* @@ -37,20 +37,21 @@ * SUCH DAMAGE. */ +/*- + * LstDeQueue.c -- + * Remove the node and return its datum from the head of the list + */ + +#include "lstInt.h" #ifndef lint #if 0 static char sccsid[] = "@(#)lstDeQueue.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstDeQueue.c,v 1.9 2000/06/17 14:34:07 espie Exp $"; +UNUSED +static char rcsid[] = "$OpenBSD: lstDeQueue.c,v 1.10 2000/09/14 13:32:09 espie Exp $"; #endif #endif /* not lint */ -/*- - * LstDeQueue.c -- - * Remove the node and return its datum from the head of the list - */ - -#include "lstInt.h" /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/lst.lib/lstDestroy.c b/usr.bin/make/lst.lib/lstDestroy.c index d7fea7f449f..cae5dbed8f8 100644 --- a/usr.bin/make/lst.lib/lstDestroy.c +++ b/usr.bin/make/lst.lib/lstDestroy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstDestroy.c,v 1.10 2000/06/17 14:43:38 espie Exp $ */ +/* $OpenBSD: lstDestroy.c,v 1.11 2000/09/14 13:32:09 espie Exp $ */ /* $NetBSD: lstDestroy.c,v 1.6 1996/11/06 17:59:37 christos Exp $ */ /* @@ -37,20 +37,21 @@ * SUCH DAMAGE. */ +/*- + * LstDestroy.c -- + * Nuke a list and all its resources + */ + +#include "lstInt.h" #ifndef lint #if 0 static char sccsid[] = "@(#)lstDestroy.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstDestroy.c,v 1.10 2000/06/17 14:43:38 espie Exp $"; +UNUSED +static char rcsid[] = "$OpenBSD: lstDestroy.c,v 1.11 2000/09/14 13:32:09 espie Exp $"; #endif #endif /* not lint */ -/*- - * LstDestroy.c -- - * Nuke a list and all its resources - */ - -#include "lstInt.h" /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/lst.lib/lstDupl.c b/usr.bin/make/lst.lib/lstDupl.c index 049354662f0..d8e28c0915a 100644 --- a/usr.bin/make/lst.lib/lstDupl.c +++ b/usr.bin/make/lst.lib/lstDupl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstDupl.c,v 1.12 2000/06/17 14:43:39 espie Exp $ */ +/* $OpenBSD: lstDupl.c,v 1.13 2000/09/14 13:32:09 espie Exp $ */ /* $NetBSD: lstDupl.c,v 1.6 1996/11/06 17:59:37 christos Exp $ */ /* @@ -37,14 +37,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstDupl.c 8.1 (Berkeley) 6/6/93"; -#else -static char rcsid[] = "$OpenBSD: lstDupl.c,v 1.12 2000/06/17 14:43:39 espie Exp $"; -#endif -#endif /* not lint */ - /*- * listDupl.c -- * Duplicate a list. This includes duplicating the individual @@ -52,6 +44,15 @@ static char rcsid[] = "$OpenBSD: lstDupl.c,v 1.12 2000/06/17 14:43:39 espie Exp */ #include "lstInt.h" +#ifndef lint +#if 0 +static char sccsid[] = "@(#)lstDupl.c 8.1 (Berkeley) 6/6/93"; +#else +UNUSED +static char rcsid[] = "$OpenBSD: lstDupl.c,v 1.13 2000/09/14 13:32:09 espie Exp $"; +#endif +#endif /* not lint */ + /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/lst.lib/lstEnQueue.c b/usr.bin/make/lst.lib/lstEnQueue.c index 6432c9b76ca..5cd86f1147c 100644 --- a/usr.bin/make/lst.lib/lstEnQueue.c +++ b/usr.bin/make/lst.lib/lstEnQueue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstEnQueue.c,v 1.7 2000/06/17 14:43:39 espie Exp $ */ +/* $OpenBSD: lstEnQueue.c,v 1.8 2000/09/14 13:32:09 espie Exp $ */ /* $NetBSD: lstEnQueue.c,v 1.5 1996/11/06 17:59:38 christos Exp $ */ /* @@ -37,20 +37,21 @@ * SUCH DAMAGE. */ +/*- + * LstEnQueue.c-- + * Treat the list as a queue and place a datum at its end + */ + +#include "lstInt.h" #ifndef lint #if 0 static char sccsid[] = "@(#)lstEnQueue.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstEnQueue.c,v 1.7 2000/06/17 14:43:39 espie Exp $"; +UNUSED +static char rcsid[] = "$OpenBSD: lstEnQueue.c,v 1.8 2000/09/14 13:32:09 espie Exp $"; #endif #endif /* not lint */ -/*- - * LstEnQueue.c-- - * Treat the list as a queue and place a datum at its end - */ - -#include "lstInt.h" /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/lst.lib/lstFindFrom.c b/usr.bin/make/lst.lib/lstFindFrom.c index e54c46ae6ce..680257061e5 100644 --- a/usr.bin/make/lst.lib/lstFindFrom.c +++ b/usr.bin/make/lst.lib/lstFindFrom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstFindFrom.c,v 1.8 2000/06/17 14:34:07 espie Exp $ */ +/* $OpenBSD: lstFindFrom.c,v 1.9 2000/09/14 13:32:09 espie Exp $ */ /* $NetBSD: lstFindFrom.c,v 1.6 1996/11/06 17:59:40 christos Exp $ */ /* @@ -37,20 +37,21 @@ * SUCH DAMAGE. */ +/*- + * LstFindFrom.c -- + * Find a node on a list from a given starting point. Used by Lst_Find. + */ + +#include "lstInt.h" #ifndef lint #if 0 static char sccsid[] = "@(#)lstFindFrom.c 8.1 (Berkeley) 6/6/93"; #else -static char *rcsid = "$OpenBSD: lstFindFrom.c,v 1.8 2000/06/17 14:34:07 espie Exp $"; +UNUSED +static char *rcsid = "$OpenBSD: lstFindFrom.c,v 1.9 2000/09/14 13:32:09 espie Exp $"; #endif #endif /* not lint */ -/*- - * LstFindFrom.c -- - * Find a node on a list from a given starting point. Used by Lst_Find. - */ - -#include "lstInt.h" /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/lst.lib/lstForEachFrom.c b/usr.bin/make/lst.lib/lstForEachFrom.c index c7700b61f2b..d3b352d7376 100644 --- a/usr.bin/make/lst.lib/lstForEachFrom.c +++ b/usr.bin/make/lst.lib/lstForEachFrom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstForEachFrom.c,v 1.8 2000/06/17 14:34:08 espie Exp $ */ +/* $OpenBSD: lstForEachFrom.c,v 1.9 2000/09/14 13:32:09 espie Exp $ */ /* $NetBSD: lstForEachFrom.c,v 1.5 1996/11/06 17:59:42 christos Exp $ */ /* @@ -37,14 +37,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstForEachFrom.c 8.1 (Berkeley) 6/6/93"; -#else -static char rcsid[] = "$OpenBSD: lstForEachFrom.c,v 1.8 2000/06/17 14:34:08 espie Exp $"; -#endif -#endif /* not lint */ - /*- * lstForEachFrom.c -- * Perform a given function on all elements of a list starting from @@ -52,6 +44,15 @@ static char rcsid[] = "$OpenBSD: lstForEachFrom.c,v 1.8 2000/06/17 14:34:08 espi */ #include "lstInt.h" +#ifndef lint +#if 0 +static char sccsid[] = "@(#)lstForEachFrom.c 8.1 (Berkeley) 6/6/93"; +#else +UNUSED +static char rcsid[] = "$OpenBSD: lstForEachFrom.c,v 1.9 2000/09/14 13:32:09 espie Exp $"; +#endif +#endif /* not lint */ + /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/lst.lib/lstInit.c b/usr.bin/make/lst.lib/lstInit.c index 8e393363924..1e4cdcd9b41 100644 --- a/usr.bin/make/lst.lib/lstInit.c +++ b/usr.bin/make/lst.lib/lstInit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstInit.c,v 1.9 2000/06/17 14:43:39 espie Exp $ */ +/* $OpenBSD: lstInit.c,v 1.10 2000/09/14 13:32:09 espie Exp $ */ /* $NetBSD: lstInit.c,v 1.5 1996/11/06 17:59:43 christos Exp $ */ /* @@ -37,20 +37,21 @@ * SUCH DAMAGE. */ +/*- + * init.c -- + * Initialize a new linked list. + */ + +#include "lstInt.h" #ifndef lint #if 0 static char sccsid[] = "@(#)lstInit.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstInit.c,v 1.9 2000/06/17 14:43:39 espie Exp $"; +UNUSED +static char rcsid[] = "$OpenBSD: lstInit.c,v 1.10 2000/09/14 13:32:09 espie Exp $"; #endif #endif /* not lint */ -/*- - * init.c -- - * Initialize a new linked list. - */ - -#include "lstInt.h" /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/lst.lib/lstInsert.c b/usr.bin/make/lst.lib/lstInsert.c index 50c3af30689..356393f7d92 100644 --- a/usr.bin/make/lst.lib/lstInsert.c +++ b/usr.bin/make/lst.lib/lstInsert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstInsert.c,v 1.10 2000/06/17 14:43:39 espie Exp $ */ +/* $OpenBSD: lstInsert.c,v 1.11 2000/09/14 13:32:09 espie Exp $ */ /* $NetBSD: lstInsert.c,v 1.5 1996/11/06 17:59:44 christos Exp $ */ /* @@ -37,20 +37,21 @@ * SUCH DAMAGE. */ +/*- + * LstInsert.c -- + * Insert a new datum before an old one + */ + +#include "lstInt.h" #ifndef lint #if 0 static char sccsid[] = "@(#)lstInsert.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstInsert.c,v 1.10 2000/06/17 14:43:39 espie Exp $"; +UNUSED +static char rcsid[] = "$OpenBSD: lstInsert.c,v 1.11 2000/09/14 13:32:09 espie Exp $"; #endif #endif /* not lint */ -/*- - * LstInsert.c -- - * Insert a new datum before an old one - */ - -#include "lstInt.h" /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/lst.lib/lstIsAtEnd.c b/usr.bin/make/lst.lib/lstIsAtEnd.c index 6e640433da8..29eb4fdc81c 100644 --- a/usr.bin/make/lst.lib/lstIsAtEnd.c +++ b/usr.bin/make/lst.lib/lstIsAtEnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstIsAtEnd.c,v 1.6 2000/06/17 14:43:40 espie Exp $ */ +/* $OpenBSD: lstIsAtEnd.c,v 1.7 2000/09/14 13:32:09 espie Exp $ */ /* $NetBSD: lstIsAtEnd.c,v 1.5 1996/11/06 17:59:45 christos Exp $ */ /* @@ -37,14 +37,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstIsAtEnd.c 8.1 (Berkeley) 6/6/93"; -#else -static char rcsid[] = "$OpenBSD: lstIsAtEnd.c,v 1.6 2000/06/17 14:43:40 espie Exp $"; -#endif -#endif /* not lint */ - /*- * LstIsAtEnd.c -- * Tell if the current node is at the end of the list. @@ -56,6 +48,15 @@ static char rcsid[] = "$OpenBSD: lstIsAtEnd.c,v 1.6 2000/06/17 14:43:40 espie Ex */ #include "lstInt.h" +#ifndef lint +#if 0 +static char sccsid[] = "@(#)lstIsAtEnd.c 8.1 (Berkeley) 6/6/93"; +#else +UNUSED +static char rcsid[] = "$OpenBSD: lstIsAtEnd.c,v 1.7 2000/09/14 13:32:09 espie Exp $"; +#endif +#endif /* not lint */ + /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/lst.lib/lstIsEmpty.c b/usr.bin/make/lst.lib/lstIsEmpty.c index b98ca563a19..29b18a9f27c 100644 --- a/usr.bin/make/lst.lib/lstIsEmpty.c +++ b/usr.bin/make/lst.lib/lstIsEmpty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstIsEmpty.c,v 1.6 2000/06/17 14:43:40 espie Exp $ */ +/* $OpenBSD: lstIsEmpty.c,v 1.7 2000/09/14 13:32:09 espie Exp $ */ /* $NetBSD: lstIsEmpty.c,v 1.5 1996/11/06 17:59:47 christos Exp $ */ /* @@ -37,20 +37,21 @@ * SUCH DAMAGE. */ +/*- + * LstIsEmpty.c -- + * A single function to decide if a list is empty + */ + +#include "lstInt.h" #ifndef lint #if 0 static char sccsid[] = "@(#)lstIsEmpty.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstIsEmpty.c,v 1.6 2000/06/17 14:43:40 espie Exp $"; +UNUSED +static char rcsid[] = "$OpenBSD: lstIsEmpty.c,v 1.7 2000/09/14 13:32:09 espie Exp $"; #endif #endif /* not lint */ -/*- - * LstIsEmpty.c -- - * A single function to decide if a list is empty - */ - -#include "lstInt.h" /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/lst.lib/lstMember.c b/usr.bin/make/lst.lib/lstMember.c index b799ea7287c..b78ce79f10d 100644 --- a/usr.bin/make/lst.lib/lstMember.c +++ b/usr.bin/make/lst.lib/lstMember.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstMember.c,v 1.7 2000/06/17 14:34:09 espie Exp $ */ +/* $OpenBSD: lstMember.c,v 1.8 2000/09/14 13:32:09 espie Exp $ */ /* $NetBSD: lstMember.c,v 1.5 1996/11/06 17:59:48 christos Exp $ */ /* @@ -37,20 +37,21 @@ * SUCH DAMAGE. */ +/*- + * lstMember.c -- + * See if a given datum is on a given list. + */ + +#include "lstInt.h" #ifndef lint #if 0 static char sccsid[] = "@(#)lstMember.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstMember.c,v 1.7 2000/06/17 14:34:09 espie Exp $"; +UNUSED +static char rcsid[] = "$OpenBSD: lstMember.c,v 1.8 2000/09/14 13:32:09 espie Exp $"; #endif #endif /* not lint */ -/*- - * lstMember.c -- - * See if a given datum is on a given list. - */ - -#include "lstInt.h" LstNode Lst_Member(l, d) diff --git a/usr.bin/make/lst.lib/lstNext.c b/usr.bin/make/lst.lib/lstNext.c index fd4c4cf7b4d..902a6de1029 100644 --- a/usr.bin/make/lst.lib/lstNext.c +++ b/usr.bin/make/lst.lib/lstNext.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstNext.c,v 1.7 2000/06/17 14:43:40 espie Exp $ */ +/* $OpenBSD: lstNext.c,v 1.8 2000/09/14 13:32:10 espie Exp $ */ /* $NetBSD: lstNext.c,v 1.5 1996/11/06 17:59:49 christos Exp $ */ /* @@ -37,14 +37,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstNext.c 8.1 (Berkeley) 6/6/93"; -#else -static char rcsid[] = "$OpenBSD: lstNext.c,v 1.7 2000/06/17 14:43:40 espie Exp $"; -#endif -#endif /* not lint */ - /*- * LstNext.c -- * Return the next node for a list. @@ -56,6 +48,15 @@ static char rcsid[] = "$OpenBSD: lstNext.c,v 1.7 2000/06/17 14:43:40 espie Exp $ */ #include "lstInt.h" +#ifndef lint +#if 0 +static char sccsid[] = "@(#)lstNext.c 8.1 (Berkeley) 6/6/93"; +#else +UNUSED +static char rcsid[] = "$OpenBSD: lstNext.c,v 1.8 2000/09/14 13:32:10 espie Exp $"; +#endif +#endif /* not lint */ + /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/lst.lib/lstOpen.c b/usr.bin/make/lst.lib/lstOpen.c index b12d78194c7..08e0f4f56c9 100644 --- a/usr.bin/make/lst.lib/lstOpen.c +++ b/usr.bin/make/lst.lib/lstOpen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstOpen.c,v 1.8 2000/06/23 16:15:51 espie Exp $ */ +/* $OpenBSD: lstOpen.c,v 1.9 2000/09/14 13:32:10 espie Exp $ */ /* $NetBSD: lstOpen.c,v 1.5 1996/11/06 17:59:50 christos Exp $ */ /* @@ -37,14 +37,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstOpen.c 8.1 (Berkeley) 6/6/93"; -#else -static char rcsid[] = "$OpenBSD: lstOpen.c,v 1.8 2000/06/23 16:15:51 espie Exp $"; -#endif -#endif /* not lint */ - /*- * LstOpen.c -- * Open a list for sequential access. The sequential functions access the @@ -55,6 +47,15 @@ static char rcsid[] = "$OpenBSD: lstOpen.c,v 1.8 2000/06/23 16:15:51 espie Exp $ */ #include "lstInt.h" +#ifndef lint +#if 0 +static char sccsid[] = "@(#)lstOpen.c 8.1 (Berkeley) 6/6/93"; +#else +UNUSED +static char rcsid[] = "$OpenBSD: lstOpen.c,v 1.9 2000/09/14 13:32:10 espie Exp $"; +#endif +#endif /* not lint */ + /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/lst.lib/lstRemove.c b/usr.bin/make/lst.lib/lstRemove.c index e6be2a8eff2..d4d900768df 100644 --- a/usr.bin/make/lst.lib/lstRemove.c +++ b/usr.bin/make/lst.lib/lstRemove.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstRemove.c,v 1.9 2000/06/17 14:43:40 espie Exp $ */ +/* $OpenBSD: lstRemove.c,v 1.10 2000/09/14 13:32:10 espie Exp $ */ /* $NetBSD: lstRemove.c,v 1.5 1996/11/06 17:59:50 christos Exp $ */ /* @@ -37,20 +37,21 @@ * SUCH DAMAGE. */ +/*- + * LstRemove.c -- + * Remove an element from a list + */ + +#include "lstInt.h" #ifndef lint #if 0 static char sccsid[] = "@(#)lstRemove.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstRemove.c,v 1.9 2000/06/17 14:43:40 espie Exp $"; +UNUSED +static char rcsid[] = "$OpenBSD: lstRemove.c,v 1.10 2000/09/14 13:32:10 espie Exp $"; #endif #endif /* not lint */ -/*- - * LstRemove.c -- - * Remove an element from a list - */ - -#include "lstInt.h" /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/lst.lib/lstReplace.c b/usr.bin/make/lst.lib/lstReplace.c index 5a449e64944..67d8796caf1 100644 --- a/usr.bin/make/lst.lib/lstReplace.c +++ b/usr.bin/make/lst.lib/lstReplace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstReplace.c,v 1.8 2000/06/17 14:34:10 espie Exp $ */ +/* $OpenBSD: lstReplace.c,v 1.9 2000/09/14 13:32:10 espie Exp $ */ /* $NetBSD: lstReplace.c,v 1.5 1996/11/06 17:59:51 christos Exp $ */ /* @@ -37,20 +37,21 @@ * SUCH DAMAGE. */ +/*- + * LstReplace.c -- + * Replace the datum in a node with a new datum + */ + +#include "lstInt.h" #ifndef lint #if 0 static char sccsid[] = "@(#)lstReplace.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstReplace.c,v 1.8 2000/06/17 14:34:10 espie Exp $"; +UNUSED +static char rcsid[] = "$OpenBSD: lstReplace.c,v 1.9 2000/09/14 13:32:10 espie Exp $"; #endif #endif /* not lint */ -/*- - * LstReplace.c -- - * Replace the datum in a node with a new datum - */ - -#include "lstInt.h" /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/lst.lib/lstSucc.c b/usr.bin/make/lst.lib/lstSucc.c index 91aeb68ef21..d71cf026365 100644 --- a/usr.bin/make/lst.lib/lstSucc.c +++ b/usr.bin/make/lst.lib/lstSucc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstSucc.c,v 1.6 2000/06/17 14:34:11 espie Exp $ */ +/* $OpenBSD: lstSucc.c,v 1.7 2000/09/14 13:32:10 espie Exp $ */ /* $NetBSD: lstSucc.c,v 1.5 1996/11/06 17:59:52 christos Exp $ */ /* @@ -37,20 +37,21 @@ * SUCH DAMAGE. */ +/*- + * LstSucc.c -- + * return the successor to a given node + */ + +#include "lstInt.h" #ifndef lint #if 0 static char sccsid[] = "@(#)lstSucc.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstSucc.c,v 1.6 2000/06/17 14:34:11 espie Exp $"; +UNUSED +static char rcsid[] = "$OpenBSD: lstSucc.c,v 1.7 2000/09/14 13:32:10 espie Exp $"; #endif #endif /* not lint */ -/*- - * LstSucc.c -- - * return the successor to a given node - */ - -#include "lstInt.h" /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 4f196c87764..109108093d1 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.40 2000/07/31 21:01:40 espie Exp $ */ +/* $OpenBSD: main.c,v 1.41 2000/09/14 13:32:07 espie Exp $ */ /* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */ /* @@ -39,20 +39,6 @@ * SUCH DAMAGE. */ -#ifndef lint -static char copyright[] = -"@(#) Copyright (c) 1988, 1989, 1990, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; -#else -static char rcsid[] = "$OpenBSD: main.c,v 1.40 2000/07/31 21:01:40 espie Exp $"; -#endif -#endif /* not lint */ - /*- * main.c -- * The main file for this entire program. Exit routines etc @@ -106,6 +92,23 @@ static char rcsid[] = "$OpenBSD: main.c,v 1.40 2000/07/31 21:01:40 espie Exp $"; #include "job.h" #include "pathnames.h" +#ifndef lint +UNUSED +static char copyright[] = +"@(#) Copyright (c) 1988, 1989, 1990, 1993\n\ + The Regents of the University of California. All rights reserved.\n"; +#endif /* not lint */ + +#ifndef lint +#if 0 +static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; +#else +UNUSED +static char rcsid[] = "$OpenBSD: main.c,v 1.41 2000/09/14 13:32:07 espie Exp $"; +#endif +#endif /* not lint */ + + #ifndef DEFMAXLOCAL #define DEFMAXLOCAL DEFMAXJOBS #endif /* DEFMAXLOCAL */ diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c index fe76c7eea5d..ad8c2bf110d 100644 --- a/usr.bin/make/make.c +++ b/usr.bin/make/make.c @@ -1,4 +1,4 @@ -/* $OpenBSD: make.c,v 1.20 2000/06/23 16:18:09 espie Exp $ */ +/* $OpenBSD: make.c,v 1.21 2000/09/14 13:32:07 espie Exp $ */ /* $NetBSD: make.c,v 1.10 1996/11/06 17:59:15 christos Exp $ */ /* @@ -39,14 +39,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93"; -#else -static char rcsid[] = "$OpenBSD: make.c,v 1.20 2000/06/23 16:18:09 espie Exp $"; -#endif -#endif /* not lint */ - /*- * make.c -- * The functions which perform the examination of targets and @@ -84,6 +76,15 @@ static char rcsid[] = "$OpenBSD: make.c,v 1.20 2000/06/23 16:18:09 espie Exp $"; #include "dir.h" #include "job.h" +#ifndef lint +#if 0 +static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93"; +#else +UNUSED +static char rcsid[] = "$OpenBSD: make.c,v 1.21 2000/09/14 13:32:07 espie Exp $"; +#endif +#endif /* not lint */ + static LIST toBeMade; /* The current fringe of the graph. These * are nodes which await examination by * MakeOODate. It is added to by diff --git a/usr.bin/make/make.h b/usr.bin/make/make.h index ccac829a150..1e95e09ff21 100644 --- a/usr.bin/make/make.h +++ b/usr.bin/make/make.h @@ -1,4 +1,4 @@ -/* $OpenBSD: make.h,v 1.24 2000/06/23 16:27:29 espie Exp $ */ +/* $OpenBSD: make.h,v 1.25 2000/09/14 13:32:07 espie Exp $ */ /* $NetBSD: make.h,v 1.15 1997/03/10 21:20:00 christos Exp $ */ /* @@ -55,6 +55,12 @@ #include <string.h> #include <ctype.h> +#ifdef __GNUC__ +#define UNUSED __attribute__((unused)) +#else +#define UNUSED +#endif + #if !defined(MAKE_BOOTSTRAP) && defined(BSD4_4) # include <sys/cdefs.h> #else diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 9946bf0c75a..8c3d78fdb1a 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.52 2000/06/23 16:41:53 espie Exp $ */ +/* $OpenBSD: parse.c,v 1.53 2000/09/14 13:32:07 espie Exp $ */ /* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */ /* @@ -39,14 +39,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; -#else -static char rcsid[] = "$OpenBSD: parse.c,v 1.52 2000/06/23 16:41:53 espie Exp $"; -#endif -#endif /* not lint */ - /*- * parse.c -- * Functions to parse a makefile. @@ -105,6 +97,15 @@ static char rcsid[] = "$OpenBSD: parse.c,v 1.52 2000/06/23 16:41:53 espie Exp $" #include "pathnames.h" #include "lowparse.h" +#ifndef lint +#if 0 +static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; +#else +UNUSED +static char rcsid[] = "$OpenBSD: parse.c,v 1.53 2000/09/14 13:32:07 espie Exp $"; +#endif +#endif /* not lint */ + static LIST targets; /* targets we're working on */ #ifdef CLEANUP static LIST targCmds; /* command lines for targets */ @@ -220,7 +221,6 @@ static void ParseAddDir __P((void *, void *)); static void ParseClearPath __P((void *)); static void ParseDoDependency __P((char *)); static void ParseAddCmd __P((void *, void *)); -static int __inline ParseReadc __P((void)); static void ParseHasCommands __P((void *)); static void ParseDoInclude __P((char *)); #ifdef SYSVINCLUDE diff --git a/usr.bin/make/sprite.h b/usr.bin/make/sprite.h index 7fa763a7f89..3bc56c7ff80 100644 --- a/usr.bin/make/sprite.h +++ b/usr.bin/make/sprite.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sprite.h,v 1.8 2000/06/10 01:41:06 espie Exp $ */ +/* $OpenBSD: sprite.h,v 1.9 2000/09/14 13:32:07 espie Exp $ */ /* $NetBSD: sprite.h,v 1.6 1996/11/06 17:59:22 christos Exp $ */ /* @@ -44,21 +44,18 @@ #ifndef _SPRITE #define _SPRITE +/* Some basic types and definitions, originally from Sprite */ -/* - * A boolean type is defined as an integer, not an enum. This allows a - * boolean argument to be an expression that isn't strictly 0 or 1 valued. - */ typedef int Boolean; #ifndef TRUE -#define TRUE 1 -#endif /* TRUE */ +#define TRUE 1 +#endif #ifndef FALSE -#define FALSE 0 -#endif /* FALSE */ +#define FALSE 0 +#endif -typedef int ReturnStatus; -#define SUCCESS 0 -#define FAILURE 1 +typedef int ReturnStatus; +#define SUCCESS 0 +#define FAILURE 1 #endif /* _SPRITE */ diff --git a/usr.bin/make/str.c b/usr.bin/make/str.c index 7aeb5f1551a..0858a3e76ca 100644 --- a/usr.bin/make/str.c +++ b/usr.bin/make/str.c @@ -1,4 +1,4 @@ -/* $OpenBSD: str.c,v 1.14 2000/07/17 23:01:20 espie Exp $ */ +/* $OpenBSD: str.c,v 1.15 2000/09/14 13:32:07 espie Exp $ */ /* $NetBSD: str.c,v 1.13 1996/11/06 17:59:23 christos Exp $ */ /*- @@ -39,16 +39,17 @@ * SUCH DAMAGE. */ +#include "make.h" + #ifndef lint #if 0 static char sccsid[] = "@(#)str.c 5.8 (Berkeley) 6/1/90"; #else -static char rcsid[] = "$OpenBSD: str.c,v 1.14 2000/07/17 23:01:20 espie Exp $"; +UNUSED +static char rcsid[] = "$OpenBSD: str.c,v 1.15 2000/09/14 13:32:07 espie Exp $"; #endif #endif /* not lint */ -#include "make.h" - /*- * str_concat -- * concatenate the two strings, possibly inserting a separator diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c index e504afa7725..4c32f092417 100644 --- a/usr.bin/make/suff.c +++ b/usr.bin/make/suff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: suff.c,v 1.35 2000/06/23 16:41:53 espie Exp $ */ +/* $OpenBSD: suff.c,v 1.36 2000/09/14 13:32:07 espie Exp $ */ /* $NetBSD: suff.c,v 1.13 1996/11/06 17:59:25 christos Exp $ */ /* @@ -39,14 +39,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; -#else -static char rcsid[] = "$OpenBSD: suff.c,v 1.35 2000/06/23 16:41:53 espie Exp $"; -#endif -#endif /* not lint */ - /*- * suff.c -- * Functions to maintain suffix lists and find implicit dependents @@ -103,6 +95,15 @@ static char rcsid[] = "$OpenBSD: suff.c,v 1.35 2000/06/23 16:41:53 espie Exp $"; #include "hash.h" #include "dir.h" +#ifndef lint +#if 0 +static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; +#else +UNUSED +static char rcsid[] = "$OpenBSD: suff.c,v 1.36 2000/09/14 13:32:07 espie Exp $"; +#endif +#endif /* not lint */ + static LIST sufflist; /* Lst of suffixes */ #ifdef CLEANUP static LIST suffClean; /* Lst of suffixes to be cleaned */ @@ -167,7 +168,6 @@ static int SuffSuffHasNameP __P((void *, void *)); static int SuffSuffIsPrefix __P((void *, void *)); static int SuffGNHasNameP __P((void *, void *)); static void SuffUnRef __P((Lst, Suff *)); -static void SuffFree __P((void *)); static void SuffInsert __P((Lst, Suff *)); static void SuffRemove __P((Lst, Suff *)); static Boolean SuffParseTransform __P((char *, Suff **, Suff **)); @@ -345,39 +345,6 @@ SuffUnRef(l, s) /*- *----------------------------------------------------------------------- - * SuffFree -- - * Free up all memory associated with the given suffix structure. - * - * Results: - * none - * - * Side Effects: - * the suffix entry is detroyed - *----------------------------------------------------------------------- - */ -static void -SuffFree(sp) - void *sp; -{ - Suff *s = (Suff *) sp; - - if (s == suffNull) - suffNull = NULL; - - if (s == emptySuff) - emptySuff = NULL; - - Lst_Destroy(&s->ref, NOFREE); - Lst_Destroy(&s->children, NOFREE); - Lst_Destroy(&s->parents, NOFREE); - Lst_Destroy(&s->searchPath, Dir_Destroy); - - free(s->name); - free(s); -} - -/*- - *----------------------------------------------------------------------- * SuffRemove -- * Remove the suffix from the list *----------------------------------------------------------------------- @@ -1595,7 +1562,6 @@ SuffFindArchiveDeps(gn, slst) char *eoarch; /* End of archive portion */ char *eoname; /* End of member portion */ GNode *mem; /* Node for member */ - int i; /* Index into copy and vals */ Suff *ms; /* Suffix descriptor for member */ char *name; /* Start of member's name */ diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index 69910de30fd..b0ed4c1e5c5 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -1,4 +1,4 @@ -/* $OpenBSD: targ.c,v 1.25 2000/06/23 16:23:26 espie Exp $ */ +/* $OpenBSD: targ.c,v 1.26 2000/09/14 13:32:08 espie Exp $ */ /* $NetBSD: targ.c,v 1.11 1997/02/20 16:51:50 christos Exp $ */ /* @@ -39,14 +39,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94"; -#else -static char *rcsid = "$OpenBSD: targ.c,v 1.25 2000/06/23 16:23:26 espie Exp $"; -#endif -#endif /* not lint */ - /*- * targ.c -- * Functions for maintaining the Lst allTargets. Target nodes are @@ -91,6 +83,15 @@ static char *rcsid = "$OpenBSD: targ.c,v 1.25 2000/06/23 16:23:26 espie Exp $"; #include "hash.h" #include "dir.h" +#ifndef lint +#if 0 +static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94"; +#else +UNUSED +static char *rcsid = "$OpenBSD: targ.c,v 1.26 2000/09/14 13:32:08 espie Exp $"; +#endif +#endif /* not lint */ + static LIST allTargets; /* the list of all targets found so far */ #ifdef CLEANUP static LIST allGNs; /* List of all the GNodes */ @@ -111,10 +112,7 @@ static void TargFreeGN __P((void *)); * Targ_Init -- * Initialize this module * - * Results: - * None - * - * Side Effects: +* Side Effects: * The allTargets list and the targets hash table are initialized *----------------------------------------------------------------------- */ diff --git a/usr.bin/make/util.c b/usr.bin/make/util.c index 17a3713abac..8bbb1cde79f 100644 --- a/usr.bin/make/util.c +++ b/usr.bin/make/util.c @@ -1,18 +1,19 @@ -/* $OpenBSD: util.c,v 1.12 2000/06/23 16:39:45 espie Exp $ */ +/* $OpenBSD: util.c,v 1.13 2000/09/14 13:32:08 espie Exp $ */ /* $NetBSD: util.c,v 1.10 1996/12/31 17:56:04 christos Exp $ */ /* * Missing stuff from OS's */ -#ifndef lint -static char rcsid[] = "$OpenBSD: util.c,v 1.12 2000/06/23 16:39:45 espie Exp $"; -#endif - #include <stdio.h> #include "make.h" #include <sys/param.h> +#ifndef lint +UNUSED +static char rcsid[] = "$OpenBSD: util.c,v 1.13 2000/09/14 13:32:08 espie Exp $"; +#endif + #ifndef __STDC__ # ifndef const # define const diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index 341a6596fed..894da926ea7 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -1,4 +1,4 @@ -/* $OpenBSD: var.c,v 1.47 2000/08/21 10:44:21 espie Exp $ */ +/* $OpenBSD: var.c,v 1.48 2000/09/14 13:32:08 espie Exp $ */ /* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */ /* @@ -66,14 +66,6 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; -#else -static char rcsid[] = "$OpenBSD: var.c,v 1.47 2000/08/21 10:44:21 espie Exp $"; -#endif -#endif /* not lint */ - /*- * var.c -- * Variable-handling functions @@ -129,6 +121,15 @@ static char rcsid[] = "$OpenBSD: var.c,v 1.47 2000/08/21 10:44:21 espie Exp $"; #include "hashconsts.h" #include "varmodifiers.h" +#ifndef lint +#if 0 +static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; +#else +UNUSED +static char rcsid[] = "$OpenBSD: var.c,v 1.48 2000/09/14 13:32:08 espie Exp $"; +#endif +#endif /* not lint */ + static SymTable *CTXT_GLOBAL, *CTXT_CMD, *CTXT_ENV; static char *varnames[] = { @@ -309,7 +310,7 @@ quick_lookup(name, end, pk) void Varq_Set(idx, val, gn) int idx; - char *val; + const char *val; GNode *gn; { /* We only look for a variable in the given context since anything set @@ -324,7 +325,6 @@ Varq_Set(idx, val, gn) } else { Buf_Reset(&(v->val)); Buf_AddString(&(v->val), val); - } if (DEBUG(VAR)) printf("%s:%s = %s\n", gn->name, varnames[idx], val); @@ -333,10 +333,10 @@ Varq_Set(idx, val, gn) void Varq_Append(idx, val, gn) int idx; - char *val; + const char *val; GNode *gn; { - Var *v = gn->context.locals[idx]; + Var *v = gn->context.locals[idx]; if (v == NULL) { v = new_var(varnames[idx], val); @@ -516,7 +516,7 @@ varfind(name, end, ctxt, flags, idx, k) * The added variable * * Side Effects: - * The new variable is placed at the front of the given context + * The new variable is placed in the given context. * The name and val arguments are duplicated so they may * safely be freed. *----------------------------------------------------------------------- @@ -538,10 +538,10 @@ VarAdd(name, val, ctxt) idx = quick_lookup(name, &end, &k); - if (idx != -1) { + if (idx != -1) Parse_Error(PARSE_FATAL, "Trying to set dynamic variable %s", v->name); - } else + else hash_insert(ctxt, hash_lookup_interval(ctxt, name, end, k), v); return v; } @@ -551,19 +551,14 @@ VarAdd(name, val, ctxt) *----------------------------------------------------------------------- * VarDelete -- * Delete a variable and all the space associated with it. - * - * Results: - * None - * - * Side Effects: - * None *----------------------------------------------------------------------- */ static void VarDelete(vp) - void *vp; + void *vp; { - Var *v = (Var *) vp; + Var *v = (Var *) vp; + Buf_Destroy(&(v->val)); free(v); } @@ -575,22 +570,18 @@ VarDelete(vp) * Var_Delete -- * Remove a variable from a context. * - * Results: - * None. - * * Side Effects: * The Var structure is removed and freed. - * *----------------------------------------------------------------------- */ void Var_Delete(name, ctxt) - char *name; - GSymT *ctxt; + const char *name; + GSymT *ctxt; { - Var *v; - u_int32_t k; - const char *end = NULL; + Var *v; + u_int32_t k; + const char *end = NULL; if (DEBUG(VAR)) printf("%s:delete %s\n", context_name(ctxt), name); @@ -606,9 +597,6 @@ Var_Delete(name, ctxt) * Var_Set -- * Set the variable name to the value val in the given context. * - * Results: - * None. - * * Side Effects: * If the variable doesn't yet exist, a new record is created for it. * Else the old value is freed and the new one stuck in its place @@ -624,11 +612,11 @@ Var_Delete(name, ctxt) */ void Var_Set(name, val, ctxt) - char *name; /* name of variable to set */ - char *val; /* value to give to the variable */ + const char *name; /* name of variable to set */ + const char *val; /* value to give to the variable */ GSymT *ctxt; /* context in which to set it */ { - register Var *v; + Var *v; /* * We only look for a variable in the given context since anything set @@ -641,7 +629,6 @@ Var_Set(name, val, ctxt) else { Buf_Reset(&(v->val)); Buf_AddString(&(v->val), val); - } if (DEBUG(VAR)) printf("%s:%s = %s\n", context_name(ctxt), name, val); @@ -664,9 +651,6 @@ Var_Set(name, val, ctxt) * The variable of the given name has the given value appended to it in * the given context. * - * Results: - * None - * * Side Effects: * If the variable doesn't exist, it is created. Else the strings * are concatenated (with a space in between). @@ -682,11 +666,11 @@ Var_Set(name, val, ctxt) */ void Var_Append(name, val, ctxt) - char *name; /* Name of variable to modify */ - char *val; /* String to append to it */ + const char *name; /* Name of variable to modify */ + const char *val; /* String to append to it */ GSymT *ctxt; /* Context in which this should occur */ { - register Var *v; + Var *v; v = VarFind(name, (SymTable *)ctxt, (ctxt == VAR_GLOBAL) ? FIND_ENV : 0); @@ -695,8 +679,6 @@ Var_Append(name, val, ctxt) } else { Buf_AddSpace(&(v->val)); Buf_AddString(&(v->val), val); - - } if (DEBUG(VAR)) printf("%s:%s = %s\n", context_name(ctxt), name, VarValue(v)); @@ -709,18 +691,14 @@ Var_Append(name, val, ctxt) * * Results: * TRUE if it does, FALSE if it doesn't - * - * Side Effects: - * None. - * *----------------------------------------------------------------------- */ Boolean Var_Exists(name, ctxt) - char *name; /* Variable to find */ + const char *name; /* Variable to find */ GSymT *ctxt; /* Context in which to start search */ { - Var *v; + Var *v; v = VarFind(name, (SymTable *)ctxt, FIND_MINE|FIND_ENV); @@ -737,17 +715,14 @@ Var_Exists(name, ctxt) * * Results: * The value if the variable exists, NULL if it doesn't - * - * Side Effects: - * None *----------------------------------------------------------------------- */ char * Var_Value(name, ctxt) - char *name; /* name to find */ + const char *name; /* name to find */ GSymT *ctxt; /* context in which to search for it */ { - Var *v; + Var *v; v = VarFind(name, (SymTable *)ctxt, FIND_ENV | FIND_MINE); if (v != NULL) @@ -768,21 +743,21 @@ Var_Value(name, ctxt) */ static Var * var_name_with_dollar(str, pos, ctxt, err, endc) - char *str; /* First dollar in variable name */ - char **pos; /* Current position in variable spec */ + char *str; /* First dollar in variable name */ + char **pos; /* Current position in variable spec */ SymTable *ctxt; /* The context for the variable */ Boolean err; /* TRUE if undefined variables are an error */ char endc; /* End character for spec */ { - BUFFER buf; /* Store the variable name */ - size_t sublen; /* Deal with recursive expansions */ - Boolean subfree; - char *n; /* Sub name */ - Var *v; + BUFFER buf; /* Store the variable name */ + size_t sublen; /* Deal with recursive expansions */ + Boolean subfree; + char *n; /* Sub name */ + Var *v; Buf_Init(&buf, MAKE_BSIZE); - while (1) { + for (;;) { Buf_AddInterval(&buf, str, *pos); n = Var_Parse(*pos, ctxt, err, &sublen, &subfree); if (n != NULL) |