QNetworkInterface: fix warning of unused function

That causes compilation error in developer build or when '-Werror'
command line argument is forced:

kernel/qnetworkinterface_unix.cpp:142:12: error: 'int getMtu(int, ifreq*)' defined but not used [-Werror=unused-function]
 static int getMtu(int socket, struct ifreq *req)
            ^
cc1plus: all warnings being treated as errors

So, mark 'getMtu()' as unused in the appropriate branches.

Change-Id: Ib4d74845835962bb12f56baf8e13834c032a0404
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Alex Trotsenko 2017-12-21 17:46:45 +02:00
parent dcc605beb6
commit 48ea14080e

View File

@ -341,6 +341,7 @@ QT_END_INCLUDE_NAMESPACE
static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList) static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList)
{ {
Q_UNUSED(getMtu)
QList<QNetworkInterfacePrivate *> interfaces; QList<QNetworkInterfacePrivate *> interfaces;
QSet<QString> seenInterfaces; QSet<QString> seenInterfaces;
QVarLengthArray<int, 16> seenIndexes; // faster than QSet<int> QVarLengthArray<int, 16> seenIndexes; // faster than QSet<int>
@ -564,6 +565,7 @@ static void getAddressExtraInfo(QNetworkAddressEntry *entry, struct sockaddr *sa
static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList) static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList)
{ {
Q_UNUSED(getMtu)
QList<QNetworkInterfacePrivate *> interfaces; QList<QNetworkInterfacePrivate *> interfaces;
// make sure there's one entry for each interface // make sure there's one entry for each interface