diff th_util.c @ 453:efd33accdc81

Break backwards compatibility by renaming BOOL, TRUE and FALSE to lowercase. Introduce optional but default use of stdbool.h.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 02 Jan 2018 22:56:03 +0200
parents 2991e6b52d95
children 85fa3d333556
line wrap: on
line diff
--- a/th_util.c	Wed Oct 25 22:32:07 2017 +0300
+++ b/th_util.c	Tue Jan 02 22:56:03 2018 +0200
@@ -12,7 +12,7 @@
 
 /* Default settings
  */
-static BOOL    th_initialized = FALSE;
+static bool    th_initialized = false;
 int            th_verbosityLevel = 2;
 char           *th_prog_name = NULL,
                *th_prog_desc = NULL,
@@ -40,7 +40,7 @@
     else
         th_prog_license = TH_PROG_LICENSE;
 
-    th_initialized = TRUE;
+    th_initialized = true;
 }
 
 
@@ -86,7 +86,7 @@
  */
 void THERR_V(const char *fmt, va_list ap)
 {
-    assert(th_initialized == TRUE);
+    assert(th_initialized == true);
 
     fprintf(stderr, "%s: ", th_prog_name);
     vfprintf(stderr, fmt, ap);
@@ -95,7 +95,7 @@
 
 void THMSG_V(int level, const char *fmt, va_list ap)
 {
-    assert(th_initialized == TRUE);
+    assert(th_initialized == true);
 
     if (th_verbosityLevel >= level)
     {
@@ -107,7 +107,7 @@
 
 void THPRINT_V(int level, const char *fmt, va_list ap)
 {
-    assert(th_initialized == TRUE);
+    assert(th_initialized == true);
 
     if (th_verbosityLevel >= level)
     {
@@ -119,7 +119,7 @@
 void THERR(const char *fmt, ...)
 {
     va_list ap;
-    assert(th_initialized == TRUE);
+    assert(th_initialized == true);
 
     va_start(ap, fmt);
     THERR_V(fmt, ap);
@@ -130,7 +130,7 @@
 void THMSG(int level, const char *fmt, ...)
 {
     va_list ap;
-    assert(th_initialized == TRUE);
+    assert(th_initialized == true);
 
     va_start(ap, fmt);
     THMSG_V(level, fmt, ap);
@@ -141,7 +141,7 @@
 void THPRINT(int level, const char *fmt, ...)
 {
     va_list ap;
-    assert(th_initialized == TRUE);
+    assert(th_initialized == true);
 
     va_start(ap, fmt);
     THPRINT_V(level, fmt, ap);