change: change code style to Linux style except indent.

This commit is contained in:
Mike Solar
2025-08-03 22:50:34 +08:00
parent 1df31fbdfe
commit c4f47b6217
788 changed files with 77112 additions and 68888 deletions
+29 -27
View File
@@ -20,38 +20,40 @@
#include "debug.h"
namespace olive {
void DebugHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
namespace olive
{
QByteArray localMsg = msg.toLocal8Bit();
const char* msg_type = "UNKNOWN";
switch (type) {
case QtDebugMsg:
msg_type = "DEBUG";
break;
case QtInfoMsg:
msg_type = "INFO";
break;
case QtWarningMsg:
msg_type = "WARNING";
break;
case QtCriticalMsg:
msg_type = "ERROR";
break;
case QtFatalMsg:
msg_type = "FATAL";
break;
}
void DebugHandler(QtMsgType type, const QMessageLogContext &context,
const QString &msg)
{
QByteArray localMsg = msg.toLocal8Bit();
//fprintf(stderr, "[%s] %s (%s:%u)\n", msg_type, localMsg.constData(), context.function, context.line);
fprintf(stderr, "[%s] %s\n", msg_type, localMsg.constData());
const char *msg_type = "UNKNOWN";
switch (type) {
case QtDebugMsg:
msg_type = "DEBUG";
break;
case QtInfoMsg:
msg_type = "INFO";
break;
case QtWarningMsg:
msg_type = "WARNING";
break;
case QtCriticalMsg:
msg_type = "ERROR";
break;
case QtFatalMsg:
msg_type = "FATAL";
break;
}
//fprintf(stderr, "[%s] %s (%s:%u)\n", msg_type, localMsg.constData(), context.function, context.line);
fprintf(stderr, "[%s] %s\n", msg_type, localMsg.constData());
#ifdef Q_OS_WINDOWS
// Windows still seems to buffer stderr and we want to see debug messages immediately, so here we make sure each line
// is flushed
fflush(stderr);
// Windows still seems to buffer stderr and we want to see debug messages immediately, so here we make sure each line
// is flushed
fflush(stderr);
#endif
}