Changes:
- Remove unused constructors that leave some members uninitialized
- Remove manual initialization in each constructor and prefer C++11 default member initializers
This is not a stylistic change, but a change that avoids bugs such as:
Changes:
This is not a stylistic change, but a change that avoids bugs such as:
Concept ACK
From our developer notes:
Initialize all non-static class members where they are defined. If this is skipped for a good reason (i.e., optimization on the critical path), add an explicit comment about this
Rationale: Ensure determinism by avoiding accidental use of uninitialized values. Also, static analyzers balk about this. Initializing the members in the declaration makes it easy to spot uninitialized ones.
class A { uint32_t m_count{0}; }
Concept ACK
On macOS:
CXX libbitcoin_server_a-pow.o
CXX libbitcoin_server_a-rest.o
In file included from miner.cpp:17:
./net.h:414:33: error: expected ';' at end of declaration list
bool setBannedIsDirty{false} GUARDED_BY(cs_setBanned);
^
;
1 error generated.
Concept ACK.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
utACK fa2510d5c1cdf9c2cd5cc9887302ced4378c7202
1030 | tallyitem()
1031 | {
1032 | - nAmount = 0;
1033 | - nConf = std::numeric_limits<int>::max();
1034 | - fIsWatchonly = false;
1035 | }
nit: could drop this constructor (as it's equivalent to the default)
Note that this code is going away anyway as it's part of the account system
174 | CWalletScanState() {
175 | - nKeys = nCKeys = nWatchKeys = nKeyMeta = m_unknown_records = 0;
176 | - fIsEncrypted = false;
177 | - fAnyUnordered = false;
178 | - nFileVersion = 0;
179 | }
nit: could drop this constructor
utACK fa2510d5c1cdf9c2cd5cc9887302ced4378c7202 modulo @Empact:s nits
Big concept ACK.
utACK fa2510d5c1cdf9c2cd5cc9887302ced4378c7202 (checked that all the fields match)
utACK fa2510d