Use signed integer format for line number in xbus logging handler

This commit is contained in:
Roland Winklmeier
2015-04-03 11:40:29 +02:00
parent f71e0a89fb
commit 942810d714

View File

@@ -40,20 +40,20 @@ class QXPlaneMessageHandler
char *buffer = new char[64 + localMsg.size() + file.size()]; char *buffer = new char[64 + localMsg.size() + file.size()];
switch (type) { switch (type) {
case QtDebugMsg: case QtDebugMsg:
std::sprintf(buffer, "%s:%u: Debug: %s\n", file.constData(), line, localMsg.constData()); std::sprintf(buffer, "%s:%d: Debug: %s\n", file.constData(), line, localMsg.constData());
XPLMDebugString(buffer); XPLMDebugString(buffer);
break; break;
case QtWarningMsg: case QtWarningMsg:
std::sprintf(buffer, "%s:%u: Warning: %s\n", file.constData(), line, localMsg.constData()); std::sprintf(buffer, "%s:%d: Warning: %s\n", file.constData(), line, localMsg.constData());
XPLMDebugString(buffer); XPLMDebugString(buffer);
break; break;
default: default:
case QtCriticalMsg: case QtCriticalMsg:
std::sprintf(buffer, "%s:%u: Error: %s\n", file.constData(), line, localMsg.constData()); std::sprintf(buffer, "%s:%d: Error: %s\n", file.constData(), line, localMsg.constData());
XPLMDebugString(buffer); XPLMDebugString(buffer);
break; break;
case QtFatalMsg: case QtFatalMsg:
std::sprintf(buffer, "%s:%u: Fatal: %s\n", file.constData(), line, localMsg.constData()); std::sprintf(buffer, "%s:%d: Fatal: %s\n", file.constData(), line, localMsg.constData());
XPLMDebugString(buffer); XPLMDebugString(buffer);
std::abort(); std::abort();
} }