From 31cacaea5d6a845b75daf64d5dc4ef02d5171e51 Mon Sep 17 00:00:00 2001 From: espie Date: Wed, 14 Oct 2015 13:50:22 +0000 Subject: [PATCH] make sure we use stdbool.h Mostly diff by Daniel Dickman, who told me to commit in his stead, as he's tied up at work. --- usr.bin/make/Makefile | 3 +-- usr.bin/make/defines.h | 8 +------- usr.bin/make/lst.h | 4 ++-- usr.bin/make/lst.lib/lstFindFrom.c | 4 ++-- usr.bin/make/main.c | 4 ++-- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/usr.bin/make/Makefile b/usr.bin/make/Makefile index 0f987fb2ef7..95a8ffe7932 100644 --- a/usr.bin/make/Makefile +++ b/usr.bin/make/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.59 2015/01/23 22:35:57 espie Exp $ +# $OpenBSD: Makefile,v 1.60 2015/10/14 13:50:22 espie Exp $ PROG= make CFLAGS+= -I${.OBJDIR} -I${.CURDIR} @@ -6,7 +6,6 @@ HOSTCFLAGS+= -I${.OBJDIR} -I${.CURDIR} CDIAGFLAGS=-Wall -W -Wno-char-subscripts -Wstrict-prototypes -pedantic \ -Wmissing-prototypes -Wdeclaration-after-statement -std=c99 -CDEFS+=-DHAS_BOOL_H CDEFS+=-DHAS_PATHS_H CDEFS+=-DHAS_EXTENDED_GETCWD #CDEFS+=-DHAS_STATS diff --git a/usr.bin/make/defines.h b/usr.bin/make/defines.h index 1ceee99474b..05b29dcf039 100644 --- a/usr.bin/make/defines.h +++ b/usr.bin/make/defines.h @@ -1,7 +1,7 @@ #ifndef DEFINES_H #define DEFINES_H -/* $OpenBSD: defines.h,v 1.14 2013/11/22 15:47:35 espie Exp $ */ +/* $OpenBSD: defines.h,v 1.15 2015/10/14 13:50:22 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -28,13 +28,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAS_STDBOOL_H # include -#else -typedef int bool; -# define false 0 -# define true 1 -#endif /* define common types in an opaque way */ struct GNode_; diff --git a/usr.bin/make/lst.h b/usr.bin/make/lst.h index d4f3903ee45..103569c1c7c 100644 --- a/usr.bin/make/lst.h +++ b/usr.bin/make/lst.h @@ -1,7 +1,7 @@ #ifndef _LST_H_ #define _LST_H_ -/* $OpenBSD: lst.h,v 1.29 2010/07/19 19:46:44 espie Exp $ */ +/* $OpenBSD: lst.h,v 1.30 2015/10/14 13:50:22 espie Exp $ */ /* $NetBSD: lst.h,v 1.7 1996/11/06 17:59:12 christos Exp $ */ /* @@ -59,7 +59,7 @@ struct ListNode_ { #endif typedef void (*SimpleProc)(void *); -typedef int (*FindProc)(void *, void *); +typedef bool (*FindProc)(void *, void *); typedef int (*ForEachNodeWhileProc)(LstNode, void *); typedef int (*FindProcConst)(void *, const void *); typedef void (*ForEachProc)(void *, void *); diff --git a/usr.bin/make/lst.lib/lstFindFrom.c b/usr.bin/make/lst.lib/lstFindFrom.c index 10d91669af6..abd5c332649 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.18 2010/07/19 19:46:44 espie Exp $ */ +/* $OpenBSD: lstFindFrom.c,v 1.19 2015/10/14 13:50:22 espie Exp $ */ /* $NetBSD: lstFindFrom.c,v 1.6 1996/11/06 17:59:40 christos Exp $ */ /* @@ -58,7 +58,7 @@ Lst_FindFrom(LstNode ln, FindProc cProc, void *d) LstNode tln; for (tln = ln; tln != NULL; tln = tln->nextPtr) - if ((*cProc)(tln->datum, d) == 0) + if (!(*cProc)(tln->datum, d)) return tln; return NULL; diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 77fb6d08abe..f47069006e1 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.114 2015/10/09 01:37:08 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.115 2015/10/14 13:50:22 espie Exp $ */ /* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */ /* @@ -113,7 +113,7 @@ static void setup_VPATH(void); static void read_all_make_rules(bool, bool, Lst, struct dirs *); static void read_makefile_list(Lst, struct dirs *); -static int ReadMakefile(void *, void *); +static bool ReadMakefile(void *, void *); static void record_option(int c, const char *arg) -- 2.20.1