Improve readability and type-safety
Use nullptr instead of 0 or NULL to initialize a null pointer. In some cases, readability was enhanced by replacing 0 with more meaningful values according to the type of the pointer being initialized.
This commit is contained in:
@@ -25,15 +25,15 @@ const char* PasswordGenerator::DefaultExcludedChars = "";
|
||||
|
||||
PasswordGenerator::PasswordGenerator()
|
||||
: m_length(0)
|
||||
, m_classes(0)
|
||||
, m_flags(0)
|
||||
, m_classes(nullptr)
|
||||
, m_flags(nullptr)
|
||||
, m_excluded(PasswordGenerator::DefaultExcludedChars)
|
||||
{
|
||||
}
|
||||
|
||||
double PasswordGenerator::calculateEntropy(const QString& password)
|
||||
{
|
||||
return ZxcvbnMatch(password.toLatin1(), 0, 0);
|
||||
return ZxcvbnMatch(password.toLatin1(), nullptr, nullptr);
|
||||
}
|
||||
|
||||
void PasswordGenerator::setLength(int length)
|
||||
|
||||
@@ -24,10 +24,10 @@ class ScreenLockListenerPrivate : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static ScreenLockListenerPrivate* instance(QWidget* parent = 0);
|
||||
static ScreenLockListenerPrivate* instance(QWidget* parent = nullptr);
|
||||
|
||||
protected:
|
||||
ScreenLockListenerPrivate(QWidget* parent = 0);
|
||||
ScreenLockListenerPrivate(QWidget* parent = nullptr);
|
||||
|
||||
signals:
|
||||
void screenLocked();
|
||||
|
||||
@@ -27,7 +27,7 @@ class ScreenLockListenerWin : public ScreenLockListenerPrivate, public QAbstract
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ScreenLockListenerWin(QWidget* parent = 0);
|
||||
explicit ScreenLockListenerWin(QWidget* parent = nullptr);
|
||||
~ScreenLockListenerWin();
|
||||
virtual bool nativeEventFilter(const QByteArray& eventType, void* message, long*) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user