changeset 2477:0ab24caf7fdf

Clean up various error messages.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 27 Apr 2020 18:33:39 +0300
parents 90eec3e1f85f
children 0d13de7edb30
files tools/ppl.c
diffstat 1 files changed, 14 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/tools/ppl.c	Mon Apr 27 18:33:18 2020 +0300
+++ b/tools/ppl.c	Mon Apr 27 18:33:39 2020 +0300
@@ -575,8 +575,8 @@
 
     if ((result = dmf_open_stdio(optFilename, "rb", &file)) != DMERR_OK)
     {
-        dmErrorMsg("Error opening file '%s', %d: (%s)\n",
-            optFilename, result, dmErrorStr(result));
+        dmErrorMsg("Error opening file '%s': %s\n",
+            optFilename, dmErrorStr(result));
         return 1;
     }
 
@@ -608,16 +608,16 @@
 
     if (result != DMERR_OK)
     {
-        dmErrorMsg("Error loading module file, %d: %s\n",
-            result, dmErrorStr(result));
+        dmErrorMsg("Error loading module file: %s\n",
+            dmErrorStr(result));
         goto exit;
     }
 
     // Try to convert it
     if ((result = jssConvertModuleForPlaying(eng.mod)) != DMERR_OK)
     {
-        dmErrorMsg("Could not convert module for playing, %d: %s\n",
-            result, dmErrorStr(result));
+        dmErrorMsg("Could not convert module for playing: %s\n",
+            dmErrorStr(result));
         goto exit;
     }
 
@@ -625,7 +625,8 @@
     // Initialize SDL components
     if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER) != 0)
     {
-        dmErrorMsg("Could not initialize SDL: %s\n", SDL_GetError());
+        dmErrorMsg("Could not initialize SDL: %s\n",
+            SDL_GetError());
         goto exit;
     }
     initSDL = TRUE;
@@ -692,19 +693,20 @@
     if (optUseGUI)
     {
         // Get font
-        result = dmf_open_memio(NULL, "pplfont.fnt", engineSetupFont, sizeof(engineSetupFont), &file);
+        static const char *engineFontName = "pplfont.fnt";
+        result = dmf_open_memio(NULL, engineFontName, engineSetupFont, sizeof(engineSetupFont), &file);
         if (result != DMERR_OK)
         {
-            dmErrorMsg("Error opening font file 'pplfont.fnt', #%d: %s\n",
-                result, dmErrorStr(result));
+            dmErrorMsg("Error opening font file '%s': %s\n",
+                engineFontName, dmErrorStr(result));
             goto exit;
         }
         result = dmLoadBitmapFont(file, &font);
         dmf_close(file);
         if (result != DMERR_OK)
         {
-            dmErrorMsg("Could not load font from file, %d: %s\n",
-                result, dmErrorStr(result));
+            dmErrorMsg("Could not load font data from '%s': %s\n",
+                engineFontName, dmErrorStr(result));
             goto exit;
         }