Module Name:    src
Committed By:   rillig
Date:           Sat Sep 12 10:14:16 UTC 2020

Modified Files:
        src/usr.bin/make: for.c nonints.h

Log Message:
make(1): use proper return type for For_Accum


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/usr.bin/make/for.c
cvs rdiff -u -r1.106 -r1.107 src/usr.bin/make/nonints.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/for.c
diff -u src/usr.bin/make/for.c:1.80 src/usr.bin/make/for.c:1.81
--- src/usr.bin/make/for.c:1.80	Sat Sep 12 10:12:09 2020
+++ src/usr.bin/make/for.c	Sat Sep 12 10:14:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: for.c,v 1.80 2020/09/12 10:12:09 rillig Exp $	*/
+/*	$NetBSD: for.c,v 1.81 2020/09/12 10:14:16 rillig Exp $	*/
 
 /*
  * Copyright (c) 1992, The Regents of the University of California.
@@ -30,14 +30,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: for.c,v 1.80 2020/09/12 10:12:09 rillig Exp $";
+static char rcsid[] = "$NetBSD: for.c,v 1.81 2020/09/12 10:14:16 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)for.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: for.c,v 1.80 2020/09/12 10:12:09 rillig Exp $");
+__RCSID("$NetBSD: for.c,v 1.81 2020/09/12 10:14:16 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -266,9 +266,9 @@ For_Eval(const char *line)
 
 /*
  * Add another line to a .for loop.
- * Returns 0 when the matching .endfor is reached.
+ * Returns FALSE when the matching .endfor is reached.
  */
-int
+Boolean
 For_Accum(const char *line)
 {
     const char *ptr = line;
@@ -282,7 +282,7 @@ For_Accum(const char *line)
 	    if (DEBUG(FOR))
 		(void)fprintf(debug_file, "For: end for %d\n", forLevel);
 	    if (--forLevel <= 0)
-		return 0;
+		return FALSE;
 	} else if (strncmp(ptr, "for", 3) == 0 && ch_isspace(ptr[3])) {
 	    forLevel++;
 	    if (DEBUG(FOR))
@@ -292,7 +292,7 @@ For_Accum(const char *line)
 
     Buf_AddStr(&accumFor->buf, line);
     Buf_AddByte(&accumFor->buf, '\n');
-    return 1;
+    return TRUE;
 }
 
 

Index: src/usr.bin/make/nonints.h
diff -u src/usr.bin/make/nonints.h:1.106 src/usr.bin/make/nonints.h:1.107
--- src/usr.bin/make/nonints.h:1.106	Sun Sep  6 19:34:36 2020
+++ src/usr.bin/make/nonints.h	Sat Sep 12 10:14:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nonints.h,v 1.106 2020/09/06 19:34:36 rillig Exp $	*/
+/*	$NetBSD: nonints.h,v 1.107 2020/09/12 10:14:16 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -99,7 +99,7 @@ unsigned int Cond_save_depth(void);
 
 /* for.c */
 int For_Eval(const char *);
-int For_Accum(const char *);
+Boolean For_Accum(const char *);
 void For_Run(int);
 
 /* job.c */

Reply via email to