diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 34c148c49..759da8085 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -20,8 +20,18 @@ jobs: sudo rm -f /usr/bin/qmake sudo ln -sf /usr/bin/qmake6 /usr/bin/qmake qmake -v + - name: configure for debug + run: | + ./configure --prefix=/usr/local --spec=linux-g++ --enable-debug + - name: make for debug + run: | + make -j4 -C src + sudo make -C src install + make -j4 -C tools + sudo make -C tools install - name: configure - run: ./configure --prefix=/usr/local --spec=linux-g++ + run: | + ./configure --prefix=/usr/local --spec=linux-g++ - name: make run: | make -j4 -C src @@ -63,8 +73,18 @@ jobs: sudo rm -f /usr/bin/qmake sudo ln -sf /usr/bin/qmake6 /usr/bin/qmake qmake -v + - name: configure for debug + run: | + ./configure --prefix=/usr/local --enable-shared-mongoc --enable-shared-lz4 --spec=linux-clang --enable-debug + - name: make for debug + run: | + make -j4 -C src + sudo make -C src install + make -j4 -C tools + sudo make -C tools install - name: configure - run: ./configure --prefix=/usr/local --enable-shared-mongoc --enable-shared-lz4 --spec=linux-clang + run: | + ./configure --prefix=/usr/local --enable-shared-mongoc --enable-shared-lz4 --spec=linux-clang - name: make run: | make -j4 -C src @@ -106,6 +126,15 @@ jobs: sudo rm -f /usr/bin/qmake sudo ln -sf /usr/bin/qmake6 /usr/bin/qmake qmake -v + - name: configure for debug + run: | + ./configure --prefix=/usr/local --spec=linux-g++ --enable-debug + - name: make for debug + run: | + make -j4 -C src + sudo make -C src install + make -j4 -C tools + sudo make -C tools install - name: configure run: | ./configure --prefix=/usr/local --spec=linux-g++ @@ -145,8 +174,18 @@ jobs: run: | which pkg-config || brew install pkg-config brew install qt6 jq + - name: configure for debug + run: | + ./configure --prefix=/usr/local --enable-debug + - name: build for debug + run: | + make -j4 -C src + sudo make -C src install + make -j4 -C tools + sudo make -C tools install - name: configure - run: ./configure --prefix=/usr/local + run: | + ./configure --prefix=/usr/local - name: build run: | make -j4 -C src @@ -166,8 +205,18 @@ jobs: run: | which pkg-config || brew install pkg-config brew install qt6 jq mongo-c-driver gflags glog lz4 + - name: configure for debug + run: | + ./configure --prefix=/usr/local --enable-shared-mongoc --enable-shared-glog --enable-shared-lz4 --enable-debug + - name: build for debug + run: | + make -j4 -C src + sudo make -C src install + make -j4 -C tools + sudo make -C tools install - name: configure - run: ./configure --prefix=/usr/local --enable-shared-mongoc --enable-shared-glog --enable-shared-lz4 + run: | + ./configure --prefix=/usr/local --enable-shared-mongoc --enable-shared-glog --enable-shared-lz4 - name: build run: | make -j4 -C src diff --git a/src/tabstractwebsocket.cpp b/src/tabstractwebsocket.cpp index 5cdd3f490..e2c3d17cb 100644 --- a/src/tabstractwebsocket.cpp +++ b/src/tabstractwebsocket.cpp @@ -167,7 +167,7 @@ bool TAbstractWebSocket::searchEndpoint(const THttpRequestHeader &header) int TAbstractWebSocket::parse(QByteArray &recvData) { - tSystemDebug("parse enter data len:{} sid:{}", (int64_t)recvData.length(), socketDescriptor()); + tSystemDebug("parse enter data len:{} sid:{}", (qint64)recvData.length(), socketDescriptor()); if (websocketFrames().isEmpty()) { websocketFrames().append(TWebSocketFrame()); } else { @@ -259,7 +259,7 @@ int TAbstractWebSocket::parse(QByteArray &recvData) } tSystemDebug("WebSocket parse header pos: {}", devhdr->pos()); - tSystemDebug("WebSocket payload length:{}", pfrm->payloadLength()); + tSystemDebug("WebSocket payload length:{}", (quint64)pfrm->payloadLength()); int hdrlen = hdr.length() - devhdr->bytesAvailable(); ds.skipRawData(hdrlen); // Forwards the pos @@ -269,7 +269,7 @@ int TAbstractWebSocket::parse(QByteArray &recvData) case TWebSocketFrame::HeaderParsed: // fall through case TWebSocketFrame::MoreData: { tSystemDebug("WebSocket reading payload: available length:{}", dev->bytesAvailable()); - tSystemDebug("WebSocket parsing length to read:{} current buf len:{}", pfrm->payloadLength(), (int64_t)pfrm->payload().size()); + tSystemDebug("WebSocket parsing length to read:{} current buf len:{}", (quint64)pfrm->payloadLength(), (qint64)pfrm->payload().size()); uint64_t size = std::min((uint64_t)(pfrm->payloadLength() - pfrm->payload().size()), (uint64_t)dev->bytesAvailable()); if (Q_UNLIKELY(size == 0)) { Q_ASSERT(0); @@ -293,14 +293,14 @@ int TAbstractWebSocket::parse(QByteArray &recvData) } } pfrm->payload().resize(pfrm->payload().size() + size); - tSystemDebug("WebSocket payload curent buf len: {}", (int64_t)pfrm->payload().length()); + tSystemDebug("WebSocket payload curent buf len: {}", (qint64)pfrm->payload().length()); if ((uint64_t)pfrm->payload().size() == pfrm->payloadLength()) { pfrm->setState(TWebSocketFrame::Completed); - tSystemDebug("Parse Completed payload len: {}", (int64_t)pfrm->payload().size()); + tSystemDebug("Parse Completed payload len: {}", (qint64)pfrm->payload().size()); } else { pfrm->setState(TWebSocketFrame::MoreData); - tSystemDebug("Parse MoreData payload len: {}", (int64_t)pfrm->payload().size()); + tSystemDebug("Parse MoreData payload len: {}", (qint64)pfrm->payload().size()); } break; } diff --git a/src/tactioncontext.cpp b/src/tactioncontext.cpp index 9ecfd2ea1..642c13299 100644 --- a/src/tactioncontext.cpp +++ b/src/tactioncontext.cpp @@ -459,7 +459,7 @@ int64_t TActionContext::writeResponse(THttpResponseHeader &header, QIODevice *bo { header.setContentLength(length); - tSystemDebug("content-length: {}", (int64_t)header.contentLength()); + tSystemDebug("content-length: {}", (qint64)header.contentLength()); header.setRawHeader(QByteArrayLiteral("Server"), QByteArrayLiteral("TreeFrog server")); header.setCurrentDate(); diff --git a/src/tactionthread.cpp b/src/tactionthread.cpp index 07e9448e1..7b5ee9df0 100644 --- a/src/tactionthread.cpp +++ b/src/tactionthread.cpp @@ -112,7 +112,7 @@ void TActionThread::run() try { for (;;) { QList requests = readRequest(_httpSocket); - tSystemDebug("HTTP request count: {}", (int64_t)requests.count()); + tSystemDebug("HTTP request count: {}", (qint64)requests.count()); if (requests.isEmpty()) { break; diff --git a/src/tepoll.cpp b/src/tepoll.cpp index 1ec8194ea..1e0120370 100644 --- a/src/tepoll.cpp +++ b/src/tepoll.cpp @@ -216,7 +216,7 @@ void TEpoll::dispatchEvents() Q_ASSERT(sd->buffer == nullptr); QByteArray secKey = sd->header.rawHeader("Sec-WebSocket-Key"); - tSystemDebug("secKey: {}", secKey.data()); + tSystemDebug("secKey: {}", (const char*)secKey.data()); int newsocket = TApplicationServerBase::duplicateSocket(sock->socketDescriptor()); // Switch to WebSocket diff --git a/src/tepollhttpsocket.cpp b/src/tepollhttpsocket.cpp index c6c4b8f79..682aebaba 100644 --- a/src/tepollhttpsocket.cpp +++ b/src/tepollhttpsocket.cpp @@ -138,7 +138,7 @@ bool TEpollHttpSocket::seekRecvBuffer(int pos) QByteArray connectionHeader = header.rawHeader("Connection").toLower(); if (connectionHeader.contains("upgrade")) { QByteArray upgradeHeader = header.rawHeader("Upgrade").toLower(); - tSystemDebug("Upgrade: {}", upgradeHeader.data()); + tSystemDebug("Upgrade: {}", (const char*)upgradeHeader.data()); if (upgradeHeader == "websocket") { if (TWebSocket::searchEndpoint(header)) { diff --git a/src/tepollwebsocket.cpp b/src/tepollwebsocket.cpp index 653bb1c93..326227479 100644 --- a/src/tepollwebsocket.cpp +++ b/src/tepollwebsocket.cpp @@ -31,7 +31,7 @@ TEpollWebSocket::TEpollWebSocket(int socketDescriptor, const QHostAddress &addre TEpollSocket(socketDescriptor, Tf::SocketState::Connected, address), TAbstractWebSocket(header) { - tSystemDebug("TEpollWebSocket [{:#x}]", (uintptr_t)this); + tSystemDebug("TEpollWebSocket [{:#x}]", (quintptr)this); socketManager.insert(socketDescriptor, this); _recvBuffer.reserve(BUFFER_RESERVE_SIZE); } @@ -40,7 +40,7 @@ TEpollWebSocket::TEpollWebSocket(int socketDescriptor, const QHostAddress &addre TEpollWebSocket::~TEpollWebSocket() { socketManager.remove(socketDescriptor()); - tSystemDebug("~TEpollWebSocket [{:#x}]", (uintptr_t)this); + tSystemDebug("~TEpollWebSocket [{:#x}]", (quintptr)this); } @@ -77,7 +77,7 @@ bool TEpollWebSocket::isBinaryRequest() const void TEpollWebSocket::sendTextForPublish(const QString &text, const QObject *except) { - tSystemDebug("sendText text len:{} (pid:{})", (int64_t)text.length(), (int)QCoreApplication::applicationPid()); + tSystemDebug("sendText text len:{} (pid:{})", (qint64)text.length(), (int)QCoreApplication::applicationPid()); if (except != this) { TAbstractWebSocket::sendText(text); } @@ -86,7 +86,7 @@ void TEpollWebSocket::sendTextForPublish(const QString &text, const QObject *exc void TEpollWebSocket::sendBinaryForPublish(const QByteArray &binary, const QObject *except) { - tSystemDebug("sendBinary binary len:{} (pid:{})", (int64_t)binary.length(), (int)QCoreApplication::applicationPid()); + tSystemDebug("sendBinary binary len:{} (pid:{})", (qint64)binary.length(), (int)QCoreApplication::applicationPid()); if (except != this) { TAbstractWebSocket::sendBinary(binary); } @@ -95,7 +95,7 @@ void TEpollWebSocket::sendBinaryForPublish(const QByteArray &binary, const QObje void TEpollWebSocket::sendPong(const QByteArray &data) { - tSystemDebug("sendPong data len:{} (pid:{})", (int64_t)data.length(), (int)QCoreApplication::applicationPid()); + tSystemDebug("sendPong data len:{} (pid:{})", (qint64)data.length(), (int)QCoreApplication::applicationPid()); TAbstractWebSocket::sendPong(data); } diff --git a/src/test/buildtest/foo.cpp b/src/test/buildtest/foo.cpp index b8a5fd4f5..2a6844eb4 100644 --- a/src/test/buildtest/foo.cpp +++ b/src/test/buildtest/foo.cpp @@ -132,7 +132,7 @@ QJsonArray Foo::getAllJson() QJsonArray array; TMongoODMapper mapper; - if (mapper.find() > 0) { + if (mapper.find()) { while (mapper.next()) { array.append(QJsonValue(QJsonObject::fromVariantMap(Foo(mapper.value()).toVariantMap()))); } diff --git a/src/test/redis/redis.cpp b/src/test/redis/redis.cpp index 4512c6161..f05130873 100644 --- a/src/test/redis/redis.cpp +++ b/src/test/redis/redis.cpp @@ -164,7 +164,7 @@ void TestRedis::setexGet() QCOMPARE(res, QByteArray()); // empty bool ok = redis.setEx(key, value, secs); QCOMPARE(ok, true); // set ok - Tf::msleep(Tf::random(50, 1900)); // sleep + Tf::msleep(Tf::random(50, 1700)); // sleep res = redis.get(key); // get value QCOMPARE(res, value); } diff --git a/src/tfnamespace.h b/src/tfnamespace.h index ec325fc95..c8fe259b5 100644 --- a/src/tfnamespace.h +++ b/src/tfnamespace.h @@ -254,6 +254,8 @@ enum class SocketState : int { constexpr auto KeepEmptyParts = Qt::KeepEmptyParts; constexpr auto SkipEmptyParts = Qt::SkipEmptyParts; +constexpr auto ReadOnly = QIODeviceBase::ReadOnly; +constexpr auto WriteOnly = QIODeviceBase::WriteOnly; } // namespace Tf diff --git a/src/tglobal.h b/src/tglobal.h index 3b0747731..57d8f5db3 100644 --- a/src/tglobal.h +++ b/src/tglobal.h @@ -6,8 +6,13 @@ constexpr auto TF_SRC_REVISION = 2956; #include #include #include +#include +#if (!defined(Q_OS_WIN) && (defined(__cpp_lib_format) || __has_include())) || (defined(_MSC_VER) && _MSC_VER >= 1930) // std::format +#define TF_HAVE_STD_FORMAT +#endif + #define T_DEFINE_CONTROLLER(TYPE) T_DEFINE_TYPE(TYPE) #define T_DEFINE_VIEW(TYPE) T_DEFINE_TYPE(TYPE) #define T_DEFINE_TYPE(TYPE) \ @@ -168,16 +173,6 @@ constexpr auto TF_SRC_REVISION = 2956; #define tTrace TDebug(Tf::TraceLevel).trace -namespace Tf { -constexpr auto ReadOnly = QIODeviceBase::ReadOnly; -constexpr auto WriteOnly = QIODeviceBase::WriteOnly; -} - - -#if (!defined(Q_OS_WIN) && defined(__cpp_lib_format)) || (defined(_MSC_VER) && _MSC_VER >= 1930) // std::format -#define TF_HAVE_STD_FORMAT -#endif - #include "tfexception.h" #include "tfnamespace.h" #include "tdeclexport.h" diff --git a/src/tkvsdatabasepool.cpp b/src/tkvsdatabasepool.cpp index 07832e1eb..bdd95c8f1 100644 --- a/src/tkvsdatabasepool.cpp +++ b/src/tkvsdatabasepool.cpp @@ -313,7 +313,7 @@ void TKvsDatabasePool::pool(TKvsDatabase &database) if (database.isOpen()) { cachedDatabase[engine].push(database.connectionName()); lastCachedTime[engine].store((uint)std::time(nullptr)); - tSystemDebug("Pooled KVS database: {} count:{}", qUtf8Printable(database.connectionName()), (int64_t)cachedDatabase->count()); + tSystemDebug("Pooled KVS database: {} count:{}", qUtf8Printable(database.connectionName()), (qint64)cachedDatabase->count()); } else { tSystemWarn("Closed KVS database connection, name: {}", qUtf8Printable(database.connectionName())); availableNames[engine].push(database.connectionName()); diff --git a/src/tpublisher.cpp b/src/tpublisher.cpp index 03e1932e4..3a090b5be 100644 --- a/src/tpublisher.cpp +++ b/src/tpublisher.cpp @@ -168,7 +168,7 @@ void TPublisher::unsubscribeFromAll(TAbstractWebSocket *socket) } } - tSystemDebug("total topics: {}", (int64_t)pubobj.count()); + tSystemDebug("total topics: {}", (qint64)pubobj.count()); } @@ -282,6 +282,6 @@ void TPublisher::release(const QString &topic) Pub *pub = pubobj.take(topic); if (pub) { delete pub; - tSystemDebug("release topic: {} (total topics:{})", qUtf8Printable(topic), (int64_t)pubobj.count()); + tSystemDebug("release topic: {} (total topics:{})", qUtf8Printable(topic), (qint64)pubobj.count()); } } diff --git a/src/tsharedmemory_unix.cpp b/src/tsharedmemory_unix.cpp index 1b20d9d4f..55c0a4a54 100644 --- a/src/tsharedmemory_unix.cpp +++ b/src/tsharedmemory_unix.cpp @@ -144,7 +144,7 @@ bool TSharedMemory::attach() } _size = st.st_size; - tSystemDebug("SharedMemory attached. name:{} size:{}", qUtf8Printable(_name), _size); + tSystemDebug("SharedMemory attached. name:{} size:{}", qUtf8Printable(_name), (quint64)_size); return true; error: diff --git a/src/tsharedmemoryallocator.cpp b/src/tsharedmemoryallocator.cpp index e61ef583d..618820818 100644 --- a/src/tsharedmemoryallocator.cpp +++ b/src/tsharedmemoryallocator.cpp @@ -139,7 +139,7 @@ void TSharedMemoryAllocator::setbrk(bool initial) } pb_header = (Tf::program_break_header_t *)_sharedMemory->data(); - tSystemDebug("addr = {:#x}", (uintptr_t)_sharedMemory->data()); + tSystemDebug("addr = {:#x}", (quint64)_sharedMemory->data()); // Checks checksum uint64_t ck = (uint64_t)_sharedMemory->size() * (uint64_t)_sharedMemory->size(); @@ -150,7 +150,7 @@ void TSharedMemoryAllocator::setbrk(bool initial) pb_header->endg = _sharedMemory->size(); pb_header->checksum = (uint64_t)_sharedMemory->size() * (uint64_t)_sharedMemory->size(); } - tSystemDebug("checksum = {}", pb_header->checksum); + tSystemDebug("checksum = {}", (qint64)pb_header->checksum); _origin = pb_header->start() + sizeof(Tf::alloc_header_t); } @@ -427,7 +427,7 @@ void TSharedMemoryAllocator::summary() const } tSystemDebug("-- memory block summary --"); - tSystemDebug("table info: blocks = {}, free = {}, used = {}", countBlocks(), countFreeBlocks(), pb_header->at.used); + tSystemDebug("table info: blocks = {}, free = {}, used = {}", countBlocks(), countFreeBlocks(), (quint64)pb_header->at.used); } // Debug function to print the entire link list @@ -441,11 +441,11 @@ void TSharedMemoryAllocator::dump() const Tf::alloc_header_t *cur = pb_header->alloc_head(); tSystemDebug("-- memory block information --"); - tSystemDebug("table info: blocks = {}, free = {}, used = {}, free-size = {}, segment-size = {}", countBlocks(), countFreeBlocks(), pb_header->at.used, sizeOfFreeBlocks(), dataSegmentSize()); - tSystemDebug("block info: head = {:#x}, tail = {:#x}", (uintptr_t)pb_header->alloc_head(), (uintptr_t)pb_header->alloc_tail()); + tSystemDebug("table info: blocks = {}, free = {}, used = {}, free-size = {}, segment-size = {}", countBlocks(), countFreeBlocks(), (quint64)pb_header->at.used, (quint64)sizeOfFreeBlocks(), (quint64)dataSegmentSize()); + tSystemDebug("block info: head = {:#x}, tail = {:#x}", (quint64)pb_header->alloc_head(), (quint64)pb_header->alloc_tail()); while (cur) { tSystemDebug("addr = {:#x}, size = {}, freed = {}, next = {:#x}, prev = {:#x}", - (uintptr_t)cur, cur->size, cur->freed, (uintptr_t)cur->next(), (uintptr_t)cur->prev()); + (quint64)cur, cur->size, cur->freed, (quint64)cur->next(), (quint64)cur->prev()); cur = cur->next(); } } diff --git a/src/tsharedmemorykvsdriver.cpp b/src/tsharedmemorykvsdriver.cpp index 9a26439f0..e600b7720 100644 --- a/src/tsharedmemorykvsdriver.cpp +++ b/src/tsharedmemorykvsdriver.cpp @@ -75,10 +75,10 @@ bool TSharedMemoryKvsDriver::open(const QString &db, const QString &, const QStr _allocator = TSharedMemoryAllocator::attach(_name); if (_allocator) { - tSystemDebug("SharedMemory attach. name:{} size:{}", qUtf8Printable(_name), _allocator->mapSize()); + tSystemDebug("SharedMemory attach. name:{} size:{}", qUtf8Printable(_name), (quint64)_allocator->mapSize()); _size = _allocator->mapSize(); } else { - tSystemError("SharedMemory attach error. name:{}", qUtf8Printable(_name)); + tSystemError("SharedMemory attach error. name:{}", qUtf8Printable(_name)); } return true; } diff --git a/src/tsystembus.cpp b/src/tsystembus.cpp index 7cce96152..b4d7c5e1d 100644 --- a/src/tsystembus.cpp +++ b/src/tsystembus.cpp @@ -112,7 +112,7 @@ void TSystemBus::readBus() void TSystemBus::writeBus() { QMutexLocker locker(&mutexWrite); - tSystemDebug("TSystemBus::writeBus len:{}", (int64_t)sendBuffer.length()); + tSystemDebug("TSystemBus::writeBus len:{}", (qint64)sendBuffer.length()); for (;;) { int len = busSocket->write(sendBuffer.data(), sendBuffer.length()); diff --git a/src/tthreadapplicationserver_linux.cpp b/src/tthreadapplicationserver_linux.cpp index 93aa27260..2413ff95c 100644 --- a/src/tthreadapplicationserver_linux.cpp +++ b/src/tthreadapplicationserver_linux.cpp @@ -115,7 +115,7 @@ void TThreadApplicationServer::run() Tf::msleep(1); } - tSystemDebug("thread ptr: {}", (uint64_t)thread); + tSystemDebug("thread ptr: {}", (quint64)thread); thread->setSocketDescriptor(socketDescriptor); thread->start(); } diff --git a/src/tthreadapplicationserver_qt.cpp b/src/tthreadapplicationserver_qt.cpp index 87515eab5..5a8c2bfa9 100644 --- a/src/tthreadapplicationserver_qt.cpp +++ b/src/tthreadapplicationserver_qt.cpp @@ -83,7 +83,7 @@ void TThreadApplicationServer::stop() void TThreadApplicationServer::incomingConnection(qintptr socketDescriptor) { - tSystemDebug("incomingConnection sd:{} thread count:{} max:{}", (int64_t)socketDescriptor, TActionThread::threadCount(), maxThreads); + tSystemDebug("incomingConnection sd:{} thread count:{} max:{}", (qint64)socketDescriptor, TActionThread::threadCount(), maxThreads); TActionThread *thread; while (!threadPoolPtr()->pop(thread)) { std::this_thread::yield(); diff --git a/src/twebsocket.cpp b/src/twebsocket.cpp index 3640363e2..b7461f899 100644 --- a/src/twebsocket.cpp +++ b/src/twebsocket.cpp @@ -56,7 +56,7 @@ void TWebSocket::close() void TWebSocket::sendTextForPublish(const QString &text, const QObject *except) { - tSystemDebug("sendText text len:{} (pid:{})", (int64_t)text.length(), (int)QCoreApplication::applicationPid()); + tSystemDebug("sendText text len:{} (pid:{})", (qint64)text.length(), (int)QCoreApplication::applicationPid()); if (except != this) { TAbstractWebSocket::sendText(text); } @@ -65,7 +65,7 @@ void TWebSocket::sendTextForPublish(const QString &text, const QObject *except) void TWebSocket::sendBinaryForPublish(const QByteArray &binary, const QObject *except) { - tSystemDebug("sendBinary binary len:{} (pid:{})", (int64_t)binary.length(), (int)QCoreApplication::applicationPid()); + tSystemDebug("sendBinary binary len:{} (pid:{})", (qint64)binary.length(), (int)QCoreApplication::applicationPid()); if (except != this) { TAbstractWebSocket::sendBinary(binary); } @@ -74,7 +74,7 @@ void TWebSocket::sendBinaryForPublish(const QByteArray &binary, const QObject *e void TWebSocket::sendPong(const QByteArray &data) { - tSystemDebug("sendPong data len:{} (pid:{})", (int64_t)data.length(), (int)QCoreApplication::applicationPid()); + tSystemDebug("sendPong data len:{} (pid:{})", (qint64)data.length(), (int)QCoreApplication::applicationPid()); TAbstractWebSocket::sendPong(data); } diff --git a/tools/tfmanager/processinfo_win.cpp b/tools/tfmanager/processinfo_win.cpp index 305f75539..32612bfd3 100644 --- a/tools/tfmanager/processinfo_win.cpp +++ b/tools/tfmanager/processinfo_win.cpp @@ -50,20 +50,6 @@ int64_t ProcessInfo::ppid() const } -// int64_t ProcessInfo::ppid() const -// { -// int64_t ppid = 0; -// HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processId); -// if (hProcess) { -// PROCESS_BASIC_INFORMATION basicInfo; -// if (NtQueryInformationProcess(hProcess, ProcessBasicInformation, &basicInfo, sizeof(basicInfo), NULL) == STATUS_SUCCESS) { -// ppid = (int64_t)basicInfo.InheritedFromUniqueProcessId; -// } -// } -// return ppid; -// } - - QString ProcessInfo::processName() const { QString ret; diff --git a/tools/tfmanager/systembusdaemon.cpp b/tools/tfmanager/systembusdaemon.cpp index a19e66813..27b995553 100644 --- a/tools/tfmanager/systembusdaemon.cpp +++ b/tools/tfmanager/systembusdaemon.cpp @@ -97,7 +97,7 @@ void SystemBusDaemon::readSocket() } QByteArray buf = socket->readAll(); - tSystemDebug("SystemBusDaemon::read len : {}", (int64_t)buf.size()); + tSystemDebug("SystemBusDaemon::read len : {}", (qint64)buf.size()); if (maxServers <= 1) { // do nothing return; @@ -161,7 +161,7 @@ void SystemBusDaemon::handleDisconnect() socketSet.remove(socket); disconnect(socket, nullptr, nullptr, nullptr); socket->deleteLater(); - tSystemDebug("disconnected local socket : {:#x}", (uintptr_t)socket); + tSystemDebug("disconnected local socket : {:#x}", (quint64)socket); } }