Hi tech@,
Here is a diff to use proper bool types for fortune(6).
Comments? OK?
Index: games/fortune/fortune/fortune.c
===================================================================
RCS file: /cvs/src/games/fortune/fortune/fortune.c,v
retrieving revision 1.55
diff -u -p -r1.55 fortune.c
--- games/fortune/fortune/fortune.c 7 Mar 2016 22:49:45 -0000 1.55
+++ games/fortune/fortune/fortune.c 29 May 2017 21:40:40 -0000
@@ -41,6 +41,7 @@
#include <err.h>
#include <fcntl.h>
#include <limits.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -49,8 +50,6 @@
#include "pathnames.h"
#include "strfile.h"
-
-#define bool short
#define MINW 6 /* minimum wait if desired */
#define CPERS 20 /* # of chars for each sec */
Index: games/fortune/strfile/strfile.c
===================================================================
RCS file: /cvs/src/games/fortune/strfile/strfile.c,v
retrieving revision 1.28
diff -u -p -r1.28 strfile.c
--- games/fortune/strfile/strfile.c 7 Mar 2016 12:07:56 -0000 1.28
+++ games/fortune/strfile/strfile.c 29 May 2017 21:40:40 -0000
@@ -36,6 +36,7 @@
#include <ctype.h>
#include <err.h>
#include <limits.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -66,9 +67,6 @@
* Added ordering options.
*/
-#define TRUE 1
-#define FALSE 0
-
#define STORING_PTRS (Oflag || Rflag)
#define CHUNKSIZE 512
@@ -92,11 +90,11 @@ char *Infile = NULL, /* input file
nam
Outfile[PATH_MAX] = "", /* output file name */
Delimch = '%'; /* delimiting character */
-int Sflag = FALSE; /* silent run flag */
-int Oflag = FALSE; /* ordering flag */
-int Iflag = FALSE; /* ignore case flag */
-int Rflag = FALSE; /* randomize order flag */
-int Xflag = FALSE; /* set rotated bit */
+int Sflag = false; /* silent run flag */
+int Oflag = false; /* ordering flag */
+int Iflag = false; /* ignore case flag */
+int Rflag = false; /* randomize order flag */
+int Xflag = false; /* set rotated bit */
long Num_pts = 0; /* number of pointers/strings */
int32_t *Seekpts;
@@ -189,7 +187,7 @@ main(int ac, char *av[])
else
fp->first = *nsp;
fp->pos = Seekpts[Num_pts - 1];
- first = FALSE;
+ first = false;
}
} while (sp != NULL);
@@ -394,8 +392,8 @@ cmp_str(const void *p1, const void *p2)
(void) fseek(Sort_1, ((STR *)p1)->pos, SEEK_SET);
(void) fseek(Sort_2, ((STR *)p2)->pos, SEEK_SET);
- n1 = FALSE;
- n2 = FALSE;
+ n1 = false;
+ n2 = false;
while (!isalnum(c1 = getc(Sort_1)) && c1 != '\0')
SET_N(n1, c1);
while (!isalnum(c2 = getc(Sort_2)) && c2 != '\0')