Skip to content

Commit 763af9d

Browse files
fixes warnings.
1 parent 2a0e319 commit 763af9d

File tree

11 files changed

+24
-24
lines changed

11 files changed

+24
-24
lines changed

src/tabstractwebsocket.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ bool TAbstractWebSocket::searchEndpoint(const THttpRequestHeader &header)
167167

168168
int TAbstractWebSocket::parse(QByteArray &recvData)
169169
{
170-
tSystemDebug("parse enter data len:%ld sid:%lld", (int64_t)recvData.length(), socketDescriptor());
170+
tSystemDebug("parse enter data len:%lld sid:%lld", (int64_t)recvData.length(), socketDescriptor());
171171
if (websocketFrames().isEmpty()) {
172172
websocketFrames().append(TWebSocketFrame());
173173
} else {
@@ -259,7 +259,7 @@ int TAbstractWebSocket::parse(QByteArray &recvData)
259259
}
260260

261261
tSystemDebug("WebSocket parse header pos: %lld", devhdr->pos());
262-
tSystemDebug("WebSocket payload length:%ld", pfrm->payloadLength());
262+
tSystemDebug("WebSocket payload length:%lld", pfrm->payloadLength());
263263

264264
int hdrlen = hdr.length() - devhdr->bytesAvailable();
265265
ds.skipRawData(hdrlen); // Forwards the pos
@@ -269,7 +269,7 @@ int TAbstractWebSocket::parse(QByteArray &recvData)
269269
case TWebSocketFrame::HeaderParsed: // fall through
270270
case TWebSocketFrame::MoreData: {
271271
tSystemDebug("WebSocket reading payload: available length:%lld", dev->bytesAvailable());
272-
tSystemDebug("WebSocket parsing length to read:%lu current buf len:%ld", pfrm->payloadLength(), (int64_t)pfrm->payload().size());
272+
tSystemDebug("WebSocket parsing length to read:%llu current buf len:%lld", pfrm->payloadLength(), (int64_t)pfrm->payload().size());
273273
uint64_t size = std::min((uint64_t)(pfrm->payloadLength() - pfrm->payload().size()), (uint64_t)dev->bytesAvailable());
274274
if (Q_UNLIKELY(size == 0)) {
275275
Q_ASSERT(0);
@@ -293,14 +293,14 @@ int TAbstractWebSocket::parse(QByteArray &recvData)
293293
}
294294
}
295295
pfrm->payload().resize(pfrm->payload().size() + size);
296-
tSystemDebug("WebSocket payload curent buf len: %ld", (int64_t)pfrm->payload().length());
296+
tSystemDebug("WebSocket payload curent buf len: %lld", (int64_t)pfrm->payload().length());
297297

298298
if ((uint64_t)pfrm->payload().size() == pfrm->payloadLength()) {
299299
pfrm->setState(TWebSocketFrame::Completed);
300-
tSystemDebug("Parse Completed payload len: %ld", (int64_t)pfrm->payload().size());
300+
tSystemDebug("Parse Completed payload len: %lld", (int64_t)pfrm->payload().size());
301301
} else {
302302
pfrm->setState(TWebSocketFrame::MoreData);
303-
tSystemDebug("Parse MoreData payload len: %ld", (int64_t)pfrm->payload().size());
303+
tSystemDebug("Parse MoreData payload len: %lld", (int64_t)pfrm->payload().size());
304304
}
305305
break;
306306
}

src/tactioncontext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ int64_t TActionContext::writeResponse(THttpResponseHeader &header, QIODevice *bo
463463
{
464464

465465
header.setContentLength(length);
466-
tSystemDebug("content-length: %ld", (int64_t)header.contentLength());
466+
tSystemDebug("content-length: %lld", (int64_t)header.contentLength());
467467
header.setRawHeader(QByteArrayLiteral("Server"), QByteArrayLiteral("TreeFrog server"));
468468
header.setCurrentDate();
469469

src/tactionthread.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void TActionThread::run()
112112
try {
113113
for (;;) {
114114
QList<THttpRequest> requests = readRequest(_httpSocket);
115-
tSystemDebug("HTTP request count: %ld", (int64_t)requests.count());
115+
tSystemDebug("HTTP request count: %lld", (int64_t)requests.count());
116116

117117
if (requests.isEmpty()) {
118118
break;

src/tkvsdatabasepool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ void TKvsDatabasePool::pool(TKvsDatabase &database)
313313
if (database.isOpen()) {
314314
cachedDatabase[engine].push(database.connectionName());
315315
lastCachedTime[engine].store((uint)std::time(nullptr));
316-
tSystemDebug("Pooled KVS database: %s count:%ld", qUtf8Printable(database.connectionName()), (int64_t)cachedDatabase->count());
316+
tSystemDebug("Pooled KVS database: %s count:%lld", qUtf8Printable(database.connectionName()), (int64_t)cachedDatabase->count());
317317
} else {
318318
tSystemWarn("Closed KVS database connection, name: %s", qUtf8Printable(database.connectionName()));
319319
availableNames[engine].push(database.connectionName());

src/tpublisher.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ void TPublisher::unsubscribeFromAll(TAbstractWebSocket *socket)
168168
}
169169
}
170170

171-
tSystemDebug("total topics: %ld", (int64_t)pubobj.count());
171+
tSystemDebug("total topics: %lld", (int64_t)pubobj.count());
172172
}
173173

174174

@@ -282,6 +282,6 @@ void TPublisher::release(const QString &topic)
282282
Pub *pub = pubobj.take(topic);
283283
if (pub) {
284284
delete pub;
285-
tSystemDebug("release topic: %s (total topics:%ld)", qUtf8Printable(topic), (int64_t)pubobj.count());
285+
tSystemDebug("release topic: %s (total topics:%lld)", qUtf8Printable(topic), (int64_t)pubobj.count());
286286
}
287287
}

src/tredisdriver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ bool TRedisDriver::request(const QByteArrayList &command, QVariantList &response
4646

4747
for (;;) {
4848
if (!readReply()) {
49-
tSystemError("Redis read error pos:%d buflen:%ld", _pos, (int64_t)_buffer.length());
49+
tSystemError("Redis read error pos:%d buflen:%lld", _pos, (int64_t)_buffer.length());
5050
close();
5151
return false;
5252
}

src/tsharedmemoryallocator.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void TSharedMemoryAllocator::setbrk(bool initial)
150150
pb_header->endg = _sharedMemory->size();
151151
pb_header->checksum = (uint64_t)_sharedMemory->size() * (uint64_t)_sharedMemory->size();
152152
}
153-
tSystemDebug("checksum = %lu", pb_header->checksum);
153+
tSystemDebug("checksum = %llu", pb_header->checksum);
154154

155155
_origin = pb_header->start() + sizeof(Tf::alloc_header_t);
156156
}
@@ -427,7 +427,7 @@ void TSharedMemoryAllocator::summary() const
427427
}
428428

429429
tSystemDebug("-- memory block summary --");
430-
tSystemDebug("table info: blocks = %d, free = %d, used = %lu", countBlocks(), countFreeBlocks(), pb_header->at.used);
430+
tSystemDebug("table info: blocks = %d, free = %d, used = %llu", countBlocks(), countFreeBlocks(), pb_header->at.used);
431431
}
432432

433433
// Debug function to print the entire link list
@@ -441,7 +441,7 @@ void TSharedMemoryAllocator::dump() const
441441
Tf::alloc_header_t *cur = pb_header->alloc_head();
442442

443443
tSystemDebug("-- memory block information --");
444-
tSystemDebug("table info: blocks = %d, free = %d, used = %lu, free-size = %lu, segment-size = %lu", countBlocks(), countFreeBlocks(), pb_header->at.used, sizeOfFreeBlocks(), dataSegmentSize());
444+
tSystemDebug("table info: blocks = %d, free = %d, used = %llu, free-size = %lu, segment-size = %lu", countBlocks(), countFreeBlocks(), pb_header->at.used, sizeOfFreeBlocks(), dataSegmentSize());
445445
tSystemDebug("block info: head = %p, tail = %p", pb_header->alloc_head(), pb_header->alloc_tail());
446446
while (cur) {
447447
tSystemDebug("addr = %p, size = %u, freed = %u, next = %p, prev = %p",

src/tsystembus.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void TSystemBus::readBus()
112112
void TSystemBus::writeBus()
113113
{
114114
QMutexLocker locker(&mutexWrite);
115-
tSystemDebug("TSystemBus::writeBus len:%ld", (int64_t)sendBuffer.length());
115+
tSystemDebug("TSystemBus::writeBus len:%lld", (int64_t)sendBuffer.length());
116116

117117
for (;;) {
118118
int len = busSocket->write(sendBuffer.data(), sendBuffer.length());

src/twebsocket.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void TWebSocket::close()
6161

6262
void TWebSocket::sendTextForPublish(const QString &text, const QObject *except)
6363
{
64-
tSystemDebug("sendText text len:%ld (pid:%d)", (int64_t)text.length(), (int)QCoreApplication::applicationPid());
64+
tSystemDebug("sendText text len:%lld (pid:%d)", (int64_t)text.length(), (int)QCoreApplication::applicationPid());
6565
if (except != this) {
6666
TAbstractWebSocket::sendText(text);
6767
}
@@ -70,7 +70,7 @@ void TWebSocket::sendTextForPublish(const QString &text, const QObject *except)
7070

7171
void TWebSocket::sendBinaryForPublish(const QByteArray &binary, const QObject *except)
7272
{
73-
tSystemDebug("sendBinary binary len:%ld (pid:%d)", (int64_t)binary.length(), (int)QCoreApplication::applicationPid());
73+
tSystemDebug("sendBinary binary len:%lld (pid:%d)", (int64_t)binary.length(), (int)QCoreApplication::applicationPid());
7474
if (except != this) {
7575
TAbstractWebSocket::sendBinary(binary);
7676
}
@@ -79,7 +79,7 @@ void TWebSocket::sendBinaryForPublish(const QByteArray &binary, const QObject *e
7979

8080
void TWebSocket::sendPong(const QByteArray &data)
8181
{
82-
tSystemDebug("sendPong data len:%ld (pid:%d)", (int64_t)data.length(), (int)QCoreApplication::applicationPid());
82+
tSystemDebug("sendPong data len:%lld (pid:%d)", (int64_t)data.length(), (int)QCoreApplication::applicationPid());
8383
TAbstractWebSocket::sendPong(data);
8484
}
8585

@@ -98,7 +98,7 @@ bool TWebSocket::canReadRequest() const
9898
void TWebSocket::readRequest()
9999
{
100100
if (myWorkerCounter > 0) {
101-
tSystemWarn("Worker already running (sd:%ld)", (uint64_t)socketDescriptor());
101+
tSystemWarn("Worker already running (sd:%llu)", (uint64_t)socketDescriptor());
102102
return;
103103
}
104104

tools/tfmanager/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ int killTreeFrogProcess(const QString &cmd)
434434
SystemBusDaemon::releaseResource(pid);
435435
tf_unlink(pidFilePath().toLatin1().data());
436436
tf_unlink(oldPidFilePath().toLatin1().data());
437-
tSystemInfo("Killed TreeFrog manager process pid:%ld", (int64_t)pid);
437+
tSystemInfo("Killed TreeFrog manager process pid:%lld", (int64_t)pid);
438438

439439
TProcessInfo::kill(pids); // kills the server process
440440
tSystemInfo("Killed TreeFrog application server processes");
@@ -456,7 +456,7 @@ void showProcessId()
456456
{
457457
int64_t pid = readPidOfApplication();
458458
if (pid > 0) {
459-
std::printf("%ld\n", pid);
459+
std::printf("%lld\n", (int64_t)pid);
460460
}
461461
}
462462

@@ -587,7 +587,7 @@ int managerMain(int argc, char *argv[])
587587
// Check TreeFrog processes are running
588588
int64_t pid = runningApplicationPid();
589589
if (pid > 0) {
590-
std::fprintf(stderr, "Already running pid:%ld\n", pid);
590+
std::fprintf(stderr, "Already running pid:%lld\n", (int64_t)pid);
591591
return 1;
592592
}
593593

0 commit comments

Comments
 (0)