Fix all warnings from the cppcoreguidelines-pro-type-member-init clang-tidy check (#4426)

This commit is contained in:
pajlada 2023-09-09 13:11:19 +02:00 committed by GitHub
parent 877a4e05fa
commit d4558b5fe5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 44 additions and 42 deletions

1
.gitignore vendored
View file

@ -84,6 +84,7 @@ Thumbs.db
dependencies dependencies
.cache .cache
.editorconfig .editorconfig
vim.log
### CMake ### ### CMake ###
CMakeLists.txt.user CMakeLists.txt.user

View file

@ -9,6 +9,7 @@
- Dev: Tests now run on Ubuntu 22.04 instead of 20.04 to loosen C++ restrictions in tests. (#4774) - Dev: Tests now run on Ubuntu 22.04 instead of 20.04 to loosen C++ restrictions in tests. (#4774)
- Dev: Do a pretty major refactor of the Settings classes. List settings (e.g. highlights) are most heavily modified, and should have an extra eye kept on them. (#4775) - Dev: Do a pretty major refactor of the Settings classes. List settings (e.g. highlights) are most heavily modified, and should have an extra eye kept on them. (#4775)
- Dev: Remove `boost::noncopyable` use & `boost_random` dependency. (#4776) - Dev: Remove `boost::noncopyable` use & `boost_random` dependency. (#4776)
- Dev: Fix clang-tidy `cppcoreguidelines-pro-type-member-init` warnings. (#4426)
## 2.4.5 ## 2.4.5

View file

@ -70,8 +70,8 @@ public:
class Application : public IApplication class Application : public IApplication
{ {
std::vector<std::unique_ptr<Singleton>> singletons_; std::vector<std::unique_ptr<Singleton>> singletons_;
int argc_; int argc_{};
char **argv_; char **argv_{};
public: public:
static Application *instance; static Application *instance;

View file

@ -17,8 +17,8 @@ public:
private: private:
QNetworkAccessManager *manager_; QNetworkAccessManager *manager_;
QNetworkReply *reply_; QNetworkReply *reply_{};
QFile *file_; QFile *file_{};
private slots: private slots:
void onDownloadProgress(qint64, qint64); void onDownloadProgress(qint64, qint64);

View file

@ -10,7 +10,7 @@ namespace chatterino {
struct Command { struct Command {
QString name; QString name;
QString func; QString func;
bool showInMsgContextMenu; bool showInMsgContextMenu{};
Command() = default; Command() = default;
explicit Command(const QString &text); explicit Command(const QString &text);

View file

@ -209,7 +209,7 @@ private:
Link link_; Link link_;
QString tooltip_; QString tooltip_;
ImagePtr thumbnail_; ImagePtr thumbnail_;
ThumbnailType thumbnailType_; ThumbnailType thumbnailType_{};
MessageElementFlags flags_; MessageElementFlags flags_;
}; };

View file

@ -90,10 +90,10 @@ struct MessageLayoutContainer {
private: private:
struct Line { struct Line {
int startIndex; int startIndex{};
int endIndex; int endIndex{};
int startCharIndex; int startCharIndex{};
int endCharIndex; int endCharIndex{};
QRect rect; QRect rect;
}; };

View file

@ -27,14 +27,14 @@ namespace {
const rapidjson::Value &unparsedEmoji, const rapidjson::Value &unparsedEmoji,
QString shortCode = QString()) QString shortCode = QString())
{ {
std::array<uint32_t, 9> unicodeBytes; std::array<uint32_t, 9> unicodeBytes{};
struct { struct {
bool apple; bool apple;
bool google; bool google;
bool twitter; bool twitter;
bool facebook; bool facebook;
} capabilities; } capabilities{};
if (!shortCode.isEmpty()) if (!shortCode.isEmpty())
{ {

View file

@ -41,7 +41,7 @@ struct CreateEmoteResult {
Emote emote; Emote emote;
EmoteId id; EmoteId id;
EmoteName name; EmoteName name;
bool hasImages; bool hasImages{};
}; };
EmotePtr cachedOrMake(Emote &&emote, const EmoteId &id) EmotePtr cachedOrMake(Emote &&emote, const EmoteId &id)

View file

@ -328,7 +328,7 @@ private:
const QString subscriptionUrl_; const QString subscriptionUrl_;
const QString channelUrl_; const QString channelUrl_;
const QString popoutPlayerUrl_; const QString popoutPlayerUrl_;
int chatterCount_; int chatterCount_{};
UniqueAccess<StreamStatus> streamStatus_; UniqueAccess<StreamStatus> streamStatus_;
UniqueAccess<RoomModes> roomModes_; UniqueAccess<RoomModes> roomModes_;
std::atomic_flag loadingRecentMessages_ = ATOMIC_FLAG_INIT; std::atomic_flag loadingRecentMessages_ = ATOMIC_FLAG_INIT;
@ -376,7 +376,7 @@ private:
* The index of the twitch connection in * The index of the twitch connection in
* 7TV's user representation. * 7TV's user representation.
*/ */
size_t seventvUserTwitchConnectionIndex_; size_t seventvUserTwitchConnectionIndex_{};
/** /**
* The next moment in time to signal activity in this channel to 7TV. * The next moment in time to signal activity in this channel to 7TV.

View file

@ -127,7 +127,7 @@ private:
QString roomID_; QString roomID_;
bool hasBits_ = false; bool hasBits_ = false;
QString bits; QString bits;
int bitsLeft; int bitsLeft{};
bool bitsStacked = false; bool bitsStacked = false;
bool historicalMessage_ = false; bool historicalMessage_ = false;
std::shared_ptr<MessageThread> thread_; std::shared_ptr<MessageThread> thread_;

View file

@ -355,7 +355,7 @@ struct HelixVip {
struct HelixChatters { struct HelixChatters {
std::unordered_set<QString> chatters; std::unordered_set<QString> chatters;
int total; int total{};
QString cursor; QString cursor;
HelixChatters() = default; HelixChatters() = default;

View file

@ -46,7 +46,7 @@ protected:
private: private:
struct { struct {
Split *split; Split *split;
} ui_; } ui_{};
struct Item { struct Item {
void *hwnd; void *hwnd;
@ -61,7 +61,7 @@ private:
void *target_; void *target_;
int yOffset_; int yOffset_;
int currentYOffset_; int currentYOffset_{};
double x_ = -1; double x_ = -1;
double pixelRatio_ = -1; double pixelRatio_ = -1;
int width_ = 360; int width_ = 360;

View file

@ -71,7 +71,7 @@ private:
struct { struct {
QLabel *label; QLabel *label;
ColorButton *color; ColorButton *color;
} selected; } selected{};
struct { struct {
QColorPicker *colorPicker; QColorPicker *colorPicker;
@ -82,7 +82,7 @@ private:
QLabel *htmlLabel; QLabel *htmlLabel;
QLineEdit *htmlEdit; QLineEdit *htmlEdit;
} picker; } picker{};
} ui_; } ui_;
enum SpinBox : size_t { RED = 0, GREEN = 1, BLUE = 2, ALPHA = 3, END }; enum SpinBox : size_t { RED = 0, GREEN = 1, BLUE = 2, ALPHA = 3, END };

View file

@ -25,7 +25,7 @@ private:
QVBoxLayout *vbox; QVBoxLayout *vbox;
QComboBox *selector; QComboBox *selector;
QDialogButtonBox *buttonBox; QDialogButtonBox *buttonBox;
} ui_; } ui_{};
QString channelURL_; QString channelURL_;
}; };

View file

@ -39,8 +39,8 @@ private:
void updateLatestMessages(); void updateLatestMessages();
void loadAvatar(const QUrl &url); void loadAvatar(const QUrl &url);
bool isMod_; bool isMod_{};
bool isBroadcaster_; bool isBroadcaster_{};
Split *split_; Split *split_;

View file

@ -256,8 +256,8 @@ private:
void showReplyThreadPopup(const MessagePtr &message); void showReplyThreadPopup(const MessagePtr &message);
bool canReplyToMessages() const; bool canReplyToMessages() const;
QTimer *layoutCooldown_; QTimer *layoutCooldown_{};
bool layoutQueued_; bool layoutQueued_{};
QTimer updateTimer_; QTimer updateTimer_;
bool updateQueued_ = false; bool updateQueued_ = false;
@ -286,7 +286,7 @@ private:
Split *split_ = nullptr; Split *split_ = nullptr;
Scrollbar *scrollBar_; Scrollbar *scrollBar_;
EffectLabel *goToBottom_; EffectLabel *goToBottom_{};
bool showScrollBar_ = false; bool showScrollBar_ = false;
FilterSetPtr channelFilters_; FilterSetPtr channelFilters_;

View file

@ -24,7 +24,7 @@ public:
void updateSize(); void updateSize();
QWidget *page; QWidget *page{};
void setCustomTitle(const QString &title); void setCustomTitle(const QString &title);
void resetCustomTitle(); void resetCustomTitle();

View file

@ -35,9 +35,9 @@ public:
private: private:
std::shared_ptr<QColor> color_; std::shared_ptr<QColor> color_;
Style style_; Style style_;
bool isRedeemedHighlight_; bool isRedeemedHighlight_{};
bool isFirstMessageHighlight_; bool isFirstMessageHighlight_{};
bool isElevatedMessageHighlight_; bool isElevatedMessageHighlight_{};
}; };
} // namespace chatterino } // namespace chatterino

View file

@ -27,7 +27,7 @@ protected:
void paintEvent(QPaintEvent *) override; void paintEvent(QPaintEvent *) override;
private: private:
TitleBarButtonStyle style_; TitleBarButtonStyle style_{};
}; };
} // namespace chatterino } // namespace chatterino

View file

@ -16,7 +16,7 @@ private:
void addLicense(QFormLayout *form, const QString &name_, void addLicense(QFormLayout *form, const QString &name_,
const QString &website, const QString &licenseLink); const QString &website, const QString &licenseLink);
QLabel *logo_; QLabel *logo_{};
}; };
} // namespace chatterino } // namespace chatterino

View file

@ -14,9 +14,9 @@ public:
AccountsPage(); AccountsPage();
private: private:
QPushButton *addButton_; QPushButton *addButton_{};
QPushButton *removeButton_; QPushButton *removeButton_{};
AccountSwitchWidget *accountSwitchWidget_; AccountSwitchWidget *accountSwitchWidget_{};
}; };
} // namespace chatterino } // namespace chatterino

View file

@ -85,7 +85,7 @@ public:
} }
protected: protected:
SettingsDialogTab *tab_; SettingsDialogTab *tab_{};
pajlada::Signals::NoArgSignal onCancel_; pajlada::Signals::NoArgSignal onCancel_;
pajlada::Signals::SignalHolder managedConnections_; pajlada::Signals::SignalHolder managedConnections_;
}; };

View file

@ -57,7 +57,7 @@ private:
struct { struct {
GenericListView *listView; GenericListView *listView;
} ui_; } ui_{};
GenericListModel model_; GenericListModel model_;
ActionCallback callback_; ActionCallback callback_;

View file

@ -121,7 +121,7 @@ public:
Type type_; Type type_;
Split *split_; Split *split_;
Node *preferedFocusTarget_; Node *preferedFocusTarget_{};
Node *parent_; Node *parent_;
QRectF geometry_; QRectF geometry_;
qreal flexH_ = 1; qreal flexH_ = 1;
@ -158,7 +158,7 @@ private:
{ {
public: public:
SplitContainer *parent; SplitContainer *parent;
Node *node; Node *node{};
void setVertical(bool isVertical); void setVertical(bool isVertical);
ResizeHandle(SplitContainer *_parent = nullptr); ResizeHandle(SplitContainer *_parent = nullptr);
@ -173,7 +173,7 @@ private:
private: private:
void resetFlex(); void resetFlex();
bool vertical_; bool vertical_{};
bool isMouseDown_ = false; bool isMouseDown_ = false;
}; };

View file

@ -129,7 +129,7 @@ protected:
QHBoxLayout *replyHbox; QHBoxLayout *replyHbox;
QLabel *replyLabel; QLabel *replyLabel;
EffectLabel *cancelReplyButton; EffectLabel *cancelReplyButton;
} ui_; } ui_{};
std::shared_ptr<MessageThread> replyThread_ = nullptr; std::shared_ptr<MessageThread> replyThread_ = nullptr;
bool enableInlineReplying_; bool enableInlineReplying_;