From b6a72ff9dbbff066f9614d25e070365e101f1aeb Mon Sep 17 00:00:00 2001 From: Calcitem Date: Sun, 1 Nov 2020 10:42:10 +0800 Subject: [PATCH] Fix member variable is not initialized in the constructor --- src/movegen.h | 3 ++- src/movepick.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/movegen.h b/src/movegen.h index cf071cfa..5e553458 100644 --- a/src/movegen.h +++ b/src/movegen.h @@ -99,7 +99,8 @@ struct MoveList inline static Square moveTable[SQUARE_NB][MD_NB] = { {SQ_0} }; private: - ExtMove moveList[MAX_MOVES], *last; + ExtMove moveList[MAX_MOVES] { {MOVE_NONE, 0} }; + ExtMove *last {nullptr}; }; #endif // #ifndef MOVEGEN_H_INCLUDED diff --git a/src/movepick.h b/src/movepick.h index 5dc25793..3e9fece3 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -141,7 +141,8 @@ public: Position &pos; Move ttMove { MOVE_NONE }; - ExtMove *cur, *endMoves; + ExtMove *cur { nullptr }; + ExtMove *endMoves { nullptr }; ExtMove moves[MAX_MOVES]{ {MOVE_NONE, 0} }; int moveCount{ 0 };