summaryrefslogtreecommitdiffstats
path: root/src/network/socket
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-10-17 17:48:34 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-03-04 10:29:19 +0000
commit5cd455dca309d0d031057ab40ff607d144683d43 (patch)
tree6c939ceeb02e415f8035753e46d7465e26db2fad /src/network/socket
parent600529e07a46d8e20f4302dc988125f3fee36ec4 (diff)
QtNetwork: use printf-style qWarning/qDebug where possible (I)
The printf-style version of QDebug expands to a lot less code than the std::ostream-style version. Of course, you pay in type safety (but compilers warn about it these days), you cannot stream complex Qt types and streaming QStrings is awkward, but in many cases you actually improve on readability. But the main reason is that something that's not supposed to be executed under normal operation has no business bloating executable code size. This is not an attempt at converting all qWarnings() to printf-style, only the low-hanging fruit. In this first part, replace qWarning() << "" with qWarning("..."). Saves ~850b in text size on optimized GCC 5.3 AMD64 builds. Change-Id: Ib1a087795a03b2a6b432e2c499968df779aaea37 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'src/network/socket')
-rw-r--r--src/network/socket/qhttpsocketengine.cpp2
-rw-r--r--src/network/socket/qsocks5socketengine.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp
index fa9c5909e0..642c9bb10f 100644
--- a/src/network/socket/qhttpsocketengine.cpp
+++ b/src/network/socket/qhttpsocketengine.cpp
@@ -510,7 +510,7 @@ void QHttpSocketEngine::slotSocketConnected()
data += "\r\n";
// qDebug() << ">>>>>>>> sending request" << this;
// qDebug() << data;
-// qDebug() << ">>>>>>>";
+// qDebug(">>>>>>>");
d->socket->write(data);
d->state = ConnectSent;
}
diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp
index 4de4c1799f..0c15810a48 100644
--- a/src/network/socket/qsocks5socketengine.cpp
+++ b/src/network/socket/qsocks5socketengine.cpp
@@ -352,7 +352,7 @@ void QSocks5BindStore::add(qintptr socketDescriptor, QSocks5BindData *bindData)
{
QMutexLocker lock(&mutex);
if (store.contains(socketDescriptor)) {
- // qDebug() << "delete it";
+ // qDebug("delete it");
}
bindData->timeStamp.start();
store.insert(socketDescriptor, bindData);
@@ -1191,7 +1191,7 @@ void QSocks5SocketEnginePrivate::_q_controlSocketReadNotification()
case Connected: {
QByteArray buf;
if (!data->authenticator->unSeal(data->controlSocket, &buf)) {
- // qDebug() << "unseal error maybe need to wait for more data";
+ // qDebug("unseal error maybe need to wait for more data");
}
if (buf.size()) {
QSOCKS5_DEBUG << dump(buf);