Mark some constructor as explicit.

This commit is contained in:
Felix Geyer 2012-01-11 19:18:35 +01:00
parent 6422dee4fc
commit 279585fff4
10 changed files with 13 additions and 11 deletions

View File

@ -30,7 +30,7 @@ public:
Sha256
};
CryptoHash(CryptoHash::Algorithm algo);
explicit CryptoHash(CryptoHash::Algorithm algo);
~CryptoHash();
void addData(const QByteArray& data);
void reset();
@ -40,7 +40,8 @@ public:
private:
CryptoHashPrivate* const d_ptr;
Q_DECLARE_PRIVATE(CryptoHash);
Q_DECLARE_PRIVATE(CryptoHash)
};
#endif // KEEPASSX_CRYPTOHASH_H

View File

@ -55,8 +55,9 @@ public:
int blockSize() const;
private:
Q_DISABLE_COPY(SymmetricCipher)
SymmetricCipherBackend* m_backend;
Q_DISABLE_COPY(SymmetricCipher)
};
#endif // KEEPASSX_SYMMETRICCIPHER_H

View File

@ -23,7 +23,7 @@
class SymmetricCipherBackend
{
public:
virtual ~SymmetricCipherBackend() {};
virtual ~SymmetricCipherBackend() {}
virtual void setAlgorithm(SymmetricCipher::Algorithm algo) = 0;
virtual void setMode(SymmetricCipher::Mode mode) = 0;
virtual void setDirection(SymmetricCipher::Direction direction) = 0;

View File

@ -20,7 +20,7 @@
#include "crypto/CryptoHash.h"
#include "format/KeePass2.h"
KeePass2RandomStream::KeePass2RandomStream(QByteArray key)
KeePass2RandomStream::KeePass2RandomStream(const QByteArray& key)
: m_cipher(SymmetricCipher::Salsa20, SymmetricCipher::Stream, SymmetricCipher::Encrypt,
CryptoHash::hash(key, CryptoHash::Sha256), KeePass2::INNER_STREAM_SALSA20_IV)
, m_offset(0)

View File

@ -25,7 +25,7 @@
class KeePass2RandomStream
{
public:
KeePass2RandomStream(QByteArray key);
explicit KeePass2RandomStream(const QByteArray& key);
QByteArray randomBytes(int size);
QByteArray process(const QByteArray& data);
void processInPlace(QByteArray& data);

View File

@ -27,7 +27,7 @@ class QIODevice;
class KeePass2Reader
{
Q_DECLARE_TR_FUNCTIONS(KeePass2Reader);
Q_DECLARE_TR_FUNCTIONS(KeePass2Reader)
public:
KeePass2Reader();

View File

@ -35,7 +35,7 @@ class Metadata;
class KeePass2XmlReader
{
Q_DECLARE_TR_FUNCTIONS(KeePass2XmlReader);
Q_DECLARE_TR_FUNCTIONS(KeePass2XmlReader)
public:
KeePass2XmlReader();

View File

@ -46,7 +46,7 @@ class DatabaseTabWidget : public QTabWidget
Q_OBJECT
public:
DatabaseTabWidget(QWidget* parent);
explicit DatabaseTabWidget(QWidget* parent);
void openDatabase(const QString& fileName);
DatabaseWidget* currentDatabaseWidget();

View File

@ -32,7 +32,7 @@ class EditGroupWidget : public QWidget
Q_OBJECT
public:
EditGroupWidget(QWidget* parent = 0);
explicit EditGroupWidget(QWidget* parent = 0);
~EditGroupWidget();
void loadGroup(Group* group, bool create);

View File

@ -26,7 +26,7 @@ class PasswordKey : public Key
{
public:
PasswordKey();
PasswordKey(const QString& password);
explicit PasswordKey(const QString& password);
QByteArray rawKey() const;
void setPassword(const QString& password);
PasswordKey* clone() const;