secnet.h: Change bool_t to a C99 _Bool
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 15 May 2014 00:31:56 +0000 (01:31 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 15 May 2014 00:34:42 +0000 (01:34 +0100)
This will (a) stop misleading readers of the code (b) make it possible
to write code expecting an implicit !! to be applied to assignments to
booleans (c) possibly make secnet smaller or faster.

I don't expect this to produce any functional change, but I haven't
reviewed every bool_t in secnet to check.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
secnet.h

index 5f7de10..b51b541 100644 (file)
@@ -1,6 +1,7 @@
 secnet (0.3.2~~) unstable; urgency=low
 
   * Updates to release checklist in Makefile.in.
+  * Use C99 _Bool for bool_t.
 
  --
 
index d5663ff..29cbac7 100644 (file)
--- a/secnet.h
+++ b/secnet.h
 
 typedef char *string_t;
 typedef const char *cstring_t;
-typedef enum {False,True} bool_t;
+
+#define False (_Bool)0
+#define True  (_Bool)1
+typedef _Bool bool_t;
 
 #define ASSERT(x) do { if (!(x)) { fatal("assertion failed line %d file " \
                                         __FILE__,__LINE__); } } while(0)