diff tools/lib64util.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 bb44c48cffac
children a4f6584edca9
line wrap: on
line diff
--- a/tools/lib64util.c	Thu Dec 08 15:56:36 2022 +0200
+++ b/tools/lib64util.c	Thu Dec 08 15:59:22 2022 +0200
@@ -90,7 +90,7 @@
 const int ndmC64DefaultPalettes = sizeof(dmC64DefaultPalettes) / sizeof(dmC64DefaultPalettes[0]);
 
 
-char * dmC64GetImageTypeString(char *buf, const size_t len, const int type, const BOOL lng)
+char * dmC64GetImageTypeString(char *buf, const size_t len, const int type, const bool lng)
 {
     static const char *fmtModesShort[] = { "*", "HiR", "MC", "ECM" };
     static const char *fmtModesLong[] = { "*", "Hires", "Multi-color", "Extended Color Mode" };
@@ -142,7 +142,7 @@
 
     if (img != NULL)
     {
-        dmC64GetImageTypeString(typeStr, sizeof(typeStr), img->extraInfo[D64_EI_MODE], TRUE);
+        dmC64GetImageTypeString(typeStr, sizeof(typeStr), img->extraInfo[D64_EI_MODE], true);
 
         dmC64ImageDumpLine(fh, indent,
             "Type", "%s", typeStr);
@@ -209,7 +209,7 @@
     else
     if (fmt != NULL)
     {
-        dmC64GetImageTypeString(typeStr, sizeof(typeStr), fmt->format->mode, TRUE);
+        dmC64GetImageTypeString(typeStr, sizeof(typeStr), fmt->format->mode, true);
 
         dmC64ImageDumpLine(fh, indent,
             "Type", "%s", typeStr);
@@ -225,7 +225,7 @@
 }
 
 
-void argShowC64Formats(FILE *fh, const BOOL rw, const BOOL verbose)
+void argShowC64Formats(FILE *fh, const bool rw, const bool verbose)
 {
     fprintf(fh,
         "Available C64 bitmap formats (-f <frmt>):\n"
@@ -255,7 +255,7 @@
 
         fprintf(fh,
             "| %-15s ",
-            dmC64GetImageTypeString(buf, sizeof(buf), fmt->format->mode, FALSE)
+            dmC64GetImageTypeString(buf, sizeof(buf), fmt->format->mode, false)
             );
 
         if (verbose)
@@ -333,13 +333,13 @@
 }
 
 
-BOOL argHandleC64PaletteOption(char *optArg, DMC64Palette **ppal, char **palFile)
+bool argHandleC64PaletteOption(char *optArg, DMC64Palette **ppal, char **palFile)
 {
     if (strcasecmp(optArg, "help") == 0 ||
         strcasecmp(optArg, "list") == 0)
     {
         argShowC64PaletteHelp(stdout);
-        return FALSE;
+        return false;
     }
 
     for (int n = 0; n < ndmC64DefaultPalettes; n++)
@@ -348,12 +348,12 @@
         if (strcasecmp(pal->name, optArg) == 0)
         {
             *ppal = pal;
-            return TRUE;
+            return true;
         }
     }
 
     *palFile = optArg;
-    return TRUE;
+    return true;
 }