diff tools/fontconv.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 92b93a12c014
children ad18774054e3
line wrap: on
line diff
--- a/tools/fontconv.c	Thu Dec 08 15:56:36 2022 +0200
+++ b/tools/fontconv.c	Thu Dec 08 15:59:22 2022 +0200
@@ -52,7 +52,7 @@
 }
 
 
-BOOL argHandleOpt(const int optN, char *optArg, char *currArg)
+bool argHandleOpt(const int optN, char *optArg, char *currArg)
 {
     switch (optN)
     {
@@ -85,7 +85,7 @@
                             optArg);
 
                         dmFree(tmpStr);
-                        return FALSE;
+                        return false;
                     }
 
                     dmFree(tmpStr);
@@ -97,7 +97,7 @@
                         dmErrorMsg("Invalid font size value ('%s')\n",
                             optArg);
 
-                        return FALSE;
+                        return false;
                     }
                     fontH = fontW;
                 }
@@ -108,7 +108,7 @@
                     dmErrorMsg("Invalid font dimensions, must be %d < W %d, %d < H < %d.\n",
                         DMFONT_MIN_WIDTH  , DMFONT_MAX_WIDTH,
                         DMFONT_MIN_HEIGHT , DMFONT_MAX_HEIGHT);
-                    return FALSE;
+                    return false;
                 }
                 optSplitWidth = fontW;
                 optSplitHeight = fontH;
@@ -127,7 +127,7 @@
                 {
                     dmErrorMsg("Invalid RGB hex representation '%s'.\n",
                         optArg);
-                    return FALSE;
+                    return false;
                 }
 
                 optColor.r = colR;
@@ -142,26 +142,26 @@
             {
                 dmErrorMsg("Invalid argument for -b option, '%s'.\n",
                     optArg);
-                return FALSE;
+                return false;
             }
             if (optBPP != 8 && optBPP != 32)
             {
                 dmErrorMsg("Invalid bit depth %d, must be 8 or 32.\n",
                     optBPP);
-                return FALSE;
+                return false;
             }
             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;
@@ -171,10 +171,10 @@
     else
     {
         dmErrorMsg("Too many filename arguments, '%s'\n", currArg);
-        return FALSE;
+        return false;
     }
 
-    return TRUE;
+    return true;
 }
 
 
@@ -286,7 +286,7 @@
     SDL_Surface *fontbmap = NULL;
     int res = DMERR_OK;
 #ifdef DM_GFX_TTF_TEXT
-    BOOL initTTF = FALSE;
+    bool initTTF = false;
     TTF_Font *ttf = NULL;
 #endif
 
@@ -312,7 +312,7 @@
         dmErrorMsg("Could not initialize FreeType/TTF: %s\n", SDL_GetError());
         goto out;
     }
-    initTTF = TRUE;
+    initTTF = true;
 #endif
 
     // Open the source file