X-Git-Url: https://vaikene.ee/gitweb/pswgen09.html?a=blobdiff_plain;f=src%2Fmain%2FCLI%2Fmain.cpp;h=0be3f3697de7522f1fe8e985efbc20fa0a994ba2;hb=13dedf19c628b9967e4c4106ab0fd967f1df0b90;hp=51d5f517adae79db24a1734e6241a7a8cb53da68;hpb=be0e791df48f5a8c9bb4c16f65b62e41e1149552;p=evaf
diff --git a/src/main/CLI/main.cpp b/src/main/CLI/main.cpp
index 51d5f51..0be3f36 100644
--- a/src/main/CLI/main.cpp
+++ b/src/main/CLI/main.cpp
@@ -49,7 +49,7 @@ namespace Internal {
*
* This function outputs messages to the console and to the log file.
*/
-static void messageOutput(QtMsgType type, char const * const msg)
+static void messageOutput(QtMsgType type, QMessageLogContext const &, QString const & msg)
{
static bool inHandler = false;
@@ -92,13 +92,12 @@ static void messageOutput(QtMsgType type, char const * const msg)
* If the critical error message is shown, then the user has an option to ignore the error. In this
* case the application is not terminated.
*/
-static void fatalMsgHandler(QString const & msg, QString const & source, QString const & where)
+[[noreturn]] static void fatalMsgHandler(QString const & msg, QString const & source, QString const & where)
{
-#ifdef Q_OS_LINUX
- abort();
-#else
+ Q_UNUSED(msg);
+ Q_UNUSED(source);
+ Q_UNUSED(where);
exit(1);
-#endif
}
} // namespace eVaf::CLI::Internal
@@ -178,7 +177,7 @@ bool Application::processCommandLine(int argc, char ** argv)
case Common::iLogger::Info:
consoleSeverityLevel = Common::iLogger::Debug;
break;
- case Common::iLogger::Debug:
+ default:
break;
}
}
@@ -238,7 +237,7 @@ int main(int argc, char ** argv)
// Install our onw message handlers
Common::iLogger::instance()->installFatalMsgHandler(Internal::fatalMsgHandler);
- qInstallMsgHandler(Internal::messageOutput);
+ qInstallMessageHandler(Internal::messageOutput);
// Process command-line arguments
if (!Application::processCommandLine(argc, argv))
@@ -266,7 +265,7 @@ int main(int argc, char ** argv)
// The main run loop
bool quit = false;
- int rval;
+ int rval = 0;
while (!quit) {
EVAF_INFO("%s is starting up", VER_MODULE_NAME_STR);
@@ -281,7 +280,7 @@ int main(int argc, char ** argv)
// Run the application
EVAF_INFO("Running %s", VER_MODULE_NAME_STR);
- rval = app.exec();
+ rval = Common::iApp::instance()->exec();
quit = rval != Common::iApp::RC_Restart;