-# $OpenBSD: Makefile,v 1.58 2014/05/12 19:11:19 espie Exp $
+# $OpenBSD: Makefile,v 1.59 2015/01/23 22:35:57 espie Exp $
PROG= make
CFLAGS+= -I${.OBJDIR} -I${.CURDIR}
HOSTCFLAGS+= -I${.OBJDIR} -I${.CURDIR}
CDIAGFLAGS=-Wall -W -Wno-char-subscripts -Wstrict-prototypes -pedantic \
- -Wmissing-prototypes -Wdeclaration-after-statement
+ -Wmissing-prototypes -Wdeclaration-after-statement -std=c99
CDEFS+=-DHAS_BOOL_H
CDEFS+=-DHAS_PATHS_H
-/* $OpenBSD: dir.c,v 1.66 2015/01/23 13:18:40 espie Exp $ */
+/* $OpenBSD: dir.c,v 1.67 2015/01/23 22:35:57 espie Exp $ */
/* $NetBSD: dir.c,v 1.14 1997/03/29 16:51:26 christos Exp $ */
/*
static void
DirPrintDir(void *p)
{
- struct PathEntry *q = p;
+ const struct PathEntry *q = p;
printf("%s ", q->name);
}
-/* $OpenBSD: direxpand.c,v 1.6 2015/01/23 13:18:40 espie Exp $ */
+/* $OpenBSD: direxpand.c,v 1.7 2015/01/23 22:35:57 espie Exp $ */
/*
* Copyright (c) 1999,2007 Marc Espie.
*
static void
DirPrintWord(void *word)
{
- char *s = word;
+ const char *s = word;
printf("%s ", s);
}
-/* $OpenBSD: dump.c,v 1.7 2015/01/23 13:18:40 espie Exp $ */
+/* $OpenBSD: dump.c,v 1.8 2015/01/23 22:35:57 espie Exp $ */
/*
* Copyright (c) 2012 Marc Espie.
*
static void
TargPrintName(void *gnp)
{
- GNode *gn = gnp;
+ const GNode *gn = gnp;
printf("%s ", gn->name);
}
-/* $OpenBSD: dump.h,v 1.2 2012/10/02 10:29:30 espie Exp $ */
+/* $OpenBSD: dump.h,v 1.3 2015/01/23 22:35:57 espie Exp $ */
#ifndef _DUMP_H_
#define _DUMP_H_
* function.
* free(t) when done with it.
*/
-extern void * sort_ohash(struct ohash *, int (*)(const void *, const void *));
+extern void *sort_ohash(struct ohash *, int (*)(const void *, const void *));
#endif
-/* $OpenBSD: main.c,v 1.107 2015/01/23 13:18:40 espie Exp $ */
+/* $OpenBSD: main.c,v 1.108 2015/01/23 22:35:57 espie Exp $ */
/* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */
/*
static bool
ReadMakefile(void *p, void *q)
{
- char *fname = p; /* makefile to read */
+ const char *fname = p; /* makefile to read */
struct dirs *d = q;
FILE *stream;
char *name;
-/* $OpenBSD: parse.c,v 1.111 2015/01/23 13:18:40 espie Exp $ */
+/* $OpenBSD: parse.c,v 1.112 2015/01/23 22:35:57 espie Exp $ */
/* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */
/*
ParseFindMain(void *gnp, void *dummy UNUSED)
{
GNode *gn = gnp;
+
if ((gn->type & OP_NOTARGET) == 0 && gn->special == SPECIAL_NONE) {
mainNode = gn;
return 0;
-/* $OpenBSD: suff.c,v 1.89 2015/01/23 13:18:40 espie Exp $ */
+/* $OpenBSD: suff.c,v 1.90 2015/01/23 22:35:58 espie Exp $ */
/* $NetBSD: suff.c,v 1.13 1996/11/06 17:59:25 christos Exp $ */
/*
static void
SuffPrintName(void *p)
{
- Suff *s = p;
+ const Suff *s = p;
printf("%s ", s == emptySuff ? "<empty>" : s->name);
}
-/* $OpenBSD: targ.c,v 1.75 2014/05/12 19:11:19 espie Exp $ */
+/* $OpenBSD: targ.c,v 1.76 2015/01/23 22:35:58 espie Exp $ */
/* $NetBSD: targ.c,v 1.11 1997/02/20 16:51:50 christos Exp $ */
/*
void
Targ_PrintCmd(void *p)
{
- struct command *cmd = p;
+ const struct command *cmd = p;
printf("\t%s\n", cmd->string);
}
-/* $OpenBSD: varmodifiers.c,v 1.40 2015/01/23 13:18:40 espie Exp $ */
+/* $OpenBSD: varmodifiers.c,v 1.41 2015/01/23 22:35:58 espie Exp $ */
/* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */
/*
VarMatch(struct Name *word, bool addSpace, Buffer buf,
void *pattern) /* Pattern the word must match */
{
- const char *pat = (const char *)pattern;
+ const char *pat = pattern;
if (Str_Matchi(word->s, word->e, pat, strchr(pat, '\0'))) {
if (addSpace)
VarNoMatch(struct Name *word, bool addSpace, Buffer buf,
void *pattern) /* Pattern the word must not match */
{
- const char *pat = (const char *)pattern;
+ const char *pat = pattern;
if (!Str_Matchi(word->s, word->e, pat, strchr(pat, '\0'))) {
if (addSpace)
static int
NameCompare(const void *ap, const void *bp)
{
- struct Name *a, *b;
+ const struct Name *a, *b;
size_t n, m;
int c;
- a = (struct Name *)ap;
- b = (struct Name *)bp;
+ a = ap;
+ b = bp;
n = a->e - a->s;
m = b->e - b->s;
if (n < m) {
c = strncmp(a->s, b->s, n);
if (c != 0)
- return c;
+ return c;
else
- return -1;
+ return -1;
} else if (m < n) {
c = strncmp(a->s, b->s, m);
if (c != 0)
- return c;
+ return c;
else
- return 1;
+ return 1;
} else
- return strncmp(a->s, b->s, n);
+ return strncmp(a->s, b->s, n);
}
static char *