Skip to content

Commit

Permalink
Make valgrind happy
Browse files Browse the repository at this point in the history
  • Loading branch information
resetius committed Nov 30, 2023
1 parent 93b69dc commit cc3a854
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ struct TLogEntry: public TMessage {
};

struct TMessageEx: public TMessage {
uint32_t Src;
uint32_t Dst;
uint64_t Term;
uint32_t Src = 0;
uint32_t Dst = 0;
uint64_t Term = 0;
};

static_assert(sizeof(TMessageEx) == sizeof(TMessage)+16);
Expand All @@ -62,11 +62,11 @@ static_assert(sizeof(TRequestVoteResponse) == sizeof(TMessageEx)+8);

struct TAppendEntriesRequest: public TMessageEx {
static constexpr EMessageType MessageType = EMessageType::APPEND_ENTRIES_REQUEST;
uint64_t PrevLogIndex;
uint64_t PrevLogTerm;
uint64_t LeaderCommit;
uint32_t LeaderId;
uint32_t Nentries;
uint64_t PrevLogIndex = 0;
uint64_t PrevLogTerm = 0;
uint64_t LeaderCommit = 0;
uint32_t LeaderId = 0;
uint32_t Nentries = 0;
};

static_assert(sizeof(TAppendEntriesRequest) == sizeof(TMessageEx) + 32);
Expand Down

0 comments on commit cc3a854

Please sign in to comment.