]> andersk Git - splint.git/blobdiff - src/Headers/bool.h
Added support for ISO C99 _Bool and stdbool bool/true/false. The
[splint.git] / src / Headers / bool.h
index 23f5ea9883e3ae9244303fa43649e4ffc39fb506..fd059070c6cece156d3be3858eb3e2bd3d4daf81 100644 (file)
@@ -1,5 +1,5 @@
 /*
-** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001.
+** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003.
 ** See ../LICENSE for license information.
 **
 */
@@ -8,11 +8,13 @@
 # define BOOL_H
 
 # ifndef FALSE
-# define FALSE 0
+/*@constant bool FALSE=false@*/
+# define FALSE false
 # endif
 
 # ifndef TRUE
-# define TRUE (! FALSE)
+/*@constant bool TRUE=true@*/
+# define TRUE true
 # endif
 
 extern /*@observer@*/ cstring bool_unparse (bool p_b) /*@*/ ;
@@ -23,6 +25,11 @@ extern int bool_compare (bool p_b1, bool p_b2) /*@*/ ;
 extern bool bool_fromInt (int p_i) /*@*/ ;
 extern int bool_toInt (bool p_b) /*@*/ ;
 
+extern bool bool_isReasonable (/*@sef@*/ bool p_b) /*@*/ ;
+/*@-boolcompare@*/
+# define bool_isReasonable(b) (((b) == TRUE) || ((b) == FALSE))
+/*@=boolcompare@*/
+
 # define bool_unparse(b)   (cstring_makeLiteralTemp ((b) ? "true" : "false" ))
 # define bool_dump(b)      (cstring_makeLiteralTemp ((b) ? "1" : "0" ))
 # define bool_not(b)       ((b) ? FALSE : TRUE)
This page took 0.039267 seconds and 4 git commands to generate.