]> diplodocus.org Git - nmh/commitdiff
Add stdbool.h plus fallback to h/nmh.h.
authorRalph Corderoy <ralph@inputplus.co.uk>
Wed, 19 Oct 2016 16:52:44 +0000 (17:52 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Wed, 19 Oct 2016 16:52:44 +0000 (17:52 +0100)
Change h/mh.h's FALSE and TRUE to use stdbool.h's.  In time, everything
can switch over and FALSE and TRUE can go.  Delete some local
re-definitions of FALSE and TRUE.

h/mh.h
h/nmh.h
mts/smtp/smtp.c
sbr/getline.c
uip/flist.c

diff --git a/h/mh.h b/h/mh.h
index d88df07..513248c 100644 (file)
--- a/h/mh.h
+++ b/h/mh.h
 #define NMH_BUFSIZ  (BUFSIZ>=8192 ? BUFSIZ : 8192)
 
 #ifndef FALSE
 #define NMH_BUFSIZ  (BUFSIZ>=8192 ? BUFSIZ : 8192)
 
 #ifndef FALSE
-#define FALSE 0
+#define FALSE false
 #endif
 #ifndef TRUE
 #endif
 #ifndef TRUE
-#define TRUE 1
+#define TRUE true
 #endif
 typedef unsigned char  boolean;  /* not int so we can pack in a structure */
 
 #endif
 typedef unsigned char  boolean;  /* not int so we can pack in a structure */
 
diff --git a/h/nmh.h b/h/nmh.h
index 2468919..ed02240 100644 (file)
--- a/h/nmh.h
+++ b/h/nmh.h
 # include <sbr/ctype-checked.h>
 #endif
 #include <assert.h>
 # include <sbr/ctype-checked.h>
 #endif
 #include <assert.h>
+
+#ifdef HAVE_STDBOOL_H
+# include <stdbool.h>
+#else
+# define bool int
+# define true 1
+# define false 0
+#endif
+
 #include <sys/stat.h>
 #include <sys/wait.h>
 
 #include <sys/stat.h>
 #include <sys/wait.h>
 
index 8d778e5..26241ae 100644 (file)
@@ -40,9 +40,6 @@
  */
 #endif
 
  */
 #endif
 
-#define        TRUE    1
-#define        FALSE   0
-
 #define        NBITS ((sizeof (int)) * 8)
 
 /*
 #define        NBITS ((sizeof (int)) * 8)
 
 /*
index 7e3e797..ab653bb 100644 (file)
 #include <stdio.h>
 #include <limits.h>
 #include <errno.h>
 #include <stdio.h>
 #include <limits.h>
 #include <errno.h>
-#ifdef HAVE_STDBOOL_H
-# include <stdbool.h>
-#else  /* ! HAVE_STDBOOL_H */
-# define bool int
-# define true 1
-# define false 0
-#endif /* ! HAVE_STDBOOL_H */
+
+#include <h/mh.h>
 
 /* Largest possible size of buffer that allows SSIZE_MAX to be returned
  * to indicate SSIZE_MAX - 1 characters read before the '\n'.  The
 
 /* Largest possible size of buffer that allows SSIZE_MAX to be returned
  * to indicate SSIZE_MAX - 1 characters read before the '\n'.  The
index 6a10ad8..68dd3f7 100644 (file)
@@ -17,9 +17,6 @@
 #include <h/mh.h>
 #include <h/utils.h>
 
 #include <h/mh.h>
 #include <h/utils.h>
 
-#define FALSE   0
-#define TRUE    1
-
 /*
  * We allocate space to record the names of folders
  * (foldersToDo array), this number of elements at a time.
 /*
  * We allocate space to record the names of folders
  * (foldersToDo array), this number of elements at a time.