diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2007-09-17 09:28:37 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2007-09-17 09:28:37 +0000 |
commit | 5c2bd4e040646f212484a6bc318cb1ee3e40d23c (patch) | |
tree | 8c0879c7efde812e7c2f52377b2c62d6a196dbc6 /usr.bin/make | |
parent | abb245a8e4236a1315832a1f3c30be4cb450be65 (diff) |
kill extra spaces at end of line
Diffstat (limited to 'usr.bin/make')
33 files changed, 352 insertions, 352 deletions
diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c index fb292d65f28..c4fc70da4c1 100644 --- a/usr.bin/make/arch.c +++ b/usr.bin/make/arch.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: arch.c,v 1.68 2007/09/16 12:30:35 espie Exp $ */ +/* $OpenBSD: arch.c,v 1.69 2007/09/17 09:28:36 espie Exp $ */ /* $NetBSD: arch.c,v 1.17 1996/11/06 17:58:59 christos Exp $ */ /* @@ -66,7 +66,7 @@ * Once again, cacheing/hashing comes into play in the manipulation * of archives. The first time an archive is referenced, all of its members' * headers are read and hashed and the archive closed again. All hashed - * archives are kept in a hash (archives) which is searched each time + * archives are kept in a hash (archives) which is searched each time * an archive member is referenced. * */ @@ -192,7 +192,7 @@ static TIMESTAMP mtime_of_member(struct arch_member *m) { if (is_out_of_date(m->mtime)) - ts_set_from_time_t((time_t) strtol(m->date, NULL, 10), + ts_set_from_time_t((time_t) strtol(m->date, NULL, 10), m->mtime); return m->mtime; } @@ -303,7 +303,7 @@ Arch_ParseArchive(char **linePtr, /* Pointer to start of specification */ snprintf(buf, length, "%s(%s)", libName, memberName); - if (strchr(memberName, '$') && + if (strchr(memberName, '$') && strcmp(memberName, oldMemberName) == 0) { /* Must contain dynamic sources, so we can't * deal with it now. Just create an ARCHV node @@ -318,7 +318,7 @@ Arch_ParseArchive(char **linePtr, /* Pointer to start of specification */ gn->type |= OP_ARCHV; Lst_AtEnd(nodeLst, gn); } - } else if (!Arch_ParseArchive(&sacrifice, nodeLst, + } else if (!Arch_ParseArchive(&sacrifice, nodeLst, ctxt)) { /* Error in nested call -- free buffer and * return false ourselves. */ @@ -334,9 +334,9 @@ Arch_ParseArchive(char **linePtr, /* Pointer to start of specification */ Lst_Init(&members); Dir_Expand(memberName, defaultPath, &members); - while ((member = (char *)Lst_DeQueue(&members)) + while ((member = (char *)Lst_DeQueue(&members)) != NULL) { - snprintf(nameBuf, MAKE_BSIZE, "%s(%s)", + snprintf(nameBuf, MAKE_BSIZE, "%s(%s)", libName, member); free(member); gn = Targ_FindNode(nameBuf, TARG_CREATE); @@ -350,7 +350,7 @@ Arch_ParseArchive(char **linePtr, /* Pointer to start of specification */ Lst_AtEnd(nodeLst, gn); } } else { - snprintf(nameBuf, MAKE_BSIZE, "%s(%s)", libName, + snprintf(nameBuf, MAKE_BSIZE, "%s(%s)", libName, memberName); gn = Targ_FindNode(nameBuf, TARG_CREATE); /* We've found the node, but have to make sure the rest @@ -446,7 +446,7 @@ read_archive(const char *archive, const char *earchive) if (n < sizeof(struct ar_hdr)) break; - if (memcmp(arHeader.ar_fmag, ARFMAG, sizeof(arHeader.ar_fmag)) + if (memcmp(arHeader.ar_fmag, ARFMAG, sizeof(arHeader.ar_fmag)) != 0) { /* The header is bogus. */ break; @@ -456,10 +456,10 @@ read_archive(const char *archive, const char *earchive) * newlines to an even-byte boundary, so we need to * extract the size of the record and round it up * during the seek. */ - size = (off_t) field2long(arHeader.ar_size, + size = (off_t) field2long(arHeader.ar_size, sizeof(arHeader.ar_size)); - (void)memcpy(memberName, arHeader.ar_name, + (void)memcpy(memberName, arHeader.ar_name, AR_NAME_SIZE); /* Find real end of name (strip extranous ' ') */ for (cp = memberName + AR_NAME_SIZE - 1; *cp == ' ';) @@ -472,7 +472,7 @@ read_archive(const char *archive, const char *earchive) */ if (memberName[0] == '/') { /* SVR4 magic mode. */ - memberName = ArchSVR4Entry(&list, memberName, + memberName = ArchSVR4Entry(&list, memberName, size, arch); if (memberName == NULL) /* Invalid data */ break; @@ -492,10 +492,10 @@ read_archive(const char *archive, const char *earchive) #ifdef AR_EFMT1 /* BSD 4.4 extended AR format: #1/<namelen>, with name * as the first <namelen> bytes of the file. */ - if (memcmp(memberName, AR_EFMT1, sizeof(AR_EFMT1) - 1) + if (memcmp(memberName, AR_EFMT1, sizeof(AR_EFMT1) - 1) == 0 && isdigit(memberName[sizeof(AR_EFMT1) - 1])) { - int elen = atoi(memberName + + int elen = atoi(memberName + sizeof(AR_EFMT1)-1); if (elen <= 0 || elen >= PATH_MAX) @@ -507,7 +507,7 @@ read_archive(const char *archive, const char *earchive) if (fseek(arch, -elen, SEEK_CUR) != 0) break; if (DEBUG(ARCH) || DEBUG(MAKE)) - printf("ArchStat: Extended format entry for %s\n", + printf("ArchStat: Extended format entry for %s\n", memberName); } #endif @@ -584,8 +584,8 @@ ArchMTimeMember( if (arch != NULL) { fclose(arch); - ts_set_from_time_t( - (time_t)strtol(arHeader.ar_date, NULL, 10), + ts_set_from_time_t( + (time_t)strtol(arHeader.ar_date, NULL, 10), result); } return result; @@ -600,7 +600,7 @@ ArchMTimeMember( struct arch_member *he; end = NULL; - he = ohash_find(&ar->members, + he = ohash_find(&ar->members, ohash_qlookupi(&ar->members, member, &end)); if (he != NULL) return mtime_of_member(he); @@ -773,7 +773,7 @@ ArchFindMember( off_t size; /* Size of archive member */ char *memberName; - if (memcmp(arHeaderPtr->ar_fmag, ARFMAG, + if (memcmp(arHeaderPtr->ar_fmag, ARFMAG, sizeof(arHeaderPtr->ar_fmag) ) != 0) /* The header is bogus, so the archive is bad. */ break; @@ -787,7 +787,7 @@ ArchFindMember( * string is anything but a space, this isn't the * member we sought. */ #ifdef SVR4ARCHIVES - if (length < sizeof(arHeaderPtr->ar_name) && + if (length < sizeof(arHeaderPtr->ar_name) && memberName[length] == '/') length++; #endif @@ -800,7 +800,7 @@ ArchFindMember( } } - size = (off_t) field2long(arHeaderPtr->ar_size, + size = (off_t) field2long(arHeaderPtr->ar_size, sizeof(arHeaderPtr->ar_size)); #ifdef SVR4ARCHIVES @@ -809,7 +809,7 @@ ArchFindMember( */ if (memberName[0] == '/') { /* svr4 magic mode. */ - memberName = ArchSVR4Entry(&list, + memberName = ArchSVR4Entry(&list, arHeaderPtr->ar_name, size, arch); if (memberName == NULL) /* Invalid data */ break; @@ -874,7 +874,7 @@ ArchTouch(const char *archive, const char *member) arch = ArchFindMember(archive, member, &arHeader, "r+"); if (arch != NULL) { - snprintf(arHeader.ar_date, sizeof(arHeader.ar_date), "%-12ld", + snprintf(arHeader.ar_date, sizeof(arHeader.ar_date), "%-12ld", (long) timestamp2time_t(now)); if (fseek(arch, -sizeof(struct ar_hdr), SEEK_CUR) == 0) (void)fwrite(&arHeader, sizeof(struct ar_hdr), 1, arch); @@ -942,7 +942,7 @@ Arch_MemMTime(GNode *gn) nameEnd = NULL; if (pgn->make && nameEnd != NULL && - strncmp(nameStart, gn->name, nameEnd - nameStart) + strncmp(nameStart, gn->name, nameEnd - nameStart) == 0 && gn->name[nameEnd-nameStart] == '\0') gn->mtime = Arch_MTime(pgn); } else if (pgn->make) { @@ -955,9 +955,9 @@ Arch_MemMTime(GNode *gn) return gn->mtime; } -/* If the system can handle the -L flag when linking (or we cannot find - * the library), we assume that the user has placed the .LIBRARIES variable - * in the final linking command (or the linker will know where to find it) +/* If the system can handle the -L flag when linking (or we cannot find + * the library), we assume that the user has placed the .LIBRARIES variable + * in the final linking command (or the linker will know where to find it) * and set the TARGET variable for this node to be the node's name. Otherwise, * we set the TARGET variable to be the full path of the library, * as returned by Dir_FindFile. @@ -1022,7 +1022,7 @@ Arch_LibOODate(GNode *gn) if (OP_NOP(gn->type) && Lst_IsEmpty(&gn->children)) return false; - if (is_strictly_before(now, gn->mtime) || + if (is_strictly_before(now, gn->mtime) || is_strictly_before(gn->mtime, gn->cmtime) || is_out_of_date(gn->mtime)) return true; @@ -1034,7 +1034,7 @@ Arch_LibOODate(GNode *gn) if (!is_out_of_date(modTimeTOC)) { if (DEBUG(ARCH) || DEBUG(MAKE)) - printf("%s modified %s...", RANLIBMAG, + printf("%s modified %s...", RANLIBMAG, time_to_string(modTimeTOC)); return is_strictly_before(modTimeTOC, gn->cmtime); } diff --git a/usr.bin/make/arch.h b/usr.bin/make/arch.h index da4789d72e0..cd2a1080389 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.1 2001/05/23 12:34:40 espie Exp $ */ +/* $OpenBSD: arch.h,v 1.2 2007/09/17 09:28:36 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -47,16 +47,16 @@ extern void Arch_End(void); /* ok = Arch_ParseArchive(&begin, nodeLst, ctxt); * Given an archive specification, add list of corresponding GNodes to - * nodeLst, one for each member in the spec. + * 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 *); /* Arch_Touch(node); - * Alter the modification time of the archive member described by node + * Alter the modification time of the archive member described by node * to the current time. */ extern void Arch_Touch(GNode *); /* Arch_TouchLib(node); - * Update the modification time of the library described by node. + * Update the modification time of the library described by node. * This is distinct from Arch_Touch, as it also updates the mtime * of the library's table of contents. */ extern void Arch_TouchLib(GNode *); @@ -66,7 +66,7 @@ extern void Arch_TouchLib(GNode *); * The time is also stored in the member's GNode. */ extern TIMESTAMP Arch_MTime(GNode *); /* stamp = Arch_MemMTime(node); - * Find the modification time of a member of an archive and returns it. + * Find the modification time of a member of an archive and returns it. * To use when the member only exists within the archive. */ extern TIMESTAMP Arch_MemMTime(GNode *); /* Arch_FindLib(node, path); diff --git a/usr.bin/make/buf.h b/usr.bin/make/buf.h index f6e24ceb6b4..40bbe4f3acf 100644 --- a/usr.bin/make/buf.h +++ b/usr.bin/make/buf.h @@ -2,7 +2,7 @@ #define _BUF_H /* $OpenPackages$ */ -/* $OpenBSD: buf.h,v 1.16 2003/06/03 02:56:11 millert Exp $ */ +/* $OpenBSD: buf.h,v 1.17 2007/09/17 09:28:36 espie Exp $ */ /* $NetBSD: buf.h,v 1.7 1996/12/31 17:53:22 christos Exp $ */ /* @@ -102,7 +102,7 @@ extern void Buf_AddChars(Buffer, size_t, const char *); * Doesn't include the null-terminating char. */ #define Buf_Size(bp) ((size_t)((bp)->inPtr - (bp)->buffer)) /* Buf_Init(buf, init); - * Initializes a buffer, to hold approximately init chars. + * Initializes a buffer, to hold approximately init chars. * Set init to 0 if you have no idea. */ extern void Buf_Init(Buffer, size_t); /* Buf_Destroy(buf); @@ -111,7 +111,7 @@ extern void Buf_Init(Buffer, size_t); /* str = Buf_Retrieve(buf); * Retrieves data from a buffer, as a NULL terminated string. */ #define Buf_Retrieve(bp) (*(bp)->inPtr = '\0', (bp)->buffer) -/* Buf_AddChar(buf, c); +/* Buf_AddChar(buf, c); * Adds a single char to buffer. */ #define Buf_AddChar(bp, byte) \ do { \ diff --git a/usr.bin/make/cmd_exec.h b/usr.bin/make/cmd_exec.h index 061c1727340..a7be777f46c 100644 --- a/usr.bin/make/cmd_exec.h +++ b/usr.bin/make/cmd_exec.h @@ -1,7 +1,7 @@ #ifndef CMD_EXEC_H #define CMD_EXEC_H /* $OpenPackages$ */ -/* $OpenBSD: cmd_exec.h,v 1.1 2001/05/23 12:34:40 espie Exp $ */ +/* $OpenBSD: cmd_exec.h,v 1.2 2007/09/17 09:28:36 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -29,7 +29,7 @@ */ /* output = Cmd_Exec(cmd, &err); - * execute the command in cmd, return the output of that command as + * execute the command in cmd, return the output of that command as * a string. If an error occurs, Cmd_Exec returns an empty string, * and err is filled with the reason for the command failure. * The output result should always be freed by the caller. */ diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c index 8a6022fb73f..29e1cb933f9 100644 --- a/usr.bin/make/compat.c +++ b/usr.bin/make/compat.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: compat.c,v 1.58 2007/09/17 08:36:57 espie Exp $ */ +/* $OpenBSD: compat.c,v 1.59 2007/09/17 09:28:36 espie Exp $ */ /* $NetBSD: compat.c,v 1.14 1996/11/06 17:59:01 christos Exp $ */ /* @@ -81,7 +81,7 @@ static int shellneed(char **); static volatile sig_atomic_t interrupted; -static void +static void CompatInterrupt(int signo) { if (interrupted != SIGINT) @@ -395,7 +395,7 @@ CompatMake(void *gnp, /* The node to make */ } if (Lst_Member(&gn->iParents, pgn) != NULL) { - Varq_Set(IMPSRC_INDEX, Varq_Value(TARGET_INDEX, gn), + Varq_Set(IMPSRC_INDEX, Varq_Value(TARGET_INDEX, gn), pgn); } @@ -435,7 +435,7 @@ CompatMake(void *gnp, /* The node to make */ /* Our commands are ok, but we still have to worry * about the -t flag... */ if (!touchFlag) - Lst_ForEachNodeWhile(&gn->commands, + Lst_ForEachNodeWhile(&gn->commands, CompatRunCommand, gn); else Job_Touch(gn, gn->type & OP_SILENT); @@ -472,7 +472,7 @@ CompatMake(void *gnp, /* The node to make */ if (is_strictly_before(gn->mtime, gn->cmtime)) gn->mtime = gn->cmtime; if (DEBUG(MAKE)) - printf("update time: %s\n", + printf("update time: %s\n", time_to_string(gn->mtime)); if (!(gn->type & OP_EXEC)) { pgn->childMade = true; @@ -488,7 +488,7 @@ CompatMake(void *gnp, /* The node to make */ (unsigned long)gn->lineno, gn->fname); else - printf("\n\nStop in %s.\n", + printf("\n\nStop in %s.\n", Var_Value(".CURDIR")); exit(1); } @@ -498,7 +498,7 @@ CompatMake(void *gnp, /* The node to make */ pgn->make = false; else { if (Lst_Member(&gn->iParents, pgn) != NULL) { - Varq_Set(IMPSRC_INDEX, Varq_Value(TARGET_INDEX, gn), + Varq_Set(IMPSRC_INDEX, Varq_Value(TARGET_INDEX, gn), pgn); } switch (gn->made) { @@ -546,7 +546,7 @@ Compat_Run(Lst targs) /* List of target nodes to re-create */ if (!queryFlag) { gn = Targ_FindNode(".BEGIN", TARG_NOCREATE); if (gn != NULL) { - Lst_ForEachNodeWhile(&gn->commands, CompatRunCommand, + Lst_ForEachNodeWhile(&gn->commands, CompatRunCommand, gn); if (gn->made == ERROR) { printf("\n\nStop.\n"); @@ -561,7 +561,7 @@ Compat_Run(Lst targs) /* List of target nodes to re-create */ * UPTODATE gn was already up-to-date * MADE gn was recreated successfully * ERROR An error occurred while gn was being created - * ABORTED gn was not remade because one of its + * ABORTED gn was not remade because one of its * inferiors could not be made due to errors. */ errors = 0; @@ -571,7 +571,7 @@ Compat_Run(Lst targs) /* List of target nodes to re-create */ if (gn->made == UPTODATE) printf("`%s' is up to date.\n", gn->name); else if (gn->made == ABORTED) { - printf("`%s' not remade because of errors.\n", + printf("`%s' not remade because of errors.\n", gn->name); errors++; } @@ -579,6 +579,6 @@ Compat_Run(Lst targs) /* List of target nodes to re-create */ /* If the user has defined a .END target, run its commands. */ if (errors == 0) - Lst_ForEachNodeWhile(&ENDNode->commands, CompatRunCommand, + Lst_ForEachNodeWhile(&ENDNode->commands, CompatRunCommand, ENDNode); } diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c index 0e49cc16003..f1a4609833d 100644 --- a/usr.bin/make/cond.c +++ b/usr.bin/make/cond.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: cond.c,v 1.37 2007/09/17 08:36:57 espie Exp $ */ +/* $OpenBSD: cond.c,v 1.38 2007/09/17 09:28:36 espie Exp $ */ /* $NetBSD: cond.c,v 1.7 1996/11/06 17:59:02 christos Exp $ */ /* @@ -192,7 +192,7 @@ find_cond(const char *p) *----------------------------------------------------------------------- */ static bool -CondGetArg(const char **linePtr, struct Name *arg, const char *func, +CondGetArg(const char **linePtr, struct Name *arg, const char *func, bool parens) /* true if arg should be bounded by parens */ { const char *cp; @@ -869,7 +869,7 @@ CondE(bool doEval) return l; } -/* Evaluate conditional in line. +/* Evaluate conditional in line. * returns COND_SKIP, COND_PARSE, COND_INVALID, COND_ISFOR, COND_ISINCLUDE, * COND_ISUNDEF. * A conditional line looks like this: @@ -901,70 +901,70 @@ Cond_Eval(const char *line) k = ohash_interval(line, &end); switch(k % MAGICSLOTS2) { case K_COND_IF % MAGICSLOTS2: - if (k == K_COND_IF && len == strlen(COND_IF) && + if (k == K_COND_IF && len == strlen(COND_IF) && strncmp(line, COND_IF, len) == 0) { ifp = ifs + COND_IF_INDEX; } else return COND_INVALID; break; case K_COND_IFDEF % MAGICSLOTS2: - if (k == K_COND_IFDEF && len == strlen(COND_IFDEF) && + if (k == K_COND_IFDEF && len == strlen(COND_IFDEF) && strncmp(line, COND_IFDEF, len) == 0) { ifp = ifs + COND_IFDEF_INDEX; } else return COND_INVALID; break; case K_COND_IFNDEF % MAGICSLOTS2: - if (k == K_COND_IFNDEF && len == strlen(COND_IFNDEF) && + if (k == K_COND_IFNDEF && len == strlen(COND_IFNDEF) && strncmp(line, COND_IFNDEF, len) == 0) { ifp = ifs + COND_IFNDEF_INDEX; } else return COND_INVALID; break; case K_COND_IFMAKE % MAGICSLOTS2: - if (k == K_COND_IFMAKE && len == strlen(COND_IFMAKE) && + if (k == K_COND_IFMAKE && len == strlen(COND_IFMAKE) && strncmp(line, COND_IFMAKE, len) == 0) { ifp = ifs + COND_IFMAKE_INDEX; } else return COND_INVALID; break; case K_COND_IFNMAKE % MAGICSLOTS2: - if (k == K_COND_IFNMAKE && len == strlen(COND_IFNMAKE) && + if (k == K_COND_IFNMAKE && len == strlen(COND_IFNMAKE) && strncmp(line, COND_IFNMAKE, len) == 0) { ifp = ifs + COND_IFNMAKE_INDEX; } else return COND_INVALID; break; case K_COND_ELIF % MAGICSLOTS2: - if (k == K_COND_ELIF && len == strlen(COND_ELIF) && + if (k == K_COND_ELIF && len == strlen(COND_ELIF) && strncmp(line, COND_ELIF, len) == 0) { ifp = ifs + COND_ELIF_INDEX; } else return COND_INVALID; break; case K_COND_ELIFDEF % MAGICSLOTS2: - if (k == K_COND_ELIFDEF && len == strlen(COND_ELIFDEF) && + if (k == K_COND_ELIFDEF && len == strlen(COND_ELIFDEF) && strncmp(line, COND_ELIFDEF, len) == 0) { ifp = ifs + COND_ELIFDEF_INDEX; } else return COND_INVALID; break; case K_COND_ELIFNDEF % MAGICSLOTS2: - if (k == K_COND_ELIFNDEF && len == strlen(COND_ELIFNDEF) && + if (k == K_COND_ELIFNDEF && len == strlen(COND_ELIFNDEF) && strncmp(line, COND_ELIFNDEF, len) == 0) { ifp = ifs + COND_ELIFNDEF_INDEX; } else return COND_INVALID; break; case K_COND_ELIFMAKE % MAGICSLOTS2: - if (k == K_COND_ELIFMAKE && len == strlen(COND_ELIFMAKE) && + if (k == K_COND_ELIFMAKE && len == strlen(COND_ELIFMAKE) && strncmp(line, COND_ELIFMAKE, len) == 0) { ifp = ifs + COND_ELIFMAKE_INDEX; } else return COND_INVALID; break; case K_COND_ELIFNMAKE % MAGICSLOTS2: - if (k == K_COND_ELIFNMAKE && len == strlen(COND_ELIFNMAKE) && + if (k == K_COND_ELIFNMAKE && len == strlen(COND_ELIFNMAKE) && strncmp(line, COND_ELIFNMAKE, len) == 0) { ifp = ifs + COND_ELIFNMAKE_INDEX; } else @@ -973,7 +973,7 @@ Cond_Eval(const char *line) case K_COND_ELSE % MAGICSLOTS2: /* valid conditional whose value is the inverse * of the previous if we parsed. */ - if (k == K_COND_ELSE && len == strlen(COND_ELSE) && + if (k == K_COND_ELSE && len == strlen(COND_ELSE) && strncmp(line, COND_ELSE, len) == 0) { if (condTop == MAXIF) { Parse_Error(level, "if-less else"); @@ -987,7 +987,7 @@ Cond_Eval(const char *line) return COND_INVALID; break; case K_COND_ENDIF % MAGICSLOTS2: - if (k == K_COND_ENDIF && len == strlen(COND_ENDIF) && + if (k == K_COND_ENDIF && len == strlen(COND_ENDIF) && strncmp(line, COND_ENDIF, len) == 0) { /* End of a conditional section. If skipIfLevel is non-zero, that * conditional was skipped, so lines following it should also be @@ -1094,7 +1094,7 @@ Cond_Eval(const char *line) break; } } - + if (!ifp->isElse) condTop--; else if (skipIfLevel != 0 || condStack[condTop].value) { @@ -1128,7 +1128,7 @@ Cond_End(void) int i; if (condTop != MAXIF) { - Parse_Error(PARSE_FATAL, "%s%d open conditional%s", + Parse_Error(PARSE_FATAL, "%s%d open conditional%s", condTop == 0 ? "at least ": "", MAXIF-condTop, MAXIF-condTop == 1 ? "" : "s"); for (i = MAXIF-1; i >= condTop; i--) { diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c index 31703971350..1ee8046a679 100644 --- a/usr.bin/make/dir.c +++ b/usr.bin/make/dir.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: dir.c,v 1.52 2007/09/16 14:29:33 espie Exp $ */ +/* $OpenBSD: dir.c,v 1.53 2007/09/17 09:28:36 espie Exp $ */ /* $NetBSD: dir.c,v 1.14 1997/03/29 16:51:26 christos Exp $ */ /* @@ -175,29 +175,29 @@ static struct ohash knownDirectories; /* cache all open directories */ * possibility a caller might update the file and invalidate the cache * entry, and we don't look up in this cache except as a last resort. */ -static struct ohash mtimes; +static struct ohash mtimes; /* There are three distinct hash structures: * - to collate files's last modification times (global mtimes) * - to collate file names (in each PathEntry structure) * - to collate known directories (global knownDirectories). */ -static struct ohash_info stamp_info = { - offsetof(struct file_stamp, name), NULL, hash_alloc, hash_free, +static struct ohash_info stamp_info = { + offsetof(struct file_stamp, name), NULL, hash_alloc, hash_free, element_alloc }; -static struct ohash_info file_info = { +static struct ohash_info file_info = { 0, NULL, hash_alloc, hash_free, element_alloc }; -static struct ohash_info dir_info = { - offsetof(struct PathEntry, name), NULL, +static struct ohash_info dir_info = { + offsetof(struct PathEntry, name), NULL, hash_alloc, hash_free, element_alloc }; /* add_file(path, name): add a file name to a path hash structure. */ static void add_file(struct PathEntry *, const char *); /* n = find_file_hashi(p, name, end, hv): retrieve name in a path hash * structure. */ -static char *find_file_hashi(struct PathEntry *, const char *, const char *, +static char *find_file_hashi(struct PathEntry *, const char *, const char *, uint32_t); /* stamp = find_stampi(name, end): look for (name, end) in the global @@ -254,7 +254,7 @@ add_file(struct PathEntry *p, const char *file) } static char * -find_file_hashi(struct PathEntry *p, const char *file, const char *efile, +find_file_hashi(struct PathEntry *p, const char *file, const char *efile, uint32_t hv) { struct ohash *h = &p->files; @@ -279,7 +279,7 @@ Dir_Init(void) if (!dot) Fatal("Can't access current directory"); - /* We always need to have dot around, so we increment its reference + /* We always need to have dot around, so we increment its reference * count to make sure it won't be destroyed. */ dot->refCount++; } @@ -313,7 +313,7 @@ Dir_End(void) *----------------------------------------------------------------------- */ void -Dir_MatchFilesi(const char *word, const char *eword, struct PathEntry *p, +Dir_MatchFilesi(const char *word, const char *eword, struct PathEntry *p, Lst expansions) { unsigned int search; /* Index into the directory's table */ @@ -331,8 +331,8 @@ Dir_MatchFilesi(const char *word, const char *eword, struct PathEntry *p, if (*word != '.' && *entry == '.') continue; if (Str_Matchi(entry, strchr(entry, '\0'), word, eword)) - Lst_AtEnd(expansions, - isDot ? estrdup(entry) : + Lst_AtEnd(expansions, + isDot ? estrdup(entry) : Str_concat(p->name, entry, '/')); } } @@ -344,10 +344,10 @@ Dir_MatchFilesi(const char *word, const char *eword, struct PathEntry *p, * [ dir1/.../dirn/file ] which exists below one of the directories * already on the search path), its directory is added to the end * of the path on the assumption that there will be more files in - * that directory later on. + * that directory later on. */ char * -Dir_FindFileComplexi(const char *name, const char *ename, Lst path, +Dir_FindFileComplexi(const char *name, const char *ename, Lst path, bool checkCurdirFirst) { struct PathEntry *p; /* current path member */ @@ -359,7 +359,7 @@ Dir_FindFileComplexi(const char *name, const char *ename, Lst path, const char *cp; /* index of first slash, if any */ bool hasSlash; struct stat stb;/* Buffer for stat, if necessary */ - struct file_stamp *entry; + struct file_stamp *entry; /* Entry for mtimes table */ uint32_t hv; /* hash value for last component in file name */ char *q; /* Str_dupi(name, ename) */ @@ -379,10 +379,10 @@ Dir_FindFileComplexi(const char *name, const char *ename, Lst path, if (DEBUG(DIR)) printf("Searching for %s...", name); - /* Unless checkCurDirFirst is false, we always look for - * the file in the current directory before anywhere else + /* Unless checkCurDirFirst is false, we always look for + * the file in the current directory before anywhere else * and we always return exactly what the caller specified. */ - if (checkCurdirFirst && + if (checkCurdirFirst && (!hasSlash || (cp - name == 2 && *name == '.')) && find_file_hashi(dot, cp, ename, hv) != NULL) { if (DEBUG(DIR)) @@ -390,10 +390,10 @@ Dir_FindFileComplexi(const char *name, const char *ename, Lst path, return Str_dupi(name, ename); } - /* Then, we look through all the directories on path, seeking one + /* Then, we look through all the directories on path, seeking one * containing the final component of name and whose final - * component(s) match name's initial component(s). - * If found, we concatenate the directory name and the + * component(s) match name's initial component(s). + * If found, we concatenate the directory name and the * final component and return the resulting string. */ for (ln = Lst_First(path); ln != NULL; ln = Lst_Adv(ln)) { p = (struct PathEntry *)Lst_Datum(ln); @@ -403,39 +403,39 @@ Dir_FindFileComplexi(const char *name, const char *ename, Lst path, if (DEBUG(DIR)) printf("here..."); if (hasSlash) { - /* If the name had a slash, its initial - * components and p's final components must - * match. This is false if a mismatch is - * encountered before all of the initial - * components have been checked (p2 > name at - * the end of the loop), or we matched only - * part of one of the components of p along + /* If the name had a slash, its initial + * components and p's final components must + * match. This is false if a mismatch is + * encountered before all of the initial + * components have been checked (p2 > name at + * the end of the loop), or we matched only + * part of one of the components of p along * with all the rest of them (*p1 != '/'). */ p1 = p->name + strlen(p->name) - 1; p2 = cp - 2; - while (p2 >= name && p1 >= p->name && + while (p2 >= name && p1 >= p->name && *p1 == *p2) { p1--; p2--; } - if (p2 >= name || + if (p2 >= name || (p1 >= p->name && *p1 != '/')) { if (DEBUG(DIR)) printf("component mismatch -- continuing..."); continue; } } - file = Str_concati(p->name, strchr(p->name, '\0'), cp, + file = Str_concati(p->name, strchr(p->name, '\0'), cp, ename, '/'); if (DEBUG(DIR)) printf("returning %s\n", file); return file; } else if (hasSlash) { - /* If the file has a leading path component and that - * component exactly matches the entire name of the - * current search directory, we assume the file + /* If the file has a leading path component and that + * component exactly matches the entire name of the + * current search directory, we assume the file * doesn't exist and return NULL. */ - for (p1 = p->name, p2 = name; *p1 && *p1 == *p2; + for (p1 = p->name, p2 = name; *p1 && *p1 == *p2; p1++, p2++) continue; if (*p1 == '\0' && p2 == cp - 1) { @@ -448,15 +448,15 @@ Dir_FindFileComplexi(const char *name, const char *ename, Lst path, /* We didn't find the file on any existing member of the path. * If the name doesn't contain a slash, end of story. - * If it does contain a slash, however, it could be in a subdirectory - * of one of the members of the search path. (eg., for path=/usr/include - * and name=sys/types.h, the above search fails to turn up types.h + * If it does contain a slash, however, it could be in a subdirectory + * of one of the members of the search path. (eg., for path=/usr/include + * and name=sys/types.h, the above search fails to turn up types.h * in /usr/include, even though /usr/include/sys/types.h exists). * * We only perform this look-up for non-absolute file names. * * Whenever we score a hit, we assume there will be more matches from - * that directory, and append all but the last component of the + * that directory, and append all but the last component of the * resulting name onto the search path. */ if (!hasSlash) { if (DEBUG(DIR)) @@ -472,10 +472,10 @@ Dir_FindFileComplexi(const char *name, const char *ename, Lst path, for (ln = Lst_First(path); ln != NULL; ln = Lst_Adv(ln)) { p = (struct PathEntry *)Lst_Datum(ln); if (p != dot) - file = Str_concati(p->name, + file = Str_concati(p->name, strchr(p->name, '\0'), name, ename, '/'); else { - /* Checking in dot -- DON'T put a leading + /* Checking in dot -- DON'T put a leading * ./ on the thing. */ file = Str_dupi(name, ename); checkedDot = true; @@ -490,22 +490,22 @@ Dir_FindFileComplexi(const char *name, const char *ename, Lst path, if (DEBUG(DIR)) printf("got it.\n"); - /* We've found another directory to search. - * We know there is a slash in 'file'. We - * call Dir_AddDiri to add the new directory - * onto the existing search path. Once that's - * done, we return the file name, knowing that - * should a file in this directory ever be - * referenced again in such a manner, we will - * find it without having to do numerous + /* We've found another directory to search. + * We know there is a slash in 'file'. We + * call Dir_AddDiri to add the new directory + * onto the existing search path. Once that's + * done, we return the file name, knowing that + * should a file in this directory ever be + * referenced again in such a manner, we will + * find it without having to do numerous * access calls. */ temp = strrchr(file, '/'); Dir_AddDiri(path, file, temp); - /* Save the modification time so if it's + /* Save the modification time so if it's * needed, we don't have to fetch it again. */ if (DEBUG(DIR)) - printf("Caching %s for %s\n", + printf("Caching %s for %s\n", time_to_string(mtime), file); record_stamp(file, mtime); return file; @@ -517,7 +517,7 @@ Dir_FindFileComplexi(const char *name, const char *ename, Lst path, printf("failed. "); if (checkedDot) { - /* Already checked by the given name, since . was in + /* Already checked by the given name, since . was in * the path, so no point in proceeding... */ if (DEBUG(DIR)) printf("Checked . already, returning NULL\n"); @@ -589,8 +589,8 @@ DirReaddiri(const char *name, const char *ename) return NULL; while ((dp = readdir(d)) != NULL) { - if (dp->d_name[0] == '.' && - (dp->d_name[1] == '\0' || + if (dp->d_name[0] == '.' && + (dp->d_name[1] == '\0' || (dp->d_name[1] == '.' && dp->d_name[2] == '\0'))) continue; add_file(p, dp->d_name); @@ -699,7 +699,7 @@ Dir_Destroy(void *pp) struct PathEntry *p = (struct PathEntry *)pp; if (--p->refCount == 0) { - ohash_remove(&knownDirectories, + ohash_remove(&knownDirectories, ohash_qlookup(&knownDirectories, p->name)); free_hash(&p->files); free(p); @@ -764,7 +764,7 @@ Dir_MTime(GNode *gn) entry = ohash_find(&mtimes, slot); if (entry != NULL) { /* Only do this once -- the second time folks are checking to - * see if the file was actually updated, so we need to + * see if the file was actually updated, so we need to * actually go to the file system. */ if (DEBUG(DIR)) printf("Using cached time %s for %s\n", diff --git a/usr.bin/make/dir.h b/usr.bin/make/dir.h index b49583c8b58..65b9fc66cd0 100644 --- a/usr.bin/make/dir.h +++ b/usr.bin/make/dir.h @@ -2,7 +2,7 @@ #define DIR_H /* $OpenPackages$ */ -/* $OpenBSD: dir.h,v 1.21 2007/09/16 14:29:33 espie Exp $ */ +/* $OpenBSD: dir.h,v 1.22 2007/09/17 09:28:36 espie Exp $ */ /* $NetBSD: dir.h,v 1.4 1996/11/06 17:59:05 christos Exp $ */ /* @@ -82,8 +82,8 @@ extern void Dir_AddDiri(Lst, const char *, const char *); */ extern void Dir_Concat(Lst, Lst); -/* Dir_Destroy(d); - * Destroy a directory in a search path. +/* Dir_Destroy(d); + * Destroy a directory in a search path. */ extern void Dir_Destroy(void *); @@ -103,7 +103,7 @@ extern void Dir_PrintPath(Lst); */ /* fullname = Dir_FindFileComplexi(name, end, path, checkCurdirFirst) - * Searches for a file (name, end) on a given search path. If it exists, + * Searches for a file (name, end) on a given search path. If it exists, * return the fullname of the file, otherwise NULL. * The fullname is always a copy, and the caller is responsible for * free()ing it. @@ -120,7 +120,7 @@ extern char *Dir_FindFileComplexi(const char *, const char *, Lst, bool); /* stamp = Dir_MTime(gn); * Return the modification time of node gn, searching along - * the default search path. + * the default search path. * Side effect: the path and mtime fields of gn are filled in. * Return specific value if file can't be found, to be tested by * is_out_of_date(). @@ -130,13 +130,13 @@ extern TIMESTAMP Dir_MTime(GNode *); -/* +/* * Misc */ /* string = Dir_MakeFlags(flag, path); - * Given a search path and a command flag, create a string with each - * of the directories in the path preceded by the command flag and all + * Given a search path and a command flag, create a string with each + * of the directories in the path preceded by the command flag and all * of them separated by spaces. */ extern char *Dir_MakeFlags(const char *, Lst); @@ -150,6 +150,6 @@ extern Lst defaultPath; struct PathEntry; extern struct PathEntry *dot; /* Handles wildcard expansion on a given directory. */ -extern void Dir_MatchFilesi(const char *, const char *, struct PathEntry *, +extern void Dir_MatchFilesi(const char *, const char *, struct PathEntry *, Lst); #endif /* DIR_H */ diff --git a/usr.bin/make/direxpand.c b/usr.bin/make/direxpand.c index 8746e39a7df..78c3f25c2c0 100644 --- a/usr.bin/make/direxpand.c +++ b/usr.bin/make/direxpand.c @@ -1,4 +1,4 @@ -/* $OpenBSD: direxpand.c,v 1.2 2007/09/16 12:19:15 espie Exp $ */ +/* $OpenBSD: direxpand.c,v 1.3 2007/09/17 09:28:36 espie Exp $ */ /* * Copyright (c) 1999,2007 Marc Espie. * @@ -135,15 +135,15 @@ DirExpandWildi(const char *word, const char *eword, Lst path, Lst expansions) if (slash != word) { char *dirpath; - /* If the glob isn't in the first component, - * try and find all the components up to + /* If the glob isn't in the first component, + * try and find all the components up to * the one with a wildcard. */ dirpath = Dir_FindFilei(word, slash+1, path); - /* dirpath is null if we can't find the - * leading component - * XXX: Dir_FindFile won't find internal - * components. i.e. if the path contains - * ../Etc/Object and we're looking for Etc, + /* dirpath is null if we can't find the + * leading component + * XXX: Dir_FindFile won't find internal + * components. i.e. if the path contains + * ../Etc/Object and we're looking for Etc, * it won't be found. */ if (dirpath != NULL) { char *dp; @@ -155,7 +155,7 @@ DirExpandWildi(const char *word, const char *eword, Lst path, Lst expansions) Lst_Init(&temp); Dir_AddDiri(&temp, dirpath, dp); - PathMatchFilesi(slash+1, eword, &temp, + PathMatchFilesi(slash+1, eword, &temp, expansions); Lst_Destroy(&temp, NOFREE); } @@ -207,7 +207,7 @@ DirExpandCurlyi(const char *word, const char *eword, Lst path, Lst expansions) int bracelevel; /* Keep track of nested braces. If we hit * the right brace with bracelevel == 0, * this is the end of the clause. */ - size_t endLen; /* The length of the ending non-curlied + size_t endLen; /* The length of the ending non-curlied * part of the current expansion */ /* End case: no curly left to expand */ @@ -219,11 +219,11 @@ DirExpandCurlyi(const char *word, const char *eword, Lst path, Lst expansions) } else Lst_AtEnd(expansions, toexpand); continue; - } + } start = brace+1; - /* Find the end of the brace clause first, being wary of + /* Find the end of the brace clause first, being wary of * nested brace clauses. */ for (end = start, bracelevel = 0;; end++) { if (*end == '{') @@ -240,10 +240,10 @@ DirExpandCurlyi(const char *word, const char *eword, Lst path, Lst expansions) for (;;) { char *file; /* To hold current expansion */ const char *cp; /* Current position in brace clause */ - + /* Find the end of the current expansion */ - for (bracelevel = 0, cp = start; - bracelevel != 0 || (*cp != '}' && *cp != ','); + for (bracelevel = 0, cp = start; + bracelevel != 0 || (*cp != '}' && *cp != ','); cp++) { if (*cp == '{') bracelevel++; @@ -252,13 +252,13 @@ DirExpandCurlyi(const char *word, const char *eword, Lst path, Lst expansions) } /* Build the current combination and enqueue it. */ - file = emalloc((brace - toexpand) + (cp - start) + + file = emalloc((brace - toexpand) + (cp - start) + endLen + 1); if (brace != toexpand) memcpy(file, toexpand, brace-toexpand); if (cp != start) memcpy(file+(brace-toexpand), start, cp-start); - memcpy(file+(brace-toexpand)+(cp-start), end, + memcpy(file+(brace-toexpand)+(cp-start), end, endLen + 1); Lst_EnQueue(&curled, file); if (*cp == '}') diff --git a/usr.bin/make/engine.c b/usr.bin/make/engine.c index e3ca2885ed0..fb71d317d3e 100644 --- a/usr.bin/make/engine.c +++ b/usr.bin/make/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.4 2007/09/17 08:36:57 espie Exp $ */ +/* $OpenBSD: engine.c,v 1.5 2007/09/17 09:28:36 espie Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. * Copyright (c) 1988, 1989 by Adam de Boor @@ -99,20 +99,20 @@ Job_CheckCommands(GNode *gn, void (*abortProc)(char *, ...)) * our tracks, otherwise we just don't update this * node's parents so they never get examined. */ - static const char msg[] = + static const char msg[] = "make: don't know how to make"; if (gn->type & OP_OPTIONAL) { - (void)fprintf(stdout, "%s %s(ignored)\n", msg, + (void)fprintf(stdout, "%s %s(ignored)\n", msg, gn->name); (void)fflush(stdout); } else if (keepgoing) { - (void)fprintf(stdout, "%s %s(continuing)\n", + (void)fprintf(stdout, "%s %s(continuing)\n", msg, gn->name); (void)fflush(stdout); return false; } else { - (*abortProc)("%s %s. Stop in %s.", msg, + (*abortProc)("%s %s. Stop in %s.", msg, gn->name, Var_Value(".CURDIR")); return false; } @@ -178,8 +178,8 @@ Job_Touch(GNode *gn, bool silent) (void)close(streamID); } else { - (void)fprintf(stdout, - "*** couldn't touch %s: %s", file, + (void)fprintf(stdout, + "*** couldn't touch %s: %s", file, strerror(errno)); (void)fflush(stdout); } @@ -242,7 +242,7 @@ Make_HandleUse( Lst_Concat(&pgn->commands, &cgn->commands); } - for (ln = Lst_First(&cgn->children); ln != NULL; + for (ln = Lst_First(&cgn->children); ln != NULL; ln = Lst_Adv(ln)) { gn = (GNode *)Lst_Datum(ln); @@ -311,7 +311,7 @@ MakeAddAllSrc( Varq_Append(OODATE_INDEX, child, pgn); } } else if (is_strictly_before(pgn->mtime, cgn->mtime) || - (!is_strictly_before(cgn->mtime, now) && + (!is_strictly_before(cgn->mtime, now) && cgn->made == MADE)) { /* * It goes in the OODATE variable if the parent is @@ -404,7 +404,7 @@ Make_OODate(GNode *gn) /* the node to check */ (void)Dir_MTime(gn); if (DEBUG(MAKE)) { if (!is_out_of_date(gn->mtime)) { - printf("modified %s...", + printf("modified %s...", time_to_string(gn->mtime)); } else { printf("non-existent..."); diff --git a/usr.bin/make/engine.h b/usr.bin/make/engine.h index dc53d5dae97..969d244dac4 100644 --- a/usr.bin/make/engine.h +++ b/usr.bin/make/engine.h @@ -1,6 +1,6 @@ #ifndef ENGINE_H #define ENGINE_H -/* $OpenBSD: engine.h,v 1.1 2007/09/16 10:39:07 espie Exp $ */ +/* $OpenBSD: engine.h,v 1.2 2007/09/17 09:28:36 espie Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -40,7 +40,7 @@ /* ok = Job_CheckCommands(node, abort); * verify the integrity of a node's commands, pulling stuff off - * .DEFAULT and other places if necessary. + * .DEFAULT and other places if necessary. */ extern bool Job_CheckCommands(GNode *, void (*abortProc)(char *, ...)); /* Job_Touch(node, besilent); diff --git a/usr.bin/make/error.c b/usr.bin/make/error.c index 0b9278a0c48..d8cab775d30 100644 --- a/usr.bin/make/error.c +++ b/usr.bin/make/error.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: error.c,v 1.12 2004/04/07 13:11:35 espie Exp $ */ +/* $OpenBSD: error.c,v 1.13 2007/09/17 09:28:36 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -147,7 +147,7 @@ Finish(int errors) /* number of errors encountered in Make_Make */ */ /* VARARGS */ static void -ParseVErrorInternal(const char *cfname, unsigned long clineno, int type, +ParseVErrorInternal(const char *cfname, unsigned long clineno, int type, const char *fmt, va_list ap) { if (cfname) @@ -173,7 +173,7 @@ Parse_Error(int type, const char *fmt, ...) va_list ap; va_start(ap, fmt); - ParseVErrorInternal(Parse_Getfilename(), Parse_Getlineno(), type, + ParseVErrorInternal(Parse_Getfilename(), Parse_Getlineno(), type, fmt, ap); va_end(ap); } diff --git a/usr.bin/make/for.c b/usr.bin/make/for.c index 8c9f9dde9bd..7652dee3ad1 100644 --- a/usr.bin/make/for.c +++ b/usr.bin/make/for.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: for.c,v 1.38 2007/09/16 09:46:14 espie Exp $ */ +/* $OpenBSD: for.c,v 1.39 2007/09/17 09:28:36 espie Exp $ */ /* $NetBSD: for.c,v 1.4 1996/11/06 17:59:05 christos Exp $ */ /* @@ -210,7 +210,7 @@ For_Accumulate(For *arg, const char *line) if (strncmp(ptr, "endfor", 6) == 0 && (isspace(ptr[6]) || !ptr[6])) { if (DEBUG(FOR)) - (void)fprintf(stderr, "For: end for %lu\n", + (void)fprintf(stderr, "For: end for %lu\n", arg->level); /* If matching endfor, don't add line to buffer. */ if (--arg->level == 0) @@ -220,7 +220,7 @@ For_Accumulate(For *arg, const char *line) isspace(ptr[3])) { arg->level++; if (DEBUG(FOR)) - (void)fprintf(stderr, "For: new loop %lu\n", + (void)fprintf(stderr, "For: new loop %lu\n", arg->level); } } @@ -247,7 +247,7 @@ ForExec(void *valuep, void *argp) } if (DEBUG(FOR)) - (void)fprintf(stderr, "--- %s = %s\n", + (void)fprintf(stderr, "--- %s = %s\n", (char *)Lst_Datum(arg->var), value); Buf_Init(&buf, arg->guess); Var_SubstVar(&buf, arg->text, Lst_Datum(arg->var), value); diff --git a/usr.bin/make/for.h b/usr.bin/make/for.h index 3838354a43d..66479f2fb31 100644 --- a/usr.bin/make/for.h +++ b/usr.bin/make/for.h @@ -1,7 +1,7 @@ #ifndef FOR_H #define FOR_H /* $OpenPackages$ */ -/* $OpenBSD: for.h,v 1.2 2002/06/13 23:26:39 espie Exp $ */ +/* $OpenBSD: for.h,v 1.3 2007/09/17 09:28:36 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. * @@ -39,7 +39,7 @@ typedef struct For_ For; * Evaluate for loop in line, and returns an opaque handle. * Loop lines are parsed as * <variable1> ... in <values> - * assuming .for has been parsed by previous modules. + * assuming .for has been parsed by previous modules. * Returns NULL if this does not parse as a for loop after all. */ extern For *For_Eval(const char *); @@ -48,7 +48,7 @@ extern For *For_Eval(const char *); extern bool For_Accumulate(For *, const char *); /* For_Run(handle); - * Runs the complete for loop, pushing back expanded lines to reparse + * Runs the complete for loop, pushing back expanded lines to reparse * using Parse_FromString. */ extern void For_Run(For *); diff --git a/usr.bin/make/generate.c b/usr.bin/make/generate.c index 055292dce7c..b95547abaac 100644 --- a/usr.bin/make/generate.c +++ b/usr.bin/make/generate.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: generate.c,v 1.9 2007/09/16 10:20:17 espie Exp $ */ +/* $OpenBSD: generate.c,v 1.10 2007/09/17 09:28:36 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -157,7 +157,7 @@ main(int argc, char *argv[]) } else occupied = NULL; - printf("/* File created by generate %d %d, do not edit */\n", + printf("/* File created by generate %d %d, do not edit */\n", tn, slots); for (i = 0; t[i] != NULL; i++) { e = NULL; @@ -165,7 +165,7 @@ main(int argc, char *argv[]) if (slots) { h = v % slots; if (occupied[h]) { - fprintf(stderr, + fprintf(stderr, "Collision: %s / %s (%d)\n", occupied[h], t[i], h); exit(1); diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index 9c575f095e1..ed4ef965412 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: job.c,v 1.67 2007/09/17 08:36:57 espie Exp $ */ +/* $OpenBSD: job.c,v 1.68 2007/09/17 09:28:36 espie Exp $ */ /* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */ /* @@ -539,7 +539,7 @@ JobCondPassSig(void *jobp, /* Job to biff */ /*- *----------------------------------------------------------------------- * JobPassSig -- - * Pass a signal to all local jobs if USE_PGRP is defined, + * Pass a signal to all local jobs if USE_PGRP is defined, * then die ourselves. * * Side Effects: @@ -787,7 +787,7 @@ JobPrintCommand(LstNode cmdNode, /* command string to print */ * echoOff command. Otherwise we issue it and pretend it was on * for the whole command... */ - if (!shutUp && !(job->flags & JOB_SILENT) && + if (!shutUp && !(job->flags & JOB_SILENT) && commandShell->hasEchoCtl){ DBPRINTF("%s\n", commandShell->echoOff); shutUp = true; @@ -930,7 +930,7 @@ JobFinish(Job *job, /* job to finish */ if (WIFEXITED(*status)) { if (DEBUG(JOB)) { - (void)fprintf(stdout, "Process %ld exited.\n", + (void)fprintf(stdout, "Process %ld exited.\n", (long)job->pid); (void)fflush(stdout); } @@ -941,7 +941,7 @@ JobFinish(Job *job, /* job to finish */ } (void)fprintf(out, "*** Error code %d%s\n", WEXITSTATUS(*status), - (job->flags & JOB_IGNERR) ? "(ignored)" : + (job->flags & JOB_IGNERR) ? "(ignored)" : ""); if (job->flags & JOB_IGNERR) { @@ -952,12 +952,12 @@ JobFinish(Job *job, /* job to finish */ MESSAGE(out, job->node); lastNode = job->node; } - (void)fprintf(out, + (void)fprintf(out, "*** Completed successfully\n"); } } else if (WIFSTOPPED(*status)) { if (DEBUG(JOB)) { - (void)fprintf(stdout, "Process %ld stopped.\n", + (void)fprintf(stdout, "Process %ld stopped.\n", (long)job->pid); (void)fflush(stdout); } @@ -1016,7 +1016,7 @@ JobFinish(Job *job, /* job to finish */ if (nJobs == maxJobs) { jobFull = true; if (DEBUG(JOB)) { - (void)fprintf(stdout, + (void)fprintf(stdout, "Job queue is full.\n"); (void)fflush(stdout); } @@ -1028,7 +1028,7 @@ JobFinish(Job *job, /* job to finish */ MESSAGE(out, job->node); lastNode = job->node; } - (void)fprintf(out, "*** Signal %d\n", + (void)fprintf(out, "*** Signal %d\n", WTERMSIG(*status)); } @@ -1218,10 +1218,10 @@ JobExec(Job *job, char **argv) int bytes, obytes; char *tmp; - bytes = howmany(job->inPipe+1, NFDBITS) * + bytes = howmany(job->inPipe+1, NFDBITS) * sizeof(fd_mask); - obytes = outputsn ? - howmany(outputsn+1, NFDBITS) * + obytes = outputsn ? + howmany(outputsn+1, NFDBITS) * sizeof(fd_mask) : 0; if (bytes != obytes) { @@ -1330,7 +1330,7 @@ JobRestart(Job *job) JobMakeArgv(job, argv); if (DEBUG(JOB)) { - (void)fprintf(stdout, "Restarting %s...", + (void)fprintf(stdout, "Restarting %s...", job->node->name); (void)fflush(stdout); } @@ -1563,7 +1563,7 @@ JobStart(GNode *gn, /* target to create */ * sanity */ numCommands = 0; - Lst_ForEachNodeWhile(&gn->commands, JobPrintCommand, + Lst_ForEachNodeWhile(&gn->commands, JobPrintCommand, job); /* @@ -1593,7 +1593,7 @@ JobStart(GNode *gn, /* target to create */ * good. */ if (cmdsOK) { - Lst_ForEachNodeWhile(&gn->commands, JobPrintCommand, + Lst_ForEachNodeWhile(&gn->commands, JobPrintCommand, job); } /* @@ -1633,7 +1633,7 @@ JobStart(GNode *gn, /* target to create */ */ if (cmdsOK) { if (aborting == 0) { - Lst_ForEachFrom(job->tailCmds, JobSaveCommand, + Lst_ForEachFrom(job->tailCmds, JobSaveCommand, job->node); Make_Update(job->node); } @@ -1671,10 +1671,10 @@ JobStart(GNode *gn, /* target to create */ } else { (void)fprintf(stdout, "Remaking `%s'\n", gn->name); (void)fflush(stdout); - (void)strlcpy(job->outFile, TMPPAT, + (void)strlcpy(job->outFile, TMPPAT, sizeof(job->outFile)); if ((job->outFd = mkstemp(job->outFile)) == -1) - Punt("Cannot create temp file: %s", + Punt("Cannot create temp file: %s", strerror(errno)); (void)fcntl(job->outFd, F_SETFD, 1); } @@ -1711,7 +1711,7 @@ JobStart(GNode *gn, /* target to create */ */ jobFull = true; if (DEBUG(JOB)) { - (void)fprintf(stdout, + (void)fprintf(stdout, "Local job queue is full.\n"); (void)fflush(stdout); } @@ -1753,7 +1753,7 @@ JobOutput(Job *job, char *cp, char *endp, int msg) * non-printable command.... */ cp++; - while (*cp == ' ' || *cp == '\t' || + while (*cp == ' ' || *cp == '\t' || *cp == '\n') { cp++; } @@ -1885,7 +1885,7 @@ end_loop: if (i >= job->curPos) { char *cp; - cp = JobOutput(job, job->outBuf, + cp = JobOutput(job, job->outBuf, &job->outBuf[i], false); /* @@ -1898,14 +1898,14 @@ end_loop: MESSAGE(stdout, job->node); lastNode = job->node; } - (void)fprintf(stdout, "%s%s", cp, + (void)fprintf(stdout, "%s%s", cp, gotNL ? "\n" : ""); (void)fflush(stdout); } } if (i < max - 1) { /* shift the remaining characters down */ - (void)memcpy(job->outBuf, &job->outBuf[i + 1], + (void)memcpy(job->outBuf, &job->outBuf[i + 1], max - (i + 1)); job->curPos = max - (i + 1); @@ -1943,7 +1943,7 @@ end_loop: */ oFILE = fopen(job->outFile, "r"); if (oFILE != NULL) { - (void)fprintf(stdout, "Results of making %s:\n", + (void)fprintf(stdout, "Results of making %s:\n", job->node->name); (void)fflush(stdout); while (fgets(inLine, sizeof(inLine), oFILE) != NULL) { @@ -2008,7 +2008,7 @@ Job_CatchChildren(bool block) /* true if should block on the wait. */ (block?0:WNOHANG)|WUNTRACED)) > 0) { HandleSigs(); if (DEBUG(JOB)) { - (void)fprintf(stdout, + (void)fprintf(stdout, "Process %ld exited or stopped.\n", (long)pid); (void)fflush(stdout); } @@ -2017,7 +2017,7 @@ Job_CatchChildren(bool block) /* true if should block on the wait. */ jnode = Lst_Find(&jobs, JobCmpPid, &pid); if (jnode == NULL) { - if (WIFSIGNALED(status) && + if (WIFSIGNALED(status) && (WTERMSIG(status) == SIGCONT)) { jnode = Lst_Find(&stoppedJobs, JobCmpPid, &pid); if (jnode == NULL) { @@ -2035,7 +2035,7 @@ Job_CatchChildren(bool block) /* true if should block on the wait. */ Lst_Remove(&jobs, jnode); nJobs--; if (jobFull && DEBUG(JOB)) { - (void)fprintf(stdout, + (void)fprintf(stdout, "Job queue is no longer full.\n"); (void)fflush(stdout); } @@ -2086,7 +2086,7 @@ Job_CatchOutput(void) return; } else { HandleSigs(); - for (ln = Lst_First(&jobs); nfds && ln != NULL; + for (ln = Lst_First(&jobs); nfds && ln != NULL; ln = Lst_Adv(ln)) { job = (Job *)Lst_Datum(ln); if (FD_ISSET(job->inPipe, readfdsp)) { diff --git a/usr.bin/make/lowparse.c b/usr.bin/make/lowparse.c index beaa0263a43..6fafc03d98c 100644 --- a/usr.bin/make/lowparse.c +++ b/usr.bin/make/lowparse.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: lowparse.c,v 1.19 2007/05/17 03:37:31 ray Exp $ */ +/* $OpenBSD: lowparse.c,v 1.20 2007/09/17 09:28:36 espie Exp $ */ /* low-level parsing functions. */ @@ -65,10 +65,10 @@ typedef struct { static IFile *current; /* IFile being parsed. */ -static LIST input_stack; /* Stack of IFiles waiting to be parsed +static LIST input_stack; /* Stack of IFiles waiting to be parsed * (includes and loop reparses) */ -/* IFile ctors. +/* IFile ctors. * * obj = new_ifile(filename, filehandle); * Create input object from filename, filehandle. */ @@ -81,7 +81,7 @@ static IFile *new_istring(char *, const char *, unsigned long); static void free_ifile(IFile *); -/* Handling basic character reading. +/* Handling basic character reading. * c = ParseReadc(); * New character c from current input stream, or EOF at end of stream. */ #define ParseReadc() current->ptr < current->end ? *current->ptr++ : newline() @@ -385,7 +385,7 @@ ParseSkipEmptyLines(Buffer linebuf) /* Parse_ReadNormalLine removes beginning and trailing blanks (but keeps * the first tab), handles escaped newlines, and skips over uninteresting - * lines. + * lines. * * The line number is incremented, which implies that continuation * lines are numbered with the last line number (we could do better, at a diff --git a/usr.bin/make/lowparse.h b/usr.bin/make/lowparse.h index 404d22b1c39..2fd910f848d 100644 --- a/usr.bin/make/lowparse.h +++ b/usr.bin/make/lowparse.h @@ -2,7 +2,7 @@ #define LOWPARSE_H /* $OpenPackages$ */ -/* $OpenBSD: lowparse.h,v 1.4 2001/05/23 12:34:45 espie Exp $ */ +/* $OpenBSD: lowparse.h,v 1.5 2007/09/17 09:28:36 espie Exp $ */ /* * Copyright (c) 1999 Marc Espie. @@ -40,7 +40,7 @@ * Parse_Fromxxx(source); * do { * while ((line = Parse_ReadNormalLine(&buf)) != NULL) { - * handle line, use Parse_Fromxxx to push includes, + * handle line, use Parse_Fromxxx to push includes, * Parse_ReadNextConditional to get over non-conditional lines. * or Parse_ReadUnparsedLine to handle special cases manually. * } diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index e832f3d69a2..5afc6c1d5f2 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: main.c,v 1.79 2007/09/16 12:30:35 espie Exp $ */ +/* $OpenBSD: main.c,v 1.80 2007/09/17 09:28:36 espie Exp $ */ /* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */ /* @@ -408,7 +408,7 @@ add_dirpath(Lst l, const char *n) } /* - * Get the name of this type of MACHINE from utsname so we can share an + * Get the name of this type of MACHINE from utsname so we can share an * executable for similar machines. (i.e. m68k: amiga hp300, mac68k, sun3, ...) * * Note that both MACHINE and MACHINE_ARCH are decided at @@ -480,7 +480,7 @@ figure_out_CURDIR() exit(2); } - /* ...but we can use the alias $PWD if we can prove it is the same + /* ...but we can use the alias $PWD if we can prove it is the same * directory */ if ((dir = getenv("PWD")) != NULL) { if (stat(dir, &sb) == 0 && sa.st_ino == sb.st_ino && @@ -768,16 +768,16 @@ main(int argc, char **argv) if (!Lst_IsEmpty(&varstoprint)) { LstNode ln; - for (ln = Lst_First(&varstoprint); ln != NULL; + for (ln = Lst_First(&varstoprint); ln != NULL; ln = Lst_Adv(ln)) { char *value = Var_Value((char *)Lst_Datum(ln)); printf("%s\n", value ? value : ""); } } else { - /* Have now read the entire graph and need to make a list - * of targets to create. If none was given on the command - * line, we consult the parsing module to find the main + /* Have now read the entire graph and need to make a list + * of targets to create. If none was given on the command + * line, we consult the parsing module to find the main * target(s) to create. */ if (Lst_IsEmpty(create)) Parse_MainName(&targs); @@ -785,14 +785,14 @@ main(int argc, char **argv) Targ_FindList(&targs, create); if (compatMake) - /* Compat_Init will take care of creating all the + /* Compat_Init will take care of creating all the * targets as well as initializing the module. */ Compat_Run(&targs); else { - /* Initialize job module before traversing the graph, - * now that any .BEGIN and .END targets have been - * read. This is done only if the -q flag wasn't given - * (to prevent the .BEGIN from being executed should + /* Initialize job module before traversing the graph, + * now that any .BEGIN and .END targets have been + * read. This is done only if the -q flag wasn't given + * (to prevent the .BEGIN from being executed should * it exist). */ if (!queryFlag) { if (maxLocal == -1) diff --git a/usr.bin/make/main.h b/usr.bin/make/main.h index a8e48fecab8..711e84b6806 100644 --- a/usr.bin/make/main.h +++ b/usr.bin/make/main.h @@ -1,7 +1,7 @@ #ifndef MAIN_H #define MAIN_H /* $OpenPackages$ */ -/* $OpenBSD: main.h,v 1.1 2001/05/23 12:34:46 espie Exp $ */ +/* $OpenBSD: main.h,v 1.2 2007/09/17 09:28:36 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -35,9 +35,9 @@ * were given at make's invocation. Used to implement .MFLAGS. */ extern void Main_ParseArgLine(const char *); -/* List of target names given on the command line. Needed to resolve +/* List of target names given on the command line. Needed to resolve * .if make(...) statements. */ -extern Lst create; +extern Lst create; extern GNode *DEFAULT; /* .DEFAULT rule */ diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c index a6a0c60a664..5ace63f5a53 100644 --- a/usr.bin/make/make.c +++ b/usr.bin/make/make.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: make.c,v 1.40 2007/09/17 08:53:59 espie Exp $ */ +/* $OpenBSD: make.c,v 1.41 2007/09/17 09:28:36 espie Exp $ */ /* $NetBSD: make.c,v 1.10 1996/11/06 17:59:15 christos Exp $ */ /* @@ -159,12 +159,12 @@ Make_Update(GNode *cgn) /* the child node */ * * cmp -s y.tab.h parse.h || cp y.tab.h parse.h * - * to function as intended. Unfortunately, thanks to the - * stateless nature of NFS, there are times when the - * modification time of a file created on a remote machine + * to function as intended. Unfortunately, thanks to the + * stateless nature of NFS, there are times when the + * modification time of a file created on a remote machine * will not be modified before the local stat() implied by - * the Dir_MTime occurs, thus leading us to believe that the - * file is unchanged, wreaking havoc with files that depend + * the Dir_MTime occurs, thus leading us to believe that the + * file is unchanged, wreaking havoc with files that depend * on this one. * XXX If we are saving commands pretend that * the target is made now. Otherwise archives with ... rules @@ -185,7 +185,7 @@ Make_Update(GNode *cgn) /* the child node */ if ( ! (cgn->type & (OP_EXEC|OP_USE))) { if (cgn->made == MADE) { pgn->childMade = true; - if (is_strictly_before(pgn->cmtime, + if (is_strictly_before(pgn->cmtime, cgn->mtime)) pgn->cmtime = cgn->mtime; } else { @@ -194,8 +194,8 @@ Make_Update(GNode *cgn) /* the child node */ } if (pgn->unmade == 0) { /* - * Queue the node up -- any unmade - * predecessors will be dealt with in + * Queue the node up -- any unmade + * predecessors will be dealt with in * MakeStartJobs. */ Lst_EnQueue(&toBeMade, pgn); @@ -204,9 +204,9 @@ Make_Update(GNode *cgn) /* the child node */ } } } - /* Deal with successor nodes. If any is marked for making and has an - * unmade count of 0, has not been made and isn't in the examination - * queue, it means we need to place it in the queue as it restrained + /* Deal with successor nodes. If any is marked for making and has an + * unmade count of 0, has not been made and isn't in the examination + * queue, it means we need to place it in the queue as it restrained * itself before. */ for (ln = Lst_First(&cgn->successors); ln != NULL; ln = Lst_Adv(ln)) { GNode *succ = (GNode *)Lst_Datum(ln); @@ -261,7 +261,7 @@ MakeStartJobs(void) if (!Lst_IsEmpty(&gn->preds)) { LstNode ln; - for (ln = Lst_First(&gn->preds); ln != NULL; + for (ln = Lst_First(&gn->preds); ln != NULL; ln = Lst_Adv(ln)){ GNode *pgn = (GNode *)Lst_Datum(ln); @@ -272,10 +272,10 @@ MakeStartJobs(void) } } /* - * If ln isn't NULL, there's a predecessor as yet + * If ln isn't NULL, there's a predecessor as yet * unmade, so we just drop this node on the floor. When - * the node in question has been made, it will notice - * this node as being ready to make but as yet unmade + * the node in question has been made, it will notice + * this node as being ready to make but as yet unmade * and will place the node on the queue. */ if (ln != NULL) @@ -296,10 +296,10 @@ MakeStartJobs(void) gn->made = UPTODATE; if (gn->type & OP_JOIN) { /* - * Even for an up-to-date .JOIN node, we need it - * to have its context variables so references - * to it get the correct value for .TARGET when - * building up the context variables of its + * Even for an up-to-date .JOIN node, we need it + * to have its context variables so references + * to it get the correct value for .TARGET when + * building up the context variables of its * parent(s)... */ Make_DoAllVar(gn); @@ -337,13 +337,13 @@ MakePrintStatus( if (cycle) { bool t = true; /* - * If printing cycles and came to one that has unmade - * children, print out the cycle by recursing on its + * If printing cycles and came to one that has unmade + * children, print out the cycle by recursing on its * children. Note a cycle like: * a : b * b : c * c : b - * will cause this to erroneously complain about a + * will cause this to erroneously complain about a * being in the cycle, but this is a good approximation. */ if (gn->made == CYCLE) { @@ -356,7 +356,7 @@ MakePrintStatus( Lst_ForEach(&gn->children, MakePrintStatus, &t); } } else { - printf("`%s' not remade because of errors.\n", + printf("`%s' not remade because of errors.\n", gn->name); } } @@ -397,7 +397,7 @@ Make_Run(Lst targs) /* the initial list of targets */ numNodes = 0; /* - * Make an initial downward pass over the graph, marking nodes to be + * Make an initial downward pass over the graph, marking nodes to be * made as we go down. We call Suff_FindDeps to find where a node is and * to get some children for it if it has none and also has no commands. * If the node is a leaf, we stick it on the toBeMade queue to @@ -410,7 +410,7 @@ Make_Run(Lst targs) /* the initial list of targets */ numNodes++; /* - * Apply any .USE rules before looking for implicit + * Apply any .USE rules before looking for implicit * dependencies to make sure everything that should have * commands has commands ... */ @@ -418,7 +418,7 @@ Make_Run(Lst targs) /* the initial list of targets */ Suff_FindDeps(gn); if (gn->unmade != 0) - Lst_ForEach(&gn->children, MakeAddChild, + Lst_ForEach(&gn->children, MakeAddChild, &examine); else Lst_EnQueue(&toBeMade, gn); @@ -427,8 +427,8 @@ Make_Run(Lst targs) /* the initial list of targets */ if (queryFlag) { /* - * We wouldn't do any work unless we could start some jobs in - * the next loop... (we won't actually start any, of course, + * We wouldn't do any work unless we could start some jobs in + * the next loop... (we won't actually start any, of course, * this is just to see if any of the targets was out of date) */ return MakeStartJobs(); @@ -436,8 +436,8 @@ Make_Run(Lst targs) /* the initial list of targets */ /* * Initialization. At the moment, no jobs are running and until * some get started, nothing will happen since the remaining - * upward traversal of the graph is performed by the routines - * in job.c upon the finishing of a job. So we fill the Job + * upward traversal of the graph is performed by the routines + * in job.c upon the finishing of a job. So we fill the Job * table as much as we can before going into our loop. */ (void)MakeStartJobs(); @@ -450,7 +450,7 @@ Make_Run(Lst targs) /* the initial list of targets */ * much as possible. Because the job table is kept as full as possible, * the only time when it will be empty is when all the jobs which need * running have been run, so that is the end condition of this loop. - * Note that the Job module will exit if there were any errors unless + * Note that the Job module will exit if there were any errors unless * the keepgoing flag was given. */ while (!Job_Empty()) { diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index f6b63b1f2e2..80dbe2cb695 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: parse.c,v 1.84 2007/09/17 08:36:57 espie Exp $ */ +/* $OpenBSD: parse.c,v 1.85 2007/09/17 09:28:36 espie Exp $ */ /* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */ /* @@ -1142,7 +1142,7 @@ resolve_include_filename(const char *file, bool isSystem) /* Handle non-system non-absolute files... */ if (!isSystem && file[0] != '/') { - /* ... by looking first under the same directory as the + /* ... by looking first under the same directory as the * current file */ char *slash; const char *fname; @@ -1153,7 +1153,7 @@ resolve_include_filename(const char *file, bool isSystem) if (slash != NULL) { char *newName; - newName = Str_concati(fname, slash, file, + newName = Str_concati(fname, slash, file, strchr(file, '\0'), '/'); fullname = Dir_FindFile(newName, parseIncPath); if (fullname == NULL) @@ -1183,7 +1183,7 @@ resolve_include_filename(const char *file, bool isSystem) } static void -handle_include_file(const char *name, const char *ename, bool isSystem, +handle_include_file(const char *name, const char *ename, bool isSystem, bool errIfNotFound) { char *file; @@ -1214,7 +1214,7 @@ handle_include_file(const char *name, const char *ename, bool isSystem, static bool lookup_bsd_include(const char *file) { - char endc; + char endc; const char *efile; bool isSystem; @@ -1249,7 +1249,7 @@ lookup_bsd_include(const char *file) static void -lookup_sysv_style_include(const char *file, const char *directive, +lookup_sysv_style_include(const char *file, const char *directive, bool errIfMissing) { const char *efile; @@ -1344,7 +1344,7 @@ handle_poison(const char *line) break; } if ((*p != '\0' && *p != '#') || type == POISON_INVALID) { - Parse_Error(PARSE_WARNING, "Invalid syntax for .poison: %s", + Parse_Error(PARSE_WARNING, "Invalid syntax for .poison: %s", line); return false; } else { @@ -1447,13 +1447,13 @@ handle_bsd_command(Buffer linebuf, Buffer copy, const char *line) /* FALLTHROUGH */ case COND_PARSE: return true; - case COND_ISFOR: + case COND_ISFOR: return handle_for_loop(linebuf, line); case COND_ISINCLUDE: return lookup_bsd_include(line + 7); case COND_ISPOISON: return handle_poison(line+6); - case COND_ISUNDEF: + case COND_ISUNDEF: return handle_undef(line + 5); default: break; @@ -1523,22 +1523,22 @@ Parse_File( } else { char *stripped; stripped = strip_comments(©, line); - if (*stripped == '.' && handle_bsd_command(&buf, ©, + if (*stripped == '.' && handle_bsd_command(&buf, ©, stripped+1)) ; - else if (FEATURES(FEATURE_SYSVINCLUDE) && + else if (FEATURES(FEATURE_SYSVINCLUDE) && strncmp(stripped, "include", 7) == 0 && isspace(stripped[7]) && strchr(stripped, ':') == NULL) { /* It's an S3/S5-style "include". */ lookup_sysv_include(stripped + 7, "include"); } else if (FEATURES(FEATURE_CONDINCLUDE) && - strncmp(stripped, "sinclude", 8) == 0 && + strncmp(stripped, "sinclude", 8) == 0 && isspace(stripped[8]) && strchr(stripped, ':') == NULL) { lookup_conditional_include(stripped+8, "sinclude"); } else if (FEATURES(FEATURE_CONDINCLUDE) && - strncmp(stripped, "-include", 8) == 0 && + strncmp(stripped, "-include", 8) == 0 && isspace(stripped[8]) && strchr(stripped, ':') == NULL) { lookup_conditional_include(stripped+8, "-include"); diff --git a/usr.bin/make/parsevar.c b/usr.bin/make/parsevar.c index e8ab17dd322..96fe0734673 100644 --- a/usr.bin/make/parsevar.c +++ b/usr.bin/make/parsevar.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: parsevar.c,v 1.9 2007/09/16 09:46:14 espie Exp $ */ +/* $OpenBSD: parsevar.c,v 1.10 2007/09/17 09:28:36 espie Exp $ */ /* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */ /* @@ -104,12 +104,12 @@ parse_variable_assignment(const char *line, int ctxt) case '?': if (type & (VAR_OPT|VAR_APPEND)) type = VAR_INVALID; - else + else type |= VAR_OPT; break; case ':': - if (FEATURES(FEATURE_SUNSHCMD) && + if (FEATURES(FEATURE_SUNSHCMD) && strncmp(arg, "sh", 2) == 0) { type = VAR_SHELL; arg += 2; @@ -169,11 +169,11 @@ parse_variable_assignment(const char *line, int ctxt) /* * Allow variables in the old value to be undefined, but leave * their invocation alone -- this is done by forcing - * errorIsOkay to be false. - * XXX: This can cause recursive variables, but that's not + * errorIsOkay to be false. + * XXX: This can cause recursive variables, but that's not * hard to do, and this allows someone to do something like * - * CFLAGS = $(.INCLUDES) + * CFLAGS = $(.INCLUDES) * CFLAGS := -I.. $(CFLAGS) * * And not get an error. diff --git a/usr.bin/make/str.c b/usr.bin/make/str.c index da00488b698..81a993d4398 100644 --- a/usr.bin/make/str.c +++ b/usr.bin/make/str.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: str.c,v 1.23 2007/09/16 15:24:53 espie Exp $ */ +/* $OpenBSD: str.c,v 1.24 2007/09/17 09:28:36 espie Exp $ */ /* $NetBSD: str.c,v 1.13 1996/11/06 17:59:23 christos Exp $ */ /*- @@ -49,7 +49,7 @@ static bool range_match(char, const char **, const char *); static bool star_match(const char *, const char *, const char *, const char *); char * -Str_concati(const char *s1, const char *e1, const char *s2, const char *e2, +Str_concati(const char *s1, const char *e1, const char *s2, const char *e2, int sep) { size_t len1, len2; @@ -151,7 +151,7 @@ brk_string(const char *str, int *store_argc, char **buffer) *t++ = '\0'; if (argc == argmax) { argmax *= 2; /* ramp up fast */ - argv = erealloc(argv, + argv = erealloc(argv, (argmax + 1) * sizeof(char *)); } argv[argc++] = start; @@ -235,16 +235,16 @@ iterate_words(const char **end) } static bool -star_match(const char *string, const char *estring, +star_match(const char *string, const char *estring, const char *pattern, const char *epattern) { /* '*' matches any substring. We handle this by calling ourselves - * recursively for each postfix of string, until either we match or + * recursively for each postfix of string, until either we match or * we reach the end of the string. */ pattern++; - /* Skip over contiguous sequences of `?*', so that + /* Skip over contiguous sequences of `?*', so that * recursive calls only occur on `real' characters. */ - while (pattern != epattern && + while (pattern != epattern && (*pattern == '?' || *pattern == '*')) { if (*pattern == '?') { if (string == estring) @@ -257,7 +257,7 @@ star_match(const char *string, const char *estring, if (pattern == epattern) return true; for (; string != estring; string++) - if (Str_Matchi(string, estring, pattern, + if (Str_Matchi(string, estring, pattern, epattern)) return true; return false; @@ -269,13 +269,13 @@ range_match(char c, const char **ppat, const char *epattern) if (*ppat == epattern) { if (c == '[') return true; - else + else return false; } if (**ppat == '!' || **ppat == '^') { (*ppat)++; return !range_match(c, ppat, epattern); - } + } for (;;) { if (**ppat == '\\') { if (++(*ppat) == epattern) @@ -293,18 +293,18 @@ range_match(char c, const char **ppat, const char *epattern) *ppat += 3; } else (*ppat)++; - /* The test for ']' is done at the end - * so that ']' can be used at the + /* The test for ']' is done at the end + * so that ']' can be used at the * start of the range without '\' */ if (*ppat == epattern || **ppat == ']') return false; } - /* Found matching character, skip over rest + /* Found matching character, skip over rest * of class. */ while (**ppat != ']') { if (**ppat == '\\') (*ppat)++; - /* A non-terminated character class + /* A non-terminated character class * is ok. */ if (*ppat == epattern) break; @@ -314,7 +314,7 @@ range_match(char c, const char **ppat, const char *epattern) } bool -Str_Matchi(const char *string, const char *estring, +Str_Matchi(const char *string, const char *estring, const char *pattern, const char *epattern) { while (pattern != epattern) { @@ -334,8 +334,8 @@ Str_Matchi(const char *string, const char *estring, } /* '?' matches any single character, so shunt test. */ else if (*pattern != '?') { - /* If the next pattern character is '\', just strip - * off the '\' so we do exact matching on the + /* If the next pattern character is '\', just strip + * off the '\' so we do exact matching on the * character that follows. */ if (*pattern == '\\') { if (++pattern == epattern) diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c index d066681c1f8..aaf4a45140b 100644 --- a/usr.bin/make/suff.c +++ b/usr.bin/make/suff.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: suff.c,v 1.66 2007/09/17 09:16:58 espie Exp $ */ +/* $OpenBSD: suff.c,v 1.67 2007/09/17 09:28:36 espie Exp $ */ /* $NetBSD: suff.c,v 1.13 1996/11/06 17:59:25 christos Exp $ */ /* @@ -310,7 +310,7 @@ transform_find_by_name(const char *name) static int SuffSuffIsPrefix(void *s, const void *str) { - return SuffStrIsPrefix(((Suff *)s)->name, + return SuffStrIsPrefix(((Suff *)s)->name, (const char *)str) == NULL ? 1 : 0; } @@ -463,7 +463,7 @@ SuffParseTransform( if (srcLn == NULL) srcLn = Lst_FindConst(&sufflist, SuffSuffIsPrefix, str); else - srcLn = Lst_FindFromConst(Lst_Succ(srcLn), + srcLn = Lst_FindFromConst(Lst_Succ(srcLn), SuffSuffIsPrefix, str); if (srcLn == NULL) { /* @@ -1037,7 +1037,7 @@ SuffFindThem( break; } - if ((ptr = Dir_FindFile(s->file, &s->suff->searchPath)) + if ((ptr = Dir_FindFile(s->file, &s->suff->searchPath)) != NULL) { rs = s; #ifdef DEBUG_SRC @@ -1116,7 +1116,7 @@ SuffFindCmds( */ suff = (Suff *)Lst_Datum(ln2); - if (Lst_Member(&suff->parents, targ->suff) + if (Lst_Member(&suff->parents, targ->suff) != NULL) { /* * Hot Damn! Create a new Src structure @@ -1404,7 +1404,7 @@ SuffApplyTransform( gn = (GNode *)Lst_Datum(ln); if (DEBUG(SUFF)) - printf("\tapplying %s -> %s to \"%s\"\n", s->name, t->name, + printf("\tapplying %s -> %s to \"%s\"\n", s->name, t->name, tGn->name); /* Record last child for expansion purposes. */ @@ -1692,7 +1692,7 @@ sfnd_abort: * the node is only a source (not on the lhs of a dependency * operator or [XXX] it has neither children or commands). */ if (OP_NOP(gn->type) || - (Lst_IsEmpty(&gn->children) && + (Lst_IsEmpty(&gn->children) && Lst_IsEmpty(&gn->commands))) { gn->path = Dir_FindFile(gn->name, (targ == NULL ? defaultPath : @@ -1705,7 +1705,7 @@ sfnd_abort: /* Suffix known for the thing -- trim * the suffix off the path to form the * proper .PREFIX variable. */ - int savep = strlen(gn->path) - + int savep = strlen(gn->path) - targ->suff->nameLen; char savec; @@ -1714,7 +1714,7 @@ sfnd_abort: savec = gn->path[savep]; gn->path[savep] = '\0'; - if ((ptr = strrchr(gn->path, '/')) + if ((ptr = strrchr(gn->path, '/')) != NULL) ptr++; else @@ -1728,7 +1728,7 @@ sfnd_abort: * the target has no known suffix. */ gn->suffix = NULL; - if ((ptr = strrchr(gn->path, '/')) + if ((ptr = strrchr(gn->path, '/')) != NULL) ptr++; else @@ -1797,7 +1797,7 @@ sfnd_abort: targ->node = Targ_FindNode(targ->file, TARG_CREATE); } - SuffApplyTransform(targ->node, src->node, targ->suff, + SuffApplyTransform(targ->node, src->node, targ->suff, src->suff); if (targ->node != gn) { @@ -1950,7 +1950,7 @@ Suff_SetNull(const char *name) */ suffNull = s; } else { - Parse_Error(PARSE_WARNING, + Parse_Error(PARSE_WARNING, "Desired null suffix %s not defined.", name); } } diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index cc3ec9161cb..588c1add13b 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: targ.c,v 1.44 2007/09/16 15:20:48 espie Exp $ */ +/* $OpenBSD: targ.c,v 1.45 2007/09/17 09:28:36 espie Exp $ */ /* $NetBSD: targ.c,v 1.11 1997/02/20 16:51:50 christos Exp $ */ /* @@ -266,7 +266,7 @@ TargFreeGN(void *gnp) *----------------------------------------------------------------------- */ GNode * -Targ_FindNodei(const char *name, const char *ename, +Targ_FindNodei(const char *name, const char *ename, int flags) /* flags governing events when target not * found */ { @@ -417,9 +417,9 @@ Targ_PrintType(int type) PRINTBIT(NOTMAIN); PRINTDBIT(LIB); /*XXX: MEMBER is defined, so CONCAT(OP_,MEMBER) gives OP_"%" */ - case OP_MEMBER: - if (DEBUG(TARG)) - printf(".MEMBER "); + case OP_MEMBER: + if (DEBUG(TARG)) + printf(".MEMBER "); break; PRINTDBIT(ARCHV); } diff --git a/usr.bin/make/timestamp.h b/usr.bin/make/timestamp.h index 49d90f62338..10875257247 100644 --- a/usr.bin/make/timestamp.h +++ b/usr.bin/make/timestamp.h @@ -2,7 +2,7 @@ #define TIMESTAMP_H /* $OpenPackages$ */ -/* $OpenBSD: timestamp.h,v 1.2 2007/09/16 12:09:36 espie Exp $ */ +/* $OpenBSD: timestamp.h,v 1.3 2007/09/17 09:28:36 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -43,7 +43,7 @@ * ts_set_from_now(n): grab current date. */ -/* sysresult = set_times(name): set modification times on a file. +/* sysresult = set_times(name): set modification times on a file. * system call results. */ diff --git a/usr.bin/make/util.c b/usr.bin/make/util.c index eada1ceb58f..d0939018339 100644 --- a/usr.bin/make/util.c +++ b/usr.bin/make/util.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: util.c,v 1.22 2007/09/17 08:36:57 espie Exp $ */ +/* $OpenBSD: util.c,v 1.23 2007/09/17 09:28:36 espie Exp $ */ /* $NetBSD: util.c,v 1.10 1996/12/31 17:56:04 christos Exp $ */ /* @@ -207,7 +207,7 @@ getwd(pathname) /* find the inode of root */ if (stat("/", &st_root) == -1) { - (void)snprintf(pathname, MAXPATHLEN, + (void)snprintf(pathname, MAXPATHLEN, "getwd: Cannot stat \"/\" (%s)", strerror(errno)); return NULL; } @@ -263,7 +263,7 @@ getwd(pathname) for (d = readdir(dp); d != NULL; d = readdir(dp)) { if (ISDOT(d->d_name) || ISDOTDOT(d->d_name)) continue; - (void)strlcpy(cur_name_add, d->d_name, + (void)strlcpy(cur_name_add, d->d_name, sizeof(nextpathbuf) MAXPATHLEN - (MAXPATHLEN - 1)); if (lstat(nextpathptr, &st_next) == -1) { (void)snprintf(pathname, MAXPATHLEN, diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index 04f415230ae..7ea2ece2a36 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: var.c,v 1.76 2007/09/16 12:01:11 espie Exp $ */ +/* $OpenBSD: var.c,v 1.77 2007/09/17 09:28:36 espie Exp $ */ /* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */ /* @@ -697,14 +697,14 @@ var_set_append(const char *name, const char *ename, const char *val, int ctxt, } void -Var_Seti_with_ctxt(const char *name, const char *ename, const char *val, +Var_Seti_with_ctxt(const char *name, const char *ename, const char *val, int ctxt) { var_set_append(name, ename, val, ctxt, false); } void -Var_Appendi_with_ctxt(const char *name, const char *ename, const char *val, +Var_Appendi_with_ctxt(const char *name, const char *ename, const char *val, int ctxt) { var_set_append(name, ename, val, ctxt, true); @@ -824,7 +824,7 @@ find_pos(int c) } } -static bool +static bool parse_base_variable_name(const char **pstr, struct Name *name, SymTable *ctxt) { const char *str = *pstr; @@ -900,14 +900,14 @@ Var_ParseBuffer(Buffer buf, const char *str, SymTable *ctxt, bool err, static Var *call_trace[MAX_DEPTH]; static int current_depth = 0; -static void +static void push_used(Var *v) { if (v->flags & VAR_IN_USE) { int i; fprintf(stderr, "Problem with variable expansion chain: "); - for (i = 0; - i < (current_depth > MAX_DEPTH ? MAX_DEPTH : current_depth); + for (i = 0; + i < (current_depth > MAX_DEPTH ? MAX_DEPTH : current_depth); i++) fprintf(stderr, "%s -> ", call_trace[i]->name); fprintf(stderr, "%s\n", v->name); @@ -1105,8 +1105,8 @@ Var_Subst(const char *str, /* the string in which to substitute */ static BUFFER subst_buffer; -/* we would like to subst on intervals, but it's complicated, so we cheat - * by storing the interval in a static buffer. +/* we would like to subst on intervals, but it's complicated, so we cheat + * by storing the interval in a static buffer. */ char * Var_Substi(const char *str, const char *estr, SymTable *ctxt, bool undefErr) @@ -1229,7 +1229,7 @@ Var_SubstVar(Buffer buf, /* To store result */ /* val won't be freed since !doFree, but * VarModifiers_Apply doesn't know that, * hence the cast. */ - newval = VarModifiers_Apply((char *)val, + newval = VarModifiers_Apply((char *)val, &name, NULL, false, &doFree, &p, paren); Buf_AddString(buf, newval); if (doFree) diff --git a/usr.bin/make/var.h b/usr.bin/make/var.h index 3fa22378f9e..44cf2ee4d20 100644 --- a/usr.bin/make/var.h +++ b/usr.bin/make/var.h @@ -104,7 +104,7 @@ extern char *Var_Parse(const char *, SymTable *, bool, size_t *, extern char var_Error[]; /* ok = Var_ParseSkip(&varspec, ctxt, &ok); - * Parses a variable specification and returns true if the varspec + * Parses a variable specification and returns true if the varspec * is correct. Advances pointer past specification. */ extern bool Var_ParseSkip(const char **, SymTable *); diff --git a/usr.bin/make/varmodifiers.c b/usr.bin/make/varmodifiers.c index 75e3b251d14..51cd4e1a8af 100644 --- a/usr.bin/make/varmodifiers.c +++ b/usr.bin/make/varmodifiers.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: varmodifiers.c,v 1.22 2007/09/16 12:02:38 espie Exp $ */ +/* $OpenBSD: varmodifiers.c,v 1.23 2007/09/17 09:28:36 espie Exp $ */ /* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */ /* @@ -353,7 +353,7 @@ VarRoot(struct Name *word, bool addSpace, Buffer buf, void *dummy UNUSED) *----------------------------------------------------------------------- */ static bool -VarMatch(struct Name *word, bool addSpace, Buffer buf, +VarMatch(struct Name *word, bool addSpace, Buffer buf, void *pattern) /* Pattern the word must match */ { const char *pat = (const char *)pattern; @@ -374,7 +374,7 @@ VarMatch(struct Name *word, bool addSpace, Buffer buf, *----------------------------------------------------------------------- */ static bool -VarNoMatch(struct Name *word, bool addSpace, Buffer buf, +VarNoMatch(struct Name *word, bool addSpace, Buffer buf, void *pattern) /* Pattern the word must not match */ { const char *pat = (const char *)pattern; @@ -394,7 +394,7 @@ VarUniq(struct Name *word, bool addSpace, Buffer buf, void *lastp) struct Name *last = (struct Name *)lastp; /* does not match */ - if (last->s == NULL || last->e - last->s != word->e - word->s || + if (last->s == NULL || last->e - last->s != word->e - word->s || strncmp(word->s, last->s, word->e - word->s) != 0) { if (addSpace) Buf_AddSpace(buf); @@ -607,7 +607,7 @@ VarSYSVMatch(struct Name *word, bool addSpace, Buffer buf, void *patp) } void * -get_sysvpattern(const char **p, SymTable *ctxt UNUSED, bool err UNUSED, +get_sysvpattern(const char **p, SymTable *ctxt UNUSED, bool err UNUSED, int endc) { VarPattern *pattern; @@ -641,7 +641,7 @@ get_sysvpattern(const char **p, SymTable *ctxt UNUSED, bool err UNUSED, return NULL; } } - + pattern = (VarPattern *)emalloc(sizeof(VarPattern)); pattern->lbuffer = pattern->lhs = Str_dupi(*p, cp); pattern->leftLen = cp - *p; @@ -661,7 +661,7 @@ get_sysvpattern(const char **p, SymTable *ctxt UNUSED, bool err UNUSED, *----------------------------------------------------------------------- */ static bool -VarSubstitute(struct Name *word, bool addSpace, Buffer buf, +VarSubstitute(struct Name *word, bool addSpace, Buffer buf, void *patternp) /* Pattern for substitution */ { size_t wordLen; /* Length of word */ @@ -850,7 +850,7 @@ VarRESubstitute(struct Name *word, bool addSpace, Buffer buf, void *patternp) Buf_AddChar(buf,rp[1]); rp++; } - else if (*rp == '&' || + else if (*rp == '&' || (*rp == '\\' && isdigit(rp[1]))) { int n; const char *subbuf; @@ -870,19 +870,19 @@ VarRESubstitute(struct Name *word, bool addSpace, Buffer buf, void *patternp) } if (n > pat->nsub) { - Error("No subexpression %s", + Error("No subexpression %s", &errstr[0]); subbuf = ""; sublen = 0; } else if (pat->matches[n].rm_so == -1 && pat->matches[n].rm_eo == -1) { - Error("No match for subexpression %s", + Error("No match for subexpression %s", &errstr[0]); subbuf = ""; sublen = 0; } else { subbuf = wp + pat->matches[n].rm_so; - sublen = pat->matches[n].rm_eo - + sublen = pat->matches[n].rm_eo - pat->matches[n].rm_so; } @@ -930,7 +930,7 @@ VarRESubstitute(struct Name *word, bool addSpace, Buffer buf, void *patternp) static char * VarModify(char *str, /* String whose words should be trimmed */ /* Function to use to modify them */ - bool (*modProc)(struct Name *, bool, Buffer, void *), + bool (*modProc)(struct Name *, bool, Buffer, void *), void *datum) /* Datum to pass it */ { BUFFER buf; /* Buffer for the new string */ @@ -972,7 +972,7 @@ VarModify(char *str, /* String whose words should be trimmed */ *----------------------------------------------------------------------- */ static char * -VarGetPattern(SymTable *ctxt, int err, const char **tstr, int delim1, +VarGetPattern(SymTable *ctxt, int err, const char **tstr, int delim1, int delim2, size_t *length, VarPattern *pattern) { const char *cp; @@ -1008,7 +1008,7 @@ VarGetPattern(SymTable *ctxt, int err, const char **tstr, int delim1, /* If unescaped dollar sign not before the * delimiter, assume it's a variable * substitution and recurse. */ - (void)Var_ParseBuffer(&buf, cp, ctxt, err, + (void)Var_ParseBuffer(&buf, cp, ctxt, err, &len); cp += len - 1; } @@ -1223,7 +1223,7 @@ get_loop(const char **p, SymTable *ctxt UNUSED, bool err, int endc) } static void * -common_get_patternarg(const char **p, SymTable *ctxt, bool err, int endc, +common_get_patternarg(const char **p, SymTable *ctxt, bool err, int endc, bool dosubst) { VarPattern *pattern; @@ -1240,7 +1240,7 @@ common_get_patternarg(const char **p, SymTable *ctxt, bool err, int endc, s += 2; pattern->rhs = NULL; - pattern->lhs = VarGetPattern(ctxt, err, &s, delim, delim, + pattern->lhs = VarGetPattern(ctxt, err, &s, delim, delim, &pattern->leftLen, NULL); pattern->lbuffer = pattern->lhs; if (pattern->lhs != NULL) { @@ -1294,7 +1294,7 @@ assign_get_value(const char **p, SymTable *ctxt, bool err, int endc) if (arg != NULL) { *p = s; arg->flags = flags; - } + } return arg; } @@ -1376,7 +1376,7 @@ do_regex(const char *s, const struct Name *n UNUSED, void *arg) #endif char * -VarModifiers_Apply(char *str, const struct Name *name, SymTable *ctxt, +VarModifiers_Apply(char *str, const struct Name *name, SymTable *ctxt, bool err, bool *freePtr, const char **pscan, int paren) { const char *tstr; @@ -1430,12 +1430,12 @@ VarModifiers_Apply(char *str, const struct Name *name, SymTable *ctxt, if (arg != NULL) { if (str != NULL || (mod->atstart && name != NULL)) { if (mod->word_apply != NULL) { - newStr = VarModify(str, + newStr = VarModify(str, mod->word_apply, arg); if (mod->apply != NULL) { char *newStr2; - newStr2 = mod->apply(newStr, + newStr2 = mod->apply(newStr, name, arg); free(newStr); newStr = newStr2; diff --git a/usr.bin/make/varmodifiers.h b/usr.bin/make/varmodifiers.h index fe3c91d005a..9de4203af62 100644 --- a/usr.bin/make/varmodifiers.h +++ b/usr.bin/make/varmodifiers.h @@ -2,7 +2,7 @@ #define VARMODIFIERS_H /* $OpenPackages$ */ -/* $OpenBSD: varmodifiers.h,v 1.9 2007/09/16 09:46:14 espie Exp $ */ +/* $OpenBSD: varmodifiers.h,v 1.10 2007/09/17 09:28:36 espie Exp $ */ /* * Copyright (c) 1999 Marc Espie. @@ -39,8 +39,8 @@ extern void VarModifiers_Init(void); /* result = VarModifiers_Apply(val, name, ctxt, undef_is_bad, * &should_free, &modstart, paren); - * Applies variable modifiers starting at modstart (including :), - * using parenthesis paren, to value val. + * Applies variable modifiers starting at modstart (including :), + * using parenthesis paren, to value val. * Variables in spec are taken from context ctxt. * If undef_is_bad, error occurs if undefined variables are mentioned. * modstart is advanced past the end of the spec. @@ -49,7 +49,7 @@ extern void VarModifiers_Init(void); * * If both val and name are NULL, VarModifiers_Apply just parses the * modifiers specification, as it can't apply it to anything. */ -extern char *VarModifiers_Apply(char *, const struct Name *, SymTable *, +extern char *VarModifiers_Apply(char *, const struct Name *, SymTable *, bool, bool *, const char **, int); /* Direct interface to specific modifiers used under special circumstances. */ diff --git a/usr.bin/make/varname.h b/usr.bin/make/varname.h index 187894423dc..01d0e5eb487 100644 --- a/usr.bin/make/varname.h +++ b/usr.bin/make/varname.h @@ -1,4 +1,4 @@ -/* $OpenBSD: varname.h,v 1.2 2002/06/05 21:34:18 espie Exp $ */ +/* $OpenBSD: varname.h,v 1.3 2007/09/17 09:28:36 espie Exp $ */ #ifndef VARNAME_H #define VARNAME_H /* @@ -48,7 +48,7 @@ struct Name { * differing modules have different requirements wrt variable spec * endings). Returns the position where the variable spec finally * ends. Name result might be a copy, or not. */ -extern const char *VarName_Get(const char *, struct Name *, SymTable *, +extern const char *VarName_Get(const char *, struct Name *, SymTable *, bool, const char *(*)(const char *)); /* VarName_Free(name); * Frees a variable name filled by VarName_Get(). */ |