From a08af6d0c6f1091d5ce7d91d87ff732191ae0b67 Mon Sep 17 00:00:00 2001 From: Rogier Date: Sat, 25 Jun 2016 09:29:43 +0200 Subject: [PATCH] Fix misleading indentation & improve code clarity Primarily to prevent gcc6 complaining about it, as in practise, there was no impact on behavior or correctness at all. At the same time, the code in question was adapted slightly to clarify the intentions and effects. --- mapper.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mapper.cpp b/mapper.cpp index fd82fc6..301b03e 100644 --- a/mapper.cpp +++ b/mapper.cpp @@ -25,6 +25,9 @@ using namespace std; +// Will be used in error messages if nothing better is available. +#define DEFAULT_PROGRAM_NAME "minetestmapper" + #define OPT_SQLITE_CACHEWORLDROW 0x81 #define OPT_PROGRESS_INDICATOR 0x82 #define OPT_DRAW_OBJECT 0x83 @@ -51,7 +54,7 @@ using namespace std; // Will be replaced with the actual name and location of the executable (if found) -string executableName = "minetestmapper"; +string executableName = DEFAULT_PROGRAM_NAME; string executablePath; // ONLY for use on windows string installPrefix = INSTALL_PREFIX; string nodeColorsDefaultFile = "colors.txt"; @@ -673,7 +676,10 @@ int main(int argc, char *argv[]) if (pos == string::npos) { if (!argv0.empty()) executableName = argv0; - executablePath = ""; + else + executableName = DEFAULT_PROGRAM_NAME; + executablePath = ""; + } else { executableName = argv0.substr(pos + 1);