From: Ian Jackson Date: Thu, 15 May 2014 00:31:56 +0000 (+0100) Subject: secnet.h: Change bool_t to a C99 _Bool X-Git-Tag: debian/0.3.2_beta1~20 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=secnet.git;a=commitdiff_plain;h=09aecaa2e38014fcb27d6ca146b5de9bacd0986d secnet.h: Change bool_t to a C99 _Bool 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 --- diff --git a/debian/changelog b/debian/changelog index 5f7de10..b51b541 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ secnet (0.3.2~~) unstable; urgency=low * Updates to release checklist in Makefile.in. + * Use C99 _Bool for bool_t. -- diff --git a/secnet.h b/secnet.h index d5663ff..29cbac7 100644 --- a/secnet.h +++ b/secnet.h @@ -16,7 +16,10 @@ 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)