gcc: fix uninitialized constructor warnings

This commit is contained in:
jeff 2023-08-30 20:16:26 -05:00 committed by jeffro256
parent 8123d945f8
commit 80b5bf8b3d
No known key found for this signature in database
GPG Key ID: 6F79797A6E392442
5 changed files with 11 additions and 7 deletions

View File

@ -77,7 +77,7 @@ namespace cryptonote
// outputs <= HF_VERSION_VIEW_TAGS
struct txout_to_key
{
txout_to_key() { }
txout_to_key(): key() { }
txout_to_key(const crypto::public_key &_key) : key(_key) { }
crypto::public_key key;
};
@ -85,7 +85,7 @@ namespace cryptonote
// outputs >= HF_VERSION_VIEW_TAGS
struct txout_to_tagged_key
{
txout_to_tagged_key() { }
txout_to_tagged_key(): key(), view_tag() { }
txout_to_tagged_key(const crypto::public_key &_key, const crypto::view_tag &_view_tag) : key(_key), view_tag(_view_tag) { }
crypto::public_key key;
crypto::view_tag view_tag; // optimization to reduce scanning time

View File

@ -1609,6 +1609,6 @@ namespace cryptonote
*/
void send_miner_notifications(uint64_t height, const crypto::hash &seed_hash, const crypto::hash &prev_id, uint64_t already_generated_coins);
friend class BlockchainAndPool;
friend struct BlockchainAndPool;
};
} // namespace cryptonote

View File

@ -37,6 +37,7 @@
#include "blockchain.h"
#include "tx_pool.h"
#include "warnings.h"
namespace cryptonote
{
@ -52,7 +53,10 @@ struct BlockchainAndPool
{
Blockchain blockchain;
tx_memory_pool tx_pool;
PUSH_WARNINGS
DISABLE_GCC_WARNING(uninitialized)
BlockchainAndPool(): blockchain(tx_pool), tx_pool(blockchain) {}
POP_WARNINGS
};
}

View File

@ -676,7 +676,7 @@ private:
//! Next timestamp that a DB check for relayable txes is allowed
std::atomic<time_t> m_next_check;
friend class BlockchainAndPool;
friend struct BlockchainAndPool;
};
}

View File

@ -218,7 +218,7 @@ namespace rct {
rct::key a, b, t;
Bulletproof():
A({}), S({}), T1({}), T2({}), taux({}), mu({}), a({}), b({}), t({}) {}
A({}), S({}), T1({}), T2({}), taux({}), mu({}), a({}), b({}), t({}), V({}), L({}), R({}) {}
Bulletproof(const rct::key &V, const rct::key &A, const rct::key &S, const rct::key &T1, const rct::key &T2, const rct::key &taux, const rct::key &mu, const rct::keyV &L, const rct::keyV &R, const rct::key &a, const rct::key &b, const rct::key &t):
V({V}), A(A), S(S), T1(T1), T2(T2), taux(taux), mu(mu), L(L), R(R), a(a), b(b), t(t) {}
Bulletproof(const rct::keyV &V, const rct::key &A, const rct::key &S, const rct::key &T1, const rct::key &T2, const rct::key &taux, const rct::key &mu, const rct::keyV &L, const rct::keyV &R, const rct::key &a, const rct::key &b, const rct::key &t):
@ -253,7 +253,7 @@ namespace rct {
rct::key r1, s1, d1;
rct::keyV L, R;
BulletproofPlus() {}
BulletproofPlus(): V(), A(), A1(), B(), r1(), s1(), d1(), L(), R() {}
BulletproofPlus(const rct::key &V, const rct::key &A, const rct::key &A1, const rct::key &B, const rct::key &r1, const rct::key &s1, const rct::key &d1, const rct::keyV &L, const rct::keyV &R):
V({V}), A(A), A1(A1), B(B), r1(r1), s1(s1), d1(d1), L(L), R(R) {}
BulletproofPlus(const rct::keyV &V, const rct::key &A, const rct::key &A1, const rct::key &B, const rct::key &r1, const rct::key &s1, const rct::key &d1, const rct::keyV &L, const rct::keyV &R):