diff tools/data2inc.c @ 2586:9807ae37ad69

Require stdbool.h, we require C11 now.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 08 Dec 2022 15:59:22 +0200
parents 3feca4682680
children
line wrap: on
line diff
--- a/tools/data2inc.c	Thu Dec 08 15:56:36 2022 +0200
+++ b/tools/data2inc.c	Thu Dec 08 15:59:22 2022 +0200
@@ -48,10 +48,10 @@
 const DMOutputFormat *setFormat = NULL;
 int     optIndentation = -1,
         optLineLen = SET_DEF_LINELEN;
-BOOL    optHexMode = FALSE,
-        optQuiet = FALSE,
-        optExtraData = FALSE,
-        optFormatting = TRUE;
+bool    optHexMode = false,
+        optQuiet = false,
+        optExtraData = false,
+        optFormatting = true;
 
 
 static const DMOptArg optList[] =
@@ -359,7 +359,7 @@
 }
 
 
-BOOL argHandleOpt(const int optN, char *optArg, char *currArg)
+bool argHandleOpt(const int optN, char *optArg, char *currArg)
 {
     switch (optN)
     {
@@ -388,12 +388,12 @@
                 if (strcasecmp(fmt->name, optArg) == 0)
                 {
                     setFormat = fmt;
-                    return TRUE;
+                    return true;
                 }
             }
             dmErrorMsg("Invalid format name '%s'.\n",
                 optArg);
-            return FALSE;
+            return false;
 
         case 16:
             optAddLine = optArg;
@@ -405,20 +405,20 @@
             {
                 dmErrorMsg("Invalid line length / number of items per line '%s'.\n",
                     optArg);
-                return FALSE;
+                return false;
             }
             break;
 
         case 20:
-            optHexMode = TRUE;
+            optHexMode = true;
             break;
 
         case 22:
-            optQuiet = TRUE;
+            optQuiet = true;
             break;
 
         case 24:
-            optFormatting = FALSE;
+            optFormatting = false;
             break;
 
         case 26:
@@ -426,19 +426,19 @@
             break;
 
         case 28:
-            optExtraData = TRUE;
+            optExtraData = true;
             break;
 
         default:
             dmErrorMsg("Unimplemented option argument '%s'.\n", currArg);
-            return FALSE;
+            return false;
     }
 
-    return TRUE;
+    return true;
 }
 
 
-BOOL argHandleFile(char * currArg)
+bool argHandleFile(char * currArg)
 {
     if (optInFilename == NULL)
         optInFilename = currArg;
@@ -448,7 +448,7 @@
     else
         dmErrorMsg("Source and destination filenames already specified, extraneous argument '%s'.\n", currArg);
 
-    return TRUE;
+    return true;
 }