diff options
author | Thorvald Natvig <slicer@users.sourceforge.net> | 2011-05-16 03:45:46 +0400 |
---|---|---|
committer | Thorvald Natvig <slicer@users.sourceforge.net> | 2011-05-16 03:45:46 +0400 |
commit | 45bd8139fe7d83481035d3dd0332c0e67dcef483 (patch) | |
tree | 768c80fafddb5a251131fb60672994ce3532a00d /src | |
parent | 1ada87d5f2b98b6ec7e3da989aabe263cd521ee2 (diff) |
Fix murmur warnings
Diffstat (limited to 'src')
-rw-r--r-- | src/murmur/Cert.cpp | 4 | ||||
-rw-r--r-- | src/murmur/Meta.cpp | 4 | ||||
-rw-r--r-- | src/murmur/MurmurIce.cpp | 2 | ||||
-rw-r--r-- | src/murmur/Server.cpp | 5 | ||||
-rw-r--r-- | src/murmur/main.cpp | 6 |
5 files changed, 12 insertions, 9 deletions
diff --git a/src/murmur/Cert.cpp b/src/murmur/Cert.cpp index 6ef162c48..29402acbe 100644 --- a/src/murmur/Cert.cpp +++ b/src/murmur/Cert.cpp @@ -59,12 +59,12 @@ bool Server::isKeyForCert(const QSslKey &key, const QSslCertificate &cert) { BIO *mem = NULL; mem = BIO_new_mem_buf(qbaKey.data(), qbaKey.size()); - BIO_set_close(mem, BIO_NOCLOSE); + Q_UNUSED(BIO_set_close(mem, BIO_NOCLOSE)); pkey = d2i_PrivateKey_bio(mem, NULL); BIO_free(mem); mem = BIO_new_mem_buf(qbaCert.data(), qbaCert.size()); - BIO_set_close(mem, BIO_NOCLOSE); + Q_UNUSED(BIO_set_close(mem, BIO_NOCLOSE)); x509 = d2i_X509_bio(mem, NULL); BIO_free(mem); mem = NULL; diff --git a/src/murmur/Meta.cpp b/src/murmur/Meta.cpp index deb6b66f3..43b28b801 100644 --- a/src/murmur/Meta.cpp +++ b/src/murmur/Meta.cpp @@ -494,7 +494,7 @@ bool Meta::boot(int srvnum) { emit started(s); #ifdef Q_OS_UNIX - int sockets = 19; // Base + unsigned int sockets = 19; // Base foreach(s, qhServers) { sockets += 11; // Listen sockets, signal pipes etc. sockets += s->iMaxUsers; // One per user @@ -516,7 +516,7 @@ bool Meta::boot(int srvnum) { } } if (r.rlim_cur < sockets) - qCritical("Current booted servers require minimum %d file descriptors when all slots are full, but only %d file descriptors are allowed for this process. Your server will crash and burn; read the FAQ for details.", sockets, r.rlim_cur); + qCritical("Current booted servers require minimum %d file descriptors when all slots are full, but only %ld file descriptors are allowed for this process. Your server will crash and burn; read the FAQ for details.", sockets, r.rlim_cur); } #endif diff --git a/src/murmur/MurmurIce.cpp b/src/murmur/MurmurIce.cpp index 45ee609f6..424156540 100644 --- a/src/murmur/MurmurIce.cpp +++ b/src/murmur/MurmurIce.cpp @@ -1508,7 +1508,7 @@ static void impl_Server_redirectWhisperGroup(const ::Murmur::AMD_Server_redirect } #define ACCESS_Meta_getSliceChecksums_ALL -static void impl_Meta_getSliceChecksums(const ::Murmur::AMD_Meta_getSliceChecksumsPtr cb, const Ice::ObjectAdapterPtr adapter) { +static void impl_Meta_getSliceChecksums(const ::Murmur::AMD_Meta_getSliceChecksumsPtr cb, const Ice::ObjectAdapterPtr) { cb->ice_response(::Ice::sliceChecksums()); } diff --git a/src/murmur/Server.cpp b/src/murmur/Server.cpp index 3f091e441..b267de123 100644 --- a/src/murmur/Server.cpp +++ b/src/murmur/Server.cpp @@ -259,7 +259,8 @@ void Server::stopThread() { #ifdef Q_OS_UNIX unsigned char val = 0; - ::write(aiNotify[1], &val, 1); + if (::write(aiNotify[1], &val, 1) != 1) + log("Failed to signal voice thread"); #else SetEvent(hNotify); #endif @@ -1225,7 +1226,7 @@ void Server::connectionClosed(QAbstractSocket::SocketError err, const QString &r if (old && old->bTemporary && old->qlUsers.isEmpty()) QCoreApplication::instance()->postEvent(this, new ExecEvent(boost::bind(&Server::removeChannel, this, old->iId))); - if (u->uiSession < iMaxUsers * 2) + if (static_cast<int>(u->uiSession) < iMaxUsers * 2) qqIds.enqueue(u->uiSession); // Reinsert session id into pool if (u->sState == ServerUser::Authenticated) { diff --git a/src/murmur/main.cpp b/src/murmur/main.cpp index 71a6a3515..a753a7a0e 100644 --- a/src/murmur/main.cpp +++ b/src/murmur/main.cpp @@ -329,7 +329,8 @@ int main(int argc, char **argv) { printf("Password: "); fflush(NULL); - fgets(password, 255, stdin); + if (fgets(password, 255, stdin) != password) + qFatal("No password provided"); p = strchr(password, '\r'); if (p) *p = 0; @@ -384,7 +385,8 @@ int main(int argc, char **argv) { } } - chdir("/"); + if (chdir("/") != 0) + fprintf(stderr, "Failed to chdir to /"); int fd; fd = open("/dev/null", O_RDONLY); |