From 1678351d11251a33571e19a38c2a4bb59712c79d Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sat, 18 Sep 2010 20:31:14 +0200 Subject: [PATCH] Enable and fix more warnings. --- CMakeLists.txt | 2 +- src/crypto/Crypto.cpp | 5 +++-- src/gui/GroupView.h | 2 +- src/keys/Key.h | 1 + src/streams/HashedBlockStream.cpp | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d158b360d..8e435da1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ option(WITH_TESTS "Enable building of unit tests" ON) set( KEEPASSX_VERSION "0.9.0" ) -add_definitions(-DQT_NO_KEYWORDS -Wall) +add_definitions(-DQT_NO_KEYWORDS -fno-exceptions -fno-rtti -Wall -Wextra -Wundef -Wold-style-cast -Wnon-virtual-dtor) if( APPLE OR MINGW ) set( PROGNAME KeePassX ) diff --git a/src/crypto/Crypto.cpp b/src/crypto/Crypto.cpp index 9b8a79f20..bee190f81 100644 --- a/src/crypto/Crypto.cpp +++ b/src/crypto/Crypto.cpp @@ -50,11 +50,12 @@ int gcry_qt_mutex_unlock(void** p_sys) static const struct gcry_thread_cbs gcry_threads_qt = { GCRY_THREAD_OPTION_USER, - NULL, + 0, gcry_qt_mutex_init, gcry_qt_mutex_destroy, gcry_qt_mutex_lock, - gcry_qt_mutex_unlock + gcry_qt_mutex_unlock, + 0, 0, 0, 0, 0, 0, 0, 0 }; Crypto::Crypto() diff --git a/src/gui/GroupView.h b/src/gui/GroupView.h index dba703731..7d6f12492 100644 --- a/src/gui/GroupView.h +++ b/src/gui/GroupView.h @@ -29,7 +29,7 @@ class GroupView : public QTreeView Q_OBJECT public: - GroupView(Database* db, QWidget* parent = 0); + explicit GroupView(Database* db, QWidget* parent = 0); void setModel(QAbstractItemModel* model); Q_SIGNALS: diff --git a/src/keys/Key.h b/src/keys/Key.h index b80a6b7ee..d6d878918 100644 --- a/src/keys/Key.h +++ b/src/keys/Key.h @@ -23,6 +23,7 @@ class Key { public: + virtual ~Key() {} virtual QByteArray rawKey() const = 0; virtual Key* clone() const = 0; }; diff --git a/src/streams/HashedBlockStream.cpp b/src/streams/HashedBlockStream.cpp index c758fc4e9..ba4a563ce 100644 --- a/src/streams/HashedBlockStream.cpp +++ b/src/streams/HashedBlockStream.cpp @@ -135,7 +135,7 @@ bool HashedBlockStream::readHashedBlock() } if (m_blockSize == 0) { - if (hash.count(static_cast(0)) != 32) { + if (hash.count('\0') != 32) { // TODO error Q_ASSERT(false); return false;