Commit f4a0cbf6 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Fix gcc warnings about unused variables.



These appear when compiling in release mode.

Change-Id: I76ee3b1b8d728fd839d713ee4f914b6965851b99
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@digia.com>
parent f5aa5f3d
......@@ -282,6 +282,7 @@ void QPacketProtocol::send(const QPacket & p)
Q_ASSERT(writeBytes == sizeof(qint32));
writeBytes = d->dev->write(p.b);
Q_ASSERT(writeBytes == p.b.size());
Q_UNUSED(writeBytes); // For building in release mode.
}
/*!
......
......@@ -211,9 +211,16 @@ int SshChannelManager::channelCount() const
void SshChannelManager::removeChannel(ChannelIterator it)
{
Q_ASSERT(it != m_channels.end() && "Unexpected channel lookup failure.");
if (it == m_channels.end()) {
throw SshClientException(SshInternalError,
QLatin1String("Internal error: Unexpected channel lookup failure"));
}
const int removeCount = m_sessions.remove(it.value());
Q_ASSERT(removeCount == 1 && "Session for channel not found.");
if (removeCount != 1) {
throw SshClientException(SshInternalError,
QString::fromLocal8Bit("Internal error: Unexpected session count %1 for channel.")
.arg(removeCount));
}
m_channels.erase(it);
}
......
......@@ -112,7 +112,10 @@ void SshAbstractCryptoFacility::convert(QByteArray &data, quint32 offset,
dataSize);
quint32 bytesRead = m_pipe->read(reinterpret_cast<byte *>(data.data()) + offset,
dataSize, m_pipe->message_count() - 1); // Can't use Pipe::LAST_MESSAGE because of a VC bug.
Q_ASSERT(bytesRead == dataSize);
if (bytesRead != dataSize) {
throw SshClientException(SshInternalError,
QLatin1String("Internal error: Botan::Pipe::read() returned unexpected value"));
}
}
QByteArray SshAbstractCryptoFacility::generateMac(const QByteArray &data,
......
......@@ -455,6 +455,7 @@ void EditorView::goForwardInNavigationHistory()
SplitterOrView::SplitterOrView(OpenEditorsModel *model)
{
Q_ASSERT(model);
Q_UNUSED(model); // For building in release mode.
m_isRoot = true;
m_layout = new QStackedLayout(this);
m_view = new EditorView();
......
......@@ -353,8 +353,7 @@ QList<MaemoMountSpecification> MaemoMountAndCopyFilesService::mountSpecification
void MaemoMountAndCopyFilesService::doInstall()
{
m_copyFacility->copyFiles(connection(), deviceConfiguration(), m_filesToCopy,
deployMountPoint());
m_copyFacility->copyFiles(deviceConfiguration(), m_filesToCopy, deployMountPoint());
}
void MaemoMountAndCopyFilesService::cancelInstallation()
......
......@@ -49,11 +49,9 @@ MaemoRemoteCopyFacility::MaemoRemoteCopyFacility(QObject *parent) :
MaemoRemoteCopyFacility::~MaemoRemoteCopyFacility() {}
void MaemoRemoteCopyFacility::copyFiles(SshConnection *connection,
const IDevice::ConstPtr &device,
void MaemoRemoteCopyFacility::copyFiles(const IDevice::ConstPtr &device,
const QList<DeployableFile> &deployables, const QString &mountPoint)
{
Q_ASSERT(connection->state() == SshConnection::Connected);
Q_ASSERT(!m_isCopying);
m_devConf = device;
......
......@@ -51,8 +51,7 @@ public:
explicit MaemoRemoteCopyFacility(QObject *parent = 0);
~MaemoRemoteCopyFacility();
void copyFiles(QSsh::SshConnection *connection,
const ProjectExplorer::IDevice::ConstPtr &device,
void copyFiles(const ProjectExplorer::IDevice::ConstPtr &device,
const QList<ProjectExplorer::DeployableFile> &deployables, const QString &mountPoint);
void cancel();
......
......@@ -81,7 +81,7 @@ public:
if (!version || version->type() != QLatin1String(QtSupport::Constants::DESKTOPQT))
return false;
bool hasViewer;
bool hasViewer = false; // Initialization needed for dumb compilers.
QtSupport::QtVersionNumber minVersion;
switch (import) {
case QmlProject::UnknownImport:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment