From eaebc23452813a8709d2bbb4d17fddb1b4f29d91 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 15 Nov 2016 12:13:40 +0100 Subject: Increase compiler warnings, fix a lot of those instances - Add explicit casts - Comment out unused params - Remove ignored const return types --- src/client/net/serverdiscovery.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/client/net/serverdiscovery.cpp') diff --git a/src/client/net/serverdiscovery.cpp b/src/client/net/serverdiscovery.cpp index 99a0dcd..5ca0eba 100644 --- a/src/client/net/serverdiscovery.cpp +++ b/src/client/net/serverdiscovery.cpp @@ -21,7 +21,7 @@ ServerDiscovery::ServerDiscovery(QObject *parent) /* Try to get a UDP port for server discovery */ int tries = 10; while (tries-- != 0) { - const quint16 port = (quint16)(qrand() % 10000) + 10000; + const quint16 port = (quint16)(qrand() % 10000 + 10000); if (_discoverySocket.bind(QHostAddress::Any, port)) break; if (tries == 0) @@ -98,8 +98,8 @@ void ServerDiscovery::doDiscovery() if (_salt2.size() < SALT_LEN) _salt2.resize(SALT_LEN); for (int i = 0; i < SALT_LEN; ++i) { - salt1[i] = qrand() & 0xff; - _salt2[i] = qrand() & 0xff; + salt1[i] = (char)(qrand() & 0xff); + _salt2[i] = (char)(qrand() & 0xff); } _packet.reset(); _packet.setField(_HASH, genSha1(&_nameBytes, &salt1, &iplist)); -- cgit v1.2.3-55-g7522