File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -103,8 +103,11 @@ class Coin
103103 */
104104struct CCoinsCacheEntry
105105{
106+ private:
107+ uint8_t m_flags{0 };
108+
109+ public:
106110 Coin coin; // The actual cached data.
107- unsigned char flags{0 };
108111
109112 enum Flags {
110113 /* *
@@ -130,14 +133,14 @@ struct CCoinsCacheEntry
130133 CCoinsCacheEntry () noexcept = default ;
131134 explicit CCoinsCacheEntry (Coin&& coin_) noexcept : coin(std::move(coin_)) {}
132135
133- inline void AddFlags (unsigned char flags) noexcept { this -> flags |= flags; }
136+ inline void AddFlags (uint8_t flags) noexcept { m_flags |= flags; }
134137 inline void ClearFlags () noexcept
135138 {
136- flags = 0 ;
139+ m_flags = 0 ;
137140 }
138- inline unsigned char GetFlags () const noexcept { return flags ; }
139- inline bool IsDirty () const noexcept { return flags & DIRTY; }
140- inline bool IsFresh () const noexcept { return flags & FRESH; }
141+ inline uint8_t GetFlags () const noexcept { return m_flags ; }
142+ inline bool IsDirty () const noexcept { return m_flags & DIRTY; }
143+ inline bool IsFresh () const noexcept { return m_flags & FRESH; }
141144};
142145
143146/* *
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ FUZZ_TARGET(coins_view, .init = initialize_coins_view)
125125 LIMITED_WHILE (good_data && fuzzed_data_provider.ConsumeBool (), 10'000 )
126126 {
127127 CCoinsCacheEntry coins_cache_entry;
128- coins_cache_entry.AddFlags (fuzzed_data_provider.ConsumeIntegral <unsigned char >());
128+ coins_cache_entry.AddFlags (fuzzed_data_provider.ConsumeIntegral <uint8_t >());
129129 if (fuzzed_data_provider.ConsumeBool ()) {
130130 coins_cache_entry.coin = random_coin;
131131 } else {
You can’t perform that action at this time.
0 commit comments