# HG changeset patch # User Matti Hamalainen # Date 1588001619 -10800 # Node ID 0ab24caf7fdf31a036b06ad564398ec921412821 # Parent 90eec3e1f85f1f23111ec27ff7f05fa0f6bfe73f Clean up various error messages. diff -r 90eec3e1f85f -r 0ab24caf7fdf tools/ppl.c --- 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; }