Use in-class initializers for bitfields.

This commit is contained in:
John Preston 2021-11-10 11:53:01 +04:00
parent fe025e3c44
commit f13e28a9c5
5 changed files with 21 additions and 36 deletions

View File

@ -433,21 +433,11 @@ PeerListRow::PeerListRow(not_null<PeerData*> peer)
PeerListRow::PeerListRow(not_null<PeerData*> peer, PeerListRowId id)
: _id(id)
, _peer(peer)
, _hidden(false)
, _initialized(false)
, _isSearchResult(false)
, _isSavedMessagesChat(false)
, _isRepliesMessagesChat(false) {
, _peer(peer) {
}
PeerListRow::PeerListRow(PeerListRowId id)
: _id(id)
, _hidden(false)
, _initialized(false)
, _isSearchResult(false)
, _isSavedMessagesChat(false)
, _isRepliesMessagesChat(false) {
: _id(id) {
}
PeerListRow::~PeerListRow() = default;

View File

@ -263,11 +263,11 @@ private:
base::flat_set<QChar> _nameFirstLetters;
int _absoluteIndex = -1;
State _disabledState = State::Active;
bool _hidden : 1;
bool _initialized : 1;
bool _isSearchResult : 1;
bool _isSavedMessagesChat : 1;
bool _isRepliesMessagesChat : 1;
bool _hidden : 1 = false;
bool _initialized : 1 = false;
bool _isSearchResult : 1 = false;
bool _isSavedMessagesChat : 1 = false;
bool _isRepliesMessagesChat : 1 = false;
};

View File

@ -126,12 +126,7 @@ MembersRow::MembersRow(
not_null<MembersRowDelegate*> delegate,
not_null<PeerData*> participantPeer)
: PeerListRow(participantPeer)
, _delegate(delegate)
, _sounding(false)
, _speaking(false)
, _raisedHandStatus(false)
, _skipLevelUpdate(false)
, _mutedByMe(false) {
, _delegate(delegate) {
refreshStatus();
_aboutText = participantPeer->about();
}

View File

@ -210,11 +210,11 @@ private:
crl::time _speakingLastTime = 0;
uint64 _raisedHandRating = 0;
int _volume = Group::kDefaultVolume;
bool _sounding : 1;
bool _speaking : 1;
bool _raisedHandStatus : 1;
bool _skipLevelUpdate : 1;
bool _mutedByMe : 1;
bool _sounding : 1 = false;
bool _speaking : 1 = false;
bool _raisedHandStatus : 1 = false;
bool _skipLevelUpdate : 1 = false;
bool _mutedByMe : 1 = false;
};

View File

@ -32,14 +32,14 @@ struct GroupCallParticipant {
uint64 raisedHandRating = 0;
uint32 ssrc = 0;
int volume = 0;
bool sounding : 1;
bool speaking : 1;
bool additionalSounding : 1;
bool additionalSpeaking : 1;
bool muted : 1;
bool mutedByMe : 1;
bool canSelfUnmute : 1;
bool onlyMinLoaded : 1;
bool sounding : 1 = false;
bool speaking : 1 = false;
bool additionalSounding : 1 = false;
bool additionalSpeaking : 1 = false;
bool muted : 1 = false;
bool mutedByMe : 1 = false;
bool canSelfUnmute : 1 = false;
bool onlyMinLoaded : 1 = false;
bool videoJoined = false;
bool applyVolumeFromMin = true;