diff options
author | Simon Rettberg | 2016-11-15 12:13:40 +0100 |
---|---|---|
committer | Simon Rettberg | 2016-11-15 12:13:40 +0100 |
commit | eaebc23452813a8709d2bbb4d17fddb1b4f29d91 (patch) | |
tree | 956155fc2fc5b58498a4c494cc59b7adc68bc76a /src/client/net/serverdiscovery.cpp | |
parent | [server] Rewrite positioning logic of connection frames (diff) | |
download | pvs2-eaebc23452813a8709d2bbb4d17fddb1b4f29d91.tar.gz pvs2-eaebc23452813a8709d2bbb4d17fddb1b4f29d91.tar.xz pvs2-eaebc23452813a8709d2bbb4d17fddb1b4f29d91.zip |
Increase compiler warnings, fix a lot of those instances
- Add explicit casts
- Comment out unused params
- Remove ignored const return types
Diffstat (limited to 'src/client/net/serverdiscovery.cpp')
-rw-r--r-- | src/client/net/serverdiscovery.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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)); |