Skip to content

Commit

Permalink
gcc: fix uninitialized constructor warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffro256 committed Oct 16, 2023
1 parent 8123d94 commit 80b5bf8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/cryptonote_basic/cryptonote_basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ 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;
};

// 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
Expand Down
2 changes: 1 addition & 1 deletion src/cryptonote_core/blockchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 5 additions & 1 deletion src/cryptonote_core/blockchain_and_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

#include "blockchain.h"
#include "tx_pool.h"
#include "warnings.h"

namespace cryptonote
{
Expand All @@ -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
};
}
2 changes: 1 addition & 1 deletion src/cryptonote_core/tx_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ namespace cryptonote
//! Next timestamp that a DB check for relayable txes is allowed
std::atomic<time_t> m_next_check;

friend class BlockchainAndPool;
friend struct BlockchainAndPool;
};
}

Expand Down
4 changes: 2 additions & 2 deletions src/ringct/rctTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 80b5bf8

Please sign in to comment.