Module Name:    src
Committed By:   rillig
Date:           Sat Aug 29 08:09:07 UTC 2020

Modified Files:
        src/usr.bin/make: compat.c make.h

Log Message:
make(1): add another Boolean variant to check during development


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/usr.bin/make/compat.c
cvs rdiff -u -r1.130 -r1.131 src/usr.bin/make/make.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/compat.c
diff -u src/usr.bin/make/compat.c:1.132 src/usr.bin/make/compat.c:1.133
--- src/usr.bin/make/compat.c:1.132	Fri Aug 28 04:48:56 2020
+++ src/usr.bin/make/compat.c	Sat Aug 29 08:09:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.132 2020/08/28 04:48:56 rillig Exp $	*/
+/*	$NetBSD: compat.c,v 1.133 2020/08/29 08:09:07 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: compat.c,v 1.132 2020/08/28 04:48:56 rillig Exp $";
+static char rcsid[] = "$NetBSD: compat.c,v 1.133 2020/08/29 08:09:07 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)compat.c	8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: compat.c,v 1.132 2020/08/28 04:48:56 rillig Exp $");
+__RCSID("$NetBSD: compat.c,v 1.133 2020/08/29 08:09:07 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -226,7 +226,7 @@ CompatRunCommand(void *cmdp, void *gnp)
     char	  * volatile cmd = (char *)cmdp;
     GNode	  *gn = (GNode *)gnp;
 
-    silent = gn->type & OP_SILENT;
+    silent = (gn->type & OP_SILENT) != 0;
     errCheck = !(gn->type & OP_IGNORE);
     doIt = FALSE;
 
@@ -260,7 +260,7 @@ CompatRunCommand(void *cmdp, void *gnp)
     while ((*cmd == '@') || (*cmd == '-') || (*cmd == '+')) {
 	switch (*cmd) {
 	case '@':
-	    silent = DEBUG(LOUD) ? FALSE : TRUE;
+	    silent = !DEBUG(LOUD);
 	    break;
 	case '-':
 	    errCheck = FALSE;
@@ -605,7 +605,7 @@ Compat_Make(void *gnp, void *pgnp)
 		Lst_ForEach(gn->commands, CompatRunCommand, gn);
 		curTarg = NULL;
 	    } else {
-		Job_Touch(gn, gn->type & OP_SILENT);
+		Job_Touch(gn, (gn->type & OP_SILENT) != 0);
 	    }
 	} else {
 	    gn->made = ERROR;

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.130 src/usr.bin/make/make.h:1.131
--- src/usr.bin/make/make.h:1.130	Sat Aug 29 07:52:55 2020
+++ src/usr.bin/make/make.h	Sat Aug 29 08:09:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.130 2020/08/29 07:52:55 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.131 2020/08/29 08:09:07 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -133,8 +133,15 @@
  * boolean argument to be an expression that isn't strictly 0 or 1 valued.
  */
 
-#ifdef USE_DOUBLE_BOOLEAN	/* Just to find type mismatches. */
+#ifdef USE_DOUBLE_BOOLEAN
+/* During development, to find type mismatches in function declarations. */
 typedef double Boolean;
+#elif defined(USE_UCHAR_BOOLEAN)
+/* During development, to find code that depends on the exact value of TRUE or
+ * that stores other values in Boolean variables. */
+typedef unsigned char Boolean;
+#define TRUE ((unsigned char)0xFF)
+#define FALSE ((unsigned char)0x00)
 #else
 typedef int Boolean;
 #endif

Reply via email to