fix gcc warnings

This commit is contained in:
Srivats P. 2014-07-06 18:36:01 +05:30
parent 347fc02dcf
commit 470d390658
6 changed files with 9 additions and 5 deletions

View File

@ -121,7 +121,7 @@ void Port::recalculateAverageRates()
void Port::setAveragePacketRate(double packetsPerSec)
{
double rate;
double rate = 0;
double pps = 0;
double bps = 0;
int n = 0;

View File

@ -811,6 +811,7 @@ void StreamConfigDialog::__updateProtocol(int level, int newId)
ret = skipProtocols(level-1);
Q_ASSERT(ret == true);
Q_UNUSED(ret);
Q_ASSERT(oldId != newId);
Q_ASSERT(newId != ButtonIdOther);

View File

@ -363,7 +363,7 @@ bool StreamBase::setBurstRate(double burstsPerSec)
/*! Convenience Function */
double StreamBase::averagePacketRate() const
{
double avgPacketRate;
double avgPacketRate = 0;
switch (sendUnit())
{

View File

@ -96,7 +96,7 @@ void PbRpcChannel::CallMethod(
::google::protobuf::Message *response,
::google::protobuf::Closure* done)
{
char* const msg = (char*) &msgBuf[0];
char* msg = (char*) &msgBuf[0];
int len;
bool ret;
@ -157,6 +157,7 @@ void PbRpcChannel::CallMethod(
mpSocket->write(msg, PB_HDR_SIZE);
ret = req->SerializeToZeroCopyStream(outStream);
Q_ASSERT(ret == true);
Q_UNUSED(ret);
outStream->Flush();
}
@ -182,6 +183,7 @@ void PbRpcChannel::on_mpSocket_readyRead()
msgLen = mpSocket->read((char*)msg, PB_HDR_SIZE);
Q_ASSERT(msgLen == PB_HDR_SIZE);
Q_UNUSED(msgLen);
type = qFromBigEndian<quint16>(msg+0);
method = qFromBigEndian<quint16>(msg+2);

View File

@ -56,7 +56,7 @@ public:
// Server Side Methods
void SetFailed(const QString &reason)
{ failed = true; errStr = reason; qWarning(qPrintable(errStr)); }
{ failed = true; errStr = reason; qWarning("%s", qPrintable(errStr)); }
void SetFailed(const std::string &reason)
{ SetFailed(QString::fromStdString(reason)); }
QString ErrorString() const { return errStr; }

View File

@ -149,6 +149,7 @@ void RpcConnection::sendRpcReply(PbRpcController *controller)
len = blob->read(msg, sizeof(msgBuf));
l = clientSock->write(msg, len);
Q_ASSERT(l == len);
Q_UNUSED(l);
}
goto _exit;
@ -355,7 +356,7 @@ _error_exit2:
return;
}
void RpcConnection::connIdMsgHandler(QtMsgType type, const char* msg)
void RpcConnection::connIdMsgHandler(QtMsgType /*type*/, const char* msg)
{
if (connId.hasLocalData()) {
QString newMsg(*connId.localData());