aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Kandeler <[email protected]>2013-03-21 12:01:58 +0100
committerChristian Kandeler <[email protected]>2013-03-25 13:52:45 +0100
commitf4a0cbf6c072b1696f6dee8aeee75d5a1ff4b41a (patch)
treee2a7b9f03777baaa45bf64bb68618fe0c284cf9e /src
parentf5aa5f3dae5f10288d67b7e4b51d04bcfb495fc3 (diff)
Fix gcc warnings about unused variables.
These appear when compiling in release mode. Change-Id: I76ee3b1b8d728fd839d713ee4f914b6965851b99 Reviewed-by: Oswald Buddenhagen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/libs/qmldebug/qpacketprotocol.cpp1
-rw-r--r--src/libs/ssh/sshchannelmanager.cpp11
-rw-r--r--src/libs/ssh/sshcryptofacility.cpp5
-rw-r--r--src/plugins/coreplugin/editormanager/editorview.cpp1
-rw-r--r--src/plugins/madde/maemodeploybymountsteps.cpp3
-rw-r--r--src/plugins/madde/maemoremotecopyfacility.cpp4
-rw-r--r--src/plugins/madde/maemoremotecopyfacility.h3
-rw-r--r--src/plugins/qmlprojectmanager/qmlproject.cpp2
8 files changed, 19 insertions, 11 deletions
diff --git a/src/libs/qmldebug/qpacketprotocol.cpp b/src/libs/qmldebug/qpacketprotocol.cpp
index 57675e4ca38..d9aa7493a91 100644
--- a/src/libs/qmldebug/qpacketprotocol.cpp
+++ b/src/libs/qmldebug/qpacketprotocol.cpp
@@ -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.
}
/*!
diff --git a/src/libs/ssh/sshchannelmanager.cpp b/src/libs/ssh/sshchannelmanager.cpp
index 71df3987eb1..6949d4e45f7 100644
--- a/src/libs/ssh/sshchannelmanager.cpp
+++ b/src/libs/ssh/sshchannelmanager.cpp
@@ -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);
}
diff --git a/src/libs/ssh/sshcryptofacility.cpp b/src/libs/ssh/sshcryptofacility.cpp
index 255ef7ef74f..24fd7470848 100644
--- a/src/libs/ssh/sshcryptofacility.cpp
+++ b/src/libs/ssh/sshcryptofacility.cpp
@@ -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,
diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp
index 8529541e359..a4a9a7c870f 100644
--- a/src/plugins/coreplugin/editormanager/editorview.cpp
+++ b/src/plugins/coreplugin/editormanager/editorview.cpp
@@ -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();
diff --git a/src/plugins/madde/maemodeploybymountsteps.cpp b/src/plugins/madde/maemodeploybymountsteps.cpp
index 9da25792e0c..9ff045826e3 100644
--- a/src/plugins/madde/maemodeploybymountsteps.cpp
+++ b/src/plugins/madde/maemodeploybymountsteps.cpp
@@ -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()
diff --git a/src/plugins/madde/maemoremotecopyfacility.cpp b/src/plugins/madde/maemoremotecopyfacility.cpp
index 9a2386f6e9e..c981c41c7f4 100644
--- a/src/plugins/madde/maemoremotecopyfacility.cpp
+++ b/src/plugins/madde/maemoremotecopyfacility.cpp
@@ -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;
diff --git a/src/plugins/madde/maemoremotecopyfacility.h b/src/plugins/madde/maemoremotecopyfacility.h
index ae881393488..ef9955dc227 100644
--- a/src/plugins/madde/maemoremotecopyfacility.h
+++ b/src/plugins/madde/maemoremotecopyfacility.h
@@ -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();
diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp
index e4100d6a144..5abbb8db12b 100644
--- a/src/plugins/qmlprojectmanager/qmlproject.cpp
+++ b/src/plugins/qmlprojectmanager/qmlproject.cpp
@@ -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: