Browse Source

chore(cleanup): don't explicitly initialize std::unique_ptr to nullptr

Fix #6009
reviewable/pr6014/r2
Anthony Bilinski 5 years ago
parent
commit
f756dbae2a
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
  1. 1
      src/core/core.cpp
  2. 2
      src/core/core.h
  3. 4
      src/core/toxcall.h
  4. 4
      src/persistence/profile.cpp
  5. 4
      src/persistence/profile.h
  6. 4
      src/widget/form/settings/avform.h
  7. 1
      src/widget/widget.cpp
  8. 2
      src/widget/widget.h

1
src/core/core.cpp

@ -475,7 +475,6 @@ bool parseErr(Tox_Err_Conference_Delete error, int line) @@ -475,7 +475,6 @@ bool parseErr(Tox_Err_Conference_Delete error, int line)
Core::Core(QThread* coreThread)
: tox(nullptr)
, av(nullptr)
, toxTimer{new QTimer{this}}
, coreThread(coreThread)
{

2
src/core/core.h

@ -251,7 +251,7 @@ private: @@ -251,7 +251,7 @@ private:
// recursive, since we might call our own functions
mutable QMutex coreLoopLock{QMutex::Recursive};
std::unique_ptr<QThread> coreThread = nullptr;
std::unique_ptr<QThread> coreThread;
};
#endif // CORE_HPP

4
src/core/toxcall.h

@ -84,7 +84,7 @@ protected: @@ -84,7 +84,7 @@ protected:
QMetaObject::Connection videoInConn;
bool videoEnabled{false};
bool nullVideoBitrate{false};
std::unique_ptr<IAudioSource> audioSource = nullptr;
std::unique_ptr<IAudioSource> audioSource;
};
class ToxFriendCall : public ToxCall
@ -109,7 +109,7 @@ private slots: @@ -109,7 +109,7 @@ private slots:
private:
QMetaObject::Connection audioSinkInvalid;
TOXAV_FRIEND_CALL_STATE state{TOXAV_FRIEND_CALL_STATE_NONE};
std::unique_ptr<IAudioSink> sink = nullptr;
std::unique_ptr<IAudioSink> sink;
uint32_t friendId;
};

4
src/persistence/profile.cpp

@ -73,7 +73,7 @@ enum class CreateToxDataError @@ -73,7 +73,7 @@ enum class CreateToxDataError
std::unique_ptr<ToxEncrypt> loadToxData(const QString& password, const QString& filePath,
QByteArray& data, LoadToxDataError& error)
{
std::unique_ptr<ToxEncrypt> tmpKey = nullptr;
std::unique_ptr<ToxEncrypt> tmpKey;
qint64 fileSize = 0;
QFile saveFile(filePath);
@ -133,7 +133,7 @@ fail: @@ -133,7 +133,7 @@ fail:
std::unique_ptr<ToxEncrypt> createToxData(const QString& name, const QString& password,
const QString& filePath, CreateToxDataError& error)
{
std::unique_ptr<ToxEncrypt> newKey{nullptr};
std::unique_ptr<ToxEncrypt> newKey;
if (!password.isEmpty()) {
newKey = ToxEncrypt::makeToxEncrypt(password);
if (!newKey) {

4
src/persistence/profile.h

@ -109,9 +109,9 @@ private: @@ -109,9 +109,9 @@ private:
void initCore(const QByteArray& toxsave, const ICoreSettings& s, bool isNewProfile);
private:
std::unique_ptr<Core> core = nullptr;
std::unique_ptr<Core> core;
QString name;
std::unique_ptr<ToxEncrypt> passkey = nullptr;
std::unique_ptr<ToxEncrypt> passkey;
std::shared_ptr<RawDatabase> database;
std::shared_ptr<History> history;
bool isRemoved;

4
src/widget/form/settings/avform.h

@ -104,8 +104,8 @@ private: @@ -104,8 +104,8 @@ private:
IVideoSettings* videoSettings;
bool subscribedToAudioIn;
std::unique_ptr<IAudioSink> audioSink = nullptr;
std::unique_ptr<IAudioSource> audioSrc = nullptr;
std::unique_ptr<IAudioSink> audioSink;
std::unique_ptr<IAudioSource> audioSrc;
VideoSurface* camVideoSurface;
CameraSource& camera;
QVector<QPair<QString, QString>> videoDeviceList;

1
src/widget/widget.cpp

@ -139,7 +139,6 @@ Widget* Widget::instance{nullptr}; @@ -139,7 +139,6 @@ Widget* Widget::instance{nullptr};
Widget::Widget(IAudioControl& audio, QWidget* parent)
: QMainWindow(parent)
, icon{nullptr}
, trayMenu{nullptr}
, ui(new Ui::MainWindow)
, activeChatroomWidget{nullptr}

2
src/widget/widget.h

@ -328,7 +328,7 @@ private: @@ -328,7 +328,7 @@ private:
int icon_size;
IAudioControl& audio;
std::unique_ptr<IAudioSink> audioNotification = nullptr;
std::unique_ptr<IAudioSink> audioNotification;
Settings& settings;
QMap<ToxPk, FriendWidget*> friendWidgets;

Loading…
Cancel
Save